mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-25 00:20:16 +00:00
feat: show cast-failed red flash on macro action bar buttons
The error-flash overlay (red fade on spell cast failure) only applied to SPELL-type slots. Macro buttons never flashed red when their primary spell failed to cast. Now resolves the macro's primary spell and checks the actionFlashEndTimes_ map for a matching flash, completing macro action bar parity with spell buttons across all 6 visual indicators.
This commit is contained in:
parent
a2df2ff596
commit
a5609659c7
1 changed files with 8 additions and 2 deletions
|
|
@ -8970,8 +8970,14 @@ void GameScreen::renderActionBar(game::GameHandler& gameHandler) {
|
|||
}
|
||||
|
||||
// Error-flash overlay: red fade on spell cast failure (~0.5 s).
|
||||
if (slot.type == game::ActionBarSlot::SPELL && slot.id != 0) {
|
||||
auto flashIt = actionFlashEndTimes_.find(slot.id);
|
||||
// Check both spell slots directly and macro slots via their primary spell.
|
||||
{
|
||||
uint32_t flashSpellId = 0;
|
||||
if (slot.type == game::ActionBarSlot::SPELL && slot.id != 0)
|
||||
flashSpellId = slot.id;
|
||||
else if (slot.type == game::ActionBarSlot::MACRO && slot.id != 0)
|
||||
flashSpellId = resolveMacroPrimarySpellId(slot.id, gameHandler);
|
||||
auto flashIt = (flashSpellId != 0) ? actionFlashEndTimes_.find(flashSpellId) : actionFlashEndTimes_.end();
|
||||
if (flashIt != actionFlashEndTimes_.end()) {
|
||||
float now = static_cast<float>(ImGui::GetTime());
|
||||
float remaining = flashIt->second - now;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue