Repository navigation
Fix(Damage Meters): show the pet's name on pet spells in the breakdown - #3589
Merged
Merged
Conversation
## What does this PR do? Fixes pet spells in the spell breakdown showing only the spell name, so a pet's attacks looked like the player's own ([bug EllesmereGaming#463](https://ellesmereui.com/bugs/463/damage-meter-doesn-t-show-pet-s-name)). Cause: each breakdown spell carries the pet's name in `creatureName`, but the breakdown window and the hover preview only used it when the spell had no name, which is almost never the case for pet abilities. Fix: new `SpellEntryLabel` helper in `EUI_DamageMeters_Format.lua`, used by both the breakdown window (`EUI_DamageMeters_Window.lua`) and the hover preview (`EUI_DamageMeters_Tooltip.lua`). When `creatureName` is set, the row reads "Spell (Pet)" through Blizzard's own `DAMAGE_METER_SPELL_ENTRY_CREATURE` string, so it is already localized. Known limit: `creatureName` is secret in combat and an empty secret cannot be told from a filled one, so during combat rows keep the plain spell name; the pet suffix appears once combat ends. Cost: one string check per breakdown row on refresh, no new events or frames. ## How was it tested? Client: Forever - Fought with a pet out, opened the breakdown for the player: pet spells read "Spell (Pet Name)", the player's own spells are unchanged. - Hover preview on the player row shows the same labels. - Confirmed by the reporter. Guardrails and the locale-key check pass. ## Checklist - [x] New settings default **OFF** (no behavior change without opt-in) - N/A: no new settings, bug fix - [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 - N/A: only EUI's own bars are touched - [x] Tested in-game on live; no version gates or pre-Midnight APIs added
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes pet spells in the spell breakdown showing only the spell name, so a pet's attacks looked like the player's own (bug #463).
Cause: each breakdown spell carries the pet's name in
creatureName, but the breakdown window and the hover preview only used it when the spell had no name, which is almost never the case for pet abilities.Fix: new
SpellEntryLabelhelper inEUI_DamageMeters_Format.lua, used by both the breakdown window (EUI_DamageMeters_Window.lua) and the hover preview (EUI_DamageMeters_Tooltip.lua). WhencreatureNameis set, the row reads "Spell (Pet)" through Blizzard's ownDAMAGE_METER_SPELL_ENTRY_CREATUREstring, so it is already localized.Known limit:
creatureNameis secret in combat and an empty secret cannot be told from a filled one, so during combat rows keep the plain spell name; the pet suffix appears once combat ends.Cost: one string check per breakdown row on refresh, no new events or frames.
How was it tested?
Client: Forever
Guardrails and the locale-key check pass.
Checklist
HookScript/hooksecurefunconly, neverSetScripton Blizzard frames - N/A: only EUI's own bars are touched