diff --git a/CHANGELOG.md b/CHANGELOG.md index 3bdade78..f668bd31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # CHANGELOG +## Version 80000.11 + +- Added options to adjust auras' count text and aura type icon. It's also possible to display + actual debuff types instead of generic down arrows; +- Added options to adjust xp bar's text's format and visiblity; +- Added options to adjust castbars' colours; +- Added a hack for cooldown numbers. Cooldown spirals are still bugged, but that's a Blizz bug; +- Updated minimap button handling. This should greatly improve compatibility w/ addons that add + various markers, for instance, TomTom, ZygorGuides; +- Updated embeds. + ## Version 80000.10 - Added cooldown options to the "Unit Frames" and unit frames' "Auras" configs; diff --git a/assets/unit-frame-aura-icons.TGA b/assets/unit-frame-aura-icons.TGA new file mode 100644 index 00000000..8eb9358b Binary files /dev/null and b/assets/unit-frame-aura-icons.TGA differ diff --git a/config/auras.lua b/config/auras.lua index 1b3a613e..eec22ce7 100644 --- a/config/auras.lua +++ b/config/auras.lua @@ -51,6 +51,18 @@ local SEP_TYPES = { [1] = L["YOURS_FIRST"], } +local POINTS = { + ["BOTTOM"] = "BOTTOM", + ["BOTTOMLEFT"] = "BOTTOMLEFT", + ["BOTTOMRIGHT"] = "BOTTOMRIGHT", + ["CENTER"] = "CENTER", + ["LEFT"] = "LEFT", + ["RIGHT"] = "RIGHT", + ["TOP"] = "TOP", + ["TOPLEFT"] = "TOPLEFT", + ["TOPRIGHT"] = "TOPRIGHT", +} + local function isModuleDisabled() return not AURAS:IsInit() end @@ -67,7 +79,7 @@ local function getOptionsTable_Aura(order, name, filter) set = function(info, value) if C.db.profile.auras[filter][info[#info]] ~= value then C.db.profile.auras[filter][info[#info]] = value - AURAS:GetHeader(filter):Update() + AURAS:ForHeader(filter, "Update") end end, args = { @@ -77,7 +89,7 @@ local function getOptionsTable_Aura(order, name, filter) name = L["RESTORE_DEFAULTS"], func = function() CONFIG:CopySettings(D.profile.auras[filter], C.db.profile.auras[filter], {point = true}) - AURAS:GetHeader(filter):Update() + AURAS:ForHeader(filter, "Update") end, }, spacer_1 = { @@ -119,7 +131,7 @@ local function getOptionsTable_Aura(order, name, filter) end, set = function(_, value) C.db.profile.auras[filter].x_growth, C.db.profile.auras[filter].y_growth = s_split("_", value) - AURAS:GetHeader(filter):Update() + AURAS:ForHeader(filter, "Update") end, }, sort_method = { @@ -145,9 +157,49 @@ local function getOptionsTable_Aura(order, name, filter) type = "description", name = " ", }, - count = { + type = { order = 20, type = "group", + name = "Aura Type", + inline = true, + get = function(info) + return C.db.profile.auras[filter].type[info[#info]] + end, + set = function(info, value) + if C.db.profile.auras[filter].type[info[#info]] ~= value then + C.db.profile.auras[filter].type[info[#info]] = value + AURAS:ForHeader(filter, "UpdateConfig") + AURAS:ForHeader(filter, "ForEachButton", "UpdateAuraTypeIcon") + end + end, + args = { + debuff_type = { + order = 1, + type = "toggle", + name = "Debuff Type", + }, + size = { + order = 2, + type = "range", + name = L["SIZE"], + min = 10, max = 32, step = 2, + }, + position = { + order = 3, + type = "select", + name = L["POINT"], + values = POINTS, + }, + }, + }, + spacer_3 = { + order = 29, + type = "description", + name = " ", + }, + count = { + order = 30, + type = "group", name = L["COUNT_TEXT"], inline = true, get = function(info) @@ -156,8 +208,8 @@ local function getOptionsTable_Aura(order, name, filter) set = function(info, value) if C.db.profile.auras[filter].count[info[#info]] ~= value then C.db.profile.auras[filter].count[info[#info]] = value - AURAS:GetHeader(filter):UpdateConfig() - AURAS:GetHeader(filter):UpdateButtons("UpdateCountFont") + AURAS:ForHeader(filter, "UpdateConfig") + AURAS:ForHeader(filter, "ForEachButton", "UpdateCountText") end end, args = { @@ -173,15 +225,27 @@ local function getOptionsTable_Aura(order, name, filter) name = L["FLAG"], values = FLAGS, }, + h_alignment = { + order = 3, + type = "select", + name = L["TEXT_HORIZ_ALIGNMENT"], + values = H_ALIGNMENTS, + }, + v_alignment = { + order = 4, + type = "select", + name = L["TEXT_VERT_ALIGNMENT"], + values = V_ALIGNMENTS, + }, }, }, - spacer_3 = { - order = 29, + spacer_4 = { + order = 39, type = "description", name = " ", }, cooldown = { - order = 30, + order = 40, type = "group", name = L["COOLDOWN_TEXT"], inline = true, @@ -191,8 +255,8 @@ local function getOptionsTable_Aura(order, name, filter) set = function(info, value) if C.db.profile.auras[filter].cooldown.text[info[#info]] ~= value then C.db.profile.auras[filter].cooldown.text[info[#info]] = value - AURAS:GetHeader(filter):UpdateConfig() - AURAS:GetHeader(filter):UpdateCooldownConfig() + AURAS:ForHeader(filter, "UpdateConfig") + AURAS:ForHeader(filter, "UpdateCooldownConfig") end end, args = { @@ -236,6 +300,9 @@ local function getOptionsTable_Aura(order, name, filter) temp.args.sort_dir = nil temp.args.sort_method = nil temp.args.count = nil + temp.args.type = nil + temp.args.spacer_3 = nil + temp.args.spacer_4 = nil temp.args.num = { order = 10, @@ -243,6 +310,9 @@ local function getOptionsTable_Aura(order, name, filter) name = L["NUM_BUTTONS"], min = 1, max = 4, step = 1, } + elseif filter == "HELPFUL" then + temp.args.type = nil + temp.args.spacer_3 = nil end return temp @@ -283,7 +353,7 @@ function CONFIG.CreateAurasPanel(_, order) disabled = isModuleDisabled, func = function() CONFIG:CopySettings(D.profile.auras, C.db.profile.auras, {point = true}) - AURAS:UpdateHeaders("Update") + AURAS:ForEachHeader("Update") end, }, spacer_1 = { diff --git a/config/bars.lua b/config/bars.lua index 0af726fe..1d15b997 100644 --- a/config/bars.lua +++ b/config/bars.lua @@ -62,6 +62,16 @@ local FLAGS = { ["_Shadow"] = L["SHADOW"], } +local FORMATS = { + ["NUM"] = L["NUMERIC"], + ["NUM_PERC"] = L["NUMERIC_PERCENTAGE"] +} + +local VISIBILITY = { + [1] = L["ALWAYS_SHOW"], + [2] = L["MOUSEOVER_SHOW"], +} + local MICRO_BARS = { ["micromenu1"] = L["MAIN_BAR"], ["micromenu2"] = L["ADDITIONAL_BAR"], @@ -1546,12 +1556,6 @@ function CONFIG.CreateActionBarsPanel(_, order) get = function(info) return C.db.profile.bars.xpbar[info[#info]] end, - set = function(info, value) - if C.db.profile.bars.xpbar[info[#info]] ~= value then - C.db.profile.bars.xpbar[info[#info]] = value - BARS:GetBar("xpbar"):Update() - end - end, args = { enabled = { order = 1, @@ -1598,6 +1602,13 @@ function CONFIG.CreateActionBarsPanel(_, order) name = L["WIDTH"], min = 530, max = 1900, step = 2, disabled = isXPBarDisabledOrRestricted, + set = function(info, value) + if C.db.profile.bars.xpbar[info[#info]] ~= value then + C.db.profile.bars.xpbar[info[#info]] = value + BARS:GetBar("xpbar"):UpdateConfig() + BARS:GetBar("xpbar"):UpdateSize(value, C.db.profile.bars.xpbar.height) + end + end, }, height = { order = 11, @@ -1605,6 +1616,13 @@ function CONFIG.CreateActionBarsPanel(_, order) name = L["HEIGHT"], min = 8, max = 32, step = 4, disabled = isXPBarDisabledOrRestricted, + set = function(info, value) + if C.db.profile.bars.xpbar[info[#info]] ~= value then + C.db.profile.bars.xpbar[info[#info]] = value + BARS:GetBar("xpbar"):UpdateConfig() + BARS:GetBar("xpbar"):UpdateSize(C.db.profile.bars.xpbar.width, value) + end + end, }, spacer_2 = { order = 19, @@ -1624,7 +1642,11 @@ function CONFIG.CreateActionBarsPanel(_, order) if C.db.profile.bars.xpbar.text[info[#info]] ~= value then C.db.profile.bars.xpbar.text[info[#info]] = value BARS:GetBar("xpbar"):UpdateConfig() - BARS:GetBar("xpbar"):UpdateFont() + BARS:GetBar("xpbar"):ForEach( + "UpdateFont", + C.db.profile.bars.xpbar.text.size, + C.db.profile.bars.xpbar.text.flag) + BARS:GetBar("xpbar"):ForEach("UpdateText") end end, args = { @@ -1640,6 +1662,33 @@ function CONFIG.CreateActionBarsPanel(_, order) name = L["FLAG"], values = FLAGS, }, + format = { + order = 3, + type = "select", + name = L["FORMAT"], + values = FORMATS, + set = function(info, value) + if C.db.profile.bars.xpbar.text[info[#info]] ~= value then + C.db.profile.bars.xpbar.text[info[#info]] = value + BARS:GetBar("xpbar"):UpdateConfig() + BARS:GetBar("xpbar"):UpdateTextFormat(value) + BARS:GetBar("xpbar"):ForEach("UpdateText") + end + end, + }, + visibility = { + order = 4, + type = "select", + name = L["VISIBILITY"], + values = VISIBILITY, + set = function(info, value) + if C.db.profile.bars.xpbar.text[info[#info]] ~= value then + C.db.profile.bars.xpbar.text[info[#info]] = value + BARS:GetBar("xpbar"):UpdateConfig() + BARS:GetBar("xpbar"):ForEach("LockText", value == 1) + end + end, + }, }, }, spacer_3 = { diff --git a/config/blizzard.lua b/config/blizzard.lua index 4cfa0cea..e8bc9e66 100644 --- a/config/blizzard.lua +++ b/config/blizzard.lua @@ -5,6 +5,7 @@ local CONFIG = P:GetModule("Config") -- Lua local _G = getfenv(0) +local unpack = _G.unpack -- Mine local DRAG_KEYS = { @@ -375,6 +376,65 @@ function CONFIG.CreateBlizzardPanel(_, order) }, }, }, + spacer_4 = { + order = 39, + type = "description", + name = " ", + }, + colors = { + order = 40, + type = "group", + name = L["COLORS"], + inline = true, + get = function(info) + return unpack(C.db.profile.blizzard.castbar.colors[info[#info]]) + end, + set = function(info, r, g, b) + if r ~= nil then + local color = C.db.profile.blizzard.castbar.colors[info[#info]] + if color[1] ~= r or color[2] ~= g or color[3] ~= b then + color[1], color[2], color[3] = r, g, b + BLIZZARD:UpdateCastBars() + end + end + end, + args = { + reset = { + type = "execute", + order = 1, + name = L["RESTORE_DEFAULTS"], + func = function() + CONFIG:CopySettings(D.profile.blizzard.castbar.colors, C.db.profile.blizzard.castbar.colors) + BLIZZARD:UpdateCastBars() + end, + }, + spacer_1 = { + order = 9, + type = "description", + name = " ", + }, + casting = { + order = 10, + type = "color", + name = L["SPELL_CAST"], + }, + channeling = { + order = 11, + type = "color", + name = L["SPELL_CHANNELED"], + }, + failed = { + order = 12, + type = "color", + name = L["SPELL_FAILED"], + }, + notinterruptible = { + order = 13, + type = "color", + name = L["SPELL_UNINTERRUPTIBLE"], + }, + }, + }, }, }, digsite_bar = { diff --git a/config/unitframes.lua b/config/unitframes.lua index dbb344e9..1a803850 100644 --- a/config/unitframes.lua +++ b/config/unitframes.lua @@ -7,6 +7,7 @@ local UNITFRAMES = P:GetModule("UnitFrames") local _G = getfenv(0) local next = _G.next local s_split = _G.string.split +local unpack = _G.unpack -- Mine local FCF_MODES = { @@ -793,6 +794,39 @@ local function getOptionsTable_Castbar(order, unit) }, }, }, + spacer_3 = { + order = 29, + type = "description", + name = " ", + }, + text = { + order = 30, + type = "group", + name = L["TEXT"], + inline = true, + get = function(info) + return C.db.profile.units[unit].castbar[info[#info - 1]][info[#info]] + end, + set = function(info, value) + C.db.profile.units[unit].castbar[info[#info - 1]][info[#info]] = value + UNITFRAMES:UpdateUnitFrame(unit, "UpdateConfig") + UNITFRAMES:UpdateUnitFrame(unit, "UpdateCastbar") + end, + args = { + size = { + order = 1, + type = "range", + name = L["SIZE"], + min = 10, max = 20, step = 2, + }, + flag = { + order = 2, + type = "select", + name = L["FLAG"], + values = FLAGS, + }, + }, + }, }, } @@ -844,6 +878,17 @@ local function getOptionsTable_Castbar(order, unit) end end + temp.args.text.get = function(info) + return C.db.profile.units[unit][E.UI_LAYOUT].castbar.text[info[#info]] + end + temp.args.text.set = function(info, value) + if C.db.profile.units[unit][E.UI_LAYOUT].castbar.text[info[#info]] ~= value then + C.db.profile.units[unit][E.UI_LAYOUT].castbar.text[info[#info]] = value + UNITFRAMES:UpdateUnitFrame(unit, "UpdateConfig") + UNITFRAMES:UpdateUnitFrame(unit, "UpdateCastbar") + end + end + if E.UI_LAYOUT == "ls" then temp.args.detached = nil temp.args.width_override.name = L["WIDTH"] @@ -1527,9 +1572,96 @@ local function getOptionsTable_Auras(order, unit) type = "description", name = " ", }, - cooldown = { + type = { order = 30, type = "group", + name = "Aura Type", + inline = true, + get = function(info) + return C.db.profile.units[unit].auras.type[info[#info]] + end, + set = function(info, value) + if C.db.profile.units[unit].auras.type[info[#info]] ~= value then + C.db.profile.units[unit].auras.type[info[#info]] = value + UNITFRAMES:UpdateUnitFrame(unit, "UpdateConfig") + UNITFRAMES:UpdateUnitFrame(unit, "UpdateAuras") + end + end, + args = { + debuff_type = { + order = 1, + type = "toggle", + name = "Debuff Type", + }, + size = { + order = 2, + type = "range", + name = L["SIZE"], + min = 10, max = 32, step = 2, + }, + position = { + order = 3, + type = "select", + name = L["POINT"], + values = POINTS, + }, + }, + }, + spacer_4 = { + order = 39, + type = "description", + name = " ", + }, + count = { + order = 40, + type = "group", + name = L["COUNT_TEXT"], + inline = true, + get = function(info) + return C.db.profile.units[unit].auras.count[info[#info]] + end, + set = function(info, value) + if C.db.profile.units[unit].auras.count[info[#info]] ~= value then + C.db.profile.units[unit].auras.count[info[#info]] = value + UNITFRAMES:UpdateUnitFrame(unit, "UpdateConfig") + UNITFRAMES:UpdateUnitFrame(unit, "UpdateAuras") + end + end, + args = { + size = { + order = 1, + type = "range", + name = L["SIZE"], + min = 10, max = 20, step = 2, + }, + flag = { + order = 2, + type = "select", + name = L["FLAG"], + values = FLAGS, + }, + h_alignment = { + order = 3, + type = "select", + name = L["TEXT_HORIZ_ALIGNMENT"], + values = H_ALIGNMENTS, + }, + v_alignment = { + order = 4, + type = "select", + name = L["TEXT_VERT_ALIGNMENT"], + values = V_ALIGNMENTS, + }, + }, + }, + spacer_5 = { + order = 49, + type = "description", + name = " ", + }, + cooldown = { + order = 50, + type = "group", name = L["COOLDOWN_TEXT"], inline = true, get = function(info) @@ -1574,8 +1706,13 @@ local function getOptionsTable_Auras(order, unit) }, }, }, + spacer_6 = { + order = 59, + type = "description", + name = " ", + }, filter = { - order = 40, + order = 60, type = "group", name = L["FILTERS"], inline = true, @@ -1883,6 +2020,28 @@ local function getOptionsTable_Auras(order, unit) end end + temp.args.type.get = function(info) + return C.db.profile.units[unit][E.UI_LAYOUT].auras.type[info[#info]] + end + temp.args.type.set = function(info, value) + if C.db.profile.units[unit][E.UI_LAYOUT].auras.type[info[#info]] ~= value then + C.db.profile.units[unit][E.UI_LAYOUT].auras.type[info[#info]] = value + UNITFRAMES:UpdateUnitFrame(unit, "UpdateConfig") + UNITFRAMES:UpdateUnitFrame(unit, "UpdateAuras") + end + end + + temp.args.count.get = function(info) + return C.db.profile.units[unit][E.UI_LAYOUT].auras.count[info[#info]] + end + temp.args.count.set = function(info, value) + if C.db.profile.units[unit][E.UI_LAYOUT].auras.count[info[#info]] ~= value then + C.db.profile.units[unit][E.UI_LAYOUT].auras.count[info[#info]] = value + UNITFRAMES:UpdateUnitFrame(unit, "UpdateConfig") + UNITFRAMES:UpdateUnitFrame(unit, "UpdateAuras") + end + end + temp.args.cooldown.get = function(info) return C.db.profile.units[unit][E.UI_LAYOUT].auras.cooldown.text[info[#info]] end @@ -2808,6 +2967,68 @@ function CONFIG.CreateUnitFramesPanel(_, order) }, }, }, + spacer_3 = { + order = 29, + type = "description", + name = " ", + }, + castbar = { + order = 30, + type = "group", + name = L["CASTBAR"], + inline = true, + disabled = isModuleDisabled, + get = function(info) + return unpack(C.db.profile.units.castbar.colors[info[#info]]) + end, + set = function(info, r, g, b) + if r ~= nil then + local color = C.db.profile.units.castbar.colors[info[#info]] + if color[1] ~= r or color[2] ~= g or color[3] ~= b then + color[1], color[2], color[3] = r, g, b + UNITFRAMES:UpdateUnitFrames("UpdateConfig") + UNITFRAMES:UpdateUnitFrames("ForElement", "Castbar", "UpdateConfig") + end + end + end, + args = { + reset = { + type = "execute", + order = 1, + name = L["RESTORE_DEFAULTS"], + func = function() + CONFIG:CopySettings(D.profile.units.castbar.colors, C.db.profile.units.castbar.colors) + UNITFRAMES:UpdateUnitFrames("UpdateConfig") + UNITFRAMES:UpdateUnitFrames("ForElement", "Castbar", "UpdateConfig") + end, + }, + spacer_1 = { + order = 9, + type = "description", + name = " ", + }, + casting = { + order = 10, + type = "color", + name = L["SPELL_CAST"], + }, + channeling = { + order = 11, + type = "color", + name = L["SPELL_CHANNELED"], + }, + failed = { + order = 12, + type = "color", + name = L["SPELL_FAILED"], + }, + notinterruptible = { + order = 13, + type = "color", + name = L["SPELL_UNINTERRUPTIBLE"], + }, + }, + }, player = getOptionsTable_UnitFrame(3, "player", L["PLAYER_FRAME"]), pet = getOptionsTable_UnitFrame(4, "pet", L["PET_FRAME"]), target = getOptionsTable_UnitFrame(5, "target", L["TARGET_FRAME"]), diff --git a/core/cooldown.lua b/core/cooldown.lua index d38e2260..453a0019 100644 --- a/core/cooldown.lua +++ b/core/cooldown.lua @@ -4,6 +4,7 @@ local E, C, M, L, P = ns.E, ns.C, ns.M, ns.L, ns.P -- Lua local _G = getfenv(0) local hooksecurefunc = _G.hooksecurefunc +local m_abs = _G.math.abs local next = _G.next local unpack = _G.unpack @@ -123,7 +124,7 @@ end local function cooldown_SetCooldown(self, start, duration) if self.config.text.enabled then - if start > 0 and duration > 1.5 then + if duration > 1.5 then activeCooldowns[self] = start + duration return end @@ -141,6 +142,12 @@ local function cooldown_UpdateFontObject(self, fontObject) self.Timer:SetJustifyV(config.v_alignment) self.Timer:SetShown(config.enabled) self.Timer:SetWordWrap(false) + + if config.flag == "_Shadow" then + self.Timer:SetShadowOffset(1, -1) + else + self.Timer:SetShadowOffset(0, 0) + end end local function cooldown_UpdateConfig(self, config) diff --git a/core/defaults.lua b/core/defaults.lua index 7e18fa13..7bb6ae2b 100644 --- a/core/defaults.lua +++ b/core/defaults.lua @@ -17,6 +17,14 @@ D.profile = { day = {255 / 255, 255 / 255, 255 / 255}, }, }, + castbar = { + colors = { + casting = {250 / 255, 193 / 255, 74 / 255}, + channeling = {60 / 255, 170 / 255, 59 / 255}, + failed = {222 / 255, 67 / 255, 58 / 255}, + notinterruptible = {125 / 255, 122 / 255, 125 / 255}, + }, + }, player = { ls = { enabled = true, @@ -104,6 +112,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "BOTTOM", anchor = "", @@ -272,6 +284,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "TOPRIGHT", anchor = "", @@ -343,6 +359,12 @@ D.profile = { x_growth = "RIGHT", y_growth = "UP", disable_mouse = false, + count = { + size = 10, + flag = "_Outline", -- "_Shadow", "" + h_alignment = "RIGHT", + v_alignment = "TOP", + }, cooldown = { text = { enabled = true, @@ -352,6 +374,11 @@ D.profile = { v_alignment = "BOTTOM", }, }, + type = { + size = 12, + position = "TOPLEFT", + debuff_type = false, + }, filter = { friendly = { buff = { @@ -443,6 +470,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "BOTTOM", anchor = "LSPlayerFrameCastbarHolder", @@ -535,6 +566,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "TOPLEFT", anchor = "", @@ -670,6 +705,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "TOPLEFT", anchor = "", @@ -743,6 +782,12 @@ D.profile = { x_growth = "RIGHT", y_growth = "UP", disable_mouse = false, + count = { + size = 10, + flag = "_Outline", -- "_Shadow", "" + h_alignment = "RIGHT", + v_alignment = "TOP", + }, cooldown = { text = { enabled = true, @@ -752,6 +797,11 @@ D.profile = { v_alignment = "BOTTOM", }, }, + type = { + size = 12, + position = "TOPLEFT", + debuff_type = false, + }, filter = { friendly = { buff = { @@ -967,6 +1017,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "TOPRIGHT", anchor = "", @@ -1039,6 +1093,12 @@ D.profile = { x_growth = "RIGHT", y_growth = "UP", disable_mouse = false, + count = { + size = 10, + flag = "_Outline", -- "_Shadow", "" + h_alignment = "RIGHT", + v_alignment = "TOP", + }, cooldown = { text = { enabled = true, @@ -1048,6 +1108,11 @@ D.profile = { v_alignment = "BOTTOM", }, }, + type = { + size = 12, + position = "TOPLEFT", + debuff_type = false, + }, filter = { friendly = { buff = { @@ -1282,6 +1347,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "TOPLEFT", anchor = "", @@ -1344,6 +1413,12 @@ D.profile = { x_growth = "LEFT", y_growth = "DOWN", disable_mouse = false, + count = { + size = 10, + flag = "_Outline", -- "_Shadow", "" + h_alignment = "RIGHT", + v_alignment = "TOP", + }, cooldown = { text = { enabled = true, @@ -1353,6 +1428,11 @@ D.profile = { v_alignment = "BOTTOM", }, }, + type = { + size = 12, + position = "TOPLEFT", + debuff_type = false, + }, filter = { friendly = { buff = { @@ -2041,6 +2121,8 @@ D.profile = { text = { size = 10, flag = "_Outline", -- "_Shadow", "" + format = "NUM", -- "NUM_PERC" + visibility = 2, -- 1 - always, 2 - mouseover }, point = { p = "BOTTOM", @@ -2087,6 +2169,8 @@ D.profile = { enabled = true, size = 12, flag = "_Outline", -- "_Shadow", "" + h_alignment = "RIGHT", + v_alignment = "TOP", }, cooldown = { text = { @@ -2097,6 +2181,11 @@ D.profile = { v_alignment = "BOTTOM", }, }, + type = { + size = 12, + position = "TOPLEFT", + debuff_type = false, + }, point = { ls = { p = "TOPRIGHT", @@ -2128,6 +2217,8 @@ D.profile = { enabled = true, size = 12, flag = "_Outline", -- "_Shadow", "" + h_alignment = "RIGHT", + v_alignment = "TOP", }, cooldown = { text = { @@ -2138,6 +2229,11 @@ D.profile = { v_alignment = "BOTTOM", }, }, + type = { + size = 12, + position = "TOPLEFT", + debuff_type = false, + }, point = { ls = { p = "TOPRIGHT", @@ -2218,6 +2314,12 @@ D.profile = { }, show_pet = -1, -- -1 - auto, 0 - false, 1 - true latency = true, + colors = { + casting = {250 / 255, 193 / 255, 74 / 255}, + channeling = {60 / 255, 170 / 255, 59 / 255}, + failed = {222 / 255, 67 / 255, 58 / 255}, + notinterruptible = {125 / 255, 122 / 255, 125 / 255}, + }, }, digsite_bar = { -- ArcheologyDigsiteProgressBar width = 200, diff --git a/core/utils.lua b/core/utils.lua index 6f6773a2..9c6dde44 100644 --- a/core/utils.lua +++ b/core/utils.lua @@ -51,26 +51,16 @@ end do local BreakUpLargeNumbers = _G.BreakUpLargeNumbers - local SECOND_NUMBER_CAP_NO_SPACE = _G.SECOND_NUMBER_CAP_NO_SPACE - local FIRST_NUMBER_CAP_NO_SPACE = _G.FIRST_NUMBER_CAP_NO_SPACE + local SECOND_NUMBER_CAP = "%s.%d" .. _G.SECOND_NUMBER_CAP_NO_SPACE + local FIRST_NUMBER_CAP = "%s.%d" .. _G.FIRST_NUMBER_CAP_NO_SPACE - function E:NumberFormat(v, mod) + function E:FormatNumber(v) if v >= 1E6 then local i, f = m_modf(v / 1E6) - - if mod and mod > 0 then - return s_format("%s.%d"..SECOND_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i), f * 10 ^ mod) - else - return s_format("%s"..SECOND_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i)) - end + return s_format(SECOND_NUMBER_CAP, BreakUpLargeNumbers(i), f * 10) elseif v >= 1E4 then local i, f = m_modf(v / 1E3) - - if mod and mod > 0 then - return s_format("%s.%d"..FIRST_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i), f * 10 ^ mod) - else - return s_format("%s"..FIRST_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i)) - end + return s_format(FIRST_NUMBER_CAP, BreakUpLargeNumbers(i), f * 10) elseif v >= 0 then return BreakUpLargeNumbers(v) else diff --git a/embeds/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua b/embeds/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua index fb050185..b250df8f 100644 --- a/embeds/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua +++ b/embeds/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua @@ -1,13 +1,13 @@ --- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables. -- @class file -- @name AceConfigDialog-3.0 --- @release $Id: AceConfigDialog-3.0.lua 1184 2018-07-21 14:13:14Z nevcairiel $ +-- @release $Id: AceConfigDialog-3.0.lua 1194 2018-08-25 07:59:05Z nevcairiel $ local LibStub = LibStub local gui = LibStub("AceGUI-3.0") local reg = LibStub("AceConfigRegistry-3.0") -local MAJOR, MINOR = "AceConfigDialog-3.0", 66 +local MAJOR, MINOR = "AceConfigDialog-3.0", 67 local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not AceConfigDialog then return end @@ -21,11 +21,11 @@ AceConfigDialog.frame.closing = AceConfigDialog.frame.closing or {} AceConfigDialog.frame.closeAllOverride = AceConfigDialog.frame.closeAllOverride or {} -- Lua APIs -local tconcat, tinsert, tsort, tremove, tsort = table.concat, table.insert, table.sort, table.remove, table.sort +local tinsert, tsort, tremove = table.insert, table.sort, table.remove local strmatch, format = string.match, string.format -local assert, loadstring, error = assert, loadstring, error +local error = error local pairs, next, select, type, unpack, wipe, ipairs = pairs, next, select, type, unpack, wipe, ipairs -local rawset, tostring, tonumber = rawset, tostring, tonumber +local tostring, tonumber = tostring, tonumber local math_min, math_max, math_floor = math.min, math.max, math.floor -- Global vars/functions that we don't upvalue since they might get hooked, or upgraded @@ -1504,10 +1504,6 @@ local function GroupSelected(widget, event, uniquevalue) end BuildPath(feedpath, ("\001"):split(uniquevalue)) - local group = options - for i = 1, #feedpath do - group = GetSubOption(group, feedpath[i]) - end widget:ReleaseChildren() AceConfigDialog:FeedGroup(user.appName,options,widget,rootframe,feedpath) diff --git a/embeds/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua b/embeds/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua index f8ac3f93..1e408111 100644 --- a/embeds/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua +++ b/embeds/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.lua @@ -8,7 +8,7 @@ -- :IterateOptionsTables() (and :GetOptionsTable() if only given one argument) return a function reference that the requesting config handling addon must call with valid "uiType", "uiName". -- @class file -- @name AceConfigRegistry-3.0 --- @release $Id: AceConfigRegistry-3.0.lua 1169 2018-02-27 16:18:28Z nevcairiel $ +-- @release $Id: AceConfigRegistry-3.0.lua 1193 2018-08-02 12:24:37Z funkydude $ local CallbackHandler = LibStub("CallbackHandler-1.0") local MAJOR, MINOR = "AceConfigRegistry-3.0", 18 @@ -59,7 +59,6 @@ local optstring={["nil"]=true,["string"]=true, _="string"} local optstringfunc={["nil"]=true,["string"]=true,["function"]=true, _="string or funcref"} local optstringnumberfunc={["nil"]=true,["string"]=true,["number"]=true,["function"]=true, _="string, number or funcref"} local optnumber={["nil"]=true,["number"]=true, _="number"} -local optmethod={["nil"]=true,["string"]=true,["function"]=true, _="methodname or funcref"} local optmethodfalse={["nil"]=true,["string"]=true,["function"]=true,["boolean"]={[false]=true}, _="methodname, funcref or false"} local optmethodnumber={["nil"]=true,["string"]=true,["function"]=true,["number"]=true, _="methodname, funcref or number"} local optmethodtable={["nil"]=true,["string"]=true,["function"]=true,["table"]=true, _="methodname, funcref or table"} diff --git a/embeds/AceDB-3.0/AceDB-3.0.lua b/embeds/AceDB-3.0/AceDB-3.0.lua index b42b4420..c41e9a46 100644 --- a/embeds/AceDB-3.0/AceDB-3.0.lua +++ b/embeds/AceDB-3.0/AceDB-3.0.lua @@ -40,15 +40,15 @@ -- end -- @class file -- @name AceDB-3.0.lua --- @release $Id: AceDB-3.0.lua 1142 2016-07-11 08:36:19Z nevcairiel $ +-- @release $Id: AceDB-3.0.lua 1193 2018-08-02 12:24:37Z funkydude $ local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 26 -local AceDB, oldminor = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR) +local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR) if not AceDB then return end -- No upgrade needed -- Lua APIs local type, pairs, next, error = type, pairs, next, error -local setmetatable, getmetatable, rawset, rawget = setmetatable, getmetatable, rawset, rawget +local setmetatable, rawset, rawget = setmetatable, rawset, rawget -- WoW APIs local _G = _G @@ -619,8 +619,6 @@ function DBObjectLib:ResetDB(defaultProfile) sv[k] = nil end - local parent = self.parent - initdb(sv, self.defaults, defaultProfile, self) -- fix the child namespaces diff --git a/embeds/AceDBOptions-3.0/AceDBOptions-3.0.lua b/embeds/AceDBOptions-3.0/AceDBOptions-3.0.lua index 5028feff..7477698b 100644 --- a/embeds/AceDBOptions-3.0/AceDBOptions-3.0.lua +++ b/embeds/AceDBOptions-3.0/AceDBOptions-3.0.lua @@ -1,9 +1,9 @@ --- AceDBOptions-3.0 provides a universal AceConfig options screen for managing AceDB-3.0 profiles. -- @class file -- @name AceDBOptions-3.0 --- @release $Id: AceDBOptions-3.0.lua 1140 2016-07-03 07:53:29Z nevcairiel $ +-- @release $Id: AceDBOptions-3.0.lua 1193 2018-08-02 12:24:37Z funkydude $ local ACEDBO_MAJOR, ACEDBO_MINOR = "AceDBOptions-3.0", 15 -local AceDBOptions, oldminor = LibStub:NewLibrary(ACEDBO_MAJOR, ACEDBO_MINOR) +local AceDBOptions = LibStub:NewLibrary(ACEDBO_MAJOR, ACEDBO_MINOR) if not AceDBOptions then return end -- No upgrade needed diff --git a/embeds/AceGUI-3.0/AceGUI-3.0.lua b/embeds/AceGUI-3.0/AceGUI-3.0.lua index e5c6aba3..a31a85a5 100644 --- a/embeds/AceGUI-3.0/AceGUI-3.0.lua +++ b/embeds/AceGUI-3.0/AceGUI-3.0.lua @@ -24,17 +24,17 @@ -- f:AddChild(btn) -- @class file -- @name AceGUI-3.0 --- @release $Id: AceGUI-3.0.lua 1184 2018-07-21 14:13:14Z nevcairiel $ +-- @release $Id: AceGUI-3.0.lua 1193 2018-08-02 12:24:37Z funkydude $ local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 36 local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR) if not AceGUI then return end -- No upgrade needed -- Lua APIs -local tconcat, tremove, tinsert = table.concat, table.remove, table.insert +local tinsert = table.insert local select, pairs, next, type = select, pairs, next, type -local error, assert, loadstring = error, assert, loadstring -local setmetatable, rawget, rawset = setmetatable, rawget, rawset +local error, assert = error, assert +local setmetatable, rawget = setmetatable, rawget local math_max = math.max -- WoW APIs @@ -661,14 +661,12 @@ AceGUI:RegisterLayout("Flow", --height of the current row local rowheight = 0 local rowoffset = 0 - local lastrowoffset local width = content.width or content:GetWidth() or 0 --control at the start of the row local rowstart local rowstartoffset - local lastrowstart local isfullheight local frameoffset diff --git a/embeds/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua b/embeds/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua index 80fd5828..ec98f4b5 100644 --- a/embeds/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua +++ b/embeds/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua @@ -219,7 +219,7 @@ local function Constructor() statustext:SetText("") local titlebg = frame:CreateTexture(nil, "OVERLAY") - titlebg:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header") + titlebg:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header titlebg:SetTexCoord(0.31, 0.67, 0, 0.63) titlebg:SetPoint("TOP", 0, 12) titlebg:SetWidth(100) @@ -235,14 +235,14 @@ local function Constructor() titletext:SetPoint("TOP", titlebg, "TOP", 0, -14) local titlebg_l = frame:CreateTexture(nil, "OVERLAY") - titlebg_l:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header") + titlebg_l:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header titlebg_l:SetTexCoord(0.21, 0.31, 0, 0.63) titlebg_l:SetPoint("RIGHT", titlebg, "LEFT") titlebg_l:SetWidth(30) titlebg_l:SetHeight(40) local titlebg_r = frame:CreateTexture(nil, "OVERLAY") - titlebg_r:SetTexture("Interface\\DialogFrame\\UI-DialogBox-Header") + titlebg_r:SetTexture(131080) -- Interface\\DialogFrame\\UI-DialogBox-Header titlebg_r:SetTexCoord(0.67, 0.77, 0, 0.63) titlebg_r:SetPoint("LEFT", titlebg, "RIGHT") titlebg_r:SetWidth(30) @@ -260,7 +260,7 @@ local function Constructor() line1:SetWidth(14) line1:SetHeight(14) line1:SetPoint("BOTTOMRIGHT", -8, 8) - line1:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border") + line1:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border local x = 0.1 * 14/17 line1:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) @@ -268,7 +268,7 @@ local function Constructor() line2:SetWidth(8) line2:SetHeight(8) line2:SetPoint("BOTTOMRIGHT", -8, 8) - line2:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border") + line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border local x = 0.1 * 8/17 line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) diff --git a/embeds/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua b/embeds/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua index 52769c2e..eb8e215c 100644 --- a/embeds/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua +++ b/embeds/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua @@ -8,7 +8,7 @@ if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end -- Lua APIs local pairs, assert, type = pairs, assert, type -local min, max, floor, abs = math.min, math.max, math.floor, math.abs +local min, max, floor = math.min, math.max, math.floor -- WoW APIs local CreateFrame, UIParent = CreateFrame, UIParent @@ -94,7 +94,6 @@ local methods = { local status = self.status or self.localstatus local height, viewheight = self.scrollframe:GetHeight(), self.content:GetHeight() local offset = status.offset or 0 - local curvalue = self.scrollbar:GetValue() -- Give us a margin of error of 2 pixels to stop some conditions that i would blame on floating point inaccuracys -- No-one is going to miss 2 pixels at the bottom of the frame, anyhow! if viewheight < height + 2 then diff --git a/embeds/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua b/embeds/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua index 95544c5f..9129f9de 100644 --- a/embeds/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua +++ b/embeds/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua @@ -165,7 +165,6 @@ local methods = { ["BuildTabs"] = function(self) local hastitle = (self.titletext:GetText() and self.titletext:GetText() ~= "") - local status = self.status or self.localstatus local tablist = self.tablist local tabs = self.tabs diff --git a/embeds/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/embeds/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua index 236f6330..ba916d0b 100644 --- a/embeds/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua +++ b/embeds/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @@ -59,7 +59,6 @@ end local function UpdateButton(button, treeline, selected, canExpand, isExpanded) local self = button.obj local toggle = button.toggle - local frame = self.frame local text = treeline.text or "" local icon = treeline.icon local iconCoords = treeline.iconCoords @@ -78,8 +77,6 @@ local function UpdateButton(button, treeline, selected, canExpand, isExpanded) button:UnlockHighlight() button.selected = false end - local normalTexture = button:GetNormalTexture() - local line = button.line button.level = level if ( level == 1 ) then button:SetNormalFontObject("GameFontNormal") @@ -114,11 +111,11 @@ local function UpdateButton(button, treeline, selected, canExpand, isExpanded) if canExpand then if not isExpanded then - toggle:SetNormalTexture("Interface\\Buttons\\UI-PlusButton-UP") - toggle:SetPushedTexture("Interface\\Buttons\\UI-PlusButton-DOWN") + toggle:SetNormalTexture(130838) -- Interface\\Buttons\\UI-PlusButton-UP + toggle:SetPushedTexture(130836) -- Interface\\Buttons\\UI-PlusButton-DOWN else - toggle:SetNormalTexture("Interface\\Buttons\\UI-MinusButton-UP") - toggle:SetPushedTexture("Interface\\Buttons\\UI-MinusButton-DOWN") + toggle:SetNormalTexture(130821) -- Interface\\Buttons\\UI-MinusButton-UP + toggle:SetPushedTexture(130820) -- Interface\\Buttons\\UI-MinusButton-DOWN end toggle:Show() else @@ -201,7 +198,6 @@ end local function Button_OnDoubleClick(button) local self = button.obj - local status = self.status or self.localstatus local status = (self.status or self.localstatus).groups status[button.uniquevalue] = not status[button.uniquevalue] self:RefreshTree() @@ -376,7 +372,6 @@ local methods = { ["BuildLevel"] = function(self, tree, level, parent) local groups = (self.status or self.localstatus).groups - local hasChildren = self.hasChildren for i, v in ipairs(tree) do if v.children then diff --git a/embeds/AceGUI-3.0/widgets/AceGUIContainer-Window.lua b/embeds/AceGUI-3.0/widgets/AceGUIContainer-Window.lua index 68254206..9818e6da 100644 --- a/embeds/AceGUI-3.0/widgets/AceGUIContainer-Window.lua +++ b/embeds/AceGUI-3.0/widgets/AceGUIContainer-Window.lua @@ -190,67 +190,67 @@ do frame:SetToplevel(true) local titlebg = frame:CreateTexture(nil, "BACKGROUND") - titlebg:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-Title-Background]]) + titlebg:SetTexture(251966) -- Interface\\PaperDollInfoFrame\\UI-GearManager-Title-Background titlebg:SetPoint("TOPLEFT", 9, -6) titlebg:SetPoint("BOTTOMRIGHT", frame, "TOPRIGHT", -28, -24) local dialogbg = frame:CreateTexture(nil, "BACKGROUND") - dialogbg:SetTexture([[Interface\Tooltips\UI-Tooltip-Background]]) + dialogbg:SetTexture(137056) -- Interface\\Tooltips\\UI-Tooltip-Background dialogbg:SetPoint("TOPLEFT", 8, -24) dialogbg:SetPoint("BOTTOMRIGHT", -6, 8) dialogbg:SetVertexColor(0, 0, 0, .75) local topleft = frame:CreateTexture(nil, "BORDER") - topleft:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-Border]]) + topleft:SetTexture(251963) -- Interface\\PaperDollInfoFrame\\UI-GearManager-Border topleft:SetWidth(64) topleft:SetHeight(64) topleft:SetPoint("TOPLEFT") topleft:SetTexCoord(0.501953125, 0.625, 0, 1) local topright = frame:CreateTexture(nil, "BORDER") - topright:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-Border]]) + topright:SetTexture(251963) -- Interface\\PaperDollInfoFrame\\UI-GearManager-Border topright:SetWidth(64) topright:SetHeight(64) topright:SetPoint("TOPRIGHT") topright:SetTexCoord(0.625, 0.75, 0, 1) local top = frame:CreateTexture(nil, "BORDER") - top:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-Border]]) + top:SetTexture(251963) -- Interface\\PaperDollInfoFrame\\UI-GearManager-Border top:SetHeight(64) top:SetPoint("TOPLEFT", topleft, "TOPRIGHT") top:SetPoint("TOPRIGHT", topright, "TOPLEFT") top:SetTexCoord(0.25, 0.369140625, 0, 1) local bottomleft = frame:CreateTexture(nil, "BORDER") - bottomleft:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-Border]]) + bottomleft:SetTexture(251963) -- Interface\\PaperDollInfoFrame\\UI-GearManager-Border bottomleft:SetWidth(64) bottomleft:SetHeight(64) bottomleft:SetPoint("BOTTOMLEFT") bottomleft:SetTexCoord(0.751953125, 0.875, 0, 1) local bottomright = frame:CreateTexture(nil, "BORDER") - bottomright:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-Border]]) + bottomright:SetTexture(251963) -- Interface\\PaperDollInfoFrame\\UI-GearManager-Border bottomright:SetWidth(64) bottomright:SetHeight(64) bottomright:SetPoint("BOTTOMRIGHT") bottomright:SetTexCoord(0.875, 1, 0, 1) local bottom = frame:CreateTexture(nil, "BORDER") - bottom:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-Border]]) + bottom:SetTexture(251963) -- Interface\\PaperDollInfoFrame\\UI-GearManager-Border bottom:SetHeight(64) bottom:SetPoint("BOTTOMLEFT", bottomleft, "BOTTOMRIGHT") bottom:SetPoint("BOTTOMRIGHT", bottomright, "BOTTOMLEFT") bottom:SetTexCoord(0.376953125, 0.498046875, 0, 1) local left = frame:CreateTexture(nil, "BORDER") - left:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-Border]]) + left:SetTexture(251963) -- Interface\\PaperDollInfoFrame\\UI-GearManager-Border left:SetWidth(64) left:SetPoint("TOPLEFT", topleft, "BOTTOMLEFT") left:SetPoint("BOTTOMLEFT", bottomleft, "TOPLEFT") left:SetTexCoord(0.001953125, 0.125, 0, 1) local right = frame:CreateTexture(nil, "BORDER") - right:SetTexture([[Interface\PaperDollInfoFrame\UI-GearManager-Border]]) + right:SetTexture(251963) -- Interface\\PaperDollInfoFrame\\UI-GearManager-Border right:SetWidth(64) right:SetPoint("TOPRIGHT", topright, "BOTTOMRIGHT") right:SetPoint("BOTTOMRIGHT", bottomright, "TOPRIGHT") @@ -290,7 +290,7 @@ do line1:SetWidth(14) line1:SetHeight(14) line1:SetPoint("BOTTOMRIGHT", -8, 8) - line1:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border") + line1:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border local x = 0.1 * 14/17 line1:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) @@ -299,7 +299,7 @@ do line2:SetWidth(8) line2:SetHeight(8) line2:SetPoint("BOTTOMRIGHT", -8, 8) - line2:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border") + line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border local x = 0.1 * 8/17 line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5) diff --git a/embeds/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua b/embeds/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua index 41884c1c..be9ae812 100644 --- a/embeds/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua +++ b/embeds/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua @@ -119,20 +119,20 @@ local methods = { end end, - ["SetValue"] = function(self,value) + ["SetValue"] = function(self, value) local check = self.check self.checked = value if value then - SetDesaturation(self.check, false) - self.check:Show() + SetDesaturation(check, false) + check:Show() else --Nil is the unknown tristate value if self.tristate and value == nil then - SetDesaturation(self.check, true) - self.check:Show() + SetDesaturation(check, true) + check:Show() else - SetDesaturation(self.check, false) - self.check:Hide() + SetDesaturation(check, false) + check:Hide() end end self:SetDisabled(self.disabled) @@ -155,21 +155,21 @@ local methods = { local size if type == "radio" then size = 16 - checkbg:SetTexture("Interface\\Buttons\\UI-RadioButton") + checkbg:SetTexture(130843) -- Interface\\Buttons\\UI-RadioButton checkbg:SetTexCoord(0, 0.25, 0, 1) - check:SetTexture("Interface\\Buttons\\UI-RadioButton") + check:SetTexture(130843) -- Interface\\Buttons\\UI-RadioButton check:SetTexCoord(0.25, 0.5, 0, 1) check:SetBlendMode("ADD") - highlight:SetTexture("Interface\\Buttons\\UI-RadioButton") + highlight:SetTexture(130843) -- Interface\\Buttons\\UI-RadioButton highlight:SetTexCoord(0.5, 0.75, 0, 1) else size = 24 - checkbg:SetTexture("Interface\\Buttons\\UI-CheckBox-Up") + checkbg:SetTexture(130755) -- Interface\\Buttons\\UI-CheckBox-Up checkbg:SetTexCoord(0, 1, 0, 1) - check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check") + check:SetTexture(130751) -- Interface\\Buttons\\UI-CheckBox-Check check:SetTexCoord(0, 1, 0, 1) check:SetBlendMode("BLEND") - highlight:SetTexture("Interface\\Buttons\\UI-CheckBox-Highlight") + highlight:SetTexture(130753) -- Interface\\Buttons\\UI-CheckBox-Highlight highlight:SetTexCoord(0, 1, 0, 1) end checkbg:SetHeight(size) @@ -255,11 +255,11 @@ local function Constructor() checkbg:SetWidth(24) checkbg:SetHeight(24) checkbg:SetPoint("TOPLEFT") - checkbg:SetTexture("Interface\\Buttons\\UI-CheckBox-Up") + checkbg:SetTexture(130755) -- Interface\\Buttons\\UI-CheckBox-Up local check = frame:CreateTexture(nil, "OVERLAY") check:SetAllPoints(checkbg) - check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check") + check:SetTexture(130751) -- Interface\\Buttons\\UI-CheckBox-Check local text = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlight") text:SetJustifyH("LEFT") @@ -268,7 +268,7 @@ local function Constructor() text:SetPoint("RIGHT") local highlight = frame:CreateTexture(nil, "HIGHLIGHT") - highlight:SetTexture("Interface\\Buttons\\UI-CheckBox-Highlight") + highlight:SetTexture(130753) -- Interface\\Buttons\\UI-CheckBox-Highlight highlight:SetBlendMode("ADD") highlight:SetAllPoints(checkbg) diff --git a/embeds/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua b/embeds/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua index 05e2b570..596e70a7 100644 --- a/embeds/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua +++ b/embeds/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua @@ -140,7 +140,7 @@ local function Constructor() local colorSwatch = frame:CreateTexture(nil, "OVERLAY") colorSwatch:SetWidth(19) colorSwatch:SetHeight(19) - colorSwatch:SetTexture("Interface\\ChatFrame\\ChatFrameColorSwatch") + colorSwatch:SetTexture(130939) -- Interface\\ChatFrame\\ChatFrameColorSwatch colorSwatch:SetPoint("LEFT") local texture = frame:CreateTexture(nil, "BACKGROUND") @@ -153,7 +153,7 @@ local function Constructor() local checkers = frame:CreateTexture(nil, "BACKGROUND") checkers:SetWidth(14) checkers:SetHeight(14) - checkers:SetTexture("Tileset\\Generic\\Checkers") + checkers:SetTexture(188523) -- Tileset\\Generic\\Checkers checkers:SetTexCoord(.25, 0, 0.5, .25) checkers:SetDesaturated(true) checkers:SetVertexColor(1, 1, 1, 0.75) @@ -168,7 +168,7 @@ local function Constructor() text:SetPoint("RIGHT") --local highlight = frame:CreateTexture(nil, "HIGHLIGHT") - --highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight") + --highlight:SetTexture(136810) -- Interface\\QuestFrame\\UI-QuestTitleHighlight --highlight:SetBlendMode("ADD") --highlight:SetAllPoints(frame) diff --git a/embeds/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua b/embeds/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua index 5748e4fc..549ce3e1 100644 --- a/embeds/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua +++ b/embeds/AceGUI-3.0/widgets/AceGUIWidget-DropDown-Items.lua @@ -1,4 +1,4 @@ ---[[ $Id: AceGUIWidget-DropDown-Items.lua 1167 2017-08-29 22:08:48Z funkydude $ ]]-- +--[[ $Id: AceGUIWidget-DropDown-Items.lua 1192 2018-07-30 18:03:51Z funkydude $ ]]-- local AceGUI = LibStub("AceGUI-3.0") @@ -169,7 +169,7 @@ function ItemBase.Create(type) self.text = text local highlight = frame:CreateTexture(nil, "OVERLAY") - highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight") + highlight:SetTexture(136810) -- Interface\\QuestFrame\\UI-QuestTitleHighlight highlight:SetBlendMode("ADD") highlight:SetHeight(14) highlight:ClearAllPoints() @@ -182,7 +182,7 @@ function ItemBase.Create(type) check:SetWidth(16) check:SetHeight(16) check:SetPoint("LEFT",frame,"LEFT",3,-1) - check:SetTexture("Interface\\Buttons\\UI-CheckBox-Check") + check:SetTexture(130751) -- Interface\\Buttons\\UI-CheckBox-Check check:Hide() self.check = check @@ -190,7 +190,7 @@ function ItemBase.Create(type) sub:SetWidth(16) sub:SetHeight(16) sub:SetPoint("RIGHT",frame,"RIGHT",-3,-1) - sub:SetTexture("Interface\\ChatFrame\\ChatFrameExpandArrow") + sub:SetTexture(130940) -- Interface\\ChatFrame\\ChatFrameExpandArrow sub:Hide() self.sub = sub diff --git a/embeds/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua b/embeds/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua index 1aaf3f50..862ae88a 100644 --- a/embeds/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua +++ b/embeds/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua @@ -51,14 +51,14 @@ local function Constructor() left:SetHeight(8) left:SetPoint("LEFT", 3, 0) left:SetPoint("RIGHT", label, "LEFT", -5, 0) - left:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border") + left:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border left:SetTexCoord(0.81, 0.94, 0.5, 1) local right = frame:CreateTexture(nil, "BACKGROUND") right:SetHeight(8) right:SetPoint("RIGHT", -3, 0) right:SetPoint("LEFT", label, "RIGHT", 5, 0) - right:SetTexture("Interface\\Tooltips\\UI-Tooltip-Border") + right:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border right:SetTexCoord(0.81, 0.94, 0.5, 1) local widget = { diff --git a/embeds/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua b/embeds/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua index 561da733..bc3d02ad 100644 --- a/embeds/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua +++ b/embeds/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua @@ -118,7 +118,7 @@ local function Constructor() local highlight = frame:CreateTexture(nil, "HIGHLIGHT") highlight:SetAllPoints(image) - highlight:SetTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight") + highlight:SetTexture(136580) -- Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight highlight:SetTexCoord(0, 1, 0.23, 0.77) highlight:SetBlendMode("ADD") diff --git a/embeds/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua b/embeds/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua index 036efee2..255dd977 100644 --- a/embeds/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua +++ b/embeds/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua @@ -8,13 +8,6 @@ if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end -- Lua APIs local select, pairs = select, pairs --- WoW APIs -local CreateFrame, UIParent = CreateFrame, UIParent - --- Global vars/functions that we don't upvalue since they might get hooked, or upgraded --- List them here for Mikk's FindGlobals script --- GLOBALS: GameFontHighlightSmall - --[[----------------------------------------------------------------------------- Scripts -------------------------------------------------------------------------------]] diff --git a/embeds/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua b/embeds/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua index 20d0887d..5a81759c 100644 --- a/embeds/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua +++ b/embeds/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua @@ -57,10 +57,9 @@ local function Frame_OnMouseDown(frame) AceGUI:ClearFocus() end -local function Slider_OnValueChanged(frame) +local function Slider_OnValueChanged(frame, newvalue) local self = frame.obj if not frame.setup then - local newvalue = frame:GetValue() if self.step and self.step > 0 then local min_value = self.min or 0 newvalue = floor((newvalue - min_value) / self.step + 0.5) * self.step + min_value diff --git a/embeds/LibStub/LibStub.lua b/embeds/LibStub/LibStub.lua index 0a41ac04..7e9b5cd1 100644 --- a/embeds/LibStub/LibStub.lua +++ b/embeds/LibStub/LibStub.lua @@ -1,13 +1,22 @@ --- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info --- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke +-- $Id: LibStub.lua 103 2014-10-16 03:02:50Z mikk $ +-- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/addons/libstub/ for more info +-- LibStub is hereby placed in the Public Domain +-- Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS! local LibStub = _G[LIBSTUB_MAJOR] +-- Check to see is this version of the stub is obsolete if not LibStub or LibStub.minor < LIBSTUB_MINOR then LibStub = LibStub or {libs = {}, minors = {} } _G[LIBSTUB_MAJOR] = LibStub LibStub.minor = LIBSTUB_MINOR + -- LibStub:NewLibrary(major, minor) + -- major (string) - the major version of the library + -- minor (string or number ) - the minor version of the library + -- + -- returns nil if a newer or same version of the lib is already present + -- returns empty library object or old library object if upgrade is needed function LibStub:NewLibrary(major, minor) assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)") minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.") @@ -18,6 +27,12 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then return self.libs[major], oldminor end + -- LibStub:GetLibrary(major, [silent]) + -- major (string) - the major version of the library + -- silent (boolean) - if true, library is optional, silently return nil if its not found + -- + -- throws an error if the library can not be found (except silent is set) + -- returns the library object if found function LibStub:GetLibrary(major, silent) if not self.libs[major] and not silent then error(("Cannot find a library instance of %q."):format(tostring(major)), 2) @@ -25,6 +40,12 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then return self.libs[major], self.minors[major] end - function LibStub:IterateLibraries() return pairs(self.libs) end + -- LibStub:IterateLibraries() + -- + -- Returns an iterator for the currently registered libraries + function LibStub:IterateLibraries() + return pairs(self.libs) + end + setmetatable(LibStub, { __call = LibStub.GetLibrary }) end diff --git a/locales/enUS.lua b/locales/enUS.lua index c9bce95b..4fb36e74 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -172,6 +172,7 @@ Use |cffffd200[nl]|r for line breaking.]=] L["DAMAGE_ABSORB_TEXT"] = "Damage Absorb Text" L["DAYS"] = "Days" L["DEAD"] = "Dead" +L["DEBUFF_TYPE"] = "Debuff Type" L["DEBUFFS"] = "Debuffs" L["DESATURATION"] = "Desaturation" L["DESCENDING"] = "Descending" @@ -313,6 +314,8 @@ L["NPC_CLASSIFICATION"] = "NPC Type" L["NPE_FRAME"] = "NPE Tutorial Frame" L["NUM_BUTTONS"] = "Number of Buttons" L["NUM_ROWS"] = "Number of Rows" +L["NUMERIC"] = "Numeric" +L["NUMERIC_PERCENTAGE"] = "Numeric & Percentage" L["OBJECTIVE_TRACKER"] = "Objective Tracker" L["ON_COOLDOWN"] = "On Cooldown" L["OOM"] = "Out of Power" @@ -396,6 +399,10 @@ L["SIZE_OVERRIDE_DESC"] = "If set to 0, element's size will be calculated automa L["SORT_DIR"] = "Sort Direction" L["SORT_METHOD"] = "Sort Method" L["SPACING"] = "Spacing" +L["SPELL_CAST"] = "Cast" +L["SPELL_CHANNELED"] = "Channelled" +L["SPELL_FAILED"] = "Failed" +L["SPELL_UNINTERRUPTIBLE"] = "Uninterruptible" L["STANCE_BAR"] = "Stance Bar" L["TALKING_HEAD_FRAME"] = "Talking Head Frame" L["TARGET_FRAME"] = "Target Frame" diff --git a/locales/koKR.lua b/locales/koKR.lua index 4bfec350..b487da4e 100644 --- a/locales/koKR.lua +++ b/locales/koKR.lua @@ -19,26 +19,16 @@ local s_format = _G.string.format -- Mine do local BreakUpLargeNumbers = _G.BreakUpLargeNumbers - local SECOND_NUMBER_CAP_NO_SPACE = _G.SECOND_NUMBER_CAP_NO_SPACE - local FIRST_NUMBER_CAP_NO_SPACE = _G.FIRST_NUMBER_CAP_NO_SPACE + local SECOND_NUMBER_CAP = "%s.%d" .. _G.SECOND_NUMBER_CAP_NO_SPACE + local FIRST_NUMBER_CAP = "%s.%d" .. _G.FIRST_NUMBER_CAP_NO_SPACE - function E:NumberFormat(v, mod) + function E:FormatNumber(v) if v >= 1E8 then local i, f = m_modf(v / 1E8) - - if mod and mod > 0 then - return s_format("%s.%d"..SECOND_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i), f * 10 ^ mod) - else - return s_format("%s"..SECOND_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i)) - end + return s_format(SECOND_NUMBER_CAP, BreakUpLargeNumbers(i), f * 10) elseif v >= 1E4 then local i, f = m_modf(v / 1E4) - - if mod and mod > 0 then - return s_format("%s.%d"..FIRST_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i), f * 10 ^ mod) - else - return s_format("%s"..FIRST_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i)) - end + return s_format(FIRST_NUMBER_CAP, BreakUpLargeNumbers(i), f * 10) elseif v >= 0 then return BreakUpLargeNumbers(v) else diff --git a/locales/ruRU.lua b/locales/ruRU.lua index 81e1ca86..482c6e4b 100644 --- a/locales/ruRU.lua +++ b/locales/ruRU.lua @@ -1,4 +1,4 @@ --- Contributors: Biowoolf@WoWInterface +-- Contributors: Biowoolf@WoWInterface local _, ns = ... local E, L = ns.E, ns.L @@ -105,6 +105,7 @@ L["DAMAGE_ABSORB_FORMAT_DESC"] = [=[Введите строку для изме L["DAMAGE_ABSORB_TEXT"] = "Текст поглощения урона" L["DAYS"] = "Days" L["DEAD"] = "Мертвый" +L["DEBUFF_TYPE"] = "Тип дебаффа" L["DEBUFFS"] = "Дебаффы" L["DESATURATION"] = "Обесцвечивание" L["DESCENDING"] = "По убыванию" @@ -246,6 +247,8 @@ L["NPC_CLASSIFICATION"] = "Тип существ" L["NPE_FRAME"] = "Рамка советов для новичка" L["NUM_BUTTONS"] = "Количество кнопок" L["NUM_ROWS"] = "Количество строк" +L["NUMERIC"] = "Цифры" +L["NUMERIC_PERCENTAGE"] = "Цифры и проценты" L["OBJECTIVE_TRACKER"] = "Список заданий" L["ON_COOLDOWN"] = "На восстановлении" L["OOM"] = "Нехватка ресурса" @@ -329,6 +332,10 @@ L["SIZE_OVERRIDE_DESC"] = "Если установлено на 0, то разм L["SORT_DIR"] = "Направление сортировки" L["SORT_METHOD"] = "Способ сортировки" L["SPACING"] = "Отступ" +L["SPELL_CAST"] = "Применяемые" +L["SPELL_CHANNELED"] = "Поддерживаемые" +L["SPELL_FAILED"] = "Неудачные" +L["SPELL_UNINTERRUPTIBLE"] = "Непрерываемые" L["STANCE_BAR"] = "Панель стоек" L["TALKING_HEAD_FRAME"] = "Рамка говорящего NPC" L["TARGET_FRAME"] = "Рамка цели" diff --git a/locales/zhCN.lua b/locales/zhCN.lua index 16fdb827..ee1f0b88 100644 --- a/locales/zhCN.lua +++ b/locales/zhCN.lua @@ -17,26 +17,16 @@ if GetLocale() ~= "zhCN" then return end -- Mine do local BreakUpLargeNumbers = _G.BreakUpLargeNumbers - local SECOND_NUMBER_CAP_NO_SPACE = _G.SECOND_NUMBER_CAP_NO_SPACE - local FIRST_NUMBER_CAP_NO_SPACE = _G.FIRST_NUMBER_CAP_NO_SPACE + local SECOND_NUMBER_CAP = "%s.%d" .. _G.SECOND_NUMBER_CAP_NO_SPACE + local FIRST_NUMBER_CAP = "%s.%d" .. _G.FIRST_NUMBER_CAP_NO_SPACE - function E:NumberFormat(v, mod) + function E:FormatNumber(v) if v >= 1E8 then local i, f = m_modf(v / 1E8) - - if mod and mod > 0 then - return s_format("%s.%d"..SECOND_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i), f * 10 ^ mod) - else - return s_format("%s"..SECOND_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i)) - end + return s_format(SECOND_NUMBER_CAP, BreakUpLargeNumbers(i), f * 10) elseif v >= 1E4 then local i, f = m_modf(v / 1E4) - - if mod and mod > 0 then - return s_format("%s.%d"..FIRST_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i), f * 10 ^ mod) - else - return s_format("%s"..FIRST_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i)) - end + return s_format(FIRST_NUMBER_CAP, BreakUpLargeNumbers(i), f * 10) elseif v >= 0 then return BreakUpLargeNumbers(v) else diff --git a/locales/zhTW.lua b/locales/zhTW.lua index b708cffa..77d6e94b 100644 --- a/locales/zhTW.lua +++ b/locales/zhTW.lua @@ -17,26 +17,16 @@ if GetLocale() ~= "zhTW" then return end -- Mine do local BreakUpLargeNumbers = _G.BreakUpLargeNumbers - local SECOND_NUMBER_CAP_NO_SPACE = _G.SECOND_NUMBER_CAP_NO_SPACE - local FIRST_NUMBER_CAP_NO_SPACE = _G.FIRST_NUMBER_CAP_NO_SPACE + local SECOND_NUMBER_CAP = "%s.%d" .. _G.SECOND_NUMBER_CAP_NO_SPACE + local FIRST_NUMBER_CAP = "%s.%d" .. _G.FIRST_NUMBER_CAP_NO_SPACE - function E:NumberFormat(v, mod) + function E:FormatNumber(v) if v >= 1E8 then local i, f = m_modf(v / 1E8) - - if mod and mod > 0 then - return s_format("%s.%d"..SECOND_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i), f * 10 ^ mod) - else - return s_format("%s"..SECOND_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i)) - end + return s_format(SECOND_NUMBER_CAP, BreakUpLargeNumbers(i), f * 10) elseif v >= 1E4 then local i, f = m_modf(v / 1E4) - - if mod and mod > 0 then - return s_format("%s.%d"..FIRST_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i), f * 10 ^ mod) - else - return s_format("%s"..FIRST_NUMBER_CAP_NO_SPACE, BreakUpLargeNumbers(i)) - end + return s_format(FIRST_NUMBER_CAP, BreakUpLargeNumbers(i), f * 10) elseif v >= 0 then return BreakUpLargeNumbers(v) else diff --git a/ls_UI.toc b/ls_UI.toc index db4ebac2..9b1c18de 100644 --- a/ls_UI.toc +++ b/ls_UI.toc @@ -1,6 +1,6 @@ ## Interface: 80000 ## Author: lightspark -## Version: 80000.10 +## Version: 80000.11 ## Title: ls: |cff1a9fc0UI|r ## Notes: Yet another UI, but this one is a bit special... ## SavedVariablesPerCharacter: LS_UI_CHAR_CONFIG diff --git a/modules/auras/auras.lua b/modules/auras/auras.lua index e7a4418e..e965fa9a 100644 --- a/modules/auras/auras.lua +++ b/modules/auras/auras.lua @@ -5,6 +5,7 @@ local MODULE = P:AddModule("Auras") -- Lua local _G = getfenv(0) local next = _G.next +local unpack = _G.unpack -- Blizz local GetInventoryItemTexture = _G.GetInventoryItemTexture @@ -27,6 +28,15 @@ local buffs = {} local debuffs = {} local headers = {} +local ICONS = { + ["Buff"] = {1 / 128, 33 / 128, 1 / 128, 33 / 128}, + ["Debuff"] = {34 / 128, 66 / 128, 1 / 128, 33 / 128}, + ["Curse"] = {67 / 128, 99 / 128, 1 / 128, 33 / 128}, + ["Disease"] = {1 / 128, 33 / 128, 34 / 128, 66 / 128}, + ["Magic"] = {34 / 128, 66 / 128, 34 / 128, 66 / 128}, + ["Poison"] = {67 / 128, 99 / 128, 34 / 128, 66 / 128}, +} + local function updateAura(button, index) local filter = button:GetParent():GetAttribute("filter") if filter == "HELPFUL" then @@ -55,8 +65,16 @@ local function updateAura(button, index) if filter == "HARMFUL" then local color = DEBUFF_TYPE_COLORS[debuffType] or DEBUFF_TYPE_COLORS.none button.Border:SetVertexColor(color.r, color.g, color.b) + + if debuffType and debuffType ~= "" and button.showDebuffType then + button.AuraType:SetTexCoord(unpack(ICONS[debuffType])) + button.AuraType:Show() + else + button.AuraType:Hide() + end else button.Border:SetVertexColor(1, 1, 1) + button.AuraType:Hide() end end end @@ -127,10 +145,29 @@ local function button_OnLeave() GameTooltip:Hide() end -local function button_UpdateCountFont(self) +local function button_UpdateAuraTypeIcon(self) + local config = self._parent._config.type + + self.AuraType:ClearAllPoints() + self.AuraType:SetPoint(config.position, 0, 0) + self.AuraType:SetSize(config.size, config.size) + + self.showDebuffType = self._parent._config.type.debuff_type +end + +local function button_UpdateCountText(self) local config = self._parent._config.count + self.Count:SetFontObject("LSFont" .. config.size .. config.flag) + self.Count:SetJustifyH(config.h_alignment) + self.Count:SetJustifyV(config.v_alignment) self.Count:SetWordWrap(false) + + if config.flag == "_Shadow" then + self.Count:SetShadowOffset(1, -1) + else + self.Count:SetShadowOffset(0, 0) + end end local function handleButton(button, header) @@ -160,15 +197,21 @@ local function handleButton(button, header) textParent:SetAllPoints() button.TextParent = textParent + local auraType = textParent:CreateTexture(nil, "ARTWORK", nil, 3) + auraType:SetTexture("Interface\\AddOns\\ls_UI\\assets\\unit-frame-aura-icons") + auraType:Hide() + button.AuraType = auraType + local count = textParent:CreateFontString(nil, "ARTWORK") - count:SetJustifyH("RIGHT") - count:SetPoint("TOPRIGHT", 2, 0) + count:SetAllPoints() button.Count = count button._parent = header - button.UpdateCountFont = button_UpdateCountFont + button.UpdateAuraTypeIcon = button_UpdateAuraTypeIcon + button.UpdateCountText = button_UpdateCountText - button:UpdateCountFont() + button:UpdateAuraTypeIcon() + button:UpdateCountText() end local function header_OnAttributeChanged(self, attr, value) @@ -213,8 +256,9 @@ local function header_Update(self) end self:Hide() - self:UpdateButtons("UpdateCountFont") - self:UpdateButtons("SetSize", config.size, config.size) + self:ForEachButton("UpdateAuraTypeIcon") + self:ForEachButton("UpdateCountText") + self:ForEachButton("SetSize", config.size, config.size) self:UpdateCooldownConfig() self:SetAttribute("filter", self._filter) self:SetAttribute("initialConfigFunction", ([[ @@ -246,7 +290,7 @@ local function header_Update(self) end end -local function header_UpdateButtons(self, method, ...) +local function header_ForEachButton(self, method, ...) local buttons = self._buttons or {self:GetChildren()} for _, button in next, buttons do if button[method] then @@ -347,8 +391,8 @@ local function createHeader(filter) end header._filter = filter + header.ForEachButton = header_ForEachButton header.Update = header_Update - header.UpdateButtons = header_UpdateButtons header.UpdateConfig = header_UpdateConfig header.UpdateCooldownConfig = header_UpdateCooldownConfig @@ -374,11 +418,11 @@ function MODULE.Init() isInit = true - MODULE:UpdateHeaders("Update") + MODULE:ForEachHeader("Update") end end -function MODULE:UpdateHeaders(method, ...) +function MODULE:ForEachHeader(method, ...) for _, header in next, headers do if header[method] then header[method](header, ...) @@ -386,6 +430,8 @@ function MODULE:UpdateHeaders(method, ...) end end -function MODULE:GetHeader(...) - return headers[...] +function MODULE:ForHeader(header, method, ...) + if headers[header] and headers[header][method] then + headers[header][method](headers[header], ...) + end end diff --git a/modules/auratracker/auratracker.lua b/modules/auratracker/auratracker.lua index 6ead9bcc..40cace3d 100644 --- a/modules/auratracker/auratracker.lua +++ b/modules/auratracker/auratracker.lua @@ -110,7 +110,11 @@ local function bar_OnEvent(self) button.Count:SetText(aura.count > 1 and aura.count) button.filter = aura.filter - CooldownFrame_Set(button.CD, aura.expiration - aura.duration, aura.duration, true) + if aura.duration and aura.duration > 0 then + button.CD:SetCooldown(aura.expiration - aura.duration, aura.duration) + else + button.CD:Clear() + end if button.filter == "HARMFUL" then local color = DEBUFF_TYPE_COLORS[aura.debuffType] or DEBUFF_TYPE_COLORS.none diff --git a/modules/bars/xpbar.lua b/modules/bars/xpbar.lua index b52b451e..c5f2a618 100644 --- a/modules/bars/xpbar.lua +++ b/modules/bars/xpbar.lua @@ -26,11 +26,13 @@ local C_Reputation = _G.C_Reputation -- Mine local isInit = false +local barValueTemplate local MAX_SEGMENTS = 4 local NAME_TEMPLATE = "|cff%s%s|r" local REPUTATION_TEMPLATE = "%s: |cff%s%s|r" -local BAR_VALUE_TEMPLATE = "%s / %s" +local CUR_MAX_VALUE_TEMPLATE = "%s / %s" +local CUR_MAX_PERC_VALUE_TEMPLATE = "%s / %s (%.1f%%)" local CFG = { visible = true, @@ -55,14 +57,27 @@ local LAYOUT = { [4] = {[1] = {}, [2] = {}, [3] = {}, [4] = {}}, } +local function bar_ForEach(self, method, ...) + for i = 1, MAX_SEGMENTS do + if self[i][method] then + self[i][method](self[i], ...) + end + end +end + local function bar_Update(self) self:UpdateConfig() - self:UpdateFont() - self:UpdateSize() + + for i = 1, MAX_SEGMENTS do + self[i]:UpdateFont(self._config.text.size, self._config.text.flag) + self[i]:LockText(self._config.text.visibility == 1) + end + + self:UpdateTextFormat(self._config.text.format) + self:UpdateSize(self._config.width, self._config.height) if not BARS:IsRestricted() then self:UpdateFading() - E.Movers:Get(self):UpdateSize() end end @@ -74,18 +89,13 @@ local function bar_UpdateConfig(self) end end -local function bar_UpdateFont(self) - local config = self._config.text - local fontObject = "LSFont" .. config.size .. config.flag +local function bar_UpdateTextFormat(self, format) + format = format or self._config.text.format - for i = 1, MAX_SEGMENTS do - self[i].Text:SetFontObject(fontObject) - - if config.flag ~= "_Shadow" then - self[i].Text:SetShadowOffset(0, 0) - else - self[i].Text:SetShadowOffset(1, -1) - end + if format == "NUM" then + barValueTemplate = CUR_MAX_VALUE_TEMPLATE + elseif format == "NUM_PERC" then + barValueTemplate = CUR_MAX_PERC_VALUE_TEMPLATE end end @@ -103,6 +113,10 @@ local function bar_UpdateSize(self, width, height) self:SetSize(width, height) + if not BARS:IsRestricted() then + E.Movers:Get(self):UpdateSize(width, height) + end + for i = 1, MAX_SEGMENTS - 1 do self[i].Sep:SetSize(12, height) self[i].Sep:SetTexCoord(1 / 32, 25 / 32, 0 / 8, height / 4) @@ -323,7 +337,7 @@ local function bar_UpdateSegments(self) self[1]:SetValue(1) self[1]:Show() - self[1].Text:SetText(nil) + self[1]:UpdateText(1, 1) self[1].Texture:SetVertexColor(M.COLORS.CLASS[E.PLAYER_CLASS]:GetRGB()) end @@ -367,22 +381,26 @@ local function segment_OnEnter(self) GameTooltip:Show() end - self.Text:Show() + if not self:IsTextLocked() then + self.Text:Show() + end end local function segment_OnLeave(self) GameTooltip:Hide() - self.Text:Hide() + if not self:IsTextLocked() then + self.Text:Hide() + end end local function segment_Update(self, cur, max, bonus, r, g, b) if self._value ~= cur or self._max ~= max then - self.Text:SetFormattedText(BAR_VALUE_TEMPLATE, E:NumberFormat(cur, 1), E:NumberFormat(max, 1)) self.Texture:SetVertexColor(r, g, b) self:SetMinMaxValues(0, max) self:SetValue(cur) + self:UpdateText(cur, max) end if self._bonus ~= bonus then @@ -404,6 +422,38 @@ local function segment_Update(self, cur, max, bonus, r, g, b) end end +local function segment_UpdateFont(self, size, flag) + self.Text:SetFontObject("LSFont" .. size .. flag) + + if flag ~= "_Shadow" then + self.Text:SetShadowOffset(0, 0) + else + self.Text:SetShadowOffset(1, -1) + end +end + +local function segment_UpdateText(self, cur, max) + cur = cur or self._value or 1 + max = max or self._max or 1 + + if cur == 1 and max == 1 then + self.Text:SetText(nil) + else + self.Text:SetFormattedText(barValueTemplate, E:FormatNumber(cur), E:FormatNumber(max), E:NumberToPerc(cur, max)) + end +end + +local function segment_LockText(self, isLocked) + if self.textLocked ~= isLocked then + self.textLocked = isLocked + self.Text:SetShown(isLocked) + end +end + +local function segment_IsTextLocked(self) + return self.textLocked +end + function BARS.HasXPBar() return isInit end @@ -415,12 +465,13 @@ function BARS.CreateXPBar() BARS:AddBar(bar._id, bar) + bar.ForEach = bar_ForEach bar.Update = bar_Update bar.UpdateConfig = bar_UpdateConfig bar.UpdateCooldownConfig = nil - bar.UpdateFont = bar_UpdateFont bar.UpdateSegments = bar_UpdateSegments bar.UpdateSize = bar_UpdateSize + bar.UpdateTextFormat = bar_UpdateTextFormat local texParent = CreateFrame("Frame", nil, bar) texParent:SetAllPoints() @@ -467,7 +518,11 @@ function BARS.CreateXPBar() text:Hide() segment.Text = text + segment.IsTextLocked = segment_IsTextLocked + segment.LockText = segment_LockText segment.Update = segment_Update + segment.UpdateFont = segment_UpdateFont + segment.UpdateText = segment_UpdateText end for i = 1, MAX_SEGMENTS - 1 do diff --git a/modules/blizzard/castbar.lua b/modules/blizzard/castbar.lua index 6757a280..029e72c7 100644 --- a/modules/blizzard/castbar.lua +++ b/modules/blizzard/castbar.lua @@ -6,11 +6,14 @@ local MODULE = P:GetModule("Blizzard") local _G = getfenv(0) local hooksecurefunc = _G.hooksecurefunc local m_min = _G.math.min +local unpack = _G.unpack --[[ luacheck: globals - CastingBarFrame CastingBarFrame_OnEvent CreateFrame GetNetStats PetCastingBarFrame UIParent UnitIsPossessed - CastingBarFrame_SetStartCastColor CastingBarFrame_SetStartChannelColor CastingBarFrame_SetFinishedCastColor - CastingBarFrame_SetNonInterruptibleCastColor CastingBarFrame_SetFailedCastColor + CastingBarFrame CastingBarFrame_OnEvent CastingBarFrame_SetFailedCastColor + CastingBarFrame_SetFinishedCastColor CastingBarFrame_SetNonInterruptibleCastColor + CastingBarFrame_SetStartCastColor CastingBarFrame_SetStartChannelColor + CastingBarFrame_SetUseStartColorForFinished CreateFrame GetNetStats PetCastingBarFrame UIParent + UnitIsPossessed UIPARENT_MANAGED_FRAME_POSITIONS ]] @@ -157,25 +160,16 @@ local function handleCastBar(self) texParent:SetPoint("BOTTOMRIGHT", holder, "BOTTOMRIGHT", -3, 0) self.TexParent = texParent - local time = texParent:CreateFontString(nil, "ARTWORK", "LSFont12_Shadow") - time:SetWordWrap(false) + local time = texParent:CreateFontString(nil, "ARTWORK") time:SetPoint("RIGHT", self, "RIGHT", 0, 0) self.Time = time local text = self.Text text:SetParent(texParent) - text:SetWordWrap(false) - text:SetJustifyH("LEFT") text:SetSize(0, 0) text:ClearAllPoints() text:SetPoint("LEFT", self, "LEFT", 2, 0) text:SetPoint("RIGHT", time, "LEFT", -2, 0) - - CastingBarFrame_SetStartCastColor(self, M.COLORS.YELLOW:GetRGB()) - CastingBarFrame_SetStartChannelColor(self, M.COLORS.YELLOW:GetRGB()) - CastingBarFrame_SetFinishedCastColor(self, M.COLORS.YELLOW:GetRGB()) - CastingBarFrame_SetNonInterruptibleCastColor(self, M.COLORS.GRAY:GetRGB()) - CastingBarFrame_SetFailedCastColor(self, M.COLORS.RED:GetRGB()) end local function updateCastBar(self) @@ -254,8 +248,32 @@ local function updateCastBar(self) E:SetStatusBarSkin(self.TexParent, "HORIZONTAL-" .. height) + CastingBarFrame_SetStartCastColor(self, unpack(config.colors.casting)) + CastingBarFrame_SetStartChannelColor(self, unpack(config.colors.channeling)) + CastingBarFrame_SetFinishedCastColor(self, unpack(config.colors.casting)) + CastingBarFrame_SetNonInterruptibleCastColor(self, unpack(config.colors.notinterruptible)) + CastingBarFrame_SetFailedCastColor(self, unpack(config.colors.failed)) + CastingBarFrame_SetUseStartColorForFinished(self, true) + self.Text:SetFontObject("LSFont" .. config.text.size .. config.text.flag) + self.Text:SetJustifyH("LEFT") + self.Text:SetWordWrap(false) + + if config.text.flag == "_Shadow" then + self.Text:SetShadowOffset(1, -1) + else + self.Text:SetShadowOffset(0, 0) + end + self.Time:SetFontObject("LSFont" .. config.text.size .. config.text.flag) + self.Time:SetJustifyH("RIGHT") + self.Time:SetWordWrap(false) + + if config.text.flag == "_Shadow" then + self.Time:SetShadowOffset(1, -1) + else + self.Time:SetShadowOffset(0, 0) + end end local function bar_SetLook(self) diff --git a/modules/minimap/minimap.lua b/modules/minimap/minimap.lua index 695d980a..247124c3 100644 --- a/modules/minimap/minimap.lua +++ b/modules/minimap/minimap.lua @@ -13,16 +13,17 @@ local m_rad = _G.math.rad local m_sin = _G.math.sin local next = _G.next local s_match = _G.string.match +local select = _G.select local unpack = _G.unpack --[[ luacheck: globals CalendarFrame ChatTypeInfo CreateFrame DEFAULT_CHAT_FRAME DropDownList1 GameTimeFrame GameTooltip - GarrisonLandingPageMinimapButton GetGameTime GetMinimapZoneText GetZonePVPInfo GuildInstanceDifficulty IsAddOnLoaded - LoadAddOn Minimap Minimap_ZoomIn Minimap_ZoomOut MiniMapChallengeMode MinimapCompassTexture - MiniMapInstanceDifficulty MiniMapMailFrame MiniMapTracking MiniMapTrackingBackground MiniMapTrackingButton - MiniMapTrackingDropDown MiniMapTrackingIcon MinimapZoneText MinimapZoneTextButton QueueStatusFrame - QueueStatusMinimapButton RegisterStateDriver TimeManagerClockButton ToggleCalendar UIDropDownMenu_GetCurrentDropDown - UIParent + GarrisonLandingPageMinimapButton GarrisonLandingPageMinimapButton_UpdateIcon GetGameTime GetMinimapZoneText + GetZonePVPInfo GuildInstanceDifficulty IsAddOnLoaded LoadAddOn Minimap Minimap_ZoomIn Minimap_ZoomOut + MiniMapChallengeMode MinimapCompassTexture MiniMapInstanceDifficulty MiniMapMailFrame MiniMapTracking + MiniMapTrackingBackground MiniMapTrackingButton MiniMapTrackingDropDown MiniMapTrackingIcon MinimapZoneText + MinimapZoneTextButton QueueStatusFrame QueueStatusMinimapButton RegisterStateDriver TimeManagerClockButton + ToggleCalendar UIDropDownMenu_GetCurrentDropDown UIParent LE_GARRISON_TYPE_8_0 ]] @@ -67,6 +68,35 @@ local PVP_COLOR_MAP = { local handledChildren = {} local ignoredChildren = {} +local function hasTrackingBorderRegion(self) + for i = 1, select("#", self:GetRegions()) do + local region = select(i, self:GetRegions()) + + if region:IsObjectType("Texture") then + local texture = region:GetTexture() + if texture and (texture == 136430 or s_match(texture, "[tT][rR][aA][cC][kK][iI][nN][gG][bB][oO][rR][dD][eE][rR]")) then + return true + end + end + end + + return false +end + +local function isMinimapButton(self) + if hasTrackingBorderRegion(self) then + return true + end + + for i = 1, select("#", self:GetChildren()) do + if hasTrackingBorderRegion(select(i, self:GetChildren())) then + return true + end + end + + return false +end + local function updateGarrisonButton(self) if C_Garrison.GetLandingPageGarrisonType() == LE_GARRISON_TYPE_8_0 then self.NormalTexture:RemoveMaskTexture(self.MaskTexture) @@ -83,15 +113,13 @@ local function updateGarrisonButton(self) end local function handleMinimapButton(button, recursive) - local regions = {button:GetRegions()} - local children = {button:GetChildren()} local normal = button.GetNormalTexture and button:GetNormalTexture() local pushed = button.GetPushedTexture and button:GetPushedTexture() local hl, icon, border, bg, thl, ticon, tborder, tbg, tnormal, tpushed - -- print("====|cffff0000", button:GetDebugName(), "|r:", #children, #regions,"====") - for _, region in next, regions do + for i = 1, select("#", button:GetRegions()) do + local region = select(i, button:GetRegions()) if region:IsObjectType("Texture") then local name = region:GetDebugName() local texture = region:GetTexture() @@ -134,10 +162,7 @@ local function handleMinimapButton(button, recursive) elseif s_match(name, "[bB][oO][rR][dD][eE][rR]") then -- print("|cffffff00", name, "|ris |cff00ff00border|r") border = region - elseif texture and texture == 136430 then - -- print("|cffffff00", name, "|ris |cff00ff00#136430|r") - border = region - elseif texture and s_match(texture, "[bB][oO][rR][dD][eE][rR]") then + elseif texture and (texture == 136430 or s_match(texture, "[tT][rR][aA][cC][kK][iI][nN][gG][bB][oO][rR][dD][eE][rR]")) then -- print("|cffffff00", name, "|ris |cff00ff00-TrackingBorder|r") border = region end @@ -145,7 +170,8 @@ local function handleMinimapButton(button, recursive) end end - for _, child in next, children do + for i = 1, select("#", button:GetChildren()) do + local child = select(i, button:GetChildren()) local name = child:GetDebugName() local oType = child:GetObjectType() -- print("|cffffff00", name, "|r:", oType) @@ -249,6 +275,7 @@ local function handleMinimapButton(button, recursive) if button == GarrisonLandingPageMinimapButton then hooksecurefunc(button, "SetSize", updateGarrisonButton) + GarrisonLandingPageMinimapButton_UpdateIcon(button) end return button @@ -904,22 +931,30 @@ function MODULE.Init() E:ForceHide(_G[name]) end - for _, child in next, {Minimap:GetChildren()} do + for i = 1, select("#", Minimap:GetChildren()) do + local child = select(i, Minimap:GetChildren()) + if not ignoredChildren[child] then child:SetFrameLevel(Minimap:GetFrameLevel() + 1) end - if child:IsObjectType("Button") and not (handledChildren[child] or ignoredChildren[child] or BUTTONS[child] or not child:GetName()) then + if not (ignoredChildren[child] or handledChildren[child] or BUTTONS[child]) and isMinimapButton(child) then handleMinimapButton(child) + else + ignoredChildren[child] = true end end C_Timer.NewTicker(5, function() - for _, child in next, {Minimap:GetChildren()} do - if child:IsObjectType("Button") and not (handledChildren[child] or ignoredChildren[child] or BUTTONS[child] or not child:GetName()) then + for i = 1, select("#", Minimap:GetChildren()) do + local child = select(i, Minimap:GetChildren()) + + if not (ignoredChildren[child] or handledChildren[child] or BUTTONS[child]) and isMinimapButton(child) then child:SetFrameLevel(Minimap:GetFrameLevel() + 1) handleMinimapButton(child) + else + ignoredChildren[child] = true end end end) diff --git a/modules/tooltips/tooltips.lua b/modules/tooltips/tooltips.lua index 60faf31b..0ae57db1 100644 --- a/modules/tooltips/tooltips.lua +++ b/modules/tooltips/tooltips.lua @@ -741,7 +741,7 @@ local function tooltipBar_OnValueChanged(self, value) self.Text:Hide() else self.Text:Show() - self.Text:SetFormattedText("%s / %s", E:NumberFormat(value, 1), E:NumberFormat(max, 1)) + self.Text:SetFormattedText("%s / %s", E:FormatNumber(value), E:FormatNumber(max)) end end diff --git a/modules/unitframes/core.lua b/modules/unitframes/core.lua index 3bb47eba..88cd8585 100644 --- a/modules/unitframes/core.lua +++ b/modules/unitframes/core.lua @@ -50,6 +50,12 @@ local function frame_UpdateSize(self) end end +local function frame_ForElement(self, element, method, ...) + if self[element] and self[element][method] then + self[element][method](self[element], ...) + end +end + local function frame_Preview(self, state) if not self.isPreviewed or state == true then if not self.isPreviewed then @@ -161,9 +167,10 @@ function UF:Init() frame:SetScript("OnLeave", frame_OnLeave) frame._unit = unit:gsub("%d+", "") + frame.ForElement = frame_ForElement + frame.Preview = frame_Preview frame.UpdateConfig = frame_UpdateConfig frame.UpdateSize = frame_UpdateSize - frame.Preview = frame_Preview if unit == "player" then if E.UI_LAYOUT == "ls" then diff --git a/modules/unitframes/elements/auras.lua b/modules/unitframes/elements/auras.lua index e87a8a66..5f99856b 100644 --- a/modules/unitframes/elements/auras.lua +++ b/modules/unitframes/elements/auras.lua @@ -7,6 +7,7 @@ local _G = getfenv(0) local m_max = _G.math.max local m_min = _G.math.min local next = _G.next +local unpack = _G.unpack -- Blizz local C_MountJournal = _G.C_MountJournal @@ -93,11 +94,21 @@ local BLACKLIST = { [240986] = true, -- Worthy Champions [240987] = true, -- Well Prepared [240989] = true, -- Heavily Augmented + [245686] = true, -- Fashionable! [264408] = true, -- Soldier of the Horde [264420] = true, -- Soldier of the Alliance [269083] = true, -- Enlisted } +local ICONS = { + ["Buff"] = {1 / 128, 33 / 128, 1 / 128, 33 / 128}, + ["Debuff"] = {34 / 128, 66 / 128, 1 / 128, 33 / 128}, + ["Curse"] = {67 / 128, 99 / 128, 1 / 128, 33 / 128}, + ["Disease"] = {1 / 128, 33 / 128, 34 / 128, 66 / 128}, + ["Magic"] = {34 / 128, 66 / 128, 34 / 128, 66 / 128}, + ["Poison"] = {67 / 128, 99 / 128, 34 / 128, 66 / 128}, +} + local function isUnitBoss(unit) return unit and (UnitIsUnit(unit, "boss1") or UnitIsUnit(unit, "boss2") or UnitIsUnit(unit, "boss3") or UnitIsUnit(unit, "boss4") or UnitIsUnit(unit, "boss5")) end @@ -249,12 +260,26 @@ local function button_OnLeave() end local function element_CreateAuraIcon(element, index) + local config = element._config local button = E:CreateButton(element, "$parentAura" .. index, true) button.icon = button.Icon button.Icon = nil - button.count = button.Count + local count = button.Count + count:SetAllPoints() + count:SetFontObject("LSFont" .. config.count.size .. config.count.flag) + count:SetJustifyH(config.count.h_alignment) + count:SetJustifyV(config.count.v_alignment) + count:SetWordWrap(false) + + if config.count.flag == "_Shadow" then + count:SetShadowOffset(1, -1) + else + count:SetShadowOffset(0, 0) + end + + button.count = count button.Count = nil button.cd = button.CD @@ -281,8 +306,9 @@ local function element_CreateAuraIcon(element, index) button.stealable = stealable local auraType = button.FGParent:CreateTexture(nil, "OVERLAY", nil, 3) - auraType:SetSize(16, 16) - auraType:SetPoint("TOPLEFT", -2, 2) + auraType:SetTexture("Interface\\AddOns\\ls_UI\\assets\\unit-frame-aura-icons") + auraType:SetPoint(config.type.position, 0, 0) + auraType:SetSize(config.type.size, config.type.size) button.AuraType = auraType button.UpdateTooltip = button_UpdateTooltip @@ -292,11 +318,15 @@ local function element_CreateAuraIcon(element, index) return button end -local function element_UpdateAuraType(_, _, aura) +local function element_UpdateAuraType(self, _, aura, _, _, _, _, debuffType) if aura.isDebuff then - aura.AuraType:SetTexture("Interface\\PETBATTLES\\BattleBar-AbilityBadge-Weak") + if self._config.type.debuff_type then + aura.AuraType:SetTexCoord(unpack(ICONS[debuffType] or ICONS["Debuff"])) + else + aura.AuraType:SetTexCoord(unpack(ICONS["Debuff"])) + end else - aura.AuraType:SetTexture("Interface\\PETBATTLES\\BattleBar-AbilityBadge-Strong") + aura.AuraType:SetTexCoord(unpack(ICONS["Buff"])) end end @@ -360,8 +390,27 @@ local function frame_UpdateAuras(self) element:SetSize((size * config.per_row + element.spacing * (config.per_row - 1)), size * config.rows + element.spacing * (config.rows - 1)) element:ClearAllPoints() - local point1 = config.point1 + local auraType, count + for i = 1, element.createdIcons do + auraType = element[i].AuraType + auraType:ClearAllPoints() + auraType:SetPoint(config.type.position, 0, 0) + auraType:SetSize(config.type.size, config.type.size) + + count = element[i].count + count:SetFontObject("LSFont" .. config.count.size .. config.count.flag) + count:SetJustifyH(config.count.h_alignment) + count:SetJustifyV(config.count.v_alignment) + count:SetWordWrap(false) + + if config.count.flag == "_Shadow" then + count:SetShadowOffset(1, -1) + else + count:SetShadowOffset(0, 0) + end + end + local point1 = config.point1 if point1 and point1.p then element:SetPoint(point1.p, E:ResolveAnchorPoint(self, point1.anchor), point1.rP, point1.x, point1.y) end diff --git a/modules/unitframes/elements/castbar.lua b/modules/unitframes/elements/castbar.lua index 64cf0fdd..012ea57f 100644 --- a/modules/unitframes/elements/castbar.lua +++ b/modules/unitframes/elements/castbar.lua @@ -5,6 +5,7 @@ local UF = P:GetModule("UnitFrames") --Lua local _G = getfenv(0) local m_abs = _G.math.abs +local unpack = _G.unpack --[[ luacheck: globals CreateFrame @@ -13,13 +14,17 @@ local m_abs = _G.math.abs -- Mine local function element_PostCastStart(self) if self.notInterruptible then - self:SetStatusBarColor(M.COLORS.GRAY:GetRGB()) + self:SetStatusBarColor(unpack(self._config.colors.notinterruptible)) if self.Icon then self.Icon:SetDesaturated(true) end else - self:SetStatusBarColor(M.COLORS.YELLOW:GetRGB()) + if self.casting then + self:SetStatusBarColor(unpack(self._config.colors.casting)) + elseif self.channeling then + self:SetStatusBarColor(unpack(self._config.colors.channeling)) + end if self.Icon then self.Icon:SetDesaturated(false) @@ -30,7 +35,7 @@ end local function element_PostCastFailed(self) self:SetMinMaxValues(0, 1) self:SetValue(1) - self:SetStatusBarColor(M.COLORS.RED:GetRGB()) + self:SetStatusBarColor(unpack(self._config.colors.failed)) self.Time:SetText("") end @@ -59,9 +64,16 @@ local function element_CustomDelayText(self, duration) end end +local function element_UpdateConfig(self) + self._config = E:CopyTable(self.__owner._config.castbar, self._config) + self._config.colors = E:CopyTable(C.db.profile.units.castbar.colors, self._config.colors) +end + local function frame_UpdateCastbar(self) - local config = self._config.castbar local element = self.Castbar + element:UpdateConfig() + + local config = element._config local holder = element.Holder local width = (config.detached and config.width_override ~= 0) and config.width_override or self._config.width local height = config.height @@ -70,7 +82,6 @@ local function frame_UpdateCastbar(self) holder._width = width local point1 = config.point1 - if point1 and point1.p then if config.detached then local mover = E.Movers:Get(holder, true) @@ -141,6 +152,26 @@ local function frame_UpdateCastbar(self) E:SetStatusBarSkin(element.TexParent, "HORIZONTAL-" .. height) + element.Text:SetFontObject("LSFont" .. config.text.size .. config.text.flag) + element.Text:SetJustifyH("LEFT") + element.Text:SetWordWrap(false) + + if config.text.flag == "_Shadow" then + element.Text:SetShadowOffset(1, -1) + else + element.Text:SetShadowOffset(0, 0) + end + + element.Time:SetFontObject("LSFont" .. config.text.size .. config.text.flag) + element.Time:SetJustifyH("RIGHT") + element.Time:SetWordWrap(false) + + if config.text.flag == "_Shadow" then + element.Time:SetShadowOffset(1, -1) + else + element.Time:SetShadowOffset(0, 0) + end + if config.enabled and not self:IsElementEnabled("Castbar") then self:EnableElement("Castbar") elseif not config.enabled and self:IsElementEnabled("Castbar") then @@ -189,17 +220,17 @@ function UF:CreateCastbar(frame) safeZone:SetVertexColor(M.COLORS.RED:GetRGBA(0.6)) element.SafeZone_ = safeZone - local tex_parent = CreateFrame("Frame", nil, element) - tex_parent:SetPoint("TOPLEFT", holder, "TOPLEFT", 3, 0) - tex_parent:SetPoint("BOTTOMRIGHT", holder, "BOTTOMRIGHT", -3, 0) - element.TexParent = tex_parent + local texParent = CreateFrame("Frame", nil, element) + texParent:SetPoint("TOPLEFT", holder, "TOPLEFT", 3, 0) + texParent:SetPoint("BOTTOMRIGHT", holder, "BOTTOMRIGHT", -3, 0) + element.TexParent = texParent - local time = tex_parent:CreateFontString(nil, "ARTWORK", "LSFont12_Shadow") + local time = texParent:CreateFontString(nil, "ARTWORK", "LSFont12_Shadow") time:SetWordWrap(false) - time:SetPoint("RIGHT", element, "RIGHT", -2, 0) + time:SetPoint("RIGHT", element, "RIGHT", 0, 0) element.Time = time - local text = tex_parent:CreateFontString(nil, "ARTWORK", "LSFont12_Shadow") + local text = texParent:CreateFontString(nil, "ARTWORK", "LSFont12_Shadow") text:SetWordWrap(false) text:SetJustifyH("LEFT") text:SetPoint("LEFT", element, "LEFT", 2, 0) @@ -207,12 +238,13 @@ function UF:CreateCastbar(frame) element.Text = text element.Holder = holder - element.PostCastStart = element_PostCastStart - element.PostChannelStart = element_PostCastStart + element.CustomDelayText = element_CustomDelayText + element.CustomTimeText = element_CustomTimeText element.PostCastFailed = element_PostCastFailed element.PostCastInterrupted = element_PostCastFailed - element.CustomTimeText = element_CustomTimeText - element.CustomDelayText = element_CustomDelayText + element.PostCastStart = element_PostCastStart + element.PostChannelStart = element_PostCastStart + element.UpdateConfig = element_UpdateConfig element.timeToHold = 0.4 frame.UpdateCastbar = frame_UpdateCastbar diff --git a/modules/unitframes/elements/tags.lua b/modules/unitframes/elements/tags.lua index cac0ee78..a88b18d3 100644 --- a/modules/unitframes/elements/tags.lua +++ b/modules/unitframes/elements/tags.lua @@ -137,7 +137,7 @@ oUF.Tags.Methods["ls:health:cur"] = function(unit) elseif UnitIsDeadOrGhost(unit) then return L["DEAD"] else - return E:NumberFormat(UnitHealth(unit), 1) + return E:FormatNumber(UnitHealth(unit)) end end @@ -162,9 +162,9 @@ oUF.Tags.Methods["ls:health:cur-perc"] = function(unit) local cur, max = UnitHealth(unit), UnitHealthMax(unit) if cur == max then - return E:NumberFormat(cur, 1) + return E:FormatNumber(cur) else - return s_format("%s - %.1f%%", E:NumberFormat(cur, 1), E:NumberToPerc(cur, max)) + return s_format("%s - %.1f%%", E:FormatNumber(cur), E:NumberToPerc(cur, max)) end end end @@ -181,7 +181,7 @@ oUF.Tags.Methods["ls:health:deficit"] = function(unit) if cur == max then return "" else - return s_format("-%s", E:NumberFormat(max - cur, 1)) + return s_format("-%s", E:FormatNumber(max - cur)) end end end @@ -201,7 +201,7 @@ oUF.Tags.Methods["ls:power:cur"] = function(unit) if not max or max == 0 then return "" else - return E:NumberFormat(cur, 1) + return E:FormatNumber(cur) end end end @@ -217,7 +217,7 @@ oUF.Tags.Methods["ls:power:max"] = function(unit) if not max or max == 0 then return "" else - return E:NumberFormat(max, 1) + return E:FormatNumber(max) end end end @@ -249,9 +249,9 @@ oUF.Tags.Methods["ls:power:cur-perc"] = function(unit) if not max or max == 0 then return "" elseif cur == max then - return E:NumberFormat(cur, 1) + return E:FormatNumber(cur) else - return s_format("%s - %.1f%%", E:NumberFormat(cur, 1), E:NumberToPerc(cur, max)) + return s_format("%s - %.1f%%", E:FormatNumber(cur), E:NumberToPerc(cur, max)) end end end @@ -274,9 +274,9 @@ oUF.Tags.Methods["ls:power:cur-color-perc"] = function(unit) if not max or max == 0 then return "" elseif cur == 0 or cur == max then - return s_format("|cff%s%s|r", hex, E:NumberFormat(cur, 1)) + return s_format("|cff%s%s|r", hex, E:FormatNumber(cur)) else - return s_format("%s - |cff%s%.1f%%|r", E:NumberFormat(cur, 1), hex, E:NumberToPerc(cur, max)) + return s_format("%s - |cff%s%.1f%%|r", E:FormatNumber(cur), hex, E:NumberToPerc(cur, max)) end end end @@ -292,9 +292,9 @@ oUF.Tags.Methods["ls:power:cur-max"] = function(unit) if not max or max == 0 then return "" elseif cur == max then - return E:NumberFormat(cur, 1) + return E:FormatNumber(cur) else - return s_format("%s - %s", E:NumberFormat(cur, 1), E:NumberFormat(max, 1)) + return s_format("%s - %s", E:FormatNumber(cur), E:FormatNumber(max)) end end end @@ -317,9 +317,9 @@ oUF.Tags.Methods["ls:power:cur-color-max"] = function(unit) if not max or max == 0 then return "" elseif cur == 0 or cur == max then - return s_format("|cff%s%s|r", hex, E:NumberFormat(cur, 1)) + return s_format("|cff%s%s|r", hex, E:FormatNumber(cur)) else - return s_format("%s - |cff%s%s|r", E:NumberFormat(cur, 1), hex, E:NumberFormat(max, 1)) + return s_format("%s - |cff%s%s|r", E:FormatNumber(cur), hex, E:FormatNumber(max)) end end end @@ -335,7 +335,7 @@ oUF.Tags.Methods["ls:power:deficit"] = function(unit) if not max or max == 0 or cur == max then return "" else - return s_format("-%s", E:NumberFormat(max - cur, 1)) + return s_format("-%s", E:FormatNumber(max - cur)) end end end @@ -347,7 +347,7 @@ end oUF.Tags.Events["ls:altpower:cur"] = 'UNIT_POWER_BAR_SHOW UNIT_POWER_BAR_HIDE UNIT_POWER_UPDATE UNIT_MAXPOWER' oUF.Tags.Methods["ls:altpower:cur"] = function(unit) if UnitAlternatePowerInfo(unit) then - return E:NumberFormat(UnitPower(unit, ALTERNATE_POWER_INDEX), 1) + return E:FormatNumber(UnitPower(unit, ALTERNATE_POWER_INDEX)) else return "" end @@ -356,7 +356,7 @@ end oUF.Tags.Events["ls:altpower:max"] = 'UNIT_POWER_BAR_SHOW UNIT_POWER_BAR_HIDE UNIT_POWER_UPDATE UNIT_MAXPOWER' oUF.Tags.Methods["ls:altpower:max"] = function(unit) if UnitAlternatePowerInfo(unit) then - return E:NumberFormat(UnitPowerMax(unit, ALTERNATE_POWER_INDEX), 1) + return E:FormatNumber(UnitPowerMax(unit, ALTERNATE_POWER_INDEX)) else return "" end @@ -377,9 +377,9 @@ oUF.Tags.Methods["ls:altpower:cur-perc"] = function(unit) local cur, max = UnitPower(unit, ALTERNATE_POWER_INDEX), UnitPowerMax(unit, ALTERNATE_POWER_INDEX) if cur == max then - return E:NumberFormat(cur, 1) + return E:FormatNumber(cur) else - return s_format("%s - %.1f%%", E:NumberFormat(cur, 1), E:NumberToPerc(cur, max)) + return s_format("%s - %.1f%%", E:FormatNumber(cur), E:NumberToPerc(cur, max)) end else return "" @@ -392,9 +392,9 @@ oUF.Tags.Methods["ls:altpower:cur-color-perc"] = function(unit) local cur, max = UnitPower(unit, ALTERNATE_POWER_INDEX), UnitPowerMax(unit, ALTERNATE_POWER_INDEX) if cur == 0 or cur == max then - return s_format("|cff%s%s|r", M.COLORS.INDIGO:GetHEX(0.3), E:NumberFormat(cur, 1)) + return s_format("|cff%s%s|r", M.COLORS.INDIGO:GetHEX(0.3), E:FormatNumber(cur)) else - return s_format("%s - |cff%s%.1f%%|r", E:NumberFormat(cur, 1), M.COLORS.INDIGO:GetHEX(0.3), E:NumberToPerc(cur, max)) + return s_format("%s - |cff%s%.1f%%|r", E:FormatNumber(cur), M.COLORS.INDIGO:GetHEX(0.3), E:NumberToPerc(cur, max)) end else return "" @@ -407,9 +407,9 @@ oUF.Tags.Methods["ls:altpower:cur-max"] = function(unit) local cur, max = UnitPower(unit, ALTERNATE_POWER_INDEX), UnitPowerMax(unit, ALTERNATE_POWER_INDEX) if cur == max then - return E:NumberFormat(cur, 1) + return E:FormatNumber(cur) else - return s_format("%s - %s", E:NumberFormat(cur, 1), E:NumberFormat(max, 1)) + return s_format("%s - %s", E:FormatNumber(cur), E:FormatNumber(max)) end else return "" @@ -422,9 +422,9 @@ oUF.Tags.Methods["ls:altpower:cur-color-max"] = function(unit) local cur, max = UnitPower(unit, ALTERNATE_POWER_INDEX), UnitPowerMax(unit, ALTERNATE_POWER_INDEX) if cur == 0 or cur == max then - return s_format("|cff%s%s|r", M.COLORS.INDIGO:GetHEX(0.3), E:NumberFormat(cur, 1)) + return s_format("|cff%s%s|r", M.COLORS.INDIGO:GetHEX(0.3), E:FormatNumber(cur)) else - return s_format("%s - |cff%s%.1f%%|r", E:NumberFormat(cur, 1), M.COLORS.INDIGO:GetHEX(0.3), E:NumberFormat(max, 1)) + return s_format("%s - |cff%s%.1f%%|r", E:FormatNumber(cur), M.COLORS.INDIGO:GetHEX(0.3), E:FormatNumber(max)) end else return "" @@ -527,14 +527,14 @@ oUF.Tags.Events["ls:absorb:heal"] = "UNIT_HEAL_ABSORB_AMOUNT_CHANGED" oUF.Tags.Methods["ls:absorb:heal"] = function(unit) local absorb = UnitGetTotalHealAbsorbs(unit) or 0 - return absorb > 0 and E:NumberFormat(absorb, 1) or " " + return absorb > 0 and E:FormatNumber(absorb) or " " end oUF.Tags.Events["ls:absorb:damage"] = "UNIT_ABSORB_AMOUNT_CHANGED" oUF.Tags.Methods["ls:absorb:damage"] = function(unit) local absorb = UnitGetTotalAbsorbs(unit) or 0 - return absorb > 0 and E:NumberFormat(absorb, 1) or " " + return absorb > 0 and E:FormatNumber(absorb) or " " end -----------