From 0847e9c5441cbca37614652444667bedab9cc2d3 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Wed, 29 Apr 2026 20:19:20 +0200 Subject: [PATCH] =?UTF-8?q?feat(menu):=20congela=20el=20m=C3=B3n=20mentre?= =?UTF-8?q?=20el=20men=C3=BA=20de=20servei=20est=C3=A0=20obert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/game/scenes/game_scene.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/source/game/scenes/game_scene.cpp b/source/game/scenes/game_scene.cpp index 7df6a0a..ebb04b9 100644 --- a/source/game/scenes/game_scene.cpp +++ b/source/game/scenes/game_scene.cpp @@ -38,6 +38,7 @@ #include "game/map/map.hpp" #include "game/options.hpp" #include "game/ui/hud.hpp" +#include "game/ui/service_menu.hpp" #include "utils/defaults.hpp" #include "utils/defines.hpp" #include "utils/easing.hpp" @@ -1116,7 +1117,17 @@ namespace { void GameScene::update(int delta_ms) { handlePauseInput(); - updatePauseTransition(delta_ms); + + // Congelació instantània mentre el menú de servei està obert. A + // diferència de la pausa de gameplay (que és un dial amb easing i + // fade de música), aquesta és binària: el món no avança gens i la + // música no es toca. També posem en pausa el dial de la pausa + // regular si estava a mig camí, perquè no continui mentre l'usuari + // navega el menú. + const bool MENU_FROZEN = ServiceMenu::get().isOpen(); + if (!MENU_FROZEN) { + updatePauseTransition(delta_ms); + } // Transició de sala: viu en temps real (no escalada per la pausa) // perquè és UI. Avança avans del bloc de món perquè quan PLAYING @@ -1168,7 +1179,7 @@ void GameScene::update(int delta_ms) { constexpr bool EDITOR_FROZEN = false; #endif const int SCALED_DELTA_MS = static_cast(static_cast(delta_ms) * pause_.scale); - if (!EDITOR_FROZEN && SCALED_DELTA_MS > 0) { + if (!EDITOR_FROZEN && !MENU_FROZEN && SCALED_DELTA_MS > 0) { const float DT = static_cast(SCALED_DELTA_MS) / 1000.0F; // Pipeline de moviment en tres passes per poder intercalar la