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:
Kelsi 2026-03-12 05:57:45 -07:00
parent bc5a7867a9
commit 8081a43d85
3 changed files with 39 additions and 0 deletions

View file

@ -54,6 +54,10 @@ public:
uint32_t getDragSpellId() const { return dragSpellId_; }
void consumeDragSpell() { draggingSpell_ = false; dragSpellId_ = 0; dragSpellIconTex_ = VK_NULL_HANDLE; }
/// Returns the max range in yards for a spell (0 if self-cast, unknown, or melee).
/// Triggers DBC load if needed. Used by the action bar for out-of-range tinting.
uint32_t getSpellMaxRange(uint32_t spellId, pipeline::AssetManager* assetManager);
/// Returns a WoW spell link string if the user shift-clicked a spell, then clears it.
std::string getAndClearPendingChatLink() {
std::string out = std::move(pendingChatSpellLink_);