Tick summon request timeout down in UI render loop; auto-expire on timeout

This commit is contained in:
Kelsi 2026-03-09 14:08:49 -07:00
parent 770ac645d5
commit b381f1e13f
2 changed files with 13 additions and 0 deletions

View file

@ -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 {

View file

@ -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<float>(window->getWidth()) : 1280.0f;