From ab7b6a6d3141a20c6b197dd88a8d2501f0ba47b6 Mon Sep 17 00:00:00 2001 From: Merathilis Date: Sat, 31 Aug 2024 15:44:07 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20FIX:=20Call=20the=20db=20here=20?= =?UTF-8?q?directly,=20cause=20it=20doesn't=20exist=20sometimes=20on=20pro?= =?UTF-8?q?file=20switch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ElvUI_MerathilisUI/Modules/Armory/Core.lua | 30 +++++++++---------- .../Modules/Blizzard/ObjectiveTracker.lua | 11 +++---- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/ElvUI_MerathilisUI/Modules/Armory/Core.lua b/ElvUI_MerathilisUI/Modules/Armory/Core.lua index 6cd85f2a2..2affe55d5 100644 --- a/ElvUI_MerathilisUI/Modules/Armory/Core.lua +++ b/ElvUI_MerathilisUI/Modules/Armory/Core.lua @@ -703,6 +703,7 @@ function module:UpdatePageInfo(_, _, which) end function module:UpdatePageStrings(slotId, _, slotItem, slotInfo, which) + local db = E.db.mui.armory if which ~= "Character" then return end @@ -721,8 +722,8 @@ function module:UpdatePageStrings(slotId, _, slotItem, slotInfo, which) end -- Enchant/Socket Text Handling - if module.db.pageInfo.enchantTextEnabled and slotInfo.itemLevelColors and next(slotInfo.itemLevelColors) then - if module.db.pageInfo.missingSocketText and slotOptions.needsSocket then + if db.pageInfo.enchantTextEnabled and slotInfo.itemLevelColors and next(slotInfo.itemLevelColors) then + if db.pageInfo.missingSocketText and slotOptions.needsSocket then if not slotOptions.warningCondition or module:CheckMessageCondition(slotOptions) then local missingGemSlots = 2 - #slotInfo.gems if missingGemSlots > 0 then @@ -744,17 +745,17 @@ function module:UpdatePageStrings(slotId, _, slotItem, slotInfo, which) local text = slotInfo.enchantTextShort -- Strip color text = F.String.StripColor(text) - if module.db.pageInfo.abbreviateEnchantText then + if db.pageInfo.abbreviateEnchantText then text = module:EnchantAbbreviate(slotInfo.enchantText) end - if module.db.pageInfo.useEnchantClassColor then + if db.pageInfo.useEnchantClassColor then slotItem.enchantText:SetText(F.String.Class(text)) else slotItem.enchantText:SetText(text) end end - elseif module.db.pageInfo.missingEnchantText and slotOptions.needsEnchant and not E.TimerunningID then + elseif db.pageInfo.missingEnchantText and slotOptions.needsEnchant and not E.TimerunningID then if not slotOptions.warningCondition or module:CheckMessageCondition(slotOptions) then slotItem.enchantText:SetText(F.String.Error("Add enchant")) else @@ -794,10 +795,7 @@ function module:UpdatePageStrings(slotId, _, slotItem, slotInfo, which) end -- Update Size - slotItem.MERGradient:SetSize( - module.db.pageInfo.itemQualityGradientWidth, - module.db.pageInfo.itemQualityGradientHeight - ) + slotItem.MERGradient:SetSize(db.pageInfo.itemQualityGradientWidth, db.pageInfo.itemQualityGradientHeight) -- Update Colors if slotOptions.direction == module.enumDirection.LEFT then @@ -807,11 +805,11 @@ function module:UpdatePageStrings(slotId, _, slotItem, slotInfo, which) r, g, b, - module.db.pageInfo.itemQualityGradientStartAlpha, + db.pageInfo.itemQualityGradientStartAlpha, r, g, b, - module.db.pageInfo.itemQualityGradientEndAlpha + db.pageInfo.itemQualityGradientEndAlpha ) elseif slotOptions.direction == module.enumDirection.RIGHT then F.SetGradientRGB( @@ -820,15 +818,15 @@ function module:UpdatePageStrings(slotId, _, slotItem, slotInfo, which) r, g, b, - module.db.pageInfo.itemQualityGradientEndAlpha, + db.pageInfo.itemQualityGradientEndAlpha, r, g, b, - module.db.pageInfo.itemQualityGradientStartAlpha + db.pageInfo.itemQualityGradientStartAlpha ) end - if module.db.pageInfo.itemQualityGradientEnabled then + if db.pageInfo.itemQualityGradientEnabled then slotItem.MERGradient:Show() else slotItem.MERGradient:Hide() @@ -836,12 +834,12 @@ function module:UpdatePageStrings(slotId, _, slotItem, slotInfo, which) end -- iLvL Text Handling - if not module.db.pageInfo.itemLevelTextEnabled then + if not db.pageInfo.itemLevelTextEnabled then slotItem.iLvlText:SetText("") end -- Icons Handling - if not module.db.pageInfo.itemLevelTextEnabled or not module.db.pageInfo.iconsEnabled then + if not db.pageInfo.itemLevelTextEnabled or not db.pageInfo.iconsEnabled then for x = 1, 10 do local essenceType = slotItem["textureSlotEssenceType" .. x] if essenceType then diff --git a/ElvUI_MerathilisUI/Modules/Blizzard/ObjectiveTracker.lua b/ElvUI_MerathilisUI/Modules/Blizzard/ObjectiveTracker.lua index 4feb55750..c22e40230 100644 --- a/ElvUI_MerathilisUI/Modules/Blizzard/ObjectiveTracker.lua +++ b/ElvUI_MerathilisUI/Modules/Blizzard/ObjectiveTracker.lua @@ -183,6 +183,7 @@ function module:CosmeticBar(header) end function module:ObjectiveTrackerModule_Update(tracker) + local db = E.db.mui.blizzard.objectiveTracker local NumQuests = select(2, GetNumQuestLogEntries()) if tracker and tracker.Header and tracker.Header.Text then @@ -193,19 +194,19 @@ function module:ObjectiveTrackerModule_Update(tracker) tracker.Header.Text:SetText(format("|Cffff0000%d/%d|r - %s", NumQuests, MAX_QUESTS, _G.QUESTS_LABEL)) end self:CosmeticBar(tracker.Header) - F.SetFontDB(tracker.Header.Text, self.db.header) + F.SetFontDB(tracker.Header.Text, db.header) if not tracker.Header.Text.__MERUnbind then tracker.Header.Text.__MERUnbind = true tracker.Header.Text:SetFontObject(nil) tracker.Header.Text.SetFontObject = E.noop end - local r = self.db.header.classColor and MER.ClassColor.r or self.db.header.color.r - local g = self.db.header.classColor and MER.ClassColor.g or self.db.header.color.g - local b = self.db.header.classColor and MER.ClassColor.b or self.db.header.color.b + local r = db and db.header.classColor and MER.ClassColor.r or db.header.color.r + local g = db and db.header.classColor and MER.ClassColor.g or db.header.color.g + local b = db and db.header.classColor and MER.ClassColor.b or db.header.color.b tracker.Header.Text:SetTextColor(r, g, b) - if self.db.header.shortHeader then + if db and db.header.shortHeader then tracker.Header.Text:SetText(self:ShortTitle(tracker.Header.Text:GetText())) end end