From 1e1c46f6b93a8c0d206b001caac5d687d5c68b38 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Mon, 4 Mar 2024 12:53:37 -0500 Subject: [PATCH] Make DynOS and Player panels disable pause camera zoom out --- src/game/camera.c | 3 ++- src/pc/djui/djui_panel.c | 2 ++ src/pc/djui/djui_panel_dynos.c | 2 ++ src/pc/djui/djui_panel_player.c | 3 +++ src/pc/djui/djui_panel_player.h | 2 ++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/game/camera.c b/src/game/camera.c index 4fa24b35..120d314b 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -34,6 +34,7 @@ #include "pc/network/network.h" #include "pc/lua/smlua_hooks.h" #include "pc/djui/djui.h" +#include "pc/djui/djui_panel_player.h" #include "first_person_cam.h" #define CBUTTON_MASK (U_CBUTTONS | D_CBUTTONS | L_CBUTTONS | R_CBUTTONS) @@ -3660,7 +3661,7 @@ void zoom_out_if_paused_and_outside(struct GraphNodeCamera *camera) { areaMaskIndex = 0; areaBit = 0; } - if (gCameraMovementFlags & CAM_MOVE_PAUSE_SCREEN) { + if (gCameraMovementFlags & CAM_MOVE_PAUSE_SCREEN && !gDjuiPanelPlayerCreated) { if (sFramesPaused >= 2) { if (sZoomOutAreaMasks[areaMaskIndex] & areaBit) { diff --git a/src/pc/djui/djui_panel.c b/src/pc/djui/djui_panel.c index e29f8de0..9d3ab5ba 100644 --- a/src/pc/djui/djui_panel.c +++ b/src/pc/djui/djui_panel.c @@ -3,6 +3,7 @@ #include "djui_panel_main.h" #include "djui_panel_pause.h" #include "djui_panel_join_message.h" +#include "djui_panel_player.h" #include "src/pc/debuglog.h" #include "src/pc/utils/misc.h" #include "sounds.h" @@ -121,6 +122,7 @@ void djui_panel_back(void) { play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource); gDjuiPanelJoinMessageVisible = false; + gDjuiPanelPlayerCreated = false; } void djui_panel_update(void) { diff --git a/src/pc/djui/djui_panel_dynos.c b/src/pc/djui/djui_panel_dynos.c index 4fe037a7..b4e81b17 100644 --- a/src/pc/djui/djui_panel_dynos.c +++ b/src/pc/djui/djui_panel_dynos.c @@ -7,6 +7,7 @@ #include "pc/network/network.h" #include "djui_panel_main.h" #include "djui_panel_options.h" +#include "djui_panel_player.h" void djui_panel_dynos_create(struct DjuiBase* caller); @@ -72,4 +73,5 @@ void djui_panel_dynos_create(struct DjuiBase* caller) { } djui_panel_add(caller, panel, NULL); + gDjuiPanelPlayerCreated = true; } diff --git a/src/pc/djui/djui_panel_player.c b/src/pc/djui/djui_panel_player.c index 74e28d24..7870512b 100644 --- a/src/pc/djui/djui_panel_player.c +++ b/src/pc/djui/djui_panel_player.c @@ -20,6 +20,8 @@ static struct DjuiSelectionbox* sPalettePresetSelection; static struct DjuiInputbox* sHexColorTextBox; static struct DjuiSlider *sSliderR, *sSliderG, *sSliderB; +bool gDjuiPanelPlayerCreated = false; + static void djui_panel_player_edit_palette_update_hex_code_box(void) { char buf[7]; static const char digitToChar[] = "0123456789abcdef"; @@ -337,4 +339,5 @@ void djui_panel_player_create(struct DjuiBase* caller) { struct DjuiPanel* p = djui_panel_add(caller, panel, NULL); p->on_panel_destroy = djui_panel_player_destroy; + gDjuiPanelPlayerCreated = true; } diff --git a/src/pc/djui/djui_panel_player.h b/src/pc/djui/djui_panel_player.h index 0a84adba..4ad66e8d 100644 --- a/src/pc/djui/djui_panel_player.h +++ b/src/pc/djui/djui_panel_player.h @@ -1,4 +1,6 @@ #pragma once #include "djui.h" +extern bool gDjuiPanelPlayerCreated; + void djui_panel_player_create(struct DjuiBase* caller);