From e4421867891abb5319d45e1c1caf19099c836a99 Mon Sep 17 00:00:00 2001 From: cloudbells Date: Thu, 4 Apr 2024 20:11:21 +0200 Subject: [PATCH] Add Sunken Temple to SoD Make minor changes to UI, remove 60 raids from SoD for the moment --- AutoLoggerClassic_Vanilla.toc | 2 +- Instances.lua | 8 +++----- Interface/Main.lua | 14 ++++++-------- Libs/CloudUI-1.0/Widgets/Dropdown.lua | 2 +- Util.lua | 2 +- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/AutoLoggerClassic_Vanilla.toc b/AutoLoggerClassic_Vanilla.toc index ebf3574..446d499 100644 --- a/AutoLoggerClassic_Vanilla.toc +++ b/AutoLoggerClassic_Vanilla.toc @@ -1,4 +1,4 @@ -## Interface: 11500 +## Interface: 11502 ## Title: AutoLoggerClassic ## Notes: Automatically triggers combat logging on and off in raids. ## Author: cloudbells diff --git a/Instances.lua b/Instances.lua index e905174..8d108a3 100644 --- a/Instances.lua +++ b/Instances.lua @@ -1,6 +1,8 @@ local _, ns = ... -if ns:IsClassic() then +if ns:IsSoD() then + ns.RAIDS = {[48] = "Blackfathom Deeps", [90] = "Gnomeregan", [109] = "Sunken Temple"} +elseif ns:IsClassic() then ns.RAIDS = { [509] = "AQ20", [531] = "AQ40", @@ -10,10 +12,6 @@ if ns:IsClassic() then [249] = "Onyxia's Lair", [309] = "Zul'Gurub", } - if ns:IsSoD() then - ns.RAIDS[48] = "Blackfathom Deeps" - ns.RAIDS[90] = "Gnomeregan" - end elseif ns:IsTBC() then ns.RAIDS = { [509] = "AQ20", diff --git a/Interface/Main.lua b/Interface/Main.lua index 7c86b21..aa9f3da 100644 --- a/Interface/Main.lua +++ b/Interface/Main.lua @@ -112,12 +112,10 @@ function ns:InitMainFrame() mainFrame:HookScript("OnShow", MainFrame_OnShow) tinsert(UISpecialFrames, "AutoLoggerClassicFrame") - if ns:IsClassic() then - if ns:IsSoD() then - mainFrame:SetSize(556, 112) - else - mainFrame:SetSize(540, 112) - end + if ns:IsSoD() then + mainFrame:SetSize(552, 72) + elseif ns:IsClassic() then + mainFrame:SetSize(540, 112) elseif ns:IsWOTLK() or ns:IsTBC() then mainFrame:SetSize(630, 472) end @@ -135,7 +133,7 @@ function ns:InitMainFrame() -- Title text. local title = titleFrame:CreateFontString(nil, "BACKGROUND", fontInstance:GetName()) title:SetText("AutoLoggerClassic") - title:SetPoint("LEFT", 4, 0) + title:SetPoint("LEFT", 2, 0) titleFrame.title = title -- Close button. @@ -143,7 +141,7 @@ function ns:InitMainFrame() CUI:ApplyTemplate(closeButton, CUI.templates.HighlightFrameTemplate) CUI:ApplyTemplate(closeButton, CUI.templates.PushableFrameTemplate) CUI:ApplyTemplate(closeButton, CUI.templates.BorderedFrameTemplate) - local size = titleFrame:GetHeight() - 1 + local size = titleFrame:GetHeight() - 6 closeButton:SetSize(size, size) local texture = closeButton:CreateTexture(nil, "ARTWORK") texture:SetTexture("Interface/Addons/AutoLoggerClassic/Media/CloseButton") diff --git a/Libs/CloudUI-1.0/Widgets/Dropdown.lua b/Libs/CloudUI-1.0/Widgets/Dropdown.lua index 750e14f..fa0d62b 100644 --- a/Libs/CloudUI-1.0/Widgets/Dropdown.lua +++ b/Libs/CloudUI-1.0/Widgets/Dropdown.lua @@ -200,7 +200,7 @@ end -- Sets the given frame's value at the given index. local function SetValueAt(self, index, value) assert(index and type(index) == "number" and index > 0, "SetValueAt: 'index' needs to be a non-negative number") - assert(text, "SetValueAt: 'value' can't be nil") + assert(value, "SetValueAt: 'value' can't be nil") if self.values[index] then self.values[index] = value end diff --git a/Util.lua b/Util.lua index 22d9571..a7e8994 100644 --- a/Util.lua +++ b/Util.lua @@ -17,5 +17,5 @@ end -- Returns true if the game version is Season of Dicovery. function ns:IsSoD() - return C_Seasons.GetActiveSeason() == Enum.SeasonID.Placeholder + return Enum.SeasonID.SeasonOfDiscovery and C_Seasons.GetActiveSeason() == Enum.SeasonID.SeasonOfDiscovery end