From 309fd11a7b1fbbdf8b76b05d521812e927ce150a Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sun, 29 Mar 2026 17:20:02 -0700 Subject: [PATCH] fix: cast bar invisible due to stale ImGui saved window position The cast bar window used ImGuiCond_FirstUseEver for positioning, so ImGui's .ini state restored a stale off-screen position from a prior session. Switch to ImGuiCond_Always and add NoSavedSettings flag so the bar always renders centered near the bottom of the screen. Also demotes remaining diagnostic logs to LOG_DEBUG. --- src/game/inventory_handler.cpp | 6 +++--- src/game/spell_handler.cpp | 3 +-- src/ui/game_screen.cpp | 5 +++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/game/inventory_handler.cpp b/src/game/inventory_handler.cpp index 87265fd3..7462d0a9 100644 --- a/src/game/inventory_handler.cpp +++ b/src/game/inventory_handler.cpp @@ -2357,9 +2357,9 @@ void InventoryHandler::handleItemQueryResponse(network::Packet& packet) { } owner_.pendingItemQueries_.erase(data.entry); - LOG_WARNING("handleItemQueryResponse: entry=", data.entry, " name='", data.name, - "' displayInfoId=", data.displayInfoId, " valid=", data.valid, - " pending=", owner_.pendingItemQueries_.size()); + LOG_DEBUG("handleItemQueryResponse: entry=", data.entry, " name='", data.name, + "' class=", data.itemClass, " subClass=", data.subClass, + " invType=", data.inventoryType, " valid=", data.valid); if (data.valid) { owner_.itemInfoCache_[data.entry] = data; diff --git a/src/game/spell_handler.cpp b/src/game/spell_handler.cpp index 092bb6ef..625bdce0 100644 --- a/src/game/spell_handler.cpp +++ b/src/game/spell_handler.cpp @@ -852,8 +852,7 @@ void SpellHandler::handleSpellStart(network::Packet& packet) { return; } LOG_DEBUG("SMSG_SPELL_START: caster=0x", std::hex, data.casterUnit, std::dec, - " spell=", data.spellId, " castTime=", data.castTime, - " isPlayer=", (data.casterUnit == owner_.playerGuid)); + " spell=", data.spellId, " castTime=", data.castTime); // Track cast bar for any non-player caster if (data.casterUnit != owner_.playerGuid && data.castTime > 0) { diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 64ee286a..9491e238 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -10620,12 +10620,13 @@ void GameScreen::renderCastBar(game::GameHandler& gameHandler) { float barX = (screenW - barW) / 2.0f; float barY = screenH - 120.0f; - ImGui::SetNextWindowPos(ImVec2(barX, barY), ImGuiCond_FirstUseEver); + ImGui::SetNextWindowPos(ImVec2(barX, barY), ImGuiCond_Always); ImGui::SetNextWindowSize(ImVec2(barW, 40), ImGuiCond_Always); ImGuiWindowFlags flags = ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoTitleBar | - ImGuiWindowFlags_NoScrollbar; + ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoSavedSettings | + ImGuiWindowFlags_NoFocusOnAppearing; ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 4.0f); ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.1f, 0.1f, 0.1f, 0.9f));