From a5609659c77c8ddd470781615d01612befbd2673 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 20 Mar 2026 08:38:24 -0700 Subject: [PATCH] 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. --- src/ui/game_screen.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index b33148b7..a7ecbeca 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -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(ImGui::GetTime()); float remaining = flashIt->second - now;