delted old debug window, added new version notice window, added new features to tracker module, updated locales, and updated main addon files.

This commit is contained in:
Torsten Brendgen
2026-04-25 17:33:32 +02:00
parent f1d2a761e4
commit 02e062d66b
12 changed files with 401 additions and 681 deletions

View File

@@ -142,13 +142,26 @@ local function IsPartyAttachMode(tracker)
end
local function IsGroupTracker(tracker)
return type(tracker) == "table" and tracker.trackerType == "group"
return HMGT.IsGroupTrackerConfig and HMGT:IsGroupTrackerConfig(tracker) or (type(tracker) == "table" and tracker.trackerType == "group")
end
local TRACKER_TYPE_VALUES = {
normal = L["OPT_TRACKER_TYPE_NORMAL"] or "Normal tracker",
group = L["OPT_TRACKER_TYPE_GROUP"] or "Group-based tracker",
}
local function GetTrackerTypeValues()
return HMGT.GetTrackerTypeOptions and HMGT:GetTrackerTypeOptions() or {
normal = L["OPT_TRACKER_TYPE_NORMAL"] or "Normal tracker",
group = L["OPT_TRACKER_TYPE_GROUP"] or "Group-based tracker",
}
end
local function GetPresetLabel(presetKey)
local definition = HMGT.GetTrackerPresetDefinition and HMGT:GetTrackerPresetDefinition(presetKey) or nil
if not definition then
return tostring(presetKey or (L["OPT_TRACKER"] or "Tracker"))
end
if type(definition.defaultName) == "function" then
return tostring(definition.defaultName(L))
end
return tostring(definition.defaultName or definition.moduleName or presetKey)
end
local function GetTrackerVisibilitySummary(tracker)
local parts = {}
@@ -180,7 +193,7 @@ local function GetTrackerSummaryText(tracker)
local display = tracker.showBar and (L["OPT_DISPLAY_BAR"] or "Progress bars") or (L["OPT_DISPLAY_ICON"] or "Icons")
return table.concat({
string.format("|cffffd100%s|r: %s", L["OPT_TRACKER_TYPE"] or "Tracker type", TRACKER_TYPE_VALUES[tracker.trackerType or "normal"] or (L["OPT_TRACKER_TYPE_NORMAL"] or "Normal tracker")),
string.format("|cffffd100%s|r: %s", L["OPT_TRACKER_TYPE"] or "Tracker type", GetTrackerTypeValues()[tracker.trackerType or "normal"] or (L["OPT_TRACKER_TYPE_NORMAL"] or "Normal tracker")),
string.format("|cffffd100%s|r: %s", L["OPT_TRACKER_CATEGORIES"] or "Categories", GetTrackerCategoriesSummary(tracker)),
string.format("|cffffd100%s|r: %s", L["OPT_STATUS_MODE"] or "Mode", modeLabel),
string.format("|cffffd100%s|r: %s", L["OPT_STATUS_DISPLAY"] or "Display", display),
@@ -814,7 +827,7 @@ local function BuildGlobalSpellBrowserArgs()
end
local function BuildTrackerOverviewArgs()
return {
local args = {
description = {
type = "description",
order = 1,
@@ -833,22 +846,36 @@ local function BuildTrackerOverviewArgs()
return string.format("%s\n\n%s (%d): %s", body, L["OPT_TRACKERS"] or "Tracker Bars", #trackers, table.concat(names, ", "))
end,
},
addTracker = {
}
local definitions = HMGT.GetTrackerPresetDefinitions and HMGT:GetTrackerPresetDefinitions() or {}
local presetKeys = {}
for presetKey in pairs(definitions) do
presetKeys[#presetKeys + 1] = presetKey
end
table.sort(presetKeys, function(a, b)
return GetPresetLabel(a) < GetPresetLabel(b)
end)
for index, presetKey in ipairs(presetKeys) do
args["addPreset_" .. presetKey] = {
type = "execute",
order = 2,
order = 2 + index,
width = "full",
name = L["OPT_ADD_TRACKER"] or "Add tracker",
name = function()
return string.format("%s: %s", L["OPT_ADD_TRACKER"] or "Add tracker", GetPresetLabel(presetKey))
end,
func = function()
local nextId = HMGT:GetNextTrackerId()
local tracker = HMGT:CreateTrackerConfig(nextId, {
name = string.format("%s %d", L["OPT_TRACKER"] or "Tracker", nextId),
})
local tracker = HMGT:BuildTrackerConfigFromPreset(presetKey, nextId)
HMGT.db.profile.trackers = HMGT.db.profile.trackers or {}
HMGT.db.profile.trackers[#HMGT.db.profile.trackers + 1] = tracker
TriggerTrackerUpdate(true)
end,
},
}
}
end
return args
end
local function BuildTrackerGroup(trackerId, order)
@@ -1008,7 +1035,7 @@ local function BuildTrackerGroup(trackerId, order)
width = "full",
name = L["OPT_TRACKER_TYPE"] or "Tracker type",
desc = L["OPT_TRACKER_TYPE_DESC"] or "Choose whether this tracker uses one shared frame or separate frames per group member.",
values = TRACKER_TYPE_VALUES,
values = GetTrackerTypeValues,
get = function()
local tracker = s()
return (tracker and tracker.trackerType) or "normal"