From af16ab1c0c5b7508a682a335aac1d0b57f570361 Mon Sep 17 00:00:00 2001 From: Torsten Brendgen Date: Thu, 16 Apr 2026 11:11:12 +0200 Subject: [PATCH] feat: Remove unused options and clean up code in RaidTimeline and MapOverlay modules --- Locales/deDE.lua | 2 - Locales/enUS.lua | 2 - Modules/MapOverlay/MapOverlay.lua | 3 - Modules/RaidTimeline/RaidTimelineOptions.lua | 58 ++++++++++++-------- 4 files changed, 35 insertions(+), 30 deletions(-) diff --git a/Locales/deDE.lua b/Locales/deDE.lua index 51b7f20..9062b0c 100644 --- a/Locales/deDE.lua +++ b/Locales/deDE.lua @@ -248,7 +248,6 @@ L["OPT_RT_ASSIGNMENT_LEAD_TIME"] = "Vorlaufzeit fuer Zuweisung" L["OPT_RT_ASSIGNMENT_LEAD_TIME_DESC"] = "Wie viele Sekunden vor dem geplanten Einsatz der zugewiesene Spieler ausgewaehlt werden soll." L["OPT_RT_ALERT_HEADER"] = "Hinweisfenster" L["OPT_RT_UNLOCK"] = "Hinweisfenster entsperren" -L["OPT_RT_PREVIEW"] = "Vorschau anzeigen" L["OPT_RT_ALERT_COLOR"] = "Textfarbe" L["OPT_RT_ALERT_PREVIEW"] = "Gelassenheit in 5" L["OPT_RT_DESC"] = "Lege hier Encounter-Timelines an und oeffne fuer die visuelle Planung den interaktiven Ace3-Timeline-Editor." @@ -313,7 +312,6 @@ L["OPT_RT_INVALID_SPELL"] = "HMGT: ungueltige Spell-ID" L["OPT_RT_TIMELINE_VIEWPORT"] = "Timeline-Fenster" L["OPT_RT_TIMELINE_EMPTY_WINDOW"] = "Im aktuellen Zeitfenster sind keine Cooldowns." L["OPT_RT_TIMELINE_EDITOR"] = "Interaktive Timeline" -L["OPT_RT_OPEN_EDITOR"] = "Timeline oeffnen" L["OPT_RT_START_TEST"] = "Timeline-Test starten" L["OPT_RT_STOP_TEST"] = "Test stoppen" L["OPT_RT_TEST_HINT"] = "Laesst die Encounter-Timeline ausserhalb des Kampfes ablaufen, damit du Zuweisungen, Whisper und Debug-Ausgaben pruefen kannst." diff --git a/Locales/enUS.lua b/Locales/enUS.lua index c333550..422735d 100644 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -246,7 +246,6 @@ L["OPT_RT_ASSIGNMENT_LEAD_TIME"] = "Assignment lead time" L["OPT_RT_ASSIGNMENT_LEAD_TIME_DESC"] = "How many seconds before the planned use the assigned player should be selected." L["OPT_RT_ALERT_HEADER"] = "Alert frame" L["OPT_RT_UNLOCK"] = "Unlock alert frame" -L["OPT_RT_PREVIEW"] = "Preview alert" L["OPT_RT_ALERT_COLOR"] = "Text colour" L["OPT_RT_ALERT_PREVIEW"] = "Tranquility in 5" L["OPT_RT_DESC"] = "Create encounter timelines here and open the interactive Ace3 timeline editor for visual planning." @@ -311,7 +310,6 @@ L["OPT_RT_INVALID_SPELL"] = "HMGT: invalid spell ID" L["OPT_RT_TIMELINE_VIEWPORT"] = "Timeline window" L["OPT_RT_TIMELINE_EMPTY_WINDOW"] = "No cooldowns in the current window." L["OPT_RT_TIMELINE_EDITOR"] = "Interactive Timeline" -L["OPT_RT_OPEN_EDITOR"] = "Open timeline" L["OPT_RT_START_TEST"] = "Start timeline test" L["OPT_RT_STOP_TEST"] = "Stop test" L["OPT_RT_TEST_HINT"] = "Runs the encounter timeline outside of combat so you can verify assignments, whispers and debug output." diff --git a/Modules/MapOverlay/MapOverlay.lua b/Modules/MapOverlay/MapOverlay.lua index 56e1cee..a9f48c4 100644 --- a/Modules/MapOverlay/MapOverlay.lua +++ b/Modules/MapOverlay/MapOverlay.lua @@ -881,9 +881,6 @@ function WorldMapPinMixin:OnLoad() if self.SetScalingLimits then self:SetScalingLimits(1, 1.0, 1.2) end - if self.SetPassThroughButtons then - self:SetPassThroughButtons("") - end end function WorldMapPinMixin:OnAcquired(poi, settings, owner) diff --git a/Modules/RaidTimeline/RaidTimelineOptions.lua b/Modules/RaidTimeline/RaidTimelineOptions.lua index 64cebfd..7a351b5 100644 --- a/Modules/RaidTimeline/RaidTimelineOptions.lua +++ b/Modules/RaidTimeline/RaidTimelineOptions.lua @@ -8,6 +8,7 @@ if not HMGT_Config or not HMGT_Config.RegisterOptionsProvider then return end local L = LibStub("AceLocale-3.0"):GetLocale(ADDON_NAME, true) or {} local AceConfigRegistry = LibStub("AceConfigRegistry-3.0") +local AceConfigDialog = LibStub("AceConfigDialog-3.0", true) local LSM = LibStub("LibSharedMedia-3.0", true) local FONT_OUTLINE_VALUES = { @@ -43,6 +44,15 @@ local function Notify(rebuild) AceConfigRegistry:NotifyChange(ADDON_NAME) end +local function SelectRaidTimelineGeneral() + if not AceConfigDialog or type(AceConfigDialog.SelectGroup) ~= "function" then + return + end + pcall(function() + AceConfigDialog:SelectGroup(ADDON_NAME, "modules", "raidTimeline", "general") + end) +end + local function GetDrafts() HMGT._raidTimelineDraft = HMGT._raidTimelineDraft or { addEncounterId = "", @@ -523,13 +533,9 @@ local function BuildEncounterDetailGroup(encounterId) diffOrder = diffOrder + 0.01 end - args.openTimelineEditor = { - type = "execute", order = 7, width = "full", name = L["OPT_RT_OPEN_EDITOR"] or "Open timeline", - func = function() if RT.OpenTimelineEditor then RT:OpenTimelineEditor(encounterId) end end, - } args.runTest = { type = "execute", - order = 7.5, + order = 7, width = "full", name = function() if RT:IsTestRunning(encounterId) then @@ -549,19 +555,19 @@ local function BuildEncounterDetailGroup(encounterId) } args.testHint = { type = "description", - order = 7.6, + order = 7.1, width = "full", name = L["OPT_RT_TEST_HINT"] or "Runs the encounter timeline outside of combat so you can verify assignments, whispers and debug output.", } - args.editorHint = { - type = "description", order = 8, width = "full", - name = L["OPT_RT_TIMELINE_HINT"] or "Click the bar to add a cooldown. Drag markers horizontally to change the time. Mousewheel scrolls, Ctrl+Mousewheel zooms.", - } args.encounterDelete = { - type = "execute", order = 9, width = "full", name = DELETE or "Delete", + type = "execute", order = 8, width = "full", name = DELETE or "Delete", disabled = function() return not RT:IsLocalEditor() end, confirm = function() return string.format(L["OPT_RT_DELETE_ENCOUNTER_CONFIRM"] or "Delete raid timeline for encounter %d?", tonumber(encounterId) or 0) end, - func = function() RT:RemoveEncounter(encounterId); Notify(true) end, + func = function() + RT:RemoveEncounter(encounterId) + Notify(true) + SelectRaidTimelineGeneral() + end, } args.entryBreak = { type = "description", order = 10, width = "full", name = " " } @@ -569,7 +575,14 @@ local function BuildEncounterDetailGroup(encounterId) args[key] = value end - return { type = "group", name = GetBossTreeLabel(encounterId), args = args } + return { + type = "group", + name = GetBossTreeLabel(encounterId), + hidden = function() + return RT:GetEncounter(encounterId) == nil + end, + args = args, + } end local function BuildRaidTreeArgs() @@ -679,34 +692,33 @@ function RT:GetOptionsGroup() set = function(_, val) RT:GetSettings().unlocked = val and true or false RT:ApplyAlertStyle() - if val then RT:ShowPreview() end + if val then + RT:ShowPreview() + else + RT:HideAlert() + end end, }, - preview = { - type = "toggle", order = 5, width = "double", name = L["OPT_RT_PREVIEW"] or "Preview alert", - get = function() return RT.previewAlertActive == true end, - set = function(_, val) if val then RT:ShowPreview() else RT:HideAlert() end end, - }, alertFont = { - type = "select", order = 6, width = 1.4, name = L["OPT_FONT"] or "Typeface", + type = "select", order = 5, width = 1.4, name = L["OPT_FONT"] or "Typeface", dialogControl = "LSM30_Font", values = AceGUIWidgetLSMlists and AceGUIWidgetLSMlists.font or (LSM and LSM:HashTable("font")) or {}, get = function() return RT:GetSettings().alertFont or "Friz Quadrata TT" end, set = function(_, val) RT:GetSettings().alertFont = val; RT:ApplyAlertStyle() end, }, alertFontSize = { - type = "range", order = 7, min = 10, max = 72, step = 1, width = 1.0, name = L["OPT_FONT_SIZE"] or "Font size", + type = "range", order = 6, min = 10, max = 72, step = 1, width = 1.0, name = L["OPT_FONT_SIZE"] or "Font size", get = function() return tonumber(RT:GetSettings().alertFontSize) or 30 end, set = function(_, val) RT:GetSettings().alertFontSize = math.floor((tonumber(val) or 30) + 0.5); RT:ApplyAlertStyle() end, }, alertFontOutline = { - type = "select", order = 8, width = 1.0, name = L["OPT_FONT_OUTLINE"] or "Font outline", + type = "select", order = 7, width = 1.0, name = L["OPT_FONT_OUTLINE"] or "Font outline", values = FONT_OUTLINE_VALUES, get = function() return RT:GetSettings().alertFontOutline or "OUTLINE" end, set = function(_, val) RT:GetSettings().alertFontOutline = val; RT:ApplyAlertStyle() end, }, alertColor = { - type = "color", order = 9, width = 0.8, name = L["OPT_RT_ALERT_COLOR"] or "Text colour", hasAlpha = true, + type = "color", order = 8, width = 0.8, name = L["OPT_RT_ALERT_COLOR"] or "Text colour", hasAlpha = true, get = function() local color = RT:GetSettings().alertColor or {} return color.r or 1, color.g or 0.82, color.b or 0.15, color.a or 1