Skip to content

Fix(Cooldown Manager): save FocusKick interrupt spell per class - #3432

Open
svart2521 wants to merge 1 commit into
EllesmereGaming:mainfrom
svart2521:bug#367
Open

svart2521 wants to merge 1 commit into
EllesmereGaming:mainfrom
svart2521:bug#367

Conversation

@svart2521

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the FocusKick "Interrupt Spell" setting resetting to None when switching between classes on the same profile, which also stopped the focus cast sound from playing (bug #367).

Cause: the pick was one value on the profile's FocusKick bar data, shared by every class using that profile. Picking Pummel on a Warrior replaced Disrupt on a Demon Hunter; back on the Demon Hunter the stored spell was not castable, so the dropdown showed None and the cast sound had no interrupt to check.

Fix:

  • ns.GetFocusKickPick / ns.SetFocusKickPick (EUI_CDM_FocusKick.lua) store the pick per class in focusKickInterruptByClass (spell id, "any" for Any Cast, or 0 for None). The cast sound, its arming check and the options dropdown all read and write through them.
  • Retail healer specs without a kick (all healers except Restoration Shaman) get their own slot, so they never inherit the class's kick. They can still pick Any Cast or None. The spec list is the existing FOCUS reminder table, moved into a shared ns.IsNoKickHealerSpec() that the reminder now uses too. WoW Forever has no specs, so there it is always the plain class.
  • A class with no saved pick falls back to the old profile-wide value, still validated against the spellbook, so the class that set it last keeps working with no re-pick. Nothing is written on login.

Cost: none added; the lookups run only on the options dropdown, the proxy refresh and a tracked unit's cast.

How was it tested?

Client: Retail

  • Reporter: Disrupt on a Demon Hunter and Pummel on a Warrior on the same profile, each keeps its own pick and the cast sound plays on both, across multiple relogs and client restarts.
  • Characters with nothing set log in without errors and keep the old fallback.
  • Guardrails and the locale-key check pass.

Checklist

  • New settings default OFF (no behavior change without opt-in) - N/A: no new settings
  • Zero cost while disabled: no events registered, no polling, no hooks doing work, no tickers; nothing built beyond an inert event frame or combat queue
  • Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations)
  • No writes onto Blizzard-owned frames (weak-table pattern used); HookScript/hooksecurefunc only, never SetScript on Blizzard frames
  • Tested in-game on live; no version gates or pre-Midnight APIs added

## What does this PR do?

Fixes the FocusKick "Interrupt Spell" setting resetting to None when switching between classes on the same profile, which also stopped the focus cast sound from playing ([bug EllesmereGaming#367](https://ellesmereui.com/bugs/367/focuskick-spell-setting-not-saved-between-classes)).

Cause: the pick was one value on the profile's FocusKick bar data, shared by every class using that profile. Picking Pummel on a Warrior replaced Disrupt on a Demon Hunter; back on the Demon Hunter the stored spell was not castable, so the dropdown showed None and the cast sound had no interrupt to check.

Fix:
- `ns.GetFocusKickPick` / `ns.SetFocusKickPick` (`EUI_CDM_FocusKick.lua`) store the pick per class in `focusKickInterruptByClass` (spell id, `"any"` for Any Cast, or `0` for None). The cast sound, its arming check and the options dropdown all read and write through them.
- Retail healer specs without a kick (all healers except Restoration Shaman) get their own slot, so they never inherit the class's kick. They can still pick Any Cast or None. The spec list is the existing FOCUS reminder table, moved into a shared `ns.IsNoKickHealerSpec()` that the reminder now uses too. WoW Forever has no specs, so there it is always the plain class.
- A class with no saved pick falls back to the old profile-wide value, still validated against the spellbook, so the class that set it last keeps working with no re-pick. Nothing is written on login.

Cost: none added; the lookups run only on the options dropdown, the proxy refresh and a tracked unit's cast.

## How was it tested?

Client: Retail

- Reporter: Disrupt on a Demon Hunter and Pummel on a Warrior on the same profile, each keeps its own pick and the cast sound plays on both, across multiple relogs and client restarts.
- Characters with nothing set log in without errors and keep the old fallback.
- Guardrails and the locale-key check pass.

## Checklist

- [x] New settings default **OFF** (no behavior change without opt-in) - N/A: no new settings
- [x] Zero cost while disabled: no events registered, no polling, no hooks doing work, no tickers; nothing built beyond an inert event frame or combat queue
- [x] Cheap while enabled: event-driven (no polling, no timer-based logic, no per-frame allocations)
- [x] No writes onto Blizzard-owned frames (weak-table pattern used); `HookScript`/`hooksecurefunc` only, never `SetScript` on Blizzard frames
- [x] Tested in-game on live; no version gates or pre-Midnight APIs added
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant