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.
This commit is contained in:
Kelsi 2026-03-20 08:32:07 -07:00
parent 1d53c35ed7
commit a2df2ff596

View file

@ -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 ||