Fix hair/vendor/loot bugs, revamp spellbook with tabs and icons, clean up action bar, add talent placeholder

- Fix white hair: always override M2 type-6 texture with DBC hair texture when available
- Fix vendor sell: add sellPrice to ItemDef/ItemTemplateRow, use directly instead of empty cache
- Fix empty loot: skip loot window when corpse has no items and no gold
- Revamp spellbook (P key): tabbed UI (General/Active/Passive), spell icons from SpellIcon.dbc, rank text
- Clean up action bar: only auto-populate Attack and Hearthstone, rest assigned via spellbook
- Add talent placeholder (N key): 3-tab window with level/talent point display
- Fix ffplay cleanup: non-blocking waitpid with SIGKILL fallback to prevent orphaned audio processes
- Fix pre-existing getQualityColor visibility for loot window rendering
This commit is contained in:
Kelsi 2026-02-06 16:04:25 -08:00
parent 2ddef93f52
commit caeb6f56f7
12 changed files with 426 additions and 119 deletions

67
src/ui/talent_screen.cpp Normal file
View file

@ -0,0 +1,67 @@
#include "ui/talent_screen.hpp"
#include "core/input.hpp"
#include "core/application.hpp"
namespace wowee { namespace ui {
void TalentScreen::render(game::GameHandler& gameHandler) {
// N key toggle (edge-triggered)
bool uiWantsKeyboard = ImGui::GetIO().WantCaptureKeyboard;
bool nDown = !uiWantsKeyboard && core::Input::getInstance().isKeyPressed(SDL_SCANCODE_N);
if (nDown && !nKeyWasDown) {
open = !open;
}
nKeyWasDown = nDown;
if (!open) return;
auto* window = core::Application::getInstance().getWindow();
float screenW = window ? static_cast<float>(window->getWidth()) : 1280.0f;
float screenH = window ? static_cast<float>(window->getHeight()) : 720.0f;
float winW = 400.0f;
float winH = 450.0f;
float winX = (screenW - winW) * 0.5f;
float winY = (screenH - winH) * 0.5f;
ImGui::SetNextWindowPos(ImVec2(winX, winY), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(winW, winH), ImGuiCond_FirstUseEver);
bool windowOpen = open;
if (ImGui::Begin("Talents", &windowOpen)) {
// Placeholder tabs
if (ImGui::BeginTabBar("TalentTabs")) {
if (ImGui::BeginTabItem("Spec 1")) {
ImGui::Spacing();
ImGui::TextDisabled("Talents coming soon.");
ImGui::Spacing();
ImGui::TextDisabled("Talent trees will be implemented in a future update.");
uint32_t level = gameHandler.getPlayerLevel();
uint32_t talentPoints = (level >= 10) ? (level - 9) : 0;
ImGui::Spacing();
ImGui::Separator();
ImGui::Text("Level: %u", level);
ImGui::Text("Talent points available: %u", talentPoints);
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Spec 2")) {
ImGui::TextDisabled("Talents coming soon.");
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Spec 3")) {
ImGui::TextDisabled("Talents coming soon.");
ImGui::EndTabItem();
}
ImGui::EndTabBar();
}
}
ImGui::End();
if (!windowOpen) {
open = false;
}
}
}} // namespace wowee::ui