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;