From 223e4a4f0d394feb21b0dac303cf97ec2ae0f35c Mon Sep 17 00:00:00 2001 From: wutname1 Date: Thu, 15 Aug 2024 22:02:25 -0500 Subject: [PATCH] Bug fixes #490 --- .vscode/settings.json | 3 ++- Modules/UnitFrames/Elements/Castbar.lua | 5 ++--- Modules/UnitFrames/Elements/Health.lua | 3 +-- Modules/UnitFrames/Elements/Power.lua | 3 +-- Modules/UnitFrames/Framework.lua | 2 +- Themes/Fel/Style.lua | 14 +++++++++----- 6 files changed, 16 insertions(+), 14 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index ead8d360..39687679 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -401,7 +401,8 @@ "MAX_PARTY_MEMBERS", "MAX_ARENA_ENEMIES", "RAID_CLASS_COLORS", - "ShowUIPanel" + "ShowUIPanel", + "MAX_RAID_MEMBERS" ], "Lua.workspace.ignoreDir": [".vscode", "libs/*"], "Lua.diagnostics.enable": true, diff --git a/Modules/UnitFrames/Elements/Castbar.lua b/Modules/UnitFrames/Elements/Castbar.lua index 0fb9f57e..019061cb 100644 --- a/Modules/UnitFrames/Elements/Castbar.lua +++ b/Modules/UnitFrames/Elements/Castbar.lua @@ -127,14 +127,13 @@ local function Update(frame, settings) element.bg:SetTexture(UF:FindStatusBarTexture(DB.texture)) element.bg:SetVertexColor(unpack(DB.bg.color or { 1, 1, 1, 0.2 })) - element.TextElements = {} - for i, TextElement in pairs(element.TextElements) do + for i, TextElement in pairs(element.TextElements or {}) do local key = DB.text[i] TextElement:SetJustifyH(key.SetJustifyH) TextElement:SetJustifyV(key.SetJustifyV) TextElement:ClearAllPoints() TextElement:SetPoint(key.position.anchor, element, key.position.anchor, key.position.x, key.position.y) - frame:Tag(TextElement, key.text) + -- frame:Tag(TextElement, key.text) if not key.enabled then element.TextElements[i]:Hide() end end diff --git a/Modules/UnitFrames/Elements/Health.lua b/Modules/UnitFrames/Elements/Health.lua index 08909f4c..2903e473 100644 --- a/Modules/UnitFrames/Elements/Health.lua +++ b/Modules/UnitFrames/Elements/Health.lua @@ -125,8 +125,7 @@ local function Update(frame, settings) element.bg:SetTexture(UF:FindStatusBarTexture(DB.texture)) element.bg:SetVertexColor(unpack(DB.bg.color or { 1, 1, 1, 0.2 })) - element.TextElements = {} - for i, TextElement in pairs(element.TextElements) do + for i, TextElement in pairs(element.TextElements or {}) do local key = DB.text[i] TextElement:SetJustifyH(key.SetJustifyH) TextElement:SetJustifyV(key.SetJustifyV) diff --git a/Modules/UnitFrames/Elements/Power.lua b/Modules/UnitFrames/Elements/Power.lua index 4c2b681d..c1e2fc7e 100644 --- a/Modules/UnitFrames/Elements/Power.lua +++ b/Modules/UnitFrames/Elements/Power.lua @@ -52,8 +52,7 @@ local function Update(frame, settings) element.bg:SetTexture(UF:FindStatusBarTexture(DB.texture)) element.bg:SetVertexColor(unpack(DB.bg.color or { 1, 1, 1, 0.2 })) - element.TextElements = {} - for i, TextElement in pairs(element.TextElements) do + for i, TextElement in pairs(element.TextElements or {}) do local key = DB.text[i] TextElement:SetJustifyH(key.SetJustifyH) TextElement:SetJustifyV(key.SetJustifyV) diff --git a/Modules/UnitFrames/Framework.lua b/Modules/UnitFrames/Framework.lua index 31336352..2837427f 100644 --- a/Modules/UnitFrames/Framework.lua +++ b/Modules/UnitFrames/Framework.lua @@ -124,7 +124,7 @@ function UF:OnInitialize() profile = { Style = 'War', UserSettings = { - ['**'] = { ['**'] = { ['**'] = { ['**'] = { ['**'] = { ['**'] = {} } } } } }, + ['**'] = { ['**'] = { ['**'] = { ['**'] = { ['**'] = { ['**'] = { ['**'] = { ['**'] = {} } } } } } } }, }, }, } diff --git a/Themes/Fel/Style.lua b/Themes/Fel/Style.lua index 06bd5554..d8cc2e42 100644 --- a/Themes/Fel/Style.lua +++ b/Themes/Fel/Style.lua @@ -18,10 +18,11 @@ local function Options() order = 0.1, desc = L['Is it getting hot in here?'], get = function(info) - return not SUI.DB.Styles.Fel.Minimap.engulfed + return not (SUI.DB.Styles.Fel and SUI.DB.Styles.Fel.Minimap and SUI.DB.Styles.Fel.Minimap.engulfed) end, set = function(info, val) - print(val) + if not SUI.DB.Styles.Fel then SUI.DB.Styles.Fel = {} end + if not SUI.DB.Styles.Fel.Minimap then SUI.DB.Styles.Fel.Minimap = {} end SUI.DB.Styles.Fel.Minimap.engulfed = not val or false module:MiniMap() end, @@ -165,7 +166,7 @@ end function module:MiniMap() local enfulfed = { texture = 'Interface\\AddOns\\SpartanUI\\Themes\\Fel\\Images\\Minimap-Engulfed', - size = { 220, 220 }, + size = { 250, 250 }, position = 'CENTER,Minimap,CENTER,5,23', } local calmed = { @@ -174,10 +175,13 @@ function module:MiniMap() position = 'CENTER,Minimap,CENTER,3,-1', } + if not SUI.DB.Styles.Fel then SUI.DB.Styles.Fel = {} end + if not SUI.DB.Styles.Fel.Minimap then SUI.DB.Styles.Fel.Minimap = {} end + if SUI.DB.Styles.Fel.Minimap.engulfed then - SUI.DB.Styles.Fel.Minimap.BG = SUI:MergeData(SUI.DB.Styles.Fel.Minimap.BG, enfulfed, true) + SUI.DB.Styles.Fel.Minimap.BG = SUI:MergeData(SUI.DB.Styles.Fel.Minimap.BG or {}, enfulfed, true) else - SUI.DB.Styles.Fel.Minimap.BG = SUI:MergeData(SUI.DB.Styles.Fel.Minimap.BG, calmed, true) + SUI.DB.Styles.Fel.Minimap.BG = SUI:MergeData(SUI.DB.Styles.Fel.Minimap.BG or {}, calmed, true) end SUI:GetModule('Module_Minimap'):update(true) end