mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Fix action bar and buff bar spell tooltips showing 'Spell #xxx'
The action bar's inline Spell.dbc loader had a broken field index lookup: operator[] on the layout map would silently insert 0 if 'Name' wasn't a key, causing all names to be read from field 0 (the spell ID). Also the once-only 'attempted' flag meant if assetMgr wasn't ready, it never retried. Replace the duplicated broken DBC loading in the action bar and buff bar with SpellbookScreen::lookupSpellName(), which reuses the spellbook's already-correct loading (expansion layout + WotLK fallback). Remove the now-unused actionSpellNames/actionSpellDbAttempted/actionSpellDbLoaded fields.
This commit is contained in:
parent
bd70ca17ca
commit
df0bfaea4f
4 changed files with 16 additions and 41 deletions
|
|
@ -71,6 +71,15 @@ void SpellbookScreen::loadSpellDBC(pipeline::AssetManager* assetManager) {
|
|||
dbcLoaded = !spellData.empty();
|
||||
}
|
||||
|
||||
std::string SpellbookScreen::lookupSpellName(uint32_t spellId, pipeline::AssetManager* assetManager) {
|
||||
if (!dbcLoadAttempted) {
|
||||
loadSpellDBC(assetManager);
|
||||
}
|
||||
auto it = spellData.find(spellId);
|
||||
if (it != spellData.end()) return it->second.name;
|
||||
return {};
|
||||
}
|
||||
|
||||
void SpellbookScreen::loadSpellIconDBC(pipeline::AssetManager* assetManager) {
|
||||
if (iconDbLoaded) return;
|
||||
iconDbLoaded = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue