Kelsidavis-WoWee/include/ui/talent_screen.hpp

55 lines
1.9 KiB
C++
Raw Normal View History

#pragma once
#include "game/game_handler.hpp"
#include <imgui.h>
#include <vulkan/vulkan.h>
#include <unordered_map>
#include <string>
namespace wowee {
namespace pipeline { class AssetManager; }
namespace ui {
class TalentScreen {
public:
void render(game::GameHandler& gameHandler);
bool isOpen() const { return open; }
void toggle() { open = !open; }
void setOpen(bool o) { open = o; }
private:
void renderTalentTrees(game::GameHandler& gameHandler);
void renderTalentTree(game::GameHandler& gameHandler, uint32_t tabId,
const std::string& bgFile);
void renderTalent(game::GameHandler& gameHandler,
const game::GameHandler::TalentEntry& talent,
uint32_t pointsInTree);
void loadSpellDBC(pipeline::AssetManager* assetManager);
void loadSpellIconDBC(pipeline::AssetManager* assetManager);
void loadGlyphPropertiesDBC(pipeline::AssetManager* assetManager);
void renderGlyphs(game::GameHandler& gameHandler);
VkDescriptorSet getSpellIcon(uint32_t iconId, pipeline::AssetManager* assetManager);
bool open = false;
bool nKeyWasDown = false;
// DBC caches
bool spellDbcLoaded = false;
bool iconDbcLoaded = false;
bool glyphDbcLoaded = false;
std::unordered_map<uint32_t, uint32_t> spellIconIds; // spellId -> iconId
std::unordered_map<uint32_t, std::string> spellIconPaths; // iconId -> path
std::unordered_map<uint32_t, VkDescriptorSet> spellIconCache; // iconId -> texture
std::unordered_map<uint32_t, std::string> spellTooltips; // spellId -> description
std::unordered_map<uint32_t, VkDescriptorSet> bgTextureCache_; // tabId -> bg texture
// GlyphProperties.dbc cache: glyphId -> { spellId, isMajor }
struct GlyphInfo { uint32_t spellId = 0; bool isMajor = false; };
std::unordered_map<uint32_t, GlyphInfo> glyphProperties_; // glyphId -> info
};
} // namespace ui
} // namespace wowee