From 87a83806a12524213d696f4cd08b75ace0609743 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Sun, 3 Mar 2024 17:30:20 -0500 Subject: [PATCH] Restore vanilla pause camera zoom out as gLevelValues field --- autogen/lua_definitions/structs.lua | 1 + docs/lua/structs.md | 1 + src/game/hardcoded.c | 9 +++++---- src/game/hardcoded.h | 1 + src/game/level_update.c | 4 +++- src/pc/lua/smlua_cobject_autogen.c | 3 ++- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/autogen/lua_definitions/structs.lua b/autogen/lua_definitions/structs.lua index 9d07adf2..e34fa3a3 100644 --- a/autogen/lua_definitions/structs.lua +++ b/autogen/lua_definitions/structs.lua @@ -930,6 +930,7 @@ --- @field public wingCapDurationTotwc integer --- @field public wingCapLookUpReq integer --- @field public wingCapSequence SeqId +--- @field public zoomOutCameraOnPause integer --- @class LinearTransitionPoint --- @field public dist number diff --git a/docs/lua/structs.md b/docs/lua/structs.md index 8aeb3644..8227c09e 100644 --- a/docs/lua/structs.md +++ b/docs/lua/structs.md @@ -1269,6 +1269,7 @@ | wingCapDurationTotwc | `integer` | | | wingCapLookUpReq | `integer` | | | wingCapSequence | [enum SeqId](constants.md#enum-SeqId) | | +| zoomOutCameraOnPause | `integer` | | [:arrow_up_small:](#) diff --git a/src/game/hardcoded.c b/src/game/hardcoded.c index dddb8e4b..ea63e8b9 100644 --- a/src/game/hardcoded.c +++ b/src/game/hardcoded.c @@ -112,7 +112,7 @@ struct LevelValues gDefaultLevelValues = { .CcmSlideStarPos = { 2500.0f, -4350.0f, 5750.0f }, .UkikiCageStarPos = { 2500.0f, -1200.0f, 1300.0f }, .UnagiStarPos = { 6833.0f, -3654.0f, 2230.0f }, - .JetstreamRingStarPos = { 3400.0f, -3200.0f, -500.0f }, + .JetstreamRingStarPos = { 3400.0f, -3200.0f, -500.0f } }, .cellHeightLimit = CELL_HEIGHT_LIMIT, .floorLowerLimit = FLOOR_LOWER_LIMIT, @@ -122,7 +122,8 @@ struct LevelValues gDefaultLevelValues = { .maxCoins = 999, .numCoinsToLife = 50, .wdwWaterLevelSpeed = 10.0f, - .useGlobalStarIds = FALSE + .useGlobalStarIds = FALSE, + .zoomOutCameraOnPause = TRUE }; struct LevelValues gLevelValues = { 0 }; @@ -245,7 +246,7 @@ struct BehaviorValues gDefaultBehaviorValues = { .WigglerAttack3Dialog = DIALOG_151, .WigglerDialog = DIALOG_150, .WingCourseDialog = DIALOG_131, - .YoshiDialog = DIALOG_161, + .YoshiDialog = DIALOG_161 }, .trajectories = { .KoopaBobTrajectory = (Trajectory*) bob_seg7_trajectory_koopa, @@ -277,7 +278,7 @@ struct BehaviorValues gDefaultBehaviorValues = { .PlatformBitfsTrajectory = (Trajectory*) bitfs_seg7_trajectory_070159AC, .PlatformHmcTrajectory = (Trajectory*) hmc_seg7_trajectory_0702B86C, .PlatformLllTrajectory = (Trajectory*) lll_seg7_trajectory_0702856C, - .PlatformLll2Trajectory = (Trajectory*) lll_seg7_trajectory_07028660, + .PlatformLll2Trajectory = (Trajectory*) lll_seg7_trajectory_07028660 } }; diff --git a/src/game/hardcoded.h b/src/game/hardcoded.h index 857416a9..a8d5fc93 100644 --- a/src/game/hardcoded.h +++ b/src/game/hardcoded.h @@ -88,6 +88,7 @@ struct LevelValues { u16 numCoinsToLife; f32 wdwWaterLevelSpeed; u8 useGlobalStarIds; + u8 zoomOutCameraOnPause; }; extern struct LevelValues gLevelValues; diff --git a/src/game/level_update.c b/src/game/level_update.c index 40353cff..7167357a 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -1335,7 +1335,9 @@ s32 play_mode_paused(void) { game_exit(); }*/ - gCameraMovementFlags &= ~CAM_MOVE_PAUSE_SCREEN; + if (!gLevelValues.zoomOutCameraOnPause) { + gCameraMovementFlags &= ~CAM_MOVE_PAUSE_SCREEN; + } return 0; } diff --git a/src/pc/lua/smlua_cobject_autogen.c b/src/pc/lua/smlua_cobject_autogen.c index 528b8c25..c576ef7e 100644 --- a/src/pc/lua/smlua_cobject_autogen.c +++ b/src/pc/lua/smlua_cobject_autogen.c @@ -995,7 +995,7 @@ static struct LuaObjectField sLakituStateFields[LUA_LAKITU_STATE_FIELD_COUNT] = { "yaw", LVT_S16, offsetof(struct LakituState, yaw), false, LOT_NONE }, }; -#define LUA_LEVEL_VALUES_FIELD_COUNT 48 +#define LUA_LEVEL_VALUES_FIELD_COUNT 49 static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] = { { "bubbleOnDeathBarrierInCapStages", LVT_U8, offsetof(struct LevelValues, bubbleOnDeathBarrierInCapStages), false, LOT_NONE }, { "cellHeightLimit", LVT_S16, offsetof(struct LevelValues, cellHeightLimit), false, LOT_NONE }, @@ -1045,6 +1045,7 @@ static struct LuaObjectField sLevelValuesFields[LUA_LEVEL_VALUES_FIELD_COUNT] = { "wingCapDurationTotwc", LVT_U16, offsetof(struct LevelValues, wingCapDurationTotwc), false, LOT_NONE }, { "wingCapLookUpReq", LVT_S16, offsetof(struct LevelValues, wingCapLookUpReq), false, LOT_NONE }, { "wingCapSequence", LVT_S32, offsetof(struct LevelValues, wingCapSequence), false, LOT_NONE }, + { "zoomOutCameraOnPause", LVT_U8, offsetof(struct LevelValues, zoomOutCameraOnPause), false, LOT_NONE }, }; #define LUA_LINEAR_TRANSITION_POINT_FIELD_COUNT 5