From 3ea1b96681e51eabf0f05e5578bf2299850390d5 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 13:09:40 -0700 Subject: [PATCH] feat: show spell description in trainer window tooltip Trainer spell tooltips now show the spell's effect description from Spell.dbc (e.g. "Sends a shadowy bolt at the enemy...") above the status/requirement lines, matching the WoW trainer UI style. Also styles the spell name yellow (like WoW) and moves status to TextDisabled for better visual hierarchy. --- src/ui/game_screen.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 93038426..1a5c9c43 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -12012,10 +12012,18 @@ void GameScreen::renderTrainerWindow(game::GameHandler& gameHandler) { if (ImGui::IsItemHovered()) { ImGui::BeginTooltip(); if (!name.empty()) { - ImGui::Text("%s", name.c_str()); - if (!rank.empty()) ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "%s", rank.c_str()); + ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.3f, 1.0f), "%s", name.c_str()); + if (!rank.empty()) ImGui::TextColored(ImVec4(0.6f, 0.6f, 0.6f, 1.0f), "%s", rank.c_str()); } - ImGui::Text("Status: %s", statusLabel); + const std::string& spDesc = gameHandler.getSpellDescription(spell->spellId); + if (!spDesc.empty()) { + ImGui::Spacing(); + ImGui::PushTextWrapPos(ImGui::GetCursorPosX() + 300.0f); + ImGui::TextWrapped("%s", spDesc.c_str()); + ImGui::PopTextWrapPos(); + ImGui::Spacing(); + } + ImGui::TextDisabled("Status: %s", statusLabel); if (spell->reqLevel > 0) { ImVec4 lvlColor = levelMet ? ImVec4(0.7f, 0.7f, 0.7f, 1.0f) : ImVec4(1.0f, 0.3f, 0.3f, 1.0f); ImGui::TextColored(lvlColor, "Required Level: %u", spell->reqLevel);