From ff82a40b3f29d6d0cfe04913333c4143c2aa739d Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Fri, 8 Dec 2023 15:36:35 -0500 Subject: [PATCH] Remove singleplayer pause --- src/engine/behavior_script.c | 4 ++-- src/game/level_update.c | 20 ++++---------------- src/game/object_helpers.c | 3 ++- src/pc/configfile.c | 2 -- src/pc/configfile.h | 1 - src/pc/djui/djui_panel_misc.c | 1 - 6 files changed, 8 insertions(+), 23 deletions(-) diff --git a/src/engine/behavior_script.c b/src/engine/behavior_script.c index 60c9c07a..faefd977 100644 --- a/src/engine/behavior_script.c +++ b/src/engine/behavior_script.c @@ -1287,7 +1287,7 @@ void cur_obj_update(void) { } // handle network area timer - if (gCurrentObject->areaTimerType != AREA_TIMER_TYPE_NONE && !(gMenuMode == -1 && configSingleplayerPause)) { + if (gCurrentObject->areaTimerType != AREA_TIMER_TYPE_NONE) { // make sure the area is valid if (gNetworkPlayerLocal == NULL || !gNetworkPlayerLocal->currAreaSyncValid) { goto cur_obj_update_end; @@ -1437,7 +1437,7 @@ cur_obj_update_begin:; } // update network area timer - if (gCurrentObject->areaTimerType != AREA_TIMER_TYPE_NONE && !(gMenuMode == -1 && configSingleplayerPause)) { + if (gCurrentObject->areaTimerType != AREA_TIMER_TYPE_NONE) { gCurrentObject->areaTimer++; if (gCurrentObject->areaTimer < gNetworkAreaTimer) { goto cur_obj_update_begin; diff --git a/src/game/level_update.c b/src/game/level_update.c index 31e01b66..0e3c9523 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -245,17 +245,10 @@ u16 level_control_timer(s32 timerOp) { } u32 pressed_pause(void) { - if (configSingleplayerPause && network_player_connected_count() == 1) { - // prevent softlock in singleplayer pause, by not allowing pause in transitions - if (gWarpTransition.isActive || sDelayedWarpOp != WARP_OP_NONE) { - return FALSE; - } - } - - u32 val4 = get_dialog_id() >= 0; + u32 dialogActive = get_dialog_id() >= 0; u32 intangible = (gMarioState->action & ACT_FLAG_INTANGIBLE) != 0; - if (!intangible && !val4 && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE + if (!intangible && !dialogActive && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE && (gPlayer1Controller->buttonPressed & START_BUTTON)) { return TRUE; } @@ -1672,13 +1665,8 @@ s32 update_level(void) { changeLevel = play_mode_normal(); break; case PLAY_MODE_PAUSED: - if (!(configSingleplayerPause && network_player_connected_count() == 1 && gActiveMods.entryCount == 0)) { - changeLevel = play_mode_normal(); - } - - if (sCurrPlayMode == PLAY_MODE_PAUSED) { - changeLevel = play_mode_paused(); - } + changeLevel = play_mode_normal(); + changeLevel = play_mode_paused(); break; case PLAY_MODE_CHANGE_AREA: changeLevel = play_mode_change_area(); diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index 4e81a57f..a6654c92 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -30,6 +30,7 @@ #include "pc/network/network.h" #include "pc/lua/smlua_hooks.h" #include "pc/lua/utils/smlua_misc_utils.h" +#include "first_person_cam.h" u8 (*gContinueDialogFunction)(void) = NULL; struct Object* gContinueDialogFunctionObject = NULL; @@ -1944,7 +1945,7 @@ void obj_set_cylboard(struct Object *obj) { void cur_obj_set_billboard_if_vanilla_cam(void) { if (!o) { return; } - if (camera_config_is_free_cam_enabled()) { + if (camera_config_is_free_cam_enabled() || get_first_person_enabled()) { o->header.gfx.node.flags &= ~GRAPH_RENDER_BILLBOARD; o->header.gfx.node.flags |= GRAPH_RENDER_CYLBOARD; } else { diff --git a/src/pc/configfile.c b/src/pc/configfile.c index a8d25017..a9af4253 100644 --- a/src/pc/configfile.c +++ b/src/pc/configfile.c @@ -150,7 +150,6 @@ bool configCtxProfiler = false; unsigned int configInterpolationMode = 1; unsigned int configGamepadNumber = 0; bool configBackgroundGamepad = true; -bool configSingleplayerPause = false; bool configDebugPrint = false; bool configDebugInfo = false; bool configDebugError = false; @@ -260,7 +259,6 @@ static const struct ConfigOption options[] = { {.name = "coop_custom_palette_skin", .type = CONFIG_TYPE_COLOR , .colorValue = &configCustomPalette.parts[SKIN]}, {.name = "coop_custom_palette_cap", .type = CONFIG_TYPE_COLOR , .colorValue = &configCustomPalette.parts[CAP]}, {.name = "coop_stay_in_level_after_star", .type = CONFIG_TYPE_UINT , .uintValue = &configStayInLevelAfterStar}, - {.name = "coop_singleplayer_pause", .type = CONFIG_TYPE_BOOL , .boolValue = &configSingleplayerPause}, {.name = "coop_compatibility", .type = CONFIG_TYPE_BOOL , .boolValue = &configCoopCompatibility}, {.name = "disable_popups", .type = CONFIG_TYPE_BOOL , .boolValue = &configDisablePopups}, #if defined(DEVELOPMENT) diff --git a/src/pc/configfile.h b/src/pc/configfile.h index c60a8ef4..c41f3179 100644 --- a/src/pc/configfile.h +++ b/src/pc/configfile.h @@ -107,7 +107,6 @@ extern bool configLuaProfiler; extern bool configCtxProfiler; #endif extern unsigned int configInterpolationMode; -extern bool configSingleplayerPause; extern bool configDebugPrint; extern bool configDebugInfo; extern bool configDebugError; diff --git a/src/pc/djui/djui_panel_misc.c b/src/pc/djui/djui_panel_misc.c index a847195c..aeeeb13a 100644 --- a/src/pc/djui/djui_panel_misc.c +++ b/src/pc/djui/djui_panel_misc.c @@ -48,7 +48,6 @@ void djui_panel_misc_create(struct DjuiBase* caller) { djui_themes_init(); { - djui_checkbox_create(body, DLANG(MISC, PAUSE_IN_SINGLEPLAYER), &configSingleplayerPause, NULL); djui_checkbox_create(body, DLANG(MISC, DISABLE_POPUPS), &configDisablePopups, NULL); djui_checkbox_create(body, DLANG(MISC, COOP_COMPATIBILITY), &configCoopCompatibility, djui_panel_compatibility_checkbox_on_value_change);