mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Add spell icons to action bar from SpellIcon.dbc
Load spell icons via Spell.dbc field 133 (SpellIconID) -> SpellIcon.dbc (icon path) -> BLP texture from Interface\Icons\. Icons are cached as GL textures and rendered with ImageButton, with cooldown text overlaid on the icon. Falls back to truncated spell name text for missing icons.
This commit is contained in:
parent
394e91cd9e
commit
a09bea5e1e
2 changed files with 156 additions and 31 deletions
|
|
@ -7,11 +7,14 @@
|
|||
#include "ui/inventory_screen.hpp"
|
||||
#include "ui/quest_log_screen.hpp"
|
||||
#include "ui/spellbook_screen.hpp"
|
||||
#include <GL/glew.h>
|
||||
#include <imgui.h>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace wowee { namespace ui {
|
||||
namespace wowee {
|
||||
namespace pipeline { class AssetManager; }
|
||||
namespace ui {
|
||||
|
||||
/**
|
||||
* In-game screen UI
|
||||
|
|
@ -152,6 +155,16 @@ private:
|
|||
bool actionSpellDbAttempted = false;
|
||||
bool actionSpellDbLoaded = false;
|
||||
std::unordered_map<uint32_t, std::string> actionSpellNames;
|
||||
|
||||
// Spell icon cache: spellId -> GL texture ID
|
||||
std::unordered_map<uint32_t, GLuint> spellIconCache_;
|
||||
// SpellIconID -> icon path (from SpellIcon.dbc)
|
||||
std::unordered_map<uint32_t, std::string> spellIconPaths_;
|
||||
// SpellID -> SpellIconID (from Spell.dbc field 133)
|
||||
std::unordered_map<uint32_t, uint32_t> spellIconIds_;
|
||||
bool spellIconDbLoaded_ = false;
|
||||
GLuint getSpellIcon(uint32_t spellId, pipeline::AssetManager* am);
|
||||
};
|
||||
|
||||
}} // namespace wowee::ui
|
||||
} // namespace ui
|
||||
} // namespace wowee
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue