From 0a03bf902805ba70c58d45c7aef77016b84a23fc Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 04:59:24 -0700 Subject: [PATCH] feat: add cast bar to pet frame Show an orange cast bar in the pet frame when the pet is casting a spell, matching the party frame cast bar pattern. Displays spell name and time remaining; falls back to 'Casting...' when spell name is unavailable from Spell.dbc. --- src/ui/game_screen.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index dc6a4208..894bb817 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -2448,6 +2448,22 @@ void GameScreen::renderPetFrame(game::GameHandler& gameHandler) { ImGui::PopStyleColor(); } + // Pet cast bar + if (auto* pcs = gameHandler.getUnitCastState(petGuid)) { + float castPct = (pcs->timeTotal > 0.0f) + ? (pcs->timeTotal - pcs->timeRemaining) / pcs->timeTotal : 0.0f; + // Orange color to distinguish from health/power bars + ImGui::PushStyleColor(ImGuiCol_PlotHistogram, ImVec4(0.85f, 0.55f, 0.1f, 1.0f)); + char petCastLabel[48]; + const std::string& spellNm = gameHandler.getSpellName(pcs->spellId); + if (!spellNm.empty()) + snprintf(petCastLabel, sizeof(petCastLabel), "%s (%.1fs)", spellNm.c_str(), pcs->timeRemaining); + else + snprintf(petCastLabel, sizeof(petCastLabel), "Casting... (%.1fs)", pcs->timeRemaining); + ImGui::ProgressBar(castPct, ImVec2(-1, 10), petCastLabel); + ImGui::PopStyleColor(); + } + // Dismiss button (compact, right-aligned) ImGui::SameLine(ImGui::GetContentRegionAvail().x - 60.0f); if (ImGui::SmallButton("Dismiss")) {