From 8d7391d73e82e6339b98aea2be7e2260e7b5c5a8 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 13:33:48 -0700 Subject: [PATCH] feat: upgrade pet action bar to rich spell tooltips with autocast status Pet ability buttons now show full spell info (name, description, range, cost, cooldown) instead of just the spell name. Built-in commands (Follow, Stay, Attack, etc.) keep their existing simple labels. Autocast-enabled spells show "Autocast: On" at the bottom of the tooltip. --- src/ui/game_screen.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 365e781e..f3efeed3 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -3094,23 +3094,30 @@ void GameScreen::renderPetFrame(game::GameHandler& gameHandler) { gameHandler.sendPetAction(slotVal, targetGuid); } - // Tooltip: show spell name or built-in command name. + // Tooltip: rich spell info for pet spells, simple label for built-in commands if (ImGui::IsItemHovered()) { - const char* tip = nullptr; if (builtinLabel) { + const char* tip = nullptr; if (actionId == 1) tip = "Passive"; else if (actionId == 2) tip = "Follow"; else if (actionId == 3) tip = "Stay"; else if (actionId == 4) tip = "Defensive"; else if (actionId == 5) tip = "Attack"; else if (actionId == 6) tip = "Aggressive"; + if (tip) ImGui::SetTooltip("%s", tip); + } else if (actionId > 6) { + auto* spellAsset = core::Application::getInstance().getAssetManager(); + ImGui::BeginTooltip(); + bool richOk = spellbookScreen.renderSpellInfoTooltip(actionId, gameHandler, spellAsset); + if (!richOk) { + std::string nm = gameHandler.getSpellName(actionId); + if (nm.empty()) nm = "Spell #" + std::to_string(actionId); + ImGui::Text("%s", nm.c_str()); + } + if (autocastOn) + ImGui::TextColored(ImVec4(0.4f, 1.0f, 0.4f, 1.0f), "Autocast: On"); + ImGui::EndTooltip(); } - std::string spellNm; - if (!tip && actionId > 6) { - spellNm = gameHandler.getSpellName(actionId); - if (!spellNm.empty()) tip = spellNm.c_str(); - } - if (tip) ImGui::SetTooltip("%s", tip); } ImGui::PopID();