From b381f1e13f02cf07a3a274182ab58e332fb62807 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Mon, 9 Mar 2026 14:08:49 -0700 Subject: [PATCH] Tick summon request timeout down in UI render loop; auto-expire on timeout --- include/game/game_handler.hpp | 8 ++++++++ src/ui/game_screen.cpp | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index c58aca01..bec28993 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -713,6 +713,14 @@ public: float getSummonTimeoutSec() const { return summonTimeoutSec_; } void acceptSummon(); void declineSummon(); + void tickSummonTimeout(float dt) { + if (!pendingSummonRequest_) return; + summonTimeoutSec_ -= dt; + if (summonTimeoutSec_ <= 0.0f) { + pendingSummonRequest_ = false; + summonTimeoutSec_ = 0.0f; + } + } // ---- Trade ---- enum class TradeStatus : uint8_t { diff --git a/src/ui/game_screen.cpp b/src/ui/game_screen.cpp index e1f6915c..1905f5af 100644 --- a/src/ui/game_screen.cpp +++ b/src/ui/game_screen.cpp @@ -4407,6 +4407,11 @@ void GameScreen::renderDuelRequestPopup(game::GameHandler& gameHandler) { void GameScreen::renderSummonRequestPopup(game::GameHandler& gameHandler) { if (!gameHandler.hasPendingSummonRequest()) return; + // Tick the timeout down + float dt = ImGui::GetIO().DeltaTime; + gameHandler.tickSummonTimeout(dt); + if (!gameHandler.hasPendingSummonRequest()) return; // expired + auto* window = core::Application::getInstance().getWindow(); float screenW = window ? static_cast(window->getWidth()) : 1280.0f;