From 948f2bfe238487041e26dd7ffe7b5400b8d30f57 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Fri, 19 Jul 2024 12:09:05 -0400 Subject: [PATCH] Small improvement to is_game_paused() --- src/pc/controller/controller_sdl2.c | 2 +- src/pc/lua/utils/smlua_misc_utils.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pc/controller/controller_sdl2.c b/src/pc/controller/controller_sdl2.c index 4d3b458d..d4e97aeb 100644 --- a/src/pc/controller/controller_sdl2.c +++ b/src/pc/controller/controller_sdl2.c @@ -170,7 +170,7 @@ extern s16 gMenuMode; static void controller_sdl_read(OSContPad *pad) { if (!init_ok) { return; } - if ((newcam_mouse == 1 || get_first_person_enabled() || gDjuiHudLockMouse) && gMenuMode == -1 && !gDjuiInMainMenu && !gDjuiChatBoxFocus && !gDjuiConsoleFocus && WAPI.has_focus()) { + if ((newcam_mouse == 1 || get_first_person_enabled() || gDjuiHudLockMouse) && !is_game_paused() && !gDjuiInMainMenu && !gDjuiChatBoxFocus && !gDjuiConsoleFocus && WAPI.has_focus()) { controller_mouse_enter_relative(); } else { controller_mouse_leave_relative(); diff --git a/src/pc/lua/utils/smlua_misc_utils.c b/src/pc/lua/utils/smlua_misc_utils.c index 2b252109..3dd63b8d 100644 --- a/src/pc/lua/utils/smlua_misc_utils.c +++ b/src/pc/lua/utils/smlua_misc_utils.c @@ -20,6 +20,7 @@ #include "pc/djui/djui_console.h" #include "pc/djui/djui_hud_utils.h" #include "pc/djui/djui_panel_playerlist.h" +#include "pc/djui/djui_panel_pause.h" #include "game/skybox.h" #include "pc/gfx/gfx_pc.h" #include "include/course_table.h" @@ -264,7 +265,7 @@ void hud_set_flash(s8 value) { extern s16 gMenuMode; bool is_game_paused(void) { - return gMenuMode != -1; + return gMenuMode != -1 || gDjuiPanelPauseCreated; } ///