From a2df2ff5962eff02e91cc353981542e39e2bdb2b Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 20 Mar 2026 08:32:07 -0700 Subject: [PATCH] feat: show insufficient-power tint on macro action bar buttons The insufficient-power indicator only applied to SPELL-type slots. Macro buttons like /cast Fireball never showed the power tint when the player was out of mana. Now resolves the macro's primary spell and checks its power cost against the player's current power, giving the same visual feedback as regular spell buttons. --- src/ui/game_screen.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 7ead77a6..b33148b7 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -8772,13 +8772,18 @@ void GameScreen::renderActionBar(game::GameHandler& gameHandler) { } } - // Insufficient-power check: orange tint when player doesn't have enough power to cast. - // Only applies to SPELL slots with a known power cost and when not already on cooldown. + // Insufficient-power check: tint when player doesn't have enough power to cast. + // Applies to SPELL and MACRO slots with a known power cost. bool insufficientPower = false; - if (!slot.isEmpty() && slot.type == game::ActionBarSlot::SPELL && slot.id != 0 - && !onCooldown) { + { + uint32_t powerCheckSpellId = 0; + if (slot.type == game::ActionBarSlot::SPELL && slot.id != 0) + powerCheckSpellId = slot.id; + else if (slot.type == game::ActionBarSlot::MACRO && slot.id != 0) + powerCheckSpellId = resolveMacroPrimarySpellId(slot.id, gameHandler); uint32_t spellCost = 0, spellPowerType = 0; - spellbookScreen.getSpellPowerInfo(slot.id, assetMgr, spellCost, spellPowerType); + if (powerCheckSpellId != 0 && !onCooldown) + spellbookScreen.getSpellPowerInfo(powerCheckSpellId, assetMgr, spellCost, spellPowerType); if (spellCost > 0) { auto playerEnt = gameHandler.getEntityManager().getEntity(gameHandler.getPlayerGuid()); if (playerEnt && (playerEnt->getType() == game::ObjectType::PLAYER ||