From 0674dc9ec24b45397d15ee258ffed6be23cbe0b8 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 07:58:36 -0700 Subject: [PATCH] feat: add spell icons to boss and party member cast bars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consistent with the player cast bar, show the spell icon (12×12 for boss, 10×10 for party) to the left of each cast bar progress widget. Falls back gracefully to the icon-less layout when no icon is found. --- src/ui/game_screen.cpp | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 533e3458..a165cbba 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -7247,6 +7247,7 @@ void GameScreen::renderNameplates(game::GameHandler& gameHandler) { void GameScreen::renderPartyFrames(game::GameHandler& gameHandler) { if (!gameHandler.isInGroup()) return; + auto* assetMgr = core::Application::getInstance().getAssetManager(); const auto& partyData = gameHandler.getPartyData(); const bool isRaid = (partyData.groupType == 1); float frameY = 120.0f; @@ -7626,7 +7627,17 @@ void GameScreen::renderPartyFrames(game::GameHandler& gameHandler) { snprintf(pcastLabel, sizeof(pcastLabel), "%s (%.1fs)", spellNm.c_str(), cs->timeRemaining); else snprintf(pcastLabel, sizeof(pcastLabel), "Casting... (%.1fs)", cs->timeRemaining); - ImGui::ProgressBar(castPct, ImVec2(-1, 10), pcastLabel); + { + VkDescriptorSet pIcon = (cs->spellId != 0 && assetMgr) + ? getSpellIcon(cs->spellId, assetMgr) : VK_NULL_HANDLE; + if (pIcon) { + ImGui::Image((ImTextureID)(uintptr_t)pIcon, ImVec2(10, 10)); + ImGui::SameLine(0, 2); + ImGui::ProgressBar(castPct, ImVec2(-1, 10), pcastLabel); + } else { + ImGui::ProgressBar(castPct, ImVec2(-1, 10), pcastLabel); + } + } ImGui::PopStyleColor(); } @@ -7974,6 +7985,8 @@ void GameScreen::renderZoneToasts(float deltaTime) { // ============================================================ void GameScreen::renderBossFrames(game::GameHandler& gameHandler) { + auto* assetMgr = core::Application::getInstance().getAssetManager(); + // Collect active boss unit slots struct BossSlot { uint32_t slot; uint64_t guid; }; std::vector active; @@ -8054,7 +8067,17 @@ void GameScreen::renderBossFrames(game::GameHandler& gameHandler) { bcastName.c_str(), cs->timeRemaining); else snprintf(bcastLabel, sizeof(bcastLabel), "Casting... (%.1fs)", cs->timeRemaining); - ImGui::ProgressBar(castPct, ImVec2(-1, 12), bcastLabel); + { + VkDescriptorSet bIcon = (bspell != 0 && assetMgr) + ? getSpellIcon(bspell, assetMgr) : VK_NULL_HANDLE; + if (bIcon) { + ImGui::Image((ImTextureID)(uintptr_t)bIcon, ImVec2(12, 12)); + ImGui::SameLine(0, 2); + ImGui::ProgressBar(castPct, ImVec2(-1, 12), bcastLabel); + } else { + ImGui::ProgressBar(castPct, ImVec2(-1, 12), bcastLabel); + } + } ImGui::PopStyleColor(); }