feat: add insufficient-power tint to action bar spell slots

Spell icons now render with a purple desaturated tint when the player
lacks enough mana/rage/energy/runic power to cast them. Power cost and
type are read from Spell.dbc via the spellbook's DBC cache. The spell
tooltip also shows "Not enough power" in purple when applicable.

Priority: cooldown > GCD > out-of-range > insufficient-power so states
don't conflict. Adds SpellbookScreen::getSpellPowerInfo() as a public
DBC accessor.
This commit is contained in:
Kelsi 2026-03-12 06:01:42 -07:00
parent 8081a43d85
commit 39634f442b
3 changed files with 49 additions and 4 deletions

View file

@ -212,6 +212,20 @@ uint32_t SpellbookScreen::getSpellMaxRange(uint32_t spellId, pipeline::AssetMana
return 0;
}
void SpellbookScreen::getSpellPowerInfo(uint32_t spellId, pipeline::AssetManager* assetManager,
uint32_t& outCost, uint32_t& outPowerType) {
outCost = 0;
outPowerType = 0;
if (!dbcLoadAttempted) {
loadSpellDBC(assetManager);
}
auto it = spellData.find(spellId);
if (it != spellData.end()) {
outCost = it->second.manaCost;
outPowerType = it->second.powerType;
}
}
void SpellbookScreen::loadSpellIconDBC(pipeline::AssetManager* assetManager) {
if (iconDbLoaded) return;
iconDbLoaded = true;