Refactor code structure for improved readability and maintainability

This commit is contained in:
Torsten Brendgen
2026-04-28 23:09:04 +02:00
parent cf78405148
commit f97b7556cd
16 changed files with 1841 additions and 9 deletions

View File

@@ -40,6 +40,7 @@ local MSG_SYNC_REQUEST = "SRQ"
local MSG_SYNC_RESPONSE = "SRS" -- SRS|version|protocol|class|spec|talentHash|knownSpellIds|cd1:t1:d1;...
local MSG_RAID_TIMELINE = "RTL" -- RTL|encounterId|time|spellId|leadTime|alertText
local MSG_RAID_TIMELINE_TEST = "RTS" -- RTS|encounterId|difficultyId|serverStartTime|duration
local MSG_LURA_RUNES = "LUR" -- LUR|slot1,slot2,slot3,slot4,slot5
local MSG_RELIABLE = "REL" -- REL|messageId|innerPayload
local MSG_ACK = "ACK" -- ACK|messageId
local COMM_PREFIX = "HMGT"
@@ -85,6 +86,7 @@ HMGT.MSG_RELIABLE = MSG_RELIABLE
HMGT.MSG_ACK = MSG_ACK
HMGT.MSG_RAID_TIMELINE = MSG_RAID_TIMELINE
HMGT.MSG_RAID_TIMELINE_TEST = MSG_RAID_TIMELINE_TEST
HMGT.MSG_LURA_RUNES = MSG_LURA_RUNES
-- ── Standardwerte ─────────────────────────────────────────────
local defaults = {
@@ -119,6 +121,34 @@ local defaults = {
alertColor = { r = 1, g = 0.82, b = 0.15, a = 1 },
encounters = {},
},
encounterAlerts = {
enabled = false,
luraRunes = {
enabled = false,
unlocked = false,
posX = 0,
posY = -120,
iconSize = 44,
backgroundAlpha = 0.14,
showLabels = true,
actionBar = {
shown = false,
autoShow = true,
unlocked = false,
posX = 0,
posY = -300,
iconSize = 42,
iconSpacing = 8,
orientation = "horizontal",
border = {
enabled = false,
width = 2,
color = { r = 1, g = 0.82, b = 0.1, a = 0.9 },
},
},
slots = {},
},
},
notes = {
enabled = true,
mainText = "",
@@ -196,6 +226,7 @@ local DEBUG_SCOPE_LABELS = {
PowerSpend = "Power Spend",
RaidTimeline = "Raid Timeline",
Notes = "Notes",
EncounterAlerts = "Encounter Alerts",
}
local DEBUG_LEVELS = {
error = 1,
@@ -1458,6 +1489,67 @@ local function NormalizeRaidTimelineSettings(settings)
settings.encounters = normalizedEncounters
end
local VALID_LURA_RUNE_KEYS = {
circle = true,
cross = true,
diamond = true,
t = true,
triangle = true,
}
local function NormalizeLuraRuneKey(value)
local key = tostring(value or ""):lower()
if VALID_LURA_RUNE_KEYS[key] then
return key
end
return ""
end
local function NormalizeLuraRunesSettings(settings)
if type(settings) ~= "table" then return end
settings.enabled = settings.enabled == true
settings.unlocked = settings.unlocked == true
settings.posX = math.floor(NormalizeLayoutValue(settings.posX, -1200, 1200, 0) + 0.5)
settings.posY = math.floor(NormalizeLayoutValue(settings.posY, -900, 900, -120) + 0.5)
settings.iconSize = math.floor(NormalizeLayoutValue(settings.iconSize, 28, 80, 44) + 0.5)
settings.backgroundAlpha = NormalizeLayoutValue(settings.backgroundAlpha, 0, 0.8, 0.14)
settings.showLabels = settings.showLabels ~= false
settings.actionBar = type(settings.actionBar) == "table" and settings.actionBar or {}
settings.actionBar.shown = settings.actionBar.shown == true
settings.actionBar.autoShow = settings.actionBar.autoShow ~= false
settings.actionBar.unlocked = settings.actionBar.unlocked == true
settings.actionBar.posX = math.floor(NormalizeLayoutValue(settings.actionBar.posX, -1200, 1200, 0) + 0.5)
settings.actionBar.posY = math.floor(NormalizeLayoutValue(settings.actionBar.posY, -900, 900, -300) + 0.5)
settings.actionBar.iconSize = math.floor(NormalizeLayoutValue(settings.actionBar.iconSize, 28, 80, 42) + 0.5)
settings.actionBar.iconSpacing = math.floor(NormalizeLayoutValue(settings.actionBar.iconSpacing, 0, 80, 8) + 0.5)
settings.actionBar.orientation = tostring(settings.actionBar.orientation or "horizontal")
if settings.actionBar.orientation ~= "vertical" then
settings.actionBar.orientation = "horizontal"
end
settings.actionBar.border = type(settings.actionBar.border) == "table" and settings.actionBar.border or {}
settings.actionBar.border.enabled = settings.actionBar.border.enabled == true
settings.actionBar.border.width = math.floor(NormalizeLayoutValue(settings.actionBar.border.width, 1, 12, 2) + 0.5)
settings.actionBar.border.color = type(settings.actionBar.border.color) == "table" and settings.actionBar.border.color or {}
settings.actionBar.border.color.r = NormalizeLayoutValue(settings.actionBar.border.color.r, 0, 1, 1)
settings.actionBar.border.color.g = NormalizeLayoutValue(settings.actionBar.border.color.g, 0, 1, 0.82)
settings.actionBar.border.color.b = NormalizeLayoutValue(settings.actionBar.border.color.b, 0, 1, 0.1)
settings.actionBar.border.color.a = NormalizeLayoutValue(settings.actionBar.border.color.a, 0, 1, 0.9)
local slots = type(settings.slots) == "table" and settings.slots or {}
local normalizedSlots = {}
for slot = 1, 5 do
normalizedSlots[slot] = NormalizeLuraRuneKey(slots[slot])
end
settings.slots = normalizedSlots
end
local function NormalizeEncounterAlertsSettings(settings)
if type(settings) ~= "table" then return end
settings.enabled = settings.enabled == true
settings.luraRunes = type(settings.luraRunes) == "table" and settings.luraRunes or {}
NormalizeLuraRunesSettings(settings.luraRunes)
end
local function NormalizeNotesSettings(settings)
if type(settings) ~= "table" then return end
settings.enabled = settings.enabled ~= false
@@ -1762,6 +1854,8 @@ function HMGT:MigrateProfileSettings()
p.personalAuras = nil
p.raidTimeline = p.raidTimeline or {}
NormalizeRaidTimelineSettings(p.raidTimeline)
p.encounterAlerts = p.encounterAlerts or {}
NormalizeEncounterAlertsSettings(p.encounterAlerts)
p.notes = p.notes or {}
NormalizeNotesSettings(p.notes)
p.minimap = p.minimap or {}
@@ -3029,6 +3123,7 @@ function HMGT:GetHealthStatusLines()
AuraExpiry = self.AuraExpiry ~= nil,
MapOverlay = self.MapOverlay ~= nil,
RaidTimeline = self.RaidTimeline ~= nil,
EncounterAlerts = self.EncounterAlerts ~= nil,
Notes = self.Notes ~= nil,
}
local moduleParts = {}
@@ -3108,6 +3203,12 @@ function HMGT:SlashCommand(input)
else
self:OpenConfig()
end
elseif input:find("^lura") == 1 then
if self.EncounterAlerts and self.EncounterAlerts.HandleSlashCommand then
self.EncounterAlerts:HandleSlashCommand(input)
else
self:OpenConfig()
end
elseif input:find("^debugdump") == 1 then
local n = tonumber(input:match("^debugdump%s+(%d+)$"))
if self.DumpDevToolsLog then

View File

@@ -66,3 +66,8 @@ Modules\RaidTimeline\RaidTimelineBossAbilityData.lua
Modules\RaidTimeline\RaidTimeline.lua
Modules\RaidTimeline\RaidTimelineBigWigs.lua
Modules\RaidTimeline\RaidTimelineOptions.lua
# EncounterAlerts
Modules\EncounterAlerts\EncounterAlerts.lua
Modules\EncounterAlerts\LuraRunes.lua
Modules\EncounterAlerts\EncounterAlertsOptions.lua

View File

@@ -17,6 +17,9 @@ function HMGT_Config:RegisterOptionsProvider(id, provider)
if type(id) ~= "string" or id == "" then return false end
if type(provider) ~= "function" then return false end
self._optionProviders[id] = provider
if type(self.RebuildRootOptions) == "function" then
self:RebuildRootOptions()
end
return true
end
@@ -1933,6 +1936,7 @@ function HMGT_Config:Initialize()
"|cffffd100/hmgt|r",
"|cffffd100/hmgt debug|r",
"|cffffd100/hmgt status|r",
"|cffffd100/hmgt lura|r",
"|cffffd100/hmgt version|r",
}, "\n"),
},
@@ -2083,6 +2087,15 @@ function HMGT_Config:Initialize()
modulesGroup.args.raidTimeline = raidTimelineGroup
end
local encounterAlertsGroup = BuildNamedModuleGroup(
"encounterAlerts",
L["OPT_MODULE_ENCOUNTER_ALERTS"] or "Encounter Alerts",
50
)
if encounterAlertsGroup then
modulesGroup.args.encounterAlerts = encounterAlertsGroup
end
if next(modulesGroup.args) == nil then
return nil
end
@@ -2120,12 +2133,20 @@ function HMGT_Config:Initialize()
},
}
function HMGT_Config:RebuildRootOptions()
local modulesGroup = BuildModulesGroup()
if modulesGroup then
rootOptions.args.modules = modulesGroup
else
rootOptions.args.modules = nil
end
NormalizeExecuteButtonWidths(rootOptions)
if AceConfigRegistry and type(AceConfigRegistry.NotifyChange) == "function" then
AceConfigRegistry:NotifyChange(ADDON_NAME)
end
end
NormalizeExecuteButtonWidths(rootOptions)
HMGT_Config:RebuildRootOptions()
local aceConfig = LibStub("AceConfig-3.0")
local aceConfigDialog = LibStub("AceConfigDialog-3.0")

View File

@@ -34,7 +34,7 @@ L["VERSION_WINDOW_ASSISTANT_TAG"] = "(Assist)"
L["VERSION_WINDOW_SELF_TAG"] = "(Du)"
L["VERSION_OUTDATED_WHISPER"] = "Deine Hail Mary Guild Tools Version ist veraltet. Du hast %s, der Gruppenleiter hat %s."
L["VERSION_WINDOW_DEBUG_ONLY"] = "HMGT: /hmgt version ist nur bei aktiviertem Debugmodus verfuegbar."
L["VERSION_WINDOW_DEVTOOLS_ONLY"] = "HMGT: /hmgt version ist nur bei aktivierten Entwicklerwerkzeugen verfuegbar."
L["VERSION_WINDOW_DEVTOOLS_ONLY"] = "HMGT: /hmgt version ist nur bei aktivierter Debug-Konsole verfuegbar."
-- ── Options: general ─────────────────────────────────────────
L["OPT_GENERAL"] = "Allgemein"
@@ -75,6 +75,36 @@ L["OPT_DEVTOOLS_OPEN"] = "Debug-Konsole oeffnen"
L["OPT_DEVTOOLS_CLEAR"] = "Debug-Log leeren"
L["OPT_DEVTOOLS_SELECT_ALL"] = "Alles markieren"
L["OPT_DEVTOOLS_DISABLED"] = "HMGT: Entwicklerwerkzeuge sind nicht aktiviert."
L["OPT_MODULE_ENCOUNTER_ALERTS"] = "Encounter Alerts"
L["OPT_ENCOUNTER_ALERTS_PLACEHOLDER"] = "Encounter-spezifische Helper-Frames und Warnungen."
L["OPT_EA_LURA_TITLE"] = "L'ura Runen"
L["OPT_EA_LURA_RUNE_WINDOW"] = "Runen-Fenster"
L["OPT_EA_LURA_ENABLED"] = "L'ura Runen aktivieren"
L["OPT_EA_LURA_UNLOCK"] = "Runen-Frame entsperren"
L["OPT_EA_LURA_HINT"] = "Erste Version: nur Normal/Heroisch Layout. Tank steht unten mittig zwischen Slot 1 und 5."
L["OPT_EA_LURA_SHOW"] = "Anzeigen"
L["OPT_EA_LURA_TEST"] = "Testmuster"
L["OPT_EA_LURA_CLEAR"] = "Leeren"
L["OPT_EA_LURA_BROADCAST"] = "Sequenz senden"
L["OPT_EA_LURA_ACTIONBAR"] = "Runen-Actionbar"
L["OPT_EA_LURA_ACTIONBAR_SHOW"] = "Leiste anzeigen"
L["OPT_EA_LURA_ACTIONBAR_UNLOCK"] = "Leiste entsperren"
L["OPT_EA_LURA_ACTIONBAR_AUTO_SHOW"] = "Automatisch im Bossraum anzeigen"
L["OPT_EA_LURA_ACTIONBAR_ORIENTATION"] = "Ausrichtung"
L["OPT_EA_LURA_ACTIONBAR_HORIZONTAL"] = "Horizontal"
L["OPT_EA_LURA_ACTIONBAR_VERTICAL"] = "Vertikal"
L["OPT_EA_LURA_ACTIONBAR_HINT"] = "Klicke die Runen in beobachteter Reihenfolge. Slot 5 sendet die Sequenz automatisch. Der rote Button leert die lokale Sequenz."
L["OPT_EA_LURA_ICON_SIZE"] = "Icongroesse"
L["OPT_EA_LURA_BACKGROUND_ALPHA"] = "Hintergrund-Alpha"
L["OPT_EA_LURA_ICON_SPACING"] = "Icon-Abstand"
L["OPT_EA_LURA_BORDER_ENABLED"] = "Rahmen anzeigen"
L["OPT_EA_LURA_BORDER_WIDTH"] = "Rahmenbreite"
L["OPT_EA_LURA_BORDER_COLOR"] = "Rahmenfarbe"
L["OPT_EA_LURA_SHOW_LABELS"] = "Labels anzeigen"
L["OPT_EA_LURA_RUNE_EMPTY"] = "Leer"
L["OPT_EA_LURA_DRAG_HINT"] = "Ziehen zum Verschieben"
L["OPT_EA_LURA_BOSS"] = "Boss"
L["OPT_EA_LURA_TANK"] = "Tank"
L["DEVTOOLS_WINDOW_TITLE"] = "HMGT Entwicklerwerkzeuge"
L["DEVTOOLS_WINDOW_HINT"] = "Strukturierte Entwickler-Ereignisse fuer die aktuelle Sitzung"
L["OPT_SYNC_REMOTE_CHARGES"] = "Remote-Aufladungen synchronisieren"

View File

@@ -34,7 +34,7 @@ L["VERSION_WINDOW_ASSISTANT_TAG"] = "(Assist)"
L["VERSION_WINDOW_SELF_TAG"] = "(You)"
L["VERSION_OUTDATED_WHISPER"] = "Your Hail Mary Guild Tools version is outdated. You have %s, the group leader has %s."
L["VERSION_WINDOW_DEBUG_ONLY"] = "HMGT: /hmgt version is only available while debug mode is enabled."
L["VERSION_WINDOW_DEVTOOLS_ONLY"] = "HMGT: /hmgt version is only available while developer tools are enabled."
L["VERSION_WINDOW_DEVTOOLS_ONLY"] = "HMGT: /hmgt version is only available while the debug console is enabled."
-- ── Options: general ─────────────────────────────────────────
L["OPT_GENERAL"] = "General"
@@ -75,6 +75,36 @@ L["OPT_DEVTOOLS_OPEN"] = "Open debug console"
L["OPT_DEVTOOLS_CLEAR"] = "Clear debug log"
L["OPT_DEVTOOLS_SELECT_ALL"] = "Select all"
L["OPT_DEVTOOLS_DISABLED"] = "HMGT: developer tools are not enabled."
L["OPT_MODULE_ENCOUNTER_ALERTS"] = "Encounter Alerts"
L["OPT_ENCOUNTER_ALERTS_PLACEHOLDER"] = "Encounter-specific helper frames and alerts."
L["OPT_EA_LURA_TITLE"] = "L'ura Runes"
L["OPT_EA_LURA_RUNE_WINDOW"] = "Rune window"
L["OPT_EA_LURA_ENABLED"] = "Enable L'ura runes"
L["OPT_EA_LURA_UNLOCK"] = "Unlock rune frame"
L["OPT_EA_LURA_HINT"] = "First version: normal/heroic layout only. Tank reference is placed bottom-center between slot 1 and 5."
L["OPT_EA_LURA_SHOW"] = "Show"
L["OPT_EA_LURA_TEST"] = "Test pattern"
L["OPT_EA_LURA_CLEAR"] = "Clear"
L["OPT_EA_LURA_BROADCAST"] = "Send sequence"
L["OPT_EA_LURA_ACTIONBAR"] = "Rune action bar"
L["OPT_EA_LURA_ACTIONBAR_SHOW"] = "Show bar"
L["OPT_EA_LURA_ACTIONBAR_UNLOCK"] = "Unlock bar"
L["OPT_EA_LURA_ACTIONBAR_AUTO_SHOW"] = "Auto show in boss room"
L["OPT_EA_LURA_ACTIONBAR_ORIENTATION"] = "Orientation"
L["OPT_EA_LURA_ACTIONBAR_HORIZONTAL"] = "Horizontal"
L["OPT_EA_LURA_ACTIONBAR_VERTICAL"] = "Vertical"
L["OPT_EA_LURA_ACTIONBAR_HINT"] = "Click rune buttons in the observed order. Slot 5 sends the sequence automatically. The red button clears the local sequence."
L["OPT_EA_LURA_ICON_SIZE"] = "Icon size"
L["OPT_EA_LURA_BACKGROUND_ALPHA"] = "Background alpha"
L["OPT_EA_LURA_ICON_SPACING"] = "Icon spacing"
L["OPT_EA_LURA_BORDER_ENABLED"] = "Show border"
L["OPT_EA_LURA_BORDER_WIDTH"] = "Border width"
L["OPT_EA_LURA_BORDER_COLOR"] = "Border color"
L["OPT_EA_LURA_SHOW_LABELS"] = "Show labels"
L["OPT_EA_LURA_RUNE_EMPTY"] = "Empty"
L["OPT_EA_LURA_DRAG_HINT"] = "Drag to move"
L["OPT_EA_LURA_BOSS"] = "Boss"
L["OPT_EA_LURA_TANK"] = "Tank"
L["DEVTOOLS_WINDOW_TITLE"] = "HMGT Developer Tools"
L["DEVTOOLS_WINDOW_HINT"] = "Structured developer events for the current session"
L["OPT_SYNC_REMOTE_CHARGES"] = "Sync remote charges"

View File

@@ -0,0 +1,102 @@
local ADDON_NAME = "HailMaryGuildTools"
local HMGT = LibStub("AceAddon-3.0"):GetAddon(ADDON_NAME)
if not HMGT then return end
local L = LibStub("AceLocale-3.0"):GetLocale(ADDON_NAME, true) or {}
local EA = HMGT:NewModule("EncounterAlerts", "AceEvent-3.0")
HMGT.EncounterAlerts = EA
EA.runtimeEnabled = false
function EA:GetSettings()
local profile = HMGT.db and HMGT.db.profile
profile = profile or {}
profile.encounterAlerts = type(profile.encounterAlerts) == "table" and profile.encounterAlerts or {}
return profile.encounterAlerts
end
function EA:GetLuraRunesSettings()
local settings = self:GetSettings()
settings.luraRunes = type(settings.luraRunes) == "table" and settings.luraRunes or {}
return settings.luraRunes
end
function EA:OnEnable()
local settings = self:GetSettings()
self.runtimeEnabled = settings.enabled == true
self:RegisterEvent("PLAYER_ENTERING_WORLD", "RefreshLuraRunesContext")
self:RegisterEvent("ZONE_CHANGED", "RefreshLuraRunesContext")
self:RegisterEvent("ZONE_CHANGED_INDOORS", "RefreshLuraRunesContext")
self:RegisterEvent("ZONE_CHANGED_NEW_AREA", "RefreshLuraRunesContext")
self:RegisterEvent("GROUP_ROSTER_UPDATE", "RefreshLuraRunesContext")
self:RegisterEvent("INSTANCE_ENCOUNTER_ENGAGE_UNIT", "RefreshLuraRunesContext")
self:RegisterEvent("PLAYER_TARGET_CHANGED", "RefreshLuraRunesContext")
self:RegisterEvent("ENCOUNTER_START", "HandleLuraEncounterStart")
self:RegisterEvent("ENCOUNTER_END", "HandleLuraEncounterEnd")
self:RegisterEvent("CHAT_MSG_RAID", "HandleLuraRaidChat")
self:RegisterEvent("CHAT_MSG_RAID_LEADER", "HandleLuraRaidChat")
if self.LuraRunes and self.LuraRunes.Refresh then
self.LuraRunes:Refresh()
end
end
function EA:Enable()
local settings = self:GetSettings()
settings.enabled = true
self.runtimeEnabled = true
if self.LuraRunes and self.LuraRunes.Refresh then
self.LuraRunes:Refresh()
end
end
function EA:Disable()
local settings = self:GetSettings()
settings.enabled = false
self.runtimeEnabled = false
if self.LuraRunes and self.LuraRunes.Hide then
self.LuraRunes:Hide()
end
end
function EA:GetDisplayName()
return L["OPT_MODULE_ENCOUNTER_ALERTS"] or "Encounter Alerts"
end
function EA:RefreshLuraRunesContext(event)
if self.LuraRunes and self.LuraRunes.RefreshContext then
self.LuraRunes:RefreshContext(event)
end
end
function EA:HandleLuraEncounterStart(_, encounterId, encounterName)
if self.LuraRunes and self.LuraRunes.OnEncounterStart then
self.LuraRunes:OnEncounterStart(encounterId, encounterName)
end
end
function EA:HandleLuraEncounterEnd(_, encounterId)
if self.LuraRunes and self.LuraRunes.OnEncounterEnd then
self.LuraRunes:OnEncounterEnd(encounterId)
end
end
function EA:HandleLuraRunesComm(senderName, payload)
if self.LuraRunes and self.LuraRunes.HandleComm then
self.LuraRunes:HandleComm(senderName, payload)
end
end
function EA:HandleLuraRaidChat(event, message, senderName)
if self.LuraRunes and self.LuraRunes.HandleRaidChatMessage then
self.LuraRunes:HandleRaidChatMessage(message, senderName, event)
end
end
function EA:HandleSlashCommand(input)
if self.LuraRunes and self.LuraRunes.HandleSlashCommand then
self.LuraRunes:HandleSlashCommand(input)
else
HMGT:OpenConfig()
end
end

View File

@@ -0,0 +1,414 @@
local ADDON_NAME = "HailMaryGuildTools"
local HMGT = LibStub("AceAddon-3.0"):GetAddon(ADDON_NAME)
if not HMGT then return end
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", true)
local function NotifyOptionsChanged()
if AceConfigRegistry and type(AceConfigRegistry.NotifyChange) == "function" then
AceConfigRegistry:NotifyChange(ADDON_NAME)
end
end
local function GetSettings()
local profile = HMGT.db and HMGT.db.profile
if not profile then
return {}
end
profile.encounterAlerts = type(profile.encounterAlerts) == "table" and profile.encounterAlerts or {}
return profile.encounterAlerts
end
local function GetLuraSettings()
local settings = GetSettings()
settings.luraRunes = type(settings.luraRunes) == "table" and settings.luraRunes or {}
settings.luraRunes.slots = type(settings.luraRunes.slots) == "table" and settings.luraRunes.slots or {}
settings.luraRunes.actionBar = type(settings.luraRunes.actionBar) == "table" and settings.luraRunes.actionBar or {}
return settings.luraRunes
end
local function GetLuraActionBarSettings()
local settings = GetLuraSettings()
settings.actionBar.shown = settings.actionBar.shown == true
settings.actionBar.autoShow = settings.actionBar.autoShow ~= false
settings.actionBar.unlocked = settings.actionBar.unlocked == true
settings.actionBar.iconSize = tonumber(settings.actionBar.iconSize) or 42
settings.actionBar.iconSpacing = tonumber(settings.actionBar.iconSpacing) or 8
settings.actionBar.orientation = tostring(settings.actionBar.orientation or "horizontal")
if settings.actionBar.orientation ~= "vertical" then
settings.actionBar.orientation = "horizontal"
end
settings.actionBar.border = type(settings.actionBar.border) == "table" and settings.actionBar.border or {}
return settings.actionBar
end
local function GetLuraBorderSettings()
local actionBar = GetLuraActionBarSettings()
actionBar.border.enabled = actionBar.border.enabled == true
actionBar.border.width = tonumber(actionBar.border.width) or 2
actionBar.border.color = type(actionBar.border.color) == "table" and actionBar.border.color or {}
actionBar.border.color.r = tonumber(actionBar.border.color.r) or 1
actionBar.border.color.g = tonumber(actionBar.border.color.g) or 0.82
actionBar.border.color.b = tonumber(actionBar.border.color.b) or 0.1
actionBar.border.color.a = tonumber(actionBar.border.color.a) or 0.9
return actionBar.border
end
local function GetActionBarOrientationValues()
return {
horizontal = L["OPT_EA_LURA_ACTIONBAR_HORIZONTAL"] or "Horizontal",
vertical = L["OPT_EA_LURA_ACTIONBAR_VERTICAL"] or "Vertical",
}
end
local function GetLuraRunes()
return HMGT.EncounterAlerts and HMGT.EncounterAlerts.LuraRunes or nil
end
local function RefreshEncounterAlerts()
if HMGT.EncounterAlerts then
local settings = GetSettings()
HMGT.EncounterAlerts.runtimeEnabled = settings.enabled == true
if HMGT.EncounterAlerts.LuraRunes and HMGT.EncounterAlerts.LuraRunes.Refresh then
HMGT.EncounterAlerts.LuraRunes:Refresh()
end
end
NotifyOptionsChanged()
end
local function BuildRuneWindowOptions()
return {
type = "group",
inline = true,
order = 2,
name = L["OPT_EA_LURA_RUNE_WINDOW"] or "Rune window",
args = {
unlocked = {
type = "toggle",
order = 1,
width = "double",
name = L["OPT_EA_LURA_UNLOCK"] or "Unlock rune frame",
get = function()
return GetLuraSettings().unlocked == true
end,
set = function(_, value)
GetSettings().enabled = true
local settings = GetLuraSettings()
settings.enabled = true
settings.unlocked = value == true
RefreshEncounterAlerts()
end,
},
hint = {
type = "description",
order = 2,
width = "full",
name = L["OPT_EA_LURA_HINT"] or "First version: normal/heroic layout only. Tank reference is placed bottom-center between slot 1 and 5.",
},
show = {
type = "execute",
order = 3,
width = 0.8,
name = L["OPT_EA_LURA_SHOW"] or "Show",
func = function()
local lura = GetLuraRunes()
if lura and lura.Show then
lura:Show()
end
end,
},
test = {
type = "execute",
order = 4,
width = 0.9,
name = L["OPT_EA_LURA_TEST"] or "Test pattern",
func = function()
local lura = GetLuraRunes()
if lura and lura.Show and lura.ApplyTestPattern then
lura:Show()
lura:ApplyTestPattern()
end
end,
},
clear = {
type = "execute",
order = 5,
width = 0.8,
name = L["OPT_EA_LURA_CLEAR"] or "Clear",
func = function()
local lura = GetLuraRunes()
if lura and lura.ClearAssignments then
lura:ClearAssignments(false)
end
end,
},
broadcast = {
type = "execute",
order = 6,
width = 1.2,
name = L["OPT_EA_LURA_BROADCAST"] or "Broadcast",
disabled = function()
local lura = GetLuraRunes()
return lura and lura.CanBroadcastSequence and not lura:CanBroadcastSequence() or false
end,
func = function()
local lura = GetLuraRunes()
if lura and lura.BroadcastAssignments then
lura:BroadcastAssignments()
end
end,
},
iconSize = {
type = "range",
order = 7,
width = 1.1,
min = 28,
max = 80,
step = 1,
name = L["OPT_EA_LURA_ICON_SIZE"] or "Icon size",
get = function()
return tonumber(GetLuraSettings().iconSize) or 44
end,
set = function(_, value)
GetLuraSettings().iconSize = tonumber(value) or 44
RefreshEncounterAlerts()
end,
},
backgroundAlpha = {
type = "range",
order = 8,
width = 1.1,
min = 0,
max = 0.8,
step = 0.01,
name = L["OPT_EA_LURA_BACKGROUND_ALPHA"] or "Background alpha",
get = function()
return tonumber(GetLuraSettings().backgroundAlpha) or 0.14
end,
set = function(_, value)
GetLuraSettings().backgroundAlpha = tonumber(value) or 0.14
RefreshEncounterAlerts()
end,
},
},
}
end
local function BuildRuneActionBarOptions()
return {
type = "group",
inline = true,
order = 3,
name = L["OPT_EA_LURA_ACTIONBAR"] or "Rune action bar",
args = {
shown = {
type = "toggle",
order = 1,
width = 1.1,
name = L["OPT_EA_LURA_ACTIONBAR_SHOW"] or "Show bar",
get = function()
return GetLuraActionBarSettings().shown == true
end,
set = function(_, value)
GetSettings().enabled = true
local settings = GetLuraSettings()
settings.enabled = true
GetLuraActionBarSettings().shown = value == true
RefreshEncounterAlerts()
end,
},
unlocked = {
type = "toggle",
order = 2,
width = 1.2,
name = L["OPT_EA_LURA_ACTIONBAR_UNLOCK"] or "Unlock bar",
get = function()
return GetLuraActionBarSettings().unlocked == true
end,
set = function(_, value)
GetSettings().enabled = true
local settings = GetLuraSettings()
settings.enabled = true
local actionBar = GetLuraActionBarSettings()
actionBar.shown = true
actionBar.unlocked = value == true
RefreshEncounterAlerts()
end,
},
autoShow = {
type = "toggle",
order = 2.5,
width = 1.4,
name = L["OPT_EA_LURA_ACTIONBAR_AUTO_SHOW"] or "Auto show in boss room",
get = function()
return GetLuraActionBarSettings().autoShow == true
end,
set = function(_, value)
GetLuraActionBarSettings().autoShow = value == true
RefreshEncounterAlerts()
end,
},
orientation = {
type = "select",
order = 3,
width = 1.2,
name = L["OPT_EA_LURA_ACTIONBAR_ORIENTATION"] or "Orientation",
values = GetActionBarOrientationValues,
get = function()
return GetLuraActionBarSettings().orientation
end,
set = function(_, value)
local actionBar = GetLuraActionBarSettings()
actionBar.orientation = tostring(value or "horizontal")
RefreshEncounterAlerts()
end,
},
iconSize = {
type = "range",
order = 5,
width = 1.1,
min = 28,
max = 80,
step = 1,
name = L["OPT_EA_LURA_ICON_SIZE"] or "Icon size",
get = function()
return tonumber(GetLuraActionBarSettings().iconSize) or 42
end,
set = function(_, value)
GetLuraActionBarSettings().iconSize = tonumber(value) or 42
RefreshEncounterAlerts()
end,
},
iconSpacing = {
type = "range",
order = 6,
width = 1.1,
min = 0,
max = 80,
step = 1,
name = L["OPT_EA_LURA_ICON_SPACING"] or "Icon spacing",
get = function()
return tonumber(GetLuraActionBarSettings().iconSpacing) or 8
end,
set = function(_, value)
GetLuraActionBarSettings().iconSpacing = tonumber(value) or 8
RefreshEncounterAlerts()
end,
},
borderEnabled = {
type = "toggle",
order = 7,
width = 1.1,
name = L["OPT_EA_LURA_BORDER_ENABLED"] or "Show border",
get = function()
return GetLuraBorderSettings().enabled == true
end,
set = function(_, value)
GetLuraBorderSettings().enabled = value == true
RefreshEncounterAlerts()
end,
},
borderWidth = {
type = "range",
order = 8,
width = 1.1,
min = 1,
max = 12,
step = 1,
name = L["OPT_EA_LURA_BORDER_WIDTH"] or "Border width",
disabled = function()
return GetLuraBorderSettings().enabled ~= true
end,
get = function()
return tonumber(GetLuraBorderSettings().width) or 2
end,
set = function(_, value)
GetLuraBorderSettings().width = tonumber(value) or 2
RefreshEncounterAlerts()
end,
},
borderColor = {
type = "color",
order = 9,
width = 1.1,
hasAlpha = true,
name = L["OPT_EA_LURA_BORDER_COLOR"] or "Border color",
disabled = function()
return GetLuraBorderSettings().enabled ~= true
end,
get = function()
local color = GetLuraBorderSettings().color
return color.r or 1, color.g or 0.82, color.b or 0.1, color.a or 0.9
end,
set = function(_, r, g, b, a)
local color = GetLuraBorderSettings().color
color.r = tonumber(r) or 1
color.g = tonumber(g) or 0.82
color.b = tonumber(b) or 0.1
color.a = tonumber(a) or 0.9
RefreshEncounterAlerts()
end,
},
hint = {
type = "description",
order = 10,
width = "full",
name = L["OPT_EA_LURA_ACTIONBAR_HINT"] or "Click rune buttons in the observed order. Slot 5 sends the sequence automatically.",
},
},
}
end
HMGT_Config:RegisterOptionsProvider("encounterAlerts", function()
return {
path = "encounterAlerts",
order = 50,
group = {
type = "group",
name = L["OPT_MODULE_ENCOUNTER_ALERTS"] or "Encounter Alerts",
order = 50,
childGroups = "tab",
args = {
general = {
type = "group",
name = L["OPT_GENERAL"] or "General",
order = 1,
args = {
description = {
type = "description",
order = 1,
width = "full",
name = L["OPT_ENCOUNTER_ALERTS_PLACEHOLDER"] or "Encounter-specific helper frames and alerts.",
},
},
},
luraRunes = {
type = "group",
name = L["OPT_EA_LURA_TITLE"] or "L'ura Runes",
order = 2,
args = {
enabled = {
type = "toggle",
order = 1,
width = "double",
name = L["OPT_EA_LURA_ENABLED"] or "Enable L'ura runes",
get = function()
return GetLuraSettings().enabled == true
end,
set = function(_, value)
local enabled = value == true
GetSettings().enabled = enabled
GetLuraSettings().enabled = enabled
RefreshEncounterAlerts()
end,
},
runeWindow = BuildRuneWindowOptions(),
actionBar = BuildRuneActionBarOptions(),
},
},
},
},
}
end)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -1037,5 +1037,10 @@ function HMGT:OnCommReceived(prefix, message, distribution, sender)
tonumber(duration)
)
end
elseif msgType == HMGT.MSG_LURA_RUNES then
local payload = message:match("^%a+|(.+)$") or ""
if HMGT.EncounterAlerts and HMGT.EncounterAlerts.HandleLuraRunesComm then
HMGT.EncounterAlerts:HandleLuraRunesComm(senderName, payload)
end
end
end

View File

@@ -58,14 +58,24 @@ Provides a dedicated notes window for raid notes, personal notes, and drafts.
Toggles tracker test mode
- `/hmgt notes`
Opens the notes window
- `/hmgt lura`
Opens the L'ura rune helper
- `/hmgt lura circle|x|diamond|t|triangle`
Adds one rune to the next L'ura sequence slot; slot 5 sends the sequence for raid leader/assist
- `Encounter Alerts > L'ura Runes > Rune action bar`
Shows five clickable rune buttons plus a local clear button for building the sequence
- `/hmgt lura reset`
Clears the local L'ura sequence builder
- `/hmgt lura bar`
Toggles the L'ura rune action bar
- `/hmgt debug`
Opens the developer tools window
Opens the debug console
- `/hmgt dev`
Alias for the developer tools window
Alias for the debug console
- `/hmgt status`
Prints a compact addon health check
- `/hmgt version`
Opens the version window when developer tools are enabled
Opens the version window when the debug console is enabled
## Installation