From d8d59dcdc894d948c7715bfbc26b047aab9d9fb2 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Thu, 12 Mar 2026 09:07:37 -0700 Subject: [PATCH] feat: show live per-player responses in ready check popup Track each player's ready/not-ready response as MSG_RAID_READY_CHECK_CONFIRM packets arrive. Display a color-coded table (green=Ready, red=Not Ready) in the ready check popup so the raid leader can see who has responded in real time. Results clear when a new check starts or finishes. --- include/game/game_handler.hpp | 6 ++++++ src/game/game_handler.cpp | 9 +++++++++ src/ui/game_screen.cpp | 23 +++++++++++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index 8b7a445a..1eafa7c7 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -458,11 +458,16 @@ public: uint64_t getPetitionNpcGuid() const { return petitionNpcGuid_; } // Ready check + struct ReadyCheckResult { + std::string name; + bool ready = false; + }; void initiateReadyCheck(); void respondToReadyCheck(bool ready); bool hasPendingReadyCheck() const { return pendingReadyCheck_; } void dismissReadyCheck() { pendingReadyCheck_ = false; } const std::string& getReadyCheckInitiator() const { return readyCheckInitiator_; } + const std::vector& getReadyCheckResults() const { return readyCheckResults_; } // Duel void forfeitDuel(); @@ -2258,6 +2263,7 @@ private: uint32_t readyCheckReadyCount_ = 0; uint32_t readyCheckNotReadyCount_ = 0; std::string readyCheckInitiator_; + std::vector readyCheckResults_; // per-player status live during check // Faction standings (factionId → absolute standing value) std::unordered_map factionStandings_; diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index 25400302..b2fd7619 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -3149,6 +3149,7 @@ void GameHandler::handlePacket(network::Packet& packet) { readyCheckReadyCount_ = 0; readyCheckNotReadyCount_ = 0; readyCheckInitiator_.clear(); + readyCheckResults_.clear(); if (packet.getSize() - packet.getReadPos() >= 8) { uint64_t initiatorGuid = packet.readUInt64(); auto entity = entityManager.getEntity(initiatorGuid); @@ -3182,7 +3183,14 @@ void GameHandler::handlePacket(network::Packet& packet) { auto ent = entityManager.getEntity(respGuid); if (ent) rname = std::static_pointer_cast(ent)->getName(); } + // Track per-player result for live popup display if (!rname.empty()) { + bool found = false; + for (auto& r : readyCheckResults_) { + if (r.name == rname) { r.ready = (isReady != 0); found = true; break; } + } + if (!found) readyCheckResults_.push_back({ rname, isReady != 0 }); + char rbuf[128]; std::snprintf(rbuf, sizeof(rbuf), "%s is %s.", rname.c_str(), isReady ? "Ready" : "Not Ready"); addSystemChatMessage(rbuf); @@ -3198,6 +3206,7 @@ void GameHandler::handlePacket(network::Packet& packet) { pendingReadyCheck_ = false; readyCheckReadyCount_ = 0; readyCheckNotReadyCount_ = 0; + readyCheckResults_.clear(); break; } case Opcode::SMSG_RAID_INSTANCE_INFO: diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index 78e201ff..5008cf58 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -8866,6 +8866,29 @@ void GameScreen::renderReadyCheckPopup(game::GameHandler& gameHandler) { gameHandler.respondToReadyCheck(false); gameHandler.dismissReadyCheck(); } + + // Live player responses + const auto& results = gameHandler.getReadyCheckResults(); + if (!results.empty()) { + ImGui::Separator(); + if (ImGui::BeginTable("##rcresults", 2, + ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_RowBg)) { + ImGui::TableSetupColumn("Player", ImGuiTableColumnFlags_WidthStretch); + ImGui::TableSetupColumn("Status", ImGuiTableColumnFlags_WidthFixed, 72.0f); + for (const auto& r : results) { + ImGui::TableNextRow(); + ImGui::TableSetColumnIndex(0); + ImGui::TextUnformatted(r.name.c_str()); + ImGui::TableSetColumnIndex(1); + if (r.ready) { + ImGui::TextColored(ImVec4(0.2f, 0.9f, 0.2f, 1.0f), "Ready"); + } else { + ImGui::TextColored(ImVec4(0.9f, 0.3f, 0.3f, 1.0f), "Not Ready"); + } + } + ImGui::EndTable(); + } + } } ImGui::End(); }