From 9a2526d74d3dcf1a6889ae6949834282a1a4dce1 Mon Sep 17 00:00:00 2001 From: legowxelab2z8 Date: Sat, 17 Oct 2020 20:57:55 -0700 Subject: [PATCH 1/7] Option to Move ItemLevel text. Added options to ItemLevel module to let the user define an anchor and offset for the item level text. --- modules/ItemLevel.lua | 78 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 77 insertions(+), 1 deletion(-) diff --git a/modules/ItemLevel.lua b/modules/ItemLevel.lua index c68d5736..87b9dbb4 100644 --- a/modules/ItemLevel.lua +++ b/modules/ItemLevel.lua @@ -65,6 +65,9 @@ function mod:OnInitialize() minLevel = 1, ignoreJunk = true, ignoreHeirloom = true, + anchor = 'BOTTOMLEFT', + offsetX = 2, + offsetY = 1, }, }) if self.db.profile.colored == true then @@ -85,6 +88,9 @@ function mod:OnInitialize() SyLevel:RegisterFilterOnPipe('Adibags', 'Item level text') SyLevelDB.EnabledFilters['Item level text']['Adibags'] = true end + self.db.RegisterCallback(self, "OnProfileChanged", "UpdateTextLocation") + self.db.RegisterCallback(self, "OnProfileCopied", "UpdateTextLocation") + self.db.RegisterCallback(self, "OnProfileReset", "UpdateTextLocation") end function mod:OnEnable() @@ -103,12 +109,25 @@ end local function CreateText(button) local text = button:CreateFontString(nil, "OVERLAY", "NumberFontNormal") - text:SetPoint("TOPLEFT", button, 3, -1) + local anchor = mod.db.profile.anchor or mod.db.defaults.profile.anchor + local offsetX = mod.db.profile.offsetX or mod.db.defaults.profile.offsetX + local offsetY = mod.db.profile.offsetY or mod.db.defaults.profile.offsetY + text:SetPoint(anchor, button, offsetX, offsetY) text:Hide() texts[button] = text return text end +function mod:UpdateTextLocation() + local anchor = mod.db.profile.anchor or mod.db.defaults.profile.anchor + local offsetX = mod.db.profile.offsetX or mod.db.defaults.profile.offsetX + local offsetY = mod.db.profile.offsetY or mod.db.defaults.profile.offsetY + for button, text in pairs(texts) do + text:ClearAllPoints() + text:SetPoint(anchor, button, offsetX, offsetY) + end +end + function mod:UpdateButton(event, button) local settings = self.db.profile local link = button:GetItemLink() @@ -199,6 +218,63 @@ function mod:GetOptions() type = 'toggle', order = 50, }, + positionHeader = { + name = L['Text Position'], + type = 'header', + order = 60, + }, + anchor = { + name = L['Anchor'], + desc = L['Where to anchor the item level text?'], + type = 'select', + values = { + TOPLEFT = L['Top Left'], + TOP = L['Top'], + TOPRIGHT = L['Top Right'], + LEFT = L['Left'], + CENTER = L['Center'], + RIGHT = L['Right'], + BOTTOMLEFT = L['Bottom Left'], + BOTTOM = L['Bottom'], + BOTTOMRIGHT = L['Bottom Right'], + + }, + sorting = { + [1] = "TOPLEFT", + [2] = "TOP", + [3] = "TOPRIGHT", + [4] = "LEFT", + [5] = "CENTER", + [6] = "RIGHT", + [7] = "BOTTOMLEFT", + [8] = "BOTTOM", + [9] = "BOTTOMRIGHT", + }, + order = 61, + set = function(info,value) mod.db.profile[info[#info]] = value mod:UpdateTextLocation() end, + }, + offsetX = { + name = L['offset right'], + desc = L['How far right?'], + type = 'range', + min = -20, + max = 20, + step = 1, + bigStep = 1, + order = 62, + set = function(info,value) mod.db.profile[info[#info]] = value mod:UpdateTextLocation() end, + }, + offsetY = { + name = L['offset up'], + desc = L['How far up?'], + type = 'range', + min = -20, + max = 20, + step = 1, + bigStep = 1, + order = 63, + set = function(info,value) mod.db.profile[info[#info]] = value mod:UpdateTextLocation() end, + }, }, addon:GetOptionHandler(self) end From be248d31778565a75a9194b16e31825f95392188 Mon Sep 17 00:00:00 2001 From: legowxelab2z8 Date: Sat, 17 Oct 2020 21:46:55 -0700 Subject: [PATCH 2/7] fix trailing whitespace Fixes the trailing whitespace that cause the build check to fail https://travis-ci.org/github/AdiAddons/AdiBags/builds/736756255 --- modules/ItemLevel.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/ItemLevel.lua b/modules/ItemLevel.lua index 87b9dbb4..9975b8a4 100644 --- a/modules/ItemLevel.lua +++ b/modules/ItemLevel.lua @@ -237,7 +237,6 @@ function mod:GetOptions() BOTTOMLEFT = L['Bottom Left'], BOTTOM = L['Bottom'], BOTTOMRIGHT = L['Bottom Right'], - }, sorting = { [1] = "TOPLEFT", From 3bfe3b50d25f2d5919e5d7866d2a308b7778b1d7 Mon Sep 17 00:00:00 2001 From: legowxelab2z8 Date: Sun, 18 Oct 2020 18:33:41 -0700 Subject: [PATCH 3/7] Localization for ItemLevel Options Added localized strings for "Anchor" "X Offset" "Y Offset" "Offset in X direction (horizontal) from the given anchor point." "Offset in Y direction (vertical) from the given anchor point." --- Localization.lua | 46 +++++++++++++++++++++++++++++++++++++++++++ modules/ItemLevel.lua | 29 +++++++++++++-------------- 2 files changed, 60 insertions(+), 15 deletions(-) diff --git a/Localization.lua b/Localization.lua index ae6b03d6..fa9fe035 100644 --- a/Localization.lua +++ b/Localization.lua @@ -284,6 +284,12 @@ L["Related to player level"] = true L["Same as InventoryItemLevels"] = true L["Use SyLevel"] = true L["Which color scheme should be used to display the item level ?"] = true +L['Text Position'] = true +L["Anchor"] = true +L["X Offset"] = true +L["Offset in X direction (horizontal) from the given anchor point."] = true +L["Y Offset"] = true +L["Offset in Y direction (vertical) from the given anchor point."] = true -- modules/Junk.lua L["Alt-right-click to configure the Junk module."] = true @@ -625,6 +631,11 @@ L["When checked, right-clicking on an empty space of a bag opens the configurati L["When ctrl is held down"] = "Quand CONTROL est enfoncé" L["When shift is held down"] = "Quand MAJ est enfoncé" L["Which color scheme should be used to display the item level ?"] = "Quel thème de couleur doit être utilisé pour afficher le niiveau d'objet ?" -- Needs review +L["Anchor"] = "Ancre" +L["X Offset"] = "Décalage en X" +L["Offset in X direction (horizontal) from the given anchor point."] = "Le décalage en X (horizontal) par rapport au point d'ancrage donné." +L["Y Offset"] = "Décalage en Y" +L["Offset in Y direction (vertical) from the given anchor point."] = "Le décalage en Y (vertical) par rapport au point d'ancrage donné." ------------------------ deDE ------------------------ elseif locale == 'deDE' then @@ -792,6 +803,11 @@ L["When alt is held down"] = "Wenn Alt gedrückt ist" L["When any modifier key is held down"] = "Wenn irgendeine Modifizierungstase gedrückt ist" L["When ctrl is held down"] = "Wenn Strg gedrückt ist" L["When shift is held down"] = "Wenn Umschalt gedrückt ist" +L["Anchor"] = "Anker" +L["X Offset"] = "X-Verschiebung" +L["Offset in X direction (horizontal) from the given anchor point."] = "Verschiebung in Richtung X (horizontal) vom gegebenen Ankerpunkt aus." +L["Y Offset"] = "Y-Verschiebung" +L["Offset in Y direction (vertical) from the given anchor point."] = "Verschiebung in Richtung Y (vertikal) vom gegebenen Ankerpunkt aus." ------------------------ esMX ------------------------ -- no translation @@ -966,6 +982,11 @@ L["When alt is held down"] = "Когда кнопка Alt нажата" L["When any modifier key is held down"] = "Когда какая-либо клавиша модификатора нажата" L["When ctrl is held down"] = "Когда кнопка Ctrl нажата" L["When shift is held down"] = "Когда кнопка Shift нажата" +L["Anchor"] = "Якорь" +L["X Offset"] = "Сдвиг по Х" +L["Offset in X direction (horizontal) from the given anchor point."] = "Сдвиг по оси Х (горизонтально) от заданной точки привязки." +L["Y Offset"] = "Сдвиг по Y" +L["Offset in Y direction (vertical) from the given anchor point."] = "Сдвиг по оси Y (вертикально) от заданной точки привязки." ------------------------ esES ------------------------ elseif locale == 'esES' then @@ -1062,6 +1083,11 @@ L["Unlock anchor"] = "desbloquear anclaje - desanclar." L["Use this to adjust the bag scale."] = "Usa esto para ajustar la escala de la bolsa." L["Use this to adjust the quality-based border opacity. 100% means fully opaque."] = [=[Usa esto para ajustar la opacidad del borde basado en la calidad. 100% significa opaco. ]=] +L["Anchor"] = "Anclar" +L["X Offset"] = "Desplazamiento X" +L["Offset in X direction (horizontal) from the given anchor point."] = "Desplazado en la dirección X (horizontal) desde el punto de anclaje dado." +L["Y Offset"] = "Desplazamiento Y" +L["Offset in Y direction (vertical) from the given anchor point."] = "Desplazado en la dirección Y (vertical) desde el punto de anclaje dado." ------------------------ zhTW ------------------------ elseif locale == 'zhTW' then @@ -1319,6 +1345,11 @@ L["When checked, right-clicking on an empty space of a bag opens the configurati L["When ctrl is held down"] = "當 ctrl 按住" L["When shift is held down"] = "當 shift 按住" L["Which color scheme should be used to display the item level ?"] = "應該使用哪種顏色設定顯示物品的等級?" -- Needs review +L["Anchor"] = "錨點" +L["X Offset"] = "X 偏移量" +L["Offset in X direction (horizontal) from the given anchor point."] = "X 方向(水平)給定的錨點偏移量。" +L["Y Offset"] = "Y 偏移量" +L["Offset in Y direction (vertical) from the given anchor point."] = "Y 方向(垂直)給定的錨點偏移量。" ------------------------ zhCN ------------------------ elseif locale == 'zhCN' then @@ -1573,6 +1604,11 @@ L["When checked, right-clicking on an empty space of a bag opens the configurati L["When ctrl is held down"] = "当CTRL键被按下" -- Needs review L["When shift is held down"] = "当SHIFT键被按下" -- Needs review L["Which color scheme should be used to display the item level ?"] = "应该使用哪种颜色设定显示物品的等级?" -- Needs review +L["Anchor"] = "锚点" +L["X Offset"] = "X 偏移量" +L["Offset in X direction (horizontal) from the given anchor point."] = "X 方向(水平)给定的锚点偏移量。" +L["Y Offset"] = "Y 偏移量" +L["Offset in Y direction (vertical) from the given anchor point."] = "Y 方向(垂直)给定的锚点偏移量。" ------------------------ koKR ------------------------ elseif locale == 'koKR' then @@ -1849,6 +1885,11 @@ L["When ctrl is held down"] = "Ctrl키를 누르고 있을 때" L["When shift is held down"] = "Shift키를 누르고 있을 때" L["Which color scheme should be used to display the item level ?"] = "아이템 레벨에 어떤 색상화 방식을 사용할까요 ?" L["You can block auto-deposit ponctually by pressing a modified key while talking to the banker."] = "은행원과 대화할 때 보조 키를 누르고 있으면 자동 보관 기능을 방지할 수 있습니다." +L["Anchor"] = "앵커" +L["X Offset"] = "X 좌표" +L["Offset in X direction (horizontal) from the given anchor point."] = "주어진 앵커를 기준으로 X 방향(수평)의 좌표를 설정합니다." +L["Y Offset"] = "Y 좌표" +L["Offset in Y direction (vertical) from the given anchor point."] = "주어진 앵커를 기준으로 Y 방향(수직)의 좌표를 설정합니다." ------------------------ ptBR ------------------------ elseif locale == 'ptBR' then @@ -2106,6 +2147,11 @@ L["When checked, right-clicking on an empty space of a bag opens the configurati L["When ctrl is held down"] = "Quando CTRL é pressionado" L["When shift is held down"] = "Quando SHIFT é pressionado" L["Which color scheme should be used to display the item level ?"] = "Qual esquema de cores deve ser usado para mostrar o nível do item?" +L["Anchor"] = "Ancorar" +L["X Offset"] = "Posição de X" +L["Offset in X direction (horizontal) from the given anchor point."] = "Posição da direção X (horizontal) do ponto de ancora dado" +L["Y Offset"] = "Posição de Y" +L["Offset in Y direction (vertical) from the given anchor point."] = "Posição da direção Y (vertical) do ponto de ancora dado" end -- @noloc]] diff --git a/modules/ItemLevel.lua b/modules/ItemLevel.lua index 9975b8a4..95f581cb 100644 --- a/modules/ItemLevel.lua +++ b/modules/ItemLevel.lua @@ -190,7 +190,7 @@ function mod:GetOptions() type = 'select', hidden = SyLevelBypass, values = { - none = L['None'], + none = L['Manual'], original = L['Same as InventoryItemLevels'], level = L['Related to player level'], }, @@ -225,18 +225,17 @@ function mod:GetOptions() }, anchor = { name = L['Anchor'], - desc = L['Where to anchor the item level text?'], type = 'select', values = { - TOPLEFT = L['Top Left'], - TOP = L['Top'], - TOPRIGHT = L['Top Right'], - LEFT = L['Left'], - CENTER = L['Center'], - RIGHT = L['Right'], - BOTTOMLEFT = L['Bottom Left'], - BOTTOM = L['Bottom'], - BOTTOMRIGHT = L['Bottom Right'], + TOPLEFT = "TOPLEFT", + TOP = "TOP", + TOPRIGHT = "TOPRIGHT", + LEFT = "LEFT", + CENTER = "CENTER", + RIGHT = "RIGHT", + BOTTOMLEFT = "BOTTOMLEFT", + BOTTOM = "BOTTOM", + BOTTOMRIGHT = "BOTTOMRIGHT", }, sorting = { [1] = "TOPLEFT", @@ -253,8 +252,8 @@ function mod:GetOptions() set = function(info,value) mod.db.profile[info[#info]] = value mod:UpdateTextLocation() end, }, offsetX = { - name = L['offset right'], - desc = L['How far right?'], + name = L["X Offset"], + desc = L["Offset in X direction (horizontal) from the given anchor point."], type = 'range', min = -20, max = 20, @@ -264,8 +263,8 @@ function mod:GetOptions() set = function(info,value) mod.db.profile[info[#info]] = value mod:UpdateTextLocation() end, }, offsetY = { - name = L['offset up'], - desc = L['How far up?'], + name = L["Y Offset"] , + desc = L["Offset in Y direction (vertical) from the given anchor point."], type = 'range', min = -20, max = 20, From 24a7df37400ffea969175d71f6136a0e141401ff Mon Sep 17 00:00:00 2001 From: legowxelab2z8 Date: Sun, 18 Oct 2020 19:33:44 -0700 Subject: [PATCH 4/7] Added Font Options (Font, Size, Color) Added an options control for setting the Font, Size, and Color. Color can be set when the Color Scheme is set to manual --- modules/ItemLevel.lua | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/modules/ItemLevel.lua b/modules/ItemLevel.lua index 95f581cb..06335e5c 100644 --- a/modules/ItemLevel.lua +++ b/modules/ItemLevel.lua @@ -43,7 +43,7 @@ mod.uiName = L['Item level'] mod.uiDesc = L['Display the level of equippable item in the top left corner of the button.'] local colorSchemes = { - none = function() return 1, 1 ,1 end + none = function() return mod.db.profile.text.r, mod.db.profile.text.g, mod.db.profile.text.b end } local texts = {} @@ -68,8 +68,19 @@ function mod:OnInitialize() anchor = 'BOTTOMLEFT', offsetX = 2, offsetY = 1, + text = addon:GetFontDefaults(NumberFontNormalLarge), }, }) + self.font = addon:CreateFont( + self.name..'Font', + NumberFontNormalLarge, + function() return self.db.profile.text end + ) + self.font.SettingHook = function(self) + local fontName, fontSize = self:GetFont() + self:SetFont(fontName, fontSize, "OUTLINE") + mod:UpdateFont() + end if self.db.profile.colored == true then self.db.profile.colorScheme = 'original' self.db.profile.colored = nil @@ -113,11 +124,20 @@ local function CreateText(button) local offsetX = mod.db.profile.offsetX or mod.db.defaults.profile.offsetX local offsetY = mod.db.profile.offsetY or mod.db.defaults.profile.offsetY text:SetPoint(anchor, button, offsetX, offsetY) + text:SetFontObject(mod.font) text:Hide() texts[button] = text return text end +function mod:UpdateFont() + if self.db.profile.colorScheme == "none" then + for button, text in pairs(texts) do + text:SetTextColor(colorSchemes[self.db.profile.colorScheme]()) + end + end +end + function mod:UpdateTextLocation() local anchor = mod.db.profile.anchor or mod.db.defaults.profile.anchor local offsetX = mod.db.profile.offsetX or mod.db.defaults.profile.offsetX @@ -171,7 +191,8 @@ end function mod:GetOptions() - return { + local options = + { useSyLevel = SyLevel and { name = L['Use SyLevel'], desc = L['Let SyLevel handle the the display.'], @@ -273,7 +294,11 @@ function mod:GetOptions() order = 63, set = function(info,value) mod.db.profile[info[#info]] = value mod:UpdateTextLocation() end, }, - }, addon:GetOptionHandler(self) + text = addon:CreateFontOptions(self.font, nil, 70), + } + options.text.args.size.step = 1 + options.text.args.color.disabled = function() return mod.db.profile.colorScheme ~= "none" end + return options, addon:GetOptionHandler(self) end -- Color scheme inspired from InventoryItemLevels From 30de37108ad32e0c3c42f0f37a8b2c6a2ee4904a Mon Sep 17 00:00:00 2001 From: legowxelab2z8 Date: Sun, 18 Oct 2020 22:43:38 -0700 Subject: [PATCH 5/7] Changed order values for options table Changed order values for the options table to avoid conflicts with other pull requests. --- modules/ItemLevel.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ItemLevel.lua b/modules/ItemLevel.lua index 06335e5c..ef4b1e5d 100644 --- a/modules/ItemLevel.lua +++ b/modules/ItemLevel.lua @@ -242,7 +242,7 @@ function mod:GetOptions() positionHeader = { name = L['Text Position'], type = 'header', - order = 60, + order = 70, }, anchor = { name = L['Anchor'], @@ -269,7 +269,7 @@ function mod:GetOptions() [8] = "BOTTOM", [9] = "BOTTOMRIGHT", }, - order = 61, + order = 71, set = function(info,value) mod.db.profile[info[#info]] = value mod:UpdateTextLocation() end, }, offsetX = { @@ -280,7 +280,7 @@ function mod:GetOptions() max = 20, step = 1, bigStep = 1, - order = 62, + order = 72, set = function(info,value) mod.db.profile[info[#info]] = value mod:UpdateTextLocation() end, }, offsetY = { @@ -291,10 +291,10 @@ function mod:GetOptions() max = 20, step = 1, bigStep = 1, - order = 63, + order = 73, set = function(info,value) mod.db.profile[info[#info]] = value mod:UpdateTextLocation() end, }, - text = addon:CreateFontOptions(self.font, nil, 70), + text = addon:CreateFontOptions(self.font, nil, 80), } options.text.args.size.step = 1 options.text.args.color.disabled = function() return mod.db.profile.colorScheme ~= "none" end From e530a5de3a88df09412e603c1d2063519d1902c2 Mon Sep 17 00:00:00 2001 From: legowxelab2z8 Date: Tue, 20 Oct 2020 22:05:11 -0700 Subject: [PATCH 6/7] Update in OnEnable instead of OnProfileChanged callback Adibags handles profile changes by calling Disable then Enable. Use OnEnable instead of using new callback handlers. --- modules/ItemLevel.lua | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/modules/ItemLevel.lua b/modules/ItemLevel.lua index ef4b1e5d..aba17d25 100644 --- a/modules/ItemLevel.lua +++ b/modules/ItemLevel.lua @@ -99,9 +99,16 @@ function mod:OnInitialize() SyLevel:RegisterFilterOnPipe('Adibags', 'Item level text') SyLevelDB.EnabledFilters['Item level text']['Adibags'] = true end - self.db.RegisterCallback(self, "OnProfileChanged", "UpdateTextLocation") - self.db.RegisterCallback(self, "OnProfileCopied", "UpdateTextLocation") - self.db.RegisterCallback(self, "OnProfileReset", "UpdateTextLocation") +end + +local function UpdateTextLocation() + local anchor = mod.db.profile.anchor or mod.db.defaults.profile.anchor + local offsetX = mod.db.profile.offsetX or mod.db.defaults.profile.offsetX + local offsetY = mod.db.profile.offsetY or mod.db.defaults.profile.offsetY + for button, text in pairs(texts) do + text:ClearAllPoints() + text:SetPoint(anchor, button, offsetX, offsetY) + end end function mod:OnEnable() @@ -110,6 +117,7 @@ function mod:OnEnable() SyLevel:EnablePipe('Adibags') end self:SendMessage('AdiBags_UpdateAllButtons') + UpdateTextLocation() end function mod:OnDisable() @@ -138,16 +146,6 @@ function mod:UpdateFont() end end -function mod:UpdateTextLocation() - local anchor = mod.db.profile.anchor or mod.db.defaults.profile.anchor - local offsetX = mod.db.profile.offsetX or mod.db.defaults.profile.offsetX - local offsetY = mod.db.profile.offsetY or mod.db.defaults.profile.offsetY - for button, text in pairs(texts) do - text:ClearAllPoints() - text:SetPoint(anchor, button, offsetX, offsetY) - end -end - function mod:UpdateButton(event, button) local settings = self.db.profile local link = button:GetItemLink() @@ -270,7 +268,7 @@ function mod:GetOptions() [9] = "BOTTOMRIGHT", }, order = 71, - set = function(info,value) mod.db.profile[info[#info]] = value mod:UpdateTextLocation() end, + set = function(info,value) mod.db.profile[info[#info]] = value; UpdateTextLocation() end, }, offsetX = { name = L["X Offset"], @@ -281,7 +279,7 @@ function mod:GetOptions() step = 1, bigStep = 1, order = 72, - set = function(info,value) mod.db.profile[info[#info]] = value mod:UpdateTextLocation() end, + set = function(info,value) mod.db.profile[info[#info]] = value; UpdateTextLocation() end, }, offsetY = { name = L["Y Offset"] , @@ -292,7 +290,7 @@ function mod:GetOptions() step = 1, bigStep = 1, order = 73, - set = function(info,value) mod.db.profile[info[#info]] = value mod:UpdateTextLocation() end, + set = function(info,value) mod.db.profile[info[#info]] = value; UpdateTextLocation() end, }, text = addon:CreateFontOptions(self.font, nil, 80), } From ec3c8246f835e791bbdde50669a875de83479bdd Mon Sep 17 00:00:00 2001 From: legowxelab2z8 Date: Tue, 20 Oct 2020 22:34:31 -0700 Subject: [PATCH 7/7] Fix font loading Fixed so font should now properly load. Since the fix is in OnEnable this will also fix font loading when changing profiles. --- modules/ItemLevel.lua | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/modules/ItemLevel.lua b/modules/ItemLevel.lua index aba17d25..5c81e44d 100644 --- a/modules/ItemLevel.lua +++ b/modules/ItemLevel.lua @@ -56,6 +56,16 @@ else function SyLevelBypass() return false end end +local function UpdateFont() + local fontName, fontSize = mod.font:GetFont() + mod.font:SetFont(fontName, fontSize, "OUTLINE") + if mod.db.profile.colorScheme == "none" then + for button, text in pairs(texts) do + text:SetTextColor(colorSchemes[mod.db.profile.colorScheme]()) + end + end +end + function mod:OnInitialize() self.db = addon.db:RegisterNamespace(self.moduleName, { profile = { @@ -76,11 +86,7 @@ function mod:OnInitialize() NumberFontNormalLarge, function() return self.db.profile.text end ) - self.font.SettingHook = function(self) - local fontName, fontSize = self:GetFont() - self:SetFont(fontName, fontSize, "OUTLINE") - mod:UpdateFont() - end + self.font.SettingHook = UpdateFont if self.db.profile.colored == true then self.db.profile.colorScheme = 'original' self.db.profile.colored = nil @@ -117,6 +123,8 @@ function mod:OnEnable() SyLevel:EnablePipe('Adibags') end self:SendMessage('AdiBags_UpdateAllButtons') + self.font:ApplySettings() + UpdateFont() UpdateTextLocation() end @@ -138,14 +146,6 @@ local function CreateText(button) return text end -function mod:UpdateFont() - if self.db.profile.colorScheme == "none" then - for button, text in pairs(texts) do - text:SetTextColor(colorSchemes[self.db.profile.colorScheme]()) - end - end -end - function mod:UpdateButton(event, button) local settings = self.db.profile local link = button:GetItemLink()