Skip to content

Commit

Permalink
Bug fixes #490
Browse files Browse the repository at this point in the history
  • Loading branch information
Wutname1 committed Aug 16, 2024
1 parent b431a36 commit 223e4a4
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 2 additions & 3 deletions Modules/UnitFrames/Elements/Castbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Modules/UnitFrames/Elements/Health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions Modules/UnitFrames/Elements/Power.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion Modules/UnitFrames/Framework.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function UF:OnInitialize()
profile = {
Style = 'War',
UserSettings = {
['**'] = { ['**'] = { ['**'] = { ['**'] = { ['**'] = { ['**'] = {} } } } } },
['**'] = { ['**'] = { ['**'] = { ['**'] = { ['**'] = { ['**'] = { ['**'] = { ['**'] = {} } } } } } } },
},
},
}
Expand Down
14 changes: 9 additions & 5 deletions Themes/Fel/Style.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 = {
Expand All @@ -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

0 comments on commit 223e4a4

Please sign in to comment.