mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-25 00:20:16 +00:00
feat: add out-of-range tint to action bar spell slots
Ranged spell icons dim to a red tint when the current target is farther than the spell's max range (read from SpellRange.dbc via spellbook data). Melee/self spells (max range ≤ 5 yd or unknown) are excluded. The spell tooltip also shows "Out of range" in red when applicable. Adds SpellbookScreen::getSpellMaxRange() as a public accessor so game_screen can query DBC range data without duplicating DBC loading.
This commit is contained in:
parent
bc5a7867a9
commit
8081a43d85
3 changed files with 39 additions and 0 deletions
|
|
@ -203,6 +203,15 @@ std::string SpellbookScreen::lookupSpellName(uint32_t spellId, pipeline::AssetMa
|
|||
return {};
|
||||
}
|
||||
|
||||
uint32_t SpellbookScreen::getSpellMaxRange(uint32_t spellId, pipeline::AssetManager* assetManager) {
|
||||
if (!dbcLoadAttempted) {
|
||||
loadSpellDBC(assetManager);
|
||||
}
|
||||
auto it = spellData.find(spellId);
|
||||
if (it != spellData.end()) return it->second.rangeIndex;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SpellbookScreen::loadSpellIconDBC(pipeline::AssetManager* assetManager) {
|
||||
if (iconDbLoaded) return;
|
||||
iconDbLoaded = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue