-------------------------------------------------------------------------------
-- BloodlustHeroism.lua
-- Multi-spell tracker group fed by SpellData_Buffs.lua: every spell tagged
-- "Bloodlust" in the curated table appears in this group's buff list. The
-- six modern bloodlust-effect buffs (Bloodlust, Heroism, Time Warp, Primal
-- Rage, Fury of the Aspects, Harrier's Cry) have distinct names, so each gets
-- its OWN checkbox row (no perClass merge). No bundled voice clips.
-- SpellData is the single source of truth — add/remove spells THERE.
-------------------------------------------------------------------------------
local addonName, ns = ...

local SPELLS = ns.SpellData.BuildSpellList("Bloodlust")

local allIDs = {}
local defaultSpells = {}
for _, sp in ipairs(SPELLS) do
    defaultSpells[sp.key] = true
    for _, id in ipairs(sp.ids) do
        allIDs[#allIDs + 1] = id
    end
end

ns.RegisterTracker("bloodlust", {
    dbPrefix      = "bl_",
    displaySpell  = 80353, -- Time Warp icon for the icon/bar previews
    buffSpellIDs  = allIDs,
    spellList     = SPELLS,
    -- Only one bloodlust buff is ever on the player at a time, so the display
    -- is singular — Tracker Type labels stay Icon/Bar (see IsSingleActiveCfg).
    singleActive  = true,
    hasVoiceClips = false, -- no bundled callouts; Sound element uses custom sounds
    frameSuffix   = "Bloodlust",
    label         = "Bloodlust/Heroism",
    defaultPos    = { "CENTER", "CENTER", 0, 0 },

    -- 12.1 preset (see Innervate for the sparse-table rationale). Groups
    -- default to an Icon(s) tracker with NO stacks text. Seeded on first
    -- enable.
    preset = {
        { style = "icon", iconShowStackText = false },
    },

    defaults = {
        enabled        = false,
        barCircleColor = { 0.9, 0.3, 0.2, 1.0 }, -- bloodlust red
        spells         = defaultSpells,
    },
})
