mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-24 16:10:14 +00:00
Handle SMSG_SUMMON_REQUEST with accept/decline popup
- Parse SMSG_SUMMON_REQUEST (summonerGuid + zoneId + timeoutMs), store summoner name from entity list, show chat notification - acceptSummon() sends CMSG_SUMMON_RESPONSE(1), declineSummon() sends CMSG_SUMMON_RESPONSE(0), SMSG_SUMMON_CANCEL clears pending state - renderSummonRequestPopup(): shows summoner name + countdown timer with Accept/Decline buttons
This commit is contained in:
parent
f369fe9c6e
commit
770ac645d5
4 changed files with 101 additions and 0 deletions
|
|
@ -399,6 +399,7 @@ void GameScreen::render(game::GameHandler& gameHandler) {
|
|||
renderDuelRequestPopup(gameHandler);
|
||||
renderLootRollPopup(gameHandler);
|
||||
renderTradeRequestPopup(gameHandler);
|
||||
renderSummonRequestPopup(gameHandler);
|
||||
renderGuildInvitePopup(gameHandler);
|
||||
renderGuildRoster(gameHandler);
|
||||
renderBuffBar(gameHandler);
|
||||
|
|
@ -4403,6 +4404,34 @@ void GameScreen::renderDuelRequestPopup(game::GameHandler& gameHandler) {
|
|||
ImGui::End();
|
||||
}
|
||||
|
||||
void GameScreen::renderSummonRequestPopup(game::GameHandler& gameHandler) {
|
||||
if (!gameHandler.hasPendingSummonRequest()) return;
|
||||
|
||||
auto* window = core::Application::getInstance().getWindow();
|
||||
float screenW = window ? static_cast<float>(window->getWidth()) : 1280.0f;
|
||||
|
||||
ImGui::SetNextWindowPos(ImVec2(screenW / 2 - 175, 430), ImGuiCond_Always);
|
||||
ImGui::SetNextWindowSize(ImVec2(350, 0), ImGuiCond_Always);
|
||||
|
||||
if (ImGui::Begin("Summon Request", nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize)) {
|
||||
ImGui::Text("%s is summoning you.", gameHandler.getSummonerName().c_str());
|
||||
float t = gameHandler.getSummonTimeoutSec();
|
||||
if (t > 0.0f) {
|
||||
ImGui::Text("Time remaining: %.0fs", t);
|
||||
}
|
||||
ImGui::Spacing();
|
||||
|
||||
if (ImGui::Button("Accept", ImVec2(130, 30))) {
|
||||
gameHandler.acceptSummon();
|
||||
}
|
||||
ImGui::SameLine();
|
||||
if (ImGui::Button("Decline", ImVec2(130, 30))) {
|
||||
gameHandler.declineSummon();
|
||||
}
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
void GameScreen::renderTradeRequestPopup(game::GameHandler& gameHandler) {
|
||||
if (!gameHandler.hasPendingTradeRequest()) return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue