Windfury!: turn on combat text events, hide Blizzard's text
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
75cff180cb
commit
ee9509e52d
3 changed files with 51 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ local sounds = {}
|
|||
function PlaySound(id, channel) sounds[#sounds + 1] = id; assert(channel == "Master") end
|
||||
local fctOn = false
|
||||
C_CVar = { GetCVarBool = function(n) assert(n == "enableFloatingCombatText"); return fctOn end }
|
||||
C_CVar.SetCVar = function(n, v) assert(n == "enableFloatingCombatText" and v == "1"); fctOn = true end
|
||||
local secrets = {}
|
||||
function issecretvalue(v) return secrets[v] == true end
|
||||
local spell
|
||||
|
|
@ -54,7 +55,7 @@ dofile(arg[1])
|
|||
|
||||
local overlay = WindfuryOverlay
|
||||
local events
|
||||
for _, fr in ipairs(frames) do if fr.events.ADDON_LOADED then events = fr end end
|
||||
for _, fr in ipairs(frames) do if fr.events.ADDON_LOADED and not events then events = fr end end
|
||||
assert(overlay and events)
|
||||
local function fire(...) events.scripts.OnEvent(events, ...) end
|
||||
local function run(sec)
|
||||
|
|
@ -138,6 +139,19 @@ assert(not printed[#printed]:find("Scrolling Combat Text"))
|
|||
|
||||
-- Debug log: casts and auras by name; a "Windfury Attack" cast fires the show.
|
||||
C_Spell = { GetSpellName = function(id) return ({ [8517] = "Windfury Attack", [133] = "Fireball" })[id] end }
|
||||
-- Login turns Scrolling Combat Text on and keeps Blizzard's text hidden.
|
||||
fctOn = false
|
||||
local fctFrame
|
||||
for _, fr in ipairs(frames) do if fr.events.PLAYER_LOGIN and fr.events.ADDON_LOADED then fctFrame = fr end end
|
||||
fctFrame.scripts.OnEvent(fctFrame, "PLAYER_LOGIN")
|
||||
assert(fctOn and WindfuryDB.hideBlizzardText)
|
||||
CombatText = CreateFrame("Frame")
|
||||
function CombatText:HookScript(k, fn) local o = self[k]; self.onShow = fn end
|
||||
fctFrame.scripts.OnEvent(fctFrame, "ADDON_LOADED", "Blizzard_CombatText")
|
||||
assert(not CombatText.shown)
|
||||
CombatText:Show(); CombatText.onShow(CombatText)
|
||||
assert(not CombatText.shown)
|
||||
|
||||
local dbg
|
||||
for _, fr in ipairs(frames) do if fr.events.PLAYER_LOGIN then dbg = fr end end
|
||||
dbg.scripts.OnEvent(dbg, "PLAYER_LOGIN")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue