Failed cast alert - #1204
Open
realCronox wants to merge 2 commits into
Open
Conversation
In its current state it plays a selectable sound file when a cast fails due to LoS, positioning, player moving while attempting a cast that can't be used on the move and similar scenarios. Feature can be set to alert only in combat, is disabled by default and costs nothing when disabled. Reuses the functionality already in EUI to manage sounds etc.
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?
Adds an optional Failed Cast Alert to the Quality of Life module: a configurable
sound when an action fails for a positional or targeting reason (no target,
out of range, not facing the target, line of sight, moving while casting).
New section on the QoL page with three settings, off by default:
Matching is deliberately not done on the numeric
errorType, which shiftsbetween patches. Two tiers instead:
GetGameMessageInfo(errorType)name is already unambiguousare matched by that name -
ERR_GENERIC_NO_TARGET,ERR_SPELL_OUT_OF_RANGE,ERR_BADATTACKFACING,ERR_NO_ATTACK_TARGET;ERR_SPELL_FAILED_Sis a generic carrier for many reasons, so for that onethe message is compared against a set built from the localized
SPELL_FAILED_UNIT_NOT_INFRONT,SPELL_FAILED_LINE_OF_SIGHTandSPELL_FAILED_MOVINGglobals.That makes it both locale-correct and patch-stable. It is a whitelist, so a
failure reason Blizzard adds later is silent rather than making noise at users
who never asked for it. Every global is nil-guarded, and the set is built
lazily on first enable.
Cost when disabled is zero: no frame is created and no event registered until
the feature is switched on. Disabling calls
UnregisterAllEvents.Sound playback reuses the existing
EllesmereUI._groupDeathSoundPaths/_Names/_Ordertables andEllesmereUI._PlayLSMSound, rather thancalling the new
EllesmereUI.BuildAlertSoundTables(). Reasoning: insideEllesmereUIQoL those tables are already built once and merged with
SharedMedia once at login, and
EllesmereUIQoL_MovementAlert.lua- thenearest precedent, same module, same shape, its own sound picker - reads
them the same way. Building a second set would add a second SharedMedia
merge pass within one module for no functional gain. Happy to switch it to
the builder if you would rather every consumer be uniform.
Files: two new (
EllesmereUIQoL_FailedCastAlert.lua,EUI_QoL_FailedCastAlert_Options.lua), the.tocentries, and two smallhunks in
EUI_QoL_Options.lua(the section call site and theonResetdelegate). Purely additive, no deletions.
The second commit regenerates
Locales/_keys.txt. That drift predates thisbranch - the feature adds no
EllesmereUI.L()literals - but thelocale-check workflow fails any PR touching Lua while it is stale.
How was it tested?
Live retail 8.7.5 and the 12.1 PTR client, both with the module loaded from
this branch.
well as retail, so 12.1 renames nothing the whitelist depends on. No
IS_121branch is needed./reloadwhile enabled(setting and behaviour persist);
/reloadwhile disabled (no frame, noevents, nothing in BugSack).
Screenshots
Checklist
HookScript/hooksecurefunconly, neverSetScripton Blizzard frames