From d80f86d99cbaaf675536179031fa05bfb18335b7 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Mon, 17 Sep 2018 20:12:42 +0700 Subject: [PATCH 01/28] Updated embeds --- .../AceConfigDialog-3.0.lua | 14 +++----- .../AceConfigRegistry-3.0.lua | 3 +- embeds/AceDB-3.0/AceDB-3.0.lua | 8 ++--- embeds/AceDBOptions-3.0/AceDBOptions-3.0.lua | 4 +-- embeds/AceGUI-3.0/AceGUI-3.0.lua | 10 +++--- .../widgets/AceGUIContainer-Frame.lua | 10 +++--- .../widgets/AceGUIContainer-ScrollFrame.lua | 3 +- .../widgets/AceGUIContainer-TabGroup.lua | 1 - .../widgets/AceGUIContainer-TreeGroup.lua | 13 +++----- .../widgets/AceGUIContainer-Window.lua | 24 +++++++------- .../widgets/AceGUIWidget-CheckBox.lua | 32 +++++++++---------- .../widgets/AceGUIWidget-ColorPicker.lua | 6 ++-- .../widgets/AceGUIWidget-DropDown-Items.lua | 8 ++--- .../widgets/AceGUIWidget-Heading.lua | 4 +-- .../AceGUI-3.0/widgets/AceGUIWidget-Icon.lua | 2 +- .../widgets/AceGUIWidget-InteractiveLabel.lua | 7 ---- .../widgets/AceGUIWidget-Slider.lua | 3 +- embeds/LibStub/LibStub.lua | 27 ++++++++++++++-- 18 files changed, 88 insertions(+), 91 deletions(-) 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 From 08ecd63a1d1a6a77b855369f49112d9e1d5a3400 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Fri, 21 Sep 2018 09:43:41 +0700 Subject: [PATCH 02/28] :knife: --- modules/unitframes/elements/auras.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/unitframes/elements/auras.lua b/modules/unitframes/elements/auras.lua index e87a8a66..0545cfeb 100644 --- a/modules/unitframes/elements/auras.lua +++ b/modules/unitframes/elements/auras.lua @@ -93,6 +93,7 @@ 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 From bda616347f826c78e554a4f7c5fccaec08c24f31 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Fri, 21 Sep 2018 09:47:58 +0700 Subject: [PATCH 03/28] Added options to adjust xp bar text's format and visiblity Also refactored xp bar code a bit, had too many funcs that were doing too much... --- config/bars.lua | 63 ++++++++++++++++++++++++---- core/defaults.lua | 2 + locales/enUS.lua | 2 + locales/ruRU.lua | 2 + modules/bars/xpbar.lua | 95 +++++++++++++++++++++++++++++++++--------- 5 files changed, 137 insertions(+), 27 deletions(-) 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/core/defaults.lua b/core/defaults.lua index 7e18fa13..5cdf1787 100644 --- a/core/defaults.lua +++ b/core/defaults.lua @@ -2041,6 +2041,8 @@ D.profile = { text = { size = 10, flag = "_Outline", -- "_Shadow", "" + format = "NUM", -- "NUM_PERC" + visibility = 2, -- 1 - always, 2 - mouseover }, point = { p = "BOTTOM", diff --git a/locales/enUS.lua b/locales/enUS.lua index c9bce95b..c232c5fb 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -313,6 +313,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" diff --git a/locales/ruRU.lua b/locales/ruRU.lua index 81e1ca86..935cd949 100644 --- a/locales/ruRU.lua +++ b/locales/ruRU.lua @@ -246,6 +246,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"] = "Нехватка ресурса" diff --git a/modules/bars/xpbar.lua b/modules/bars/xpbar.lua index b52b451e..0ac313fa 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:NumberFormat(cur, 1), E:NumberFormat(max, 1), 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 From d9dcc33af9c30a19fcd230de93325d04f072890c Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Fri, 21 Sep 2018 09:54:47 +0700 Subject: [PATCH 04/28] Removed the 2nd arg from E:NumberFormat I always used it and it's always 1 --- core/utils.lua | 20 +++-------- locales/koKR.lua | 20 +++-------- locales/zhCN.lua | 20 +++-------- locales/zhTW.lua | 20 +++-------- modules/bars/xpbar.lua | 2 +- modules/tooltips/tooltips.lua | 2 +- modules/unitframes/elements/tags.lua | 54 ++++++++++++++-------------- 7 files changed, 49 insertions(+), 89 deletions(-) diff --git a/core/utils.lua b/core/utils.lua index 6f6773a2..b615ff1c 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:NumberFormat(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/locales/koKR.lua b/locales/koKR.lua index 4bfec350..4900ea80 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:NumberFormat(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/zhCN.lua b/locales/zhCN.lua index 16fdb827..d1a773c0 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:NumberFormat(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..26ba91b1 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:NumberFormat(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/modules/bars/xpbar.lua b/modules/bars/xpbar.lua index 0ac313fa..5720bb1f 100644 --- a/modules/bars/xpbar.lua +++ b/modules/bars/xpbar.lua @@ -439,7 +439,7 @@ local function segment_UpdateText(self, cur, max) if cur == 1 and max == 1 then self.Text:SetText(nil) else - self.Text:SetFormattedText(barValueTemplate, E:NumberFormat(cur, 1), E:NumberFormat(max, 1), E:NumberToPerc(cur, max)) + self.Text:SetFormattedText(barValueTemplate, E:NumberFormat(cur), E:NumberFormat(max), E:NumberToPerc(cur, max)) end end diff --git a/modules/tooltips/tooltips.lua b/modules/tooltips/tooltips.lua index 60faf31b..9666e94f 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:NumberFormat(value), E:NumberFormat(max)) end end diff --git a/modules/unitframes/elements/tags.lua b/modules/unitframes/elements/tags.lua index cac0ee78..b1e8b977 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:NumberFormat(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:NumberFormat(cur) else - return s_format("%s - %.1f%%", E:NumberFormat(cur, 1), E:NumberToPerc(cur, max)) + return s_format("%s - %.1f%%", E:NumberFormat(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:NumberFormat(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:NumberFormat(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:NumberFormat(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:NumberFormat(cur) else - return s_format("%s - %.1f%%", E:NumberFormat(cur, 1), E:NumberToPerc(cur, max)) + return s_format("%s - %.1f%%", E:NumberFormat(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:NumberFormat(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:NumberFormat(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:NumberFormat(cur) else - return s_format("%s - %s", E:NumberFormat(cur, 1), E:NumberFormat(max, 1)) + return s_format("%s - %s", E:NumberFormat(cur), E:NumberFormat(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:NumberFormat(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:NumberFormat(cur), hex, E:NumberFormat(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:NumberFormat(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:NumberFormat(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:NumberFormat(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:NumberFormat(cur) else - return s_format("%s - %.1f%%", E:NumberFormat(cur, 1), E:NumberToPerc(cur, max)) + return s_format("%s - %.1f%%", E:NumberFormat(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:NumberFormat(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:NumberFormat(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:NumberFormat(cur) else - return s_format("%s - %s", E:NumberFormat(cur, 1), E:NumberFormat(max, 1)) + return s_format("%s - %s", E:NumberFormat(cur), E:NumberFormat(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:NumberFormat(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:NumberFormat(cur), M.COLORS.INDIGO:GetHEX(0.3), E:NumberFormat(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:NumberFormat(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:NumberFormat(absorb) or " " end ----------- From 71f7d6cc9f6fde81c0f223f1e78d16226ffeb434 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Fri, 21 Sep 2018 09:56:03 +0700 Subject: [PATCH 05/28] Renamed E:NumberFormat to E:FormatNumber --- core/utils.lua | 2 +- locales/koKR.lua | 2 +- locales/zhCN.lua | 2 +- locales/zhTW.lua | 2 +- modules/bars/xpbar.lua | 2 +- modules/tooltips/tooltips.lua | 2 +- modules/unitframes/elements/tags.lua | 54 ++++++++++++++-------------- 7 files changed, 33 insertions(+), 33 deletions(-) diff --git a/core/utils.lua b/core/utils.lua index b615ff1c..9c6dde44 100644 --- a/core/utils.lua +++ b/core/utils.lua @@ -54,7 +54,7 @@ do 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) + function E:FormatNumber(v) if v >= 1E6 then local i, f = m_modf(v / 1E6) return s_format(SECOND_NUMBER_CAP, BreakUpLargeNumbers(i), f * 10) diff --git a/locales/koKR.lua b/locales/koKR.lua index 4900ea80..b487da4e 100644 --- a/locales/koKR.lua +++ b/locales/koKR.lua @@ -22,7 +22,7 @@ do 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) + function E:FormatNumber(v) if v >= 1E8 then local i, f = m_modf(v / 1E8) return s_format(SECOND_NUMBER_CAP, BreakUpLargeNumbers(i), f * 10) diff --git a/locales/zhCN.lua b/locales/zhCN.lua index d1a773c0..ee1f0b88 100644 --- a/locales/zhCN.lua +++ b/locales/zhCN.lua @@ -20,7 +20,7 @@ do 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) + function E:FormatNumber(v) if v >= 1E8 then local i, f = m_modf(v / 1E8) return s_format(SECOND_NUMBER_CAP, BreakUpLargeNumbers(i), f * 10) diff --git a/locales/zhTW.lua b/locales/zhTW.lua index 26ba91b1..77d6e94b 100644 --- a/locales/zhTW.lua +++ b/locales/zhTW.lua @@ -20,7 +20,7 @@ do 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) + function E:FormatNumber(v) if v >= 1E8 then local i, f = m_modf(v / 1E8) return s_format(SECOND_NUMBER_CAP, BreakUpLargeNumbers(i), f * 10) diff --git a/modules/bars/xpbar.lua b/modules/bars/xpbar.lua index 5720bb1f..c5f2a618 100644 --- a/modules/bars/xpbar.lua +++ b/modules/bars/xpbar.lua @@ -439,7 +439,7 @@ local function segment_UpdateText(self, cur, max) if cur == 1 and max == 1 then self.Text:SetText(nil) else - self.Text:SetFormattedText(barValueTemplate, E:NumberFormat(cur), E:NumberFormat(max), E:NumberToPerc(cur, max)) + self.Text:SetFormattedText(barValueTemplate, E:FormatNumber(cur), E:FormatNumber(max), E:NumberToPerc(cur, max)) end end diff --git a/modules/tooltips/tooltips.lua b/modules/tooltips/tooltips.lua index 9666e94f..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), E:NumberFormat(max)) + self.Text:SetFormattedText("%s / %s", E:FormatNumber(value), E:FormatNumber(max)) end end diff --git a/modules/unitframes/elements/tags.lua b/modules/unitframes/elements/tags.lua index b1e8b977..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)) + 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) + return E:FormatNumber(cur) else - return s_format("%s - %.1f%%", E:NumberFormat(cur), 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)) + 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) + 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) + 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) + return E:FormatNumber(cur) else - return s_format("%s - %.1f%%", E:NumberFormat(cur), 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)) + return s_format("|cff%s%s|r", hex, E:FormatNumber(cur)) else - return s_format("%s - |cff%s%.1f%%|r", E:NumberFormat(cur), 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) + return E:FormatNumber(cur) else - return s_format("%s - %s", E:NumberFormat(cur), E:NumberFormat(max)) + 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)) + return s_format("|cff%s%s|r", hex, E:FormatNumber(cur)) else - return s_format("%s - |cff%s%s|r", E:NumberFormat(cur), hex, E:NumberFormat(max)) + 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)) + 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)) + 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)) + 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) + return E:FormatNumber(cur) else - return s_format("%s - %.1f%%", E:NumberFormat(cur), 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)) + 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), 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) + return E:FormatNumber(cur) else - return s_format("%s - %s", E:NumberFormat(cur), E:NumberFormat(max)) + 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)) + 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), M.COLORS.INDIGO:GetHEX(0.3), E:NumberFormat(max)) + 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) 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) or " " + return absorb > 0 and E:FormatNumber(absorb) or " " end ----------- From 6763c73d4a6d3b07a8a0260bf48e52ebb20cf3b8 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Sat, 22 Sep 2018 15:06:57 +0700 Subject: [PATCH 06/28] Updated embedded oUF --- embeds/oUF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embeds/oUF b/embeds/oUF index 09bfeded..4d6bf111 160000 --- a/embeds/oUF +++ b/embeds/oUF @@ -1 +1 @@ -Subproject commit 09bfedede81266d10f90f678e66bf104e338b8ee +Subproject commit 4d6bf111fbe1654137a38596d7ba4c5455ea8737 From 63d79a6eaa767c70c2c0d069151771f7efe66d84 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Sat, 22 Sep 2018 15:09:21 +0700 Subject: [PATCH 07/28] Hacked cooldown bug --- core/cooldown.lua | 3 ++- modules/auras/auras.lua | 2 +- modules/auratracker/auratracker.lua | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/cooldown.lua b/core/cooldown.lua index d38e2260..9638e2b9 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 diff --git a/modules/auras/auras.lua b/modules/auras/auras.lua index e7a4418e..731a52b3 100644 --- a/modules/auras/auras.lua +++ b/modules/auras/auras.lua @@ -46,7 +46,7 @@ local function updateAura(button, index) button.Count:SetText(count > 1 and count) if(duration and duration > 0 and expirationTime) then - button.Cooldown:SetCooldown(expirationTime - duration, duration) + button.Cooldown:SetCooldown(1, expirationTime - 1) button.Cooldown:Show() else button.Cooldown:Hide() diff --git a/modules/auratracker/auratracker.lua b/modules/auratracker/auratracker.lua index 6ead9bcc..ca672475 100644 --- a/modules/auratracker/auratracker.lua +++ b/modules/auratracker/auratracker.lua @@ -110,7 +110,7 @@ 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) + CooldownFrame_Set(button.CD, 1, aura.expiration - 1, true) if button.filter == "HARMFUL" then local color = DEBUFF_TYPE_COLORS[aura.debuffType] or DEBUFF_TYPE_COLORS.none From 25e23261367d8b14420fa2bfc1ccba7c077c0eb8 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Sat, 22 Sep 2018 15:12:33 +0700 Subject: [PATCH 08/28] Added options to adjust castbar colours --- config/unitframes.lua | 63 +++++++++++++++++++++++++ core/defaults.lua | 8 ++++ modules/unitframes/core.lua | 9 +++- modules/unitframes/elements/castbar.lua | 44 ++++++++++------- 4 files changed, 107 insertions(+), 17 deletions(-) diff --git a/config/unitframes.lua b/config/unitframes.lua index dbb344e9..193bc9d7 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 = { @@ -2808,6 +2809,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 = "Casting", + }, + channeling = { + order = 11, + type = "color", + name = "Channeling", + }, + failed = { + order = 12, + type = "color", + name = "Failed", + }, + notinterruptible = { + order = 13, + type = "color", + name = "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/defaults.lua b/core/defaults.lua index 5cdf1787..1502035d 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 = {52 / 255, 48 / 255, 51 / 255}, + }, + }, player = { ls = { enabled = true, 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/castbar.lua b/modules/unitframes/elements/castbar.lua index 64cf0fdd..3bd7d5c1 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) @@ -189,17 +200,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 +218,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 From 63b24be260ee6ebb870d32a1bcf9f70b1d71e773 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Sat, 22 Sep 2018 16:54:05 +0700 Subject: [PATCH 09/28] Localised castbar colours --- config/unitframes.lua | 8 ++++---- locales/enUS.lua | 4 ++++ locales/ruRU.lua | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/config/unitframes.lua b/config/unitframes.lua index 193bc9d7..99e1e26b 100644 --- a/config/unitframes.lua +++ b/config/unitframes.lua @@ -2852,22 +2852,22 @@ function CONFIG.CreateUnitFramesPanel(_, order) casting = { order = 10, type = "color", - name = "Casting", + name = L["SPELL_CAST"], }, channeling = { order = 11, type = "color", - name = "Channeling", + name = L["SPELL_CHANNELED"], }, failed = { order = 12, type = "color", - name = "Failed", + name = L["SPELL_FAILED"], }, notinterruptible = { order = 13, type = "color", - name = "Uninterruptible", + name = L["SPELL_UNINTERRUPTIBLE"], }, }, }, diff --git a/locales/enUS.lua b/locales/enUS.lua index c232c5fb..54f9bda7 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -398,6 +398,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/ruRU.lua b/locales/ruRU.lua index 935cd949..7b6fb720 100644 --- a/locales/ruRU.lua +++ b/locales/ruRU.lua @@ -331,6 +331,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"] = "Рамка цели" From 0b5b6d0f33ce021d40fa425e909386e0231cd28b Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Sat, 22 Sep 2018 16:55:48 +0700 Subject: [PATCH 10/28] Updated embedded oUF --- embeds/oUF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embeds/oUF b/embeds/oUF index 4d6bf111..68de36c0 160000 --- a/embeds/oUF +++ b/embeds/oUF @@ -1 +1 @@ -Subproject commit 4d6bf111fbe1654137a38596d7ba4c5455ea8737 +Subproject commit 68de36c0bdcad16e418e017228f1518e995338bb From 045b5e5d3344970ae264789f11ab3e87d9324d58 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Sat, 22 Sep 2018 20:32:56 +0700 Subject: [PATCH 11/28] :lipstick: --- core/defaults.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/defaults.lua b/core/defaults.lua index 1502035d..b917f3d2 100644 --- a/core/defaults.lua +++ b/core/defaults.lua @@ -22,7 +22,7 @@ D.profile = { casting = {250 / 255, 193 / 255, 74 / 255}, channeling = {60 / 255, 170 / 255, 59 / 255}, failed = {222 / 255, 67 / 255, 58 / 255}, - notinterruptible = {52 / 255, 48 / 255, 51 / 255}, + notinterruptible = {125 / 255, 122 / 255, 125 / 255}, }, }, player = { From 0924280f83b9540778f93e6eddd578afae9d74c2 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Sun, 23 Sep 2018 09:02:44 +0700 Subject: [PATCH 12/28] Undid most of the cooldown hacks --- embeds/oUF | 2 +- modules/auras/auras.lua | 2 +- modules/auratracker/auratracker.lua | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/embeds/oUF b/embeds/oUF index 68de36c0..4cc11c9b 160000 --- a/embeds/oUF +++ b/embeds/oUF @@ -1 +1 @@ -Subproject commit 68de36c0bdcad16e418e017228f1518e995338bb +Subproject commit 4cc11c9bdc246287954ebce39ba77330b816b3c9 diff --git a/modules/auras/auras.lua b/modules/auras/auras.lua index 731a52b3..e7a4418e 100644 --- a/modules/auras/auras.lua +++ b/modules/auras/auras.lua @@ -46,7 +46,7 @@ local function updateAura(button, index) button.Count:SetText(count > 1 and count) if(duration and duration > 0 and expirationTime) then - button.Cooldown:SetCooldown(1, expirationTime - 1) + button.Cooldown:SetCooldown(expirationTime - duration, duration) button.Cooldown:Show() else button.Cooldown:Hide() diff --git a/modules/auratracker/auratracker.lua b/modules/auratracker/auratracker.lua index ca672475..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, 1, aura.expiration - 1, 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 From 06fe58a97cf3760fef44ae0d129562aca78df426 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Sun, 23 Sep 2018 11:29:42 +0700 Subject: [PATCH 13/28] Added options to adjust UF aura type icon --- assets/unit-frame-aura-icons.TGA | Bin 0 -> 14839 bytes config/unitframes.lua | 49 ++++++++++++++++++++++++-- core/defaults.lua | 20 +++++++++++ locales/enUS.lua | 1 + locales/ruRU.lua | 3 +- modules/unitframes/elements/auras.lua | 35 ++++++++++++++---- 6 files changed, 99 insertions(+), 9 deletions(-) create mode 100644 assets/unit-frame-aura-icons.TGA diff --git a/assets/unit-frame-aura-icons.TGA b/assets/unit-frame-aura-icons.TGA new file mode 100644 index 0000000000000000000000000000000000000000..0963c605e65ab432f394cb5fcb7146e7288fbde9 GIT binary patch literal 14839 zcmeHt_gj=l*FUgJN2;)N78Y2_(tAgW6;14lJ$6M!6nk6jvBwyDjV+qQC-#nr6h%=i zSdyrzwx}`5^Stl(dEV>#e9t+{uEw9M}oH;Y+bI;5@Gv_ulvokaP=9$ei zQ>$T4Klxk96bmEu^fywd^~_^t6s78=^an0gGiL*fShW=;Gs^>9T)}^=5lQKPSSb4c z!<^4rL}t~?m`};9TI@5mvx5GFxA6mE|ue21L&KMBpew7l<;+u>&Vme#PaFt;$;w%pHl zOs)tC*dLZSvv}Pn^+#|Fe8#*SVQ9%|MDIQ_mNks))vmwfn68O30g{5KN&^1`p zwH!{it&Cmv-p86t`Hw4Su)3MK8Nyd3BJEBGBwa5wbp2kDlw&UEAY@sr=!mYFS>`8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GQ8-r;BlO9U z(Wst8?=|9cC8q1ACE^N!$n`HyjKiGHro$ND99asOJlTUN!Q9Fm?)!bbf;BuS)~t6w>;r}SK5wzZ_9$rtNO4V2st6tU z6D)#z-k0eiH;1CB{fPGR+M!Qj&I$~dj9x|9sFz?)NT2T^I;<^6X1+`v$R%q!h;Qhl z!KJcj)Ro6d-Y`88Cx%Djvtlg{jL_lm;0RowlZK0>Q6lI3+*qBIYbVFx^e7!TKQ%HE zn~H|$A z6qt6|uM%2nQQ+D-*A$rjVkdcO{uUi&=-5A?DgFV$gMNjk|GPj4cfilkmi&oe%I9-u z6zUE)5Ip25f_guMrVo8>$z16$zdLqt$&r?*bv@LmE{#CLw0N8u8IHq)w9sEDiGY$R z<`^ZXM$qnq8CEyv(vn7X&W;Yp#@>PS`Mc?by+dxtcvA54{fb+$8`=tP$0?9~n4-XY zC<@F$YYJd<&U~ibPEeGXXqT@DkQ!gnZGFlM_9GmPizVCgdk>UWnvuUlGyD|-2R=d2 z;Ae)(L~RmuQZKOI&%zHH@+wANA07MtC6 znT80DLD`D<^`>viihqG$m;3PV{o~u)F9Zz#vqQ3qj2UEiQ~P z$T{EGTa6em+ZM>ljv)@i7B`ATd&@K{IBs&4SUkt%9Vu4ta*AU12Pte$ImhRjcHZ3@ zRyoFtPp&Wbf-*;VA0wLu8_zcIY+pw%JcMu0A59~H9p&Ygd3yhW&*?k255H@T%2oTty#-fjfsnK5wh1X%-Itk65!3ClWp;mGhHdj8?KFgBRpNx@iH=!u?DPVjR! zhRLWdFQx+|0LKrhKc(L&ftGSuSw1Jiv z8?m3RqCYY63lZ`U#ki8vQ$79thq+H%I4sGO?+ut6NNFOauP8k>={|1Z VutY7PHhyC7e<|>Py#Ey>{~xoPsyqMy literal 0 HcmV?d00001 diff --git a/config/unitframes.lua b/config/unitframes.lua index 99e1e26b..6f0ab60d 100644 --- a/config/unitframes.lua +++ b/config/unitframes.lua @@ -1528,9 +1528,49 @@ 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 = 1, + }, + position = { + order = 3, + type = "select", + name = L["POINT"], + values = POINTS, + }, + }, + }, + spacer_4 = { + order = 39, + type = "description", + name = " ", + }, + cooldown = { + order = 50, + type = "group", name = L["COOLDOWN_TEXT"], inline = true, get = function(info) @@ -1575,8 +1615,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, diff --git a/core/defaults.lua b/core/defaults.lua index b917f3d2..0d985c81 100644 --- a/core/defaults.lua +++ b/core/defaults.lua @@ -360,6 +360,11 @@ D.profile = { v_alignment = "BOTTOM", }, }, + type = { + size = 12, + position = "TOPLEFT", + debuff_type = false, + }, filter = { friendly = { buff = { @@ -760,6 +765,11 @@ D.profile = { v_alignment = "BOTTOM", }, }, + type = { + size = 12, + position = "TOPLEFT", + debuff_type = false, + }, filter = { friendly = { buff = { @@ -1056,6 +1066,11 @@ D.profile = { v_alignment = "BOTTOM", }, }, + type = { + size = 12, + position = "TOPLEFT", + debuff_type = false, + }, filter = { friendly = { buff = { @@ -1361,6 +1376,11 @@ D.profile = { v_alignment = "BOTTOM", }, }, + type = { + size = 12, + position = "TOPLEFT", + debuff_type = false, + }, filter = { friendly = { buff = { diff --git a/locales/enUS.lua b/locales/enUS.lua index 54f9bda7..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" diff --git a/locales/ruRU.lua b/locales/ruRU.lua index 7b6fb720..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"] = "По убыванию" diff --git a/modules/unitframes/elements/auras.lua b/modules/unitframes/elements/auras.lua index 0545cfeb..f3cc675b 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 @@ -99,6 +100,15 @@ local BLACKLIST = { [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 @@ -250,6 +260,7 @@ 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 @@ -282,8 +293,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 @@ -293,11 +305,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 @@ -361,8 +377,15 @@ 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 + 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) + 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 From 9fe073e8bfc52725fbc75b890ee3b2fc591e979d Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Sun, 23 Sep 2018 11:32:24 +0700 Subject: [PATCH 14/28] Added options to adjust UF aura count text --- config/unitframes.lua | 47 +++++++++++++++++++++++++++ core/defaults.lua | 24 ++++++++++++++ modules/unitframes/elements/auras.lua | 29 +++++++++++++++-- 3 files changed, 98 insertions(+), 2 deletions(-) diff --git a/config/unitframes.lua b/config/unitframes.lua index 6f0ab60d..2c46fd39 100644 --- a/config/unitframes.lua +++ b/config/unitframes.lua @@ -1568,6 +1568,53 @@ local function getOptionsTable_Auras(order, unit) 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", diff --git a/core/defaults.lua b/core/defaults.lua index 0d985c81..12f5d81b 100644 --- a/core/defaults.lua +++ b/core/defaults.lua @@ -351,6 +351,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, @@ -756,6 +762,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, @@ -1057,6 +1069,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, @@ -1367,6 +1385,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, diff --git a/modules/unitframes/elements/auras.lua b/modules/unitframes/elements/auras.lua index f3cc675b..5f99856b 100644 --- a/modules/unitframes/elements/auras.lua +++ b/modules/unitframes/elements/auras.lua @@ -266,7 +266,20 @@ local function element_CreateAuraIcon(element, index) 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 @@ -377,12 +390,24 @@ 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 auraType + 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 From 6945f568b285ebe6fae0fcc829d50c2bac256db7 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Sun, 23 Sep 2018 12:18:04 +0700 Subject: [PATCH 15/28] Added options to adjust aura count text --- config/auras.lua | 14 +++++++++++++- core/defaults.lua | 4 ++++ modules/auras/auras.lua | 22 +++++++++++++++------- 3 files changed, 32 insertions(+), 8 deletions(-) diff --git a/config/auras.lua b/config/auras.lua index 1b3a613e..8167b157 100644 --- a/config/auras.lua +++ b/config/auras.lua @@ -157,7 +157,7 @@ local function getOptionsTable_Aura(order, name, filter) 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:GetHeader(filter):UpdateButtons("UpdateCountText") end end, args = { @@ -173,6 +173,18 @@ 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 = { diff --git a/core/defaults.lua b/core/defaults.lua index 12f5d81b..56e922c9 100644 --- a/core/defaults.lua +++ b/core/defaults.lua @@ -2141,6 +2141,8 @@ D.profile = { enabled = true, size = 12, flag = "_Outline", -- "_Shadow", "" + h_alignment = "RIGHT", + v_alignment = "TOP", }, cooldown = { text = { @@ -2182,6 +2184,8 @@ D.profile = { enabled = true, size = 12, flag = "_Outline", -- "_Shadow", "" + h_alignment = "RIGHT", + v_alignment = "TOP", }, cooldown = { text = { diff --git a/modules/auras/auras.lua b/modules/auras/auras.lua index e7a4418e..7c314092 100644 --- a/modules/auras/auras.lua +++ b/modules/auras/auras.lua @@ -1,4 +1,4 @@ -local _, ns = ... +local _, ns = ... local E, C, M, L, P = ns.E, ns.C, ns.M, ns.L, ns.P local MODULE = P:AddModule("Auras") @@ -127,10 +127,19 @@ local function button_OnLeave() GameTooltip:Hide() end -local function button_UpdateCountFont(self) +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) @@ -161,14 +170,13 @@ local function handleButton(button, header) button.TextParent = textParent 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.UpdateCountText = button_UpdateCountText - button:UpdateCountFont() + button:UpdateCountText() end local function header_OnAttributeChanged(self, attr, value) @@ -213,7 +221,7 @@ local function header_Update(self) end self:Hide() - self:UpdateButtons("UpdateCountFont") + self:UpdateButtons("UpdateCountText") self:UpdateButtons("SetSize", config.size, config.size) self:UpdateCooldownConfig() self:SetAttribute("filter", self._filter) From cb983b111bf6f3f5b9498db1da9b0578eafeb0fd Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Sun, 23 Sep 2018 20:52:45 +0700 Subject: [PATCH 16/28] Added aura type icon to debuff buttons --- config/auras.lua | 82 +++++++++++++++++++++++++++++++++++------ core/defaults.lua | 10 +++++ modules/auras/auras.lua | 56 +++++++++++++++++++++++----- 3 files changed, 127 insertions(+), 21 deletions(-) diff --git a/config/auras.lua b/config/auras.lua index 8167b157..27780d8b 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 = 1, + }, + 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("UpdateCountText") + AURAS:ForHeader(filter, "UpdateConfig") + AURAS:ForHeader(filter, "ForEachButton", "UpdateCountText") end end, args = { @@ -187,13 +239,13 @@ local function getOptionsTable_Aura(order, name, filter) }, }, }, - spacer_3 = { - order = 29, + spacer_4 = { + order = 39, type = "description", name = " ", }, cooldown = { - order = 30, + order = 40, type = "group", name = L["COOLDOWN_TEXT"], inline = true, @@ -203,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 = { @@ -248,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, @@ -255,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 @@ -295,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/core/defaults.lua b/core/defaults.lua index 56e922c9..93e97cec 100644 --- a/core/defaults.lua +++ b/core/defaults.lua @@ -2153,6 +2153,11 @@ D.profile = { v_alignment = "BOTTOM", }, }, + type = { + size = 12, + position = "TOPLEFT", + debuff_type = false, + }, point = { ls = { p = "TOPRIGHT", @@ -2196,6 +2201,11 @@ D.profile = { v_alignment = "BOTTOM", }, }, + type = { + size = 12, + position = "TOPLEFT", + debuff_type = false, + }, point = { ls = { p = "TOPRIGHT", diff --git a/modules/auras/auras.lua b/modules/auras/auras.lua index 7c314092..315d6329 100644 --- a/modules/auras/auras.lua +++ b/modules/auras/auras.lua @@ -1,10 +1,11 @@ -local _, ns = ... +local _, ns = ... local E, C, M, L, P = ns.E, ns.C, ns.M, ns.L, ns.P 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,6 +145,16 @@ local function button_OnLeave() GameTooltip:Hide() end +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 @@ -169,13 +197,20 @@ 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:SetAllPoints() button.Count = count button._parent = header + button.UpdateAuraTypeIcon = button_UpdateAuraTypeIcon button.UpdateCountText = button_UpdateCountText + button:UpdateAuraTypeIcon() button:UpdateCountText() end @@ -221,8 +256,9 @@ local function header_Update(self) end self:Hide() - self:UpdateButtons("UpdateCountText") - 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", ([[ @@ -254,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 @@ -355,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 @@ -382,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, ...) @@ -394,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 From 523758862758c19e85138097cd30b80fc5665d19 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Sun, 23 Sep 2018 20:52:51 +0700 Subject: [PATCH 17/28] :lipstick: --- core/cooldown.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/cooldown.lua b/core/cooldown.lua index 9638e2b9..453a0019 100644 --- a/core/cooldown.lua +++ b/core/cooldown.lua @@ -142,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) From b93ee6722fe91f24cd2932ac6995c937d4686ae7 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Mon, 24 Sep 2018 10:25:41 +0700 Subject: [PATCH 18/28] Oops... --- config/auras.lua | 2 +- config/unitframes.lua | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/config/auras.lua b/config/auras.lua index 27780d8b..eec22ce7 100644 --- a/config/auras.lua +++ b/config/auras.lua @@ -182,7 +182,7 @@ local function getOptionsTable_Aura(order, name, filter) order = 2, type = "range", name = L["SIZE"], - min = 10, max = 32, step = 1, + min = 10, max = 32, step = 2, }, position = { order = 3, diff --git a/config/unitframes.lua b/config/unitframes.lua index 2c46fd39..aa13c7dc 100644 --- a/config/unitframes.lua +++ b/config/unitframes.lua @@ -1553,7 +1553,7 @@ local function getOptionsTable_Auras(order, unit) order = 2, type = "range", name = L["SIZE"], - min = 10, max = 32, step = 1, + min = 10, max = 32, step = 2, }, position = { order = 3, @@ -1976,6 +1976,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 From f2a31753adb7276cedc5b3d9022d0ca66d4dfcda Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Mon, 24 Sep 2018 10:47:28 +0700 Subject: [PATCH 19/28] :lipstick: --- assets/unit-frame-aura-icons.TGA | Bin 14839 -> 15680 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/assets/unit-frame-aura-icons.TGA b/assets/unit-frame-aura-icons.TGA index 0963c605e65ab432f394cb5fcb7146e7288fbde9..8eb9358b5cf4f1d388f5a9da77f7235ee2845cfb 100644 GIT binary patch literal 15680 zcmeHu2X|CQ)~!;jl~XI{oLf1A$c*zCa2gw&!C(WkRZ4|rN@cU7G_b*gILQ{h%!IXHMY*#3q&40DK$ zg`@oG&)1AGGtDADZ))s&%A6$HPOw;Ta*X^mQgX6Q(oS_G;b34nFUDM#vD|q6&|;~e znwftxRZYp1wk(ImVgBt|?Z*eIwKtP%8F$`a%FW0Yipphke0w^9%}IEfYr z$_ge^%Ufb>BZ@nnK|%RRlyp9ejt^eYIAx_>&Y{yo7g5;Z6pA{Ywplo-&2W{HiGqEe zF5d8R@qx3W3pKV0f|k(!SpK+6GF4D1KtT5pCnYH4m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_zcIY+pw%JcMu0A59~H9p&Ygd3yhW&*?k255H@T%2oTty#-fjfsnK5wh1X%-Itk65!3ClWp;mGhHdj8?KFgBRpNx@iH=!u?DPVjR! zhRLWdFQx+|0LKrhKc(L&ftGSuSw1Jiv z8?m3RqCYY63lZ`U#ki8vQ$79thq+H%I4sGO?+ut6NNFOauP8k>={|1Z VutY7PHhyC7e<|>Py#Ey>{~xoPsyqMy From 8e5908c8577c4defe558b07b78e58d947bc561d5 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Mon, 24 Sep 2018 10:48:12 +0700 Subject: [PATCH 20/28] Added options to adjust UF castbar text --- config/unitframes.lua | 44 +++++++++++++++++++++++++ core/defaults.lua | 28 ++++++++++++++++ modules/unitframes/elements/castbar.lua | 20 +++++++++++ 3 files changed, 92 insertions(+) diff --git a/config/unitframes.lua b/config/unitframes.lua index aa13c7dc..1a803850 100644 --- a/config/unitframes.lua +++ b/config/unitframes.lua @@ -794,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, + }, + }, + }, }, } @@ -845,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"] diff --git a/core/defaults.lua b/core/defaults.lua index 93e97cec..9d5cfac4 100644 --- a/core/defaults.lua +++ b/core/defaults.lua @@ -112,6 +112,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "BOTTOM", anchor = "", @@ -280,6 +284,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "TOPRIGHT", anchor = "", @@ -462,6 +470,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "BOTTOM", anchor = "LSPlayerFrameCastbarHolder", @@ -554,6 +566,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "TOPLEFT", anchor = "", @@ -689,6 +705,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "TOPLEFT", anchor = "", @@ -997,6 +1017,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "TOPRIGHT", anchor = "", @@ -1323,6 +1347,10 @@ D.profile = { enabled = true, position = "LEFT", -- or "RIGHT" }, + text = { + size = 12, + flag = "_Shadow", -- "_Outline", "" + }, point1 = { p = "TOPLEFT", anchor = "", diff --git a/modules/unitframes/elements/castbar.lua b/modules/unitframes/elements/castbar.lua index 3bd7d5c1..012ea57f 100644 --- a/modules/unitframes/elements/castbar.lua +++ b/modules/unitframes/elements/castbar.lua @@ -152,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 From 0fa84e8960d143a48115a615ef2c3fd9550bc65c Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Mon, 24 Sep 2018 10:57:32 +0700 Subject: [PATCH 21/28] Added options to adjust Blizz castbar colours --- config/blizzard.lua | 60 ++++++++++++++++++++++++++++++++++++ core/defaults.lua | 6 ++++ modules/blizzard/castbar.lua | 44 ++++++++++++++++++-------- 3 files changed, 97 insertions(+), 13 deletions(-) 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/core/defaults.lua b/core/defaults.lua index 9d5cfac4..7bb6ae2b 100644 --- a/core/defaults.lua +++ b/core/defaults.lua @@ -2314,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/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) From 0d65a31f776362328b721f2eecf7d54b2220aeb2 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Mon, 24 Sep 2018 10:58:21 +0700 Subject: [PATCH 22/28] :lipstick: --- modules/auras/auras.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auras/auras.lua b/modules/auras/auras.lua index 315d6329..e965fa9a 100644 --- a/modules/auras/auras.lua +++ b/modules/auras/auras.lua @@ -201,7 +201,7 @@ local function handleButton(button, header) auraType:SetTexture("Interface\\AddOns\\ls_UI\\assets\\unit-frame-aura-icons") auraType:Hide() button.AuraType = auraType - + local count = textParent:CreateFontString(nil, "ARTWORK") count:SetAllPoints() button.Count = count From 2dfb81e963aa3a881ff0ca3a2aba90609c433a9c Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Mon, 24 Sep 2018 11:08:32 +0700 Subject: [PATCH 23/28] Updated embedded oUF --- embeds/oUF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embeds/oUF b/embeds/oUF index 4cc11c9b..1d2e840b 160000 --- a/embeds/oUF +++ b/embeds/oUF @@ -1 +1 @@ -Subproject commit 4cc11c9bdc246287954ebce39ba77330b816b3c9 +Subproject commit 1d2e840bee26b4b53ebf48ecceb7d3a90d3dc4e4 From ce3b60a182cbbf3d72702170baefa48716ee9bb1 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Tue, 25 Sep 2018 06:26:24 +0700 Subject: [PATCH 24/28] Updated embedded oUF --- embeds/oUF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embeds/oUF b/embeds/oUF index 1d2e840b..8a0b92d8 160000 --- a/embeds/oUF +++ b/embeds/oUF @@ -1 +1 @@ -Subproject commit 1d2e840bee26b4b53ebf48ecceb7d3a90d3dc4e4 +Subproject commit 8a0b92d89812318b3399d3f6a161077d52b7bdfa From 42580dc2cb73277f0d711690a6e4f85e75442b18 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Fri, 28 Sep 2018 22:29:25 +0700 Subject: [PATCH 25/28] Updated embedded oUF --- embeds/oUF | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/embeds/oUF b/embeds/oUF index 8a0b92d8..1d9dcd9e 160000 --- a/embeds/oUF +++ b/embeds/oUF @@ -1 +1 @@ -Subproject commit 8a0b92d89812318b3399d3f6a161077d52b7bdfa +Subproject commit 1d9dcd9edb2a4dbe67bca031b3677e3c726bd88f From 789c458cfdd1c125d32b8f78518216c6b0d5082e Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Fri, 28 Sep 2018 22:36:29 +0700 Subject: [PATCH 26/28] Updated minimap button handling --- modules/minimap/minimap.lua | 73 +++++++++++++++++++++++++++---------- 1 file changed, 54 insertions(+), 19 deletions(-) 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) From b6c7342db6096c67a6bb35087957e570a3b8d293 Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Fri, 28 Sep 2018 22:43:38 +0700 Subject: [PATCH 27/28] .toc bump --- ls_UI.toc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 43e90dd269984b83cf8654c283f560d42bb1a23b Mon Sep 17 00:00:00 2001 From: Val Voronov Date: Fri, 28 Sep 2018 22:43:49 +0700 Subject: [PATCH 28/28] Updated CHANGELOG --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) 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;