2026-02-04 11:31:08 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "game/game_handler.hpp"
|
2026-02-22 03:32:08 -08:00
|
|
|
#include <vulkan/vulkan.h>
|
2026-02-04 11:31:08 -08:00
|
|
|
#include <imgui.h>
|
|
|
|
|
#include <string>
|
2026-02-06 16:04:25 -08:00
|
|
|
#include <vector>
|
2026-02-06 20:40:17 -08:00
|
|
|
#include <map>
|
2026-02-04 11:31:08 -08:00
|
|
|
#include <unordered_map>
|
|
|
|
|
|
|
|
|
|
namespace wowee {
|
|
|
|
|
|
|
|
|
|
namespace pipeline { class AssetManager; }
|
|
|
|
|
|
|
|
|
|
namespace ui {
|
|
|
|
|
|
2026-02-06 16:04:25 -08:00
|
|
|
struct SpellInfo {
|
|
|
|
|
uint32_t spellId = 0;
|
|
|
|
|
std::string name;
|
|
|
|
|
std::string rank;
|
Revamp talent and spellbook UIs with proper visuals and functionality
Talent screen:
- Remove all debug text and per-frame LOG_INFO spam
- Show class name in window title (e.g. "Warrior Talents")
- Display point distribution in header (0/31/20) and per-tab counts
- Highlighted active spec button with styled spec switcher
- Load and render tree background textures from TalentTab.dbc
- Draw prerequisite arrows with arrowheads (green=met, gray=unmet)
- Fix rank display (was showing rank+1, now correct 1-indexed values)
- Rank counter with dark background pill for readability
- Hover glow effect, rounded corners, centered grid layout
- Wider window (680x600) for 4-column WoW talent grid
Spellbook:
- Add search/filter bar for finding spells by name
- Add spell descriptions from Spell.dbc tooltip field
- Rich tooltips with name, rank, passive indicator, cooldown, description
- Visual icon borders: yellow=passive, red=cooldown, default=active
- Cooldown overlay on icon with countdown number
- Hover highlight on spell rows
- Tab counts update to reflect search filter results
- Rounded corners on icons and hover states
- Extracted renderSpellTooltip helper for consistent tooltip rendering
2026-02-25 14:55:40 -08:00
|
|
|
std::string description; // Tooltip/description text from Spell.dbc
|
|
|
|
|
uint32_t iconId = 0; // SpellIconID
|
|
|
|
|
uint32_t attributes = 0; // Spell attributes (field 4)
|
|
|
|
|
uint32_t castTimeMs = 0; // Cast time in ms (0 = instant)
|
|
|
|
|
uint32_t manaCost = 0; // Mana cost
|
|
|
|
|
uint32_t powerType = 0; // 0=mana, 1=rage, 2=focus, 3=energy
|
|
|
|
|
uint32_t rangeIndex = 0; // Range index from SpellRange.dbc
|
2026-03-10 19:22:48 -07:00
|
|
|
uint32_t schoolMask = 0; // School bitmask (1=phys,2=holy,4=fire,8=nature,16=frost,32=shadow,64=arcane)
|
2026-02-06 16:04:25 -08:00
|
|
|
bool isPassive() const { return (attributes & 0x40) != 0; }
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-06 20:40:17 -08:00
|
|
|
struct SpellTabInfo {
|
|
|
|
|
std::string name;
|
|
|
|
|
std::vector<const SpellInfo*> spells;
|
|
|
|
|
};
|
2026-02-06 16:04:25 -08:00
|
|
|
|
2026-02-04 11:31:08 -08:00
|
|
|
class SpellbookScreen {
|
|
|
|
|
public:
|
|
|
|
|
void render(game::GameHandler& gameHandler, pipeline::AssetManager* assetManager);
|
|
|
|
|
bool isOpen() const { return open; }
|
|
|
|
|
void toggle() { open = !open; }
|
|
|
|
|
void setOpen(bool o) { open = o; }
|
|
|
|
|
|
2026-02-17 15:41:55 -08:00
|
|
|
// Spell name lookup — triggers DBC load if needed, used by action bar tooltips
|
|
|
|
|
std::string lookupSpellName(uint32_t spellId, pipeline::AssetManager* assetManager);
|
2026-03-10 19:31:46 -07:00
|
|
|
|
|
|
|
|
// Rich tooltip — renders a full spell tooltip (inside an already-open BeginTooltip block).
|
|
|
|
|
// Triggers DBC load if needed. Returns true if spell data was found.
|
|
|
|
|
bool renderSpellInfoTooltip(uint32_t spellId, game::GameHandler& gameHandler,
|
|
|
|
|
pipeline::AssetManager* assetManager);
|
2026-02-17 15:41:55 -08:00
|
|
|
|
2026-02-06 20:27:01 -08:00
|
|
|
// Drag-and-drop state for action bar assignment
|
|
|
|
|
bool isDraggingSpell() const { return draggingSpell_; }
|
|
|
|
|
uint32_t getDragSpellId() const { return dragSpellId_; }
|
2026-02-22 03:32:08 -08:00
|
|
|
void consumeDragSpell() { draggingSpell_ = false; dragSpellId_ = 0; dragSpellIconTex_ = VK_NULL_HANDLE; }
|
2026-02-06 20:27:01 -08:00
|
|
|
|
2026-02-04 11:31:08 -08:00
|
|
|
private:
|
|
|
|
|
bool open = false;
|
|
|
|
|
bool pKeyWasDown = false;
|
|
|
|
|
|
2026-02-06 16:04:25 -08:00
|
|
|
// Spell data (loaded from Spell.dbc)
|
2026-02-04 11:31:08 -08:00
|
|
|
bool dbcLoaded = false;
|
|
|
|
|
bool dbcLoadAttempted = false;
|
2026-02-06 16:04:25 -08:00
|
|
|
std::unordered_map<uint32_t, SpellInfo> spellData;
|
|
|
|
|
|
|
|
|
|
// Icon data (loaded from SpellIcon.dbc)
|
|
|
|
|
bool iconDbLoaded = false;
|
|
|
|
|
std::unordered_map<uint32_t, std::string> spellIconPaths; // SpellIconID -> path
|
Revamp talent and spellbook UIs with proper visuals and functionality
Talent screen:
- Remove all debug text and per-frame LOG_INFO spam
- Show class name in window title (e.g. "Warrior Talents")
- Display point distribution in header (0/31/20) and per-tab counts
- Highlighted active spec button with styled spec switcher
- Load and render tree background textures from TalentTab.dbc
- Draw prerequisite arrows with arrowheads (green=met, gray=unmet)
- Fix rank display (was showing rank+1, now correct 1-indexed values)
- Rank counter with dark background pill for readability
- Hover glow effect, rounded corners, centered grid layout
- Wider window (680x600) for 4-column WoW talent grid
Spellbook:
- Add search/filter bar for finding spells by name
- Add spell descriptions from Spell.dbc tooltip field
- Rich tooltips with name, rank, passive indicator, cooldown, description
- Visual icon borders: yellow=passive, red=cooldown, default=active
- Cooldown overlay on icon with countdown number
- Hover highlight on spell rows
- Tab counts update to reflect search filter results
- Rounded corners on icons and hover states
- Extracted renderSpellTooltip helper for consistent tooltip rendering
2026-02-25 14:55:40 -08:00
|
|
|
std::unordered_map<uint32_t, VkDescriptorSet> spellIconCache; // SpellIconID -> texture
|
2026-02-06 16:04:25 -08:00
|
|
|
|
2026-02-06 20:40:17 -08:00
|
|
|
// Skill line data (loaded from SkillLine.dbc + SkillLineAbility.dbc)
|
|
|
|
|
bool skillLineDbLoaded = false;
|
Revamp talent and spellbook UIs with proper visuals and functionality
Talent screen:
- Remove all debug text and per-frame LOG_INFO spam
- Show class name in window title (e.g. "Warrior Talents")
- Display point distribution in header (0/31/20) and per-tab counts
- Highlighted active spec button with styled spec switcher
- Load and render tree background textures from TalentTab.dbc
- Draw prerequisite arrows with arrowheads (green=met, gray=unmet)
- Fix rank display (was showing rank+1, now correct 1-indexed values)
- Rank counter with dark background pill for readability
- Hover glow effect, rounded corners, centered grid layout
- Wider window (680x600) for 4-column WoW talent grid
Spellbook:
- Add search/filter bar for finding spells by name
- Add spell descriptions from Spell.dbc tooltip field
- Rich tooltips with name, rank, passive indicator, cooldown, description
- Visual icon borders: yellow=passive, red=cooldown, default=active
- Cooldown overlay on icon with countdown number
- Hover highlight on spell rows
- Tab counts update to reflect search filter results
- Rounded corners on icons and hover states
- Extracted renderSpellTooltip helper for consistent tooltip rendering
2026-02-25 14:55:40 -08:00
|
|
|
std::unordered_map<uint32_t, std::string> skillLineNames;
|
|
|
|
|
std::unordered_map<uint32_t, uint32_t> skillLineCategories;
|
2026-02-26 00:59:07 -08:00
|
|
|
std::unordered_multimap<uint32_t, uint32_t> spellToSkillLine;
|
2026-02-06 16:04:25 -08:00
|
|
|
|
Revamp talent and spellbook UIs with proper visuals and functionality
Talent screen:
- Remove all debug text and per-frame LOG_INFO spam
- Show class name in window title (e.g. "Warrior Talents")
- Display point distribution in header (0/31/20) and per-tab counts
- Highlighted active spec button with styled spec switcher
- Load and render tree background textures from TalentTab.dbc
- Draw prerequisite arrows with arrowheads (green=met, gray=unmet)
- Fix rank display (was showing rank+1, now correct 1-indexed values)
- Rank counter with dark background pill for readability
- Hover glow effect, rounded corners, centered grid layout
- Wider window (680x600) for 4-column WoW talent grid
Spellbook:
- Add search/filter bar for finding spells by name
- Add spell descriptions from Spell.dbc tooltip field
- Rich tooltips with name, rank, passive indicator, cooldown, description
- Visual icon borders: yellow=passive, red=cooldown, default=active
- Cooldown overlay on icon with countdown number
- Hover highlight on spell rows
- Tab counts update to reflect search filter results
- Rounded corners on icons and hover states
- Extracted renderSpellTooltip helper for consistent tooltip rendering
2026-02-25 14:55:40 -08:00
|
|
|
// Categorized spell tabs
|
2026-02-06 20:40:17 -08:00
|
|
|
std::vector<SpellTabInfo> spellTabs;
|
|
|
|
|
size_t lastKnownSpellCount = 0;
|
2026-02-26 01:21:51 -08:00
|
|
|
bool categorizedWithSkillLines = false;
|
2026-02-04 11:31:08 -08:00
|
|
|
|
Revamp talent and spellbook UIs with proper visuals and functionality
Talent screen:
- Remove all debug text and per-frame LOG_INFO spam
- Show class name in window title (e.g. "Warrior Talents")
- Display point distribution in header (0/31/20) and per-tab counts
- Highlighted active spec button with styled spec switcher
- Load and render tree background textures from TalentTab.dbc
- Draw prerequisite arrows with arrowheads (green=met, gray=unmet)
- Fix rank display (was showing rank+1, now correct 1-indexed values)
- Rank counter with dark background pill for readability
- Hover glow effect, rounded corners, centered grid layout
- Wider window (680x600) for 4-column WoW talent grid
Spellbook:
- Add search/filter bar for finding spells by name
- Add spell descriptions from Spell.dbc tooltip field
- Rich tooltips with name, rank, passive indicator, cooldown, description
- Visual icon borders: yellow=passive, red=cooldown, default=active
- Cooldown overlay on icon with countdown number
- Hover highlight on spell rows
- Tab counts update to reflect search filter results
- Rounded corners on icons and hover states
- Extracted renderSpellTooltip helper for consistent tooltip rendering
2026-02-25 14:55:40 -08:00
|
|
|
// Search filter
|
|
|
|
|
char searchFilter_[128] = "";
|
|
|
|
|
|
2026-02-06 20:27:01 -08:00
|
|
|
// Drag-and-drop from spellbook to action bar
|
|
|
|
|
bool draggingSpell_ = false;
|
|
|
|
|
uint32_t dragSpellId_ = 0;
|
2026-02-22 03:32:08 -08:00
|
|
|
VkDescriptorSet dragSpellIconTex_ = VK_NULL_HANDLE;
|
2026-02-04 11:31:08 -08:00
|
|
|
|
|
|
|
|
void loadSpellDBC(pipeline::AssetManager* assetManager);
|
2026-02-06 16:04:25 -08:00
|
|
|
void loadSpellIconDBC(pipeline::AssetManager* assetManager);
|
2026-02-06 20:40:17 -08:00
|
|
|
void loadSkillLineDBCs(pipeline::AssetManager* assetManager);
|
2026-02-17 15:13:54 -08:00
|
|
|
void categorizeSpells(const std::unordered_set<uint32_t>& knownSpells);
|
2026-02-22 03:32:08 -08:00
|
|
|
VkDescriptorSet getSpellIcon(uint32_t iconId, pipeline::AssetManager* assetManager);
|
2026-02-06 16:04:25 -08:00
|
|
|
const SpellInfo* getSpellInfo(uint32_t spellId) const;
|
Revamp talent and spellbook UIs with proper visuals and functionality
Talent screen:
- Remove all debug text and per-frame LOG_INFO spam
- Show class name in window title (e.g. "Warrior Talents")
- Display point distribution in header (0/31/20) and per-tab counts
- Highlighted active spec button with styled spec switcher
- Load and render tree background textures from TalentTab.dbc
- Draw prerequisite arrows with arrowheads (green=met, gray=unmet)
- Fix rank display (was showing rank+1, now correct 1-indexed values)
- Rank counter with dark background pill for readability
- Hover glow effect, rounded corners, centered grid layout
- Wider window (680x600) for 4-column WoW talent grid
Spellbook:
- Add search/filter bar for finding spells by name
- Add spell descriptions from Spell.dbc tooltip field
- Rich tooltips with name, rank, passive indicator, cooldown, description
- Visual icon borders: yellow=passive, red=cooldown, default=active
- Cooldown overlay on icon with countdown number
- Hover highlight on spell rows
- Tab counts update to reflect search filter results
- Rounded corners on icons and hover states
- Extracted renderSpellTooltip helper for consistent tooltip rendering
2026-02-25 14:55:40 -08:00
|
|
|
|
|
|
|
|
// Tooltip rendering helper
|
|
|
|
|
void renderSpellTooltip(const SpellInfo* info, game::GameHandler& gameHandler);
|
2026-02-04 11:31:08 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace ui
|
|
|
|
|
} // namespace wowee
|