Restore separated staff roll option

This commit is contained in:
Agent X 2024-06-13 10:19:10 -04:00
parent 82cd4176a3
commit 76df190de1
5 changed files with 47 additions and 44 deletions

View File

@ -48,8 +48,8 @@
#include "engine/level_script.h"
#define MENU_LEVEL_MIN 1
#define MENU_LEVEL_MAX 18
#define MENU_LEVEL_MIN 0
#define MENU_LEVEL_MAX 17
struct SavedWarpValues gReceiveWarp = { 0 };
extern s8 sReceivedLoadedActNum;
@ -1258,7 +1258,7 @@ s32 play_mode_normal(void) {
}
} else {
if (gDjuiInMainMenu &&
!gMenuStaffRoll &&
!configMenuStaffRoll &&
gCurrDemoInput == NULL &&
configMenuDemos &&
!gInPlayerMenu &&
@ -1479,30 +1479,30 @@ void update_menu_level(void) {
// figure out level
s32 curLevel = 0;
switch (configMenuLevel) {
case 1: curLevel = LEVEL_CASTLE_GROUNDS; break;
case 2: curLevel = LEVEL_BOB; break;
case 3: curLevel = LEVEL_WF; break;
case 4: curLevel = LEVEL_WMOTR; break;
case 5: curLevel = LEVEL_JRB; break;
case 6: curLevel = LEVEL_SSL; break;
case 7: curLevel = LEVEL_TTM; break;
case 8: curLevel = LEVEL_SL; break;
case 9: curLevel = LEVEL_BBH; break;
case 10: curLevel = LEVEL_LLL; break;
case 11: curLevel = LEVEL_THI; break;
case 12: curLevel = LEVEL_HMC; break;
case 13: curLevel = LEVEL_CCM; break;
case 14: curLevel = LEVEL_RR; break;
case 15: curLevel = LEVEL_BITDW; break;
case 16: curLevel = LEVEL_PSS; break;
case 17: curLevel = LEVEL_TTC; break;
case 18: curLevel = LEVEL_WDW; break;
case 0: curLevel = LEVEL_CASTLE_GROUNDS; break;
case 1: curLevel = LEVEL_BOB; break;
case 2: curLevel = LEVEL_WF; break;
case 3: curLevel = LEVEL_WMOTR; break;
case 4: curLevel = LEVEL_JRB; break;
case 5: curLevel = LEVEL_SSL; break;
case 6: curLevel = LEVEL_TTM; break;
case 7: curLevel = LEVEL_SL; break;
case 8: curLevel = LEVEL_BBH; break;
case 9: curLevel = LEVEL_LLL; break;
case 10: curLevel = LEVEL_THI; break;
case 11: curLevel = LEVEL_HMC; break;
case 12: curLevel = LEVEL_CCM; break;
case 13: curLevel = LEVEL_RR; break;
case 14: curLevel = LEVEL_BITDW; break;
case 15: curLevel = LEVEL_PSS; break;
case 16: curLevel = LEVEL_TTC; break;
case 17: curLevel = LEVEL_WDW; break;
default: curLevel = LEVEL_CASTLE_GROUNDS; break;
}
// figure out music
stop_cap_music();
if (!configMenuSound || gMenuStaffRoll || curLevel == LEVEL_CASTLE_GROUNDS) {
if (!configMenuSound || configMenuStaffRoll || curLevel == LEVEL_CASTLE_GROUNDS) {
reset_volume();
disable_background_sound();
set_background_music(0, SEQ_MENU_FILE_SELECT, 0);
@ -1512,7 +1512,7 @@ void update_menu_level(void) {
set_background_music(gCurrentArea->musicParam, gCurrentArea->musicParam2, 0);
}
if (gMenuStaffRoll) {
if (configMenuStaffRoll) {
return;
} else {
gCurrCreditsEntry = NULL;
@ -1652,9 +1652,7 @@ void update_menu_level(void) {
gLakituState.skipCameraInterpolationTimestamp = gGlobalTimer;
extern s32 gCamSkipInterp;
gCamSkipInterp = 1;
if (gCurrentArea != NULL) {
vec3f_copy(gCurrentArea->camera->pos, gLakituState.curPos);
}
vec3f_copy(gLakituState.pos, gLakituState.curPos);
vec3f_copy(gLakituState.goalPos, gLakituState.curPos);
@ -1796,13 +1794,13 @@ s32 init_level(void) {
configMenuLevel = randLevel;
}
if (gMenuStaffRoll) {
if (configMenuStaffRoll) {
gMarioState->marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE;
warp_credits();
level_trigger_warp(gMarioState, WARP_OP_CREDITS_NEXT);
sFirstCastleGroundsMenu = false;
} else {
if (configMenuLevel == 1 && sFirstCastleGroundsMenu) {
if (configMenuLevel == 0 && sFirstCastleGroundsMenu) {
set_mario_action(gMarioState, ACT_INTRO_CUTSCENE, 7);
sFirstCastleGroundsMenu = false;
} else {

View File

@ -99,9 +99,6 @@ extern s16 gChangeLevel;
extern s16 gChangeActNum;
extern s16 gDelayedInitSound;
extern bool gInPlayerMenu;
#define gMenuStaffRoll configMenuLevel == 0
struct WarpDest {
u8 type;
s16 levelNum;
@ -148,6 +145,8 @@ extern bool gNeverEnteredCastle;
extern u32 gControlTimerStartNat;
extern u32 gControlTimerStopNat;
extern bool gInPlayerMenu;
enum HUDDisplayFlag {
HUD_DISPLAY_FLAG_LIVES = 0x0001,
HUD_DISPLAY_FLAG_COIN_COUNT = 0x0002,

View File

@ -20,7 +20,6 @@
#include "debuglog.h"
#include "djui/djui_hud_utils.h"
#include "game/save_file.h"
#include "game/level_update.h"
#define ARRAY_LEN(arr) (sizeof(arr) / sizeof(arr[0]))
@ -163,6 +162,7 @@ bool configNametags = true;
unsigned int configBouncyLevelBounds = 0;
bool configSkipIntro = 0;
bool configPauseAnywhere = false;
bool configMenuStaffRoll = true;
unsigned int configMenuLevel = 0;
bool configMenuSound = false;
bool configMenuRandom = false;
@ -282,6 +282,7 @@ static const struct ConfigOption options[] = {
{.name = "coop_bouncy_bounds", .type = CONFIG_TYPE_UINT, .uintValue = &configBouncyLevelBounds},
{.name = "skip_intro", .type = CONFIG_TYPE_BOOL, .boolValue = &configSkipIntro},
{.name = "pause_anywhere", .type = CONFIG_TYPE_BOOL, .boolValue = &configPauseAnywhere},
{.name = "coop_menu_staff_roll", .type = CONFIG_TYPE_BOOL, .boolValue = &configMenuStaffRoll},
{.name = "coop_menu_level", .type = CONFIG_TYPE_UINT, .uintValue = &configMenuLevel},
{.name = "coop_menu_sound", .type = CONFIG_TYPE_BOOL, .boolValue = &configMenuSound},
{.name = "coop_menu_random", .type = CONFIG_TYPE_BOOL, .boolValue = &configMenuRandom},

View File

@ -113,6 +113,7 @@ extern bool configNametags;
extern unsigned int configBouncyLevelBounds;
extern bool configSkipIntro;
extern bool configPauseAnywhere;
extern bool configMenuStaffRoll;
extern unsigned int configMenuLevel;
extern bool configMenuSound;
extern bool configMenuRandom;

View File

@ -10,17 +10,19 @@
#include "pc/configfile.h"
#include "game/level_update.h"
static struct DjuiSelectionbox* sLevelBox = NULL;
static struct DjuiCheckbox* sUseStageMusicCheckbox = NULL;
static struct DjuiCheckbox* sRandomStageCheckbox = NULL;
static struct DjuiCheckbox* sVanillaDemosCheckbox = NULL;
void djui_panel_main_menu_create(struct DjuiBase* caller);
static void djui_panel_menu_options_level_menu(UNUSED struct DjuiBase* caller) {
djui_base_set_enabled(&sUseStageMusicCheckbox->base, !gMenuStaffRoll);
djui_base_set_enabled(&sRandomStageCheckbox->base, !gMenuStaffRoll);
djui_base_set_enabled(&sVanillaDemosCheckbox->base, !gMenuStaffRoll);
if (gMenuStaffRoll) {
static void djui_panel_level_menu(UNUSED struct DjuiBase* caller) {
djui_base_set_enabled(&sLevelBox->base, !(configMenuRandom || configMenuStaffRoll));
djui_base_set_enabled(&sUseStageMusicCheckbox->base, !configMenuStaffRoll);
djui_base_set_enabled(&sRandomStageCheckbox->base, !configMenuStaffRoll);
djui_base_set_enabled(&sVanillaDemosCheckbox->base, !configMenuStaffRoll);
if (configMenuStaffRoll) {
warp_credits();
level_trigger_warp(gMarioState, WARP_OP_CREDITS_NEXT);
}
@ -60,8 +62,7 @@ void djui_panel_main_menu_create(struct DjuiBase* caller) {
djui_selectionbox_create(body, DLANG(DJUI_THEMES, DJUI_FONT), djuiFontChoices, 2, &configDjuiThemeFont, djui_panel_menu_options_djui_setting_change);
if (gDjuiInMainMenu) {
char* levelChoices[] = {
DLANG(MENU_OPTIONS, STAFF_ROLL),
char* levelChoices[18] = {
"CG",
"BOB",
"WF",
@ -82,16 +83,19 @@ void djui_panel_main_menu_create(struct DjuiBase* caller) {
"WDW"
};
djui_selectionbox_create(body, DLANG(MENU_OPTIONS, LEVEL), levelChoices, 19, &configMenuLevel, djui_panel_menu_options_level_menu);
struct DjuiSelectionbox* selectionbox1 = djui_selectionbox_create(body, DLANG(MENU_OPTIONS, LEVEL), levelChoices, 18, &configMenuLevel, NULL);
djui_base_set_enabled(&selectionbox1->base, !(configMenuRandom || configMenuStaffRoll));
sLevelBox = selectionbox1;
djui_checkbox_create(body, DLANG(MENU_OPTIONS, STAFF_ROLL), &configMenuStaffRoll, djui_panel_level_menu);
struct DjuiCheckbox* checkbox1 = djui_checkbox_create(body, DLANG(MENU_OPTIONS, USE_STAGE_MUSIC), &configMenuSound, NULL);
djui_base_set_enabled(&checkbox1->base, !gMenuStaffRoll);
djui_base_set_enabled(&checkbox1->base, !configMenuStaffRoll);
sUseStageMusicCheckbox = checkbox1;
struct DjuiCheckbox* checkbox2 = djui_checkbox_create(body, DLANG(MENU_OPTIONS, RANDOM_STAGE), &configMenuRandom, djui_panel_menu_options_level_menu);
djui_base_set_enabled(&checkbox2->base, !gMenuStaffRoll);
struct DjuiCheckbox* checkbox2 = djui_checkbox_create(body, DLANG(MENU_OPTIONS, RANDOM_STAGE), &configMenuRandom, djui_panel_level_menu);
djui_base_set_enabled(&checkbox2->base, !configMenuStaffRoll);
sRandomStageCheckbox = checkbox2;
struct DjuiCheckbox* checkbox3 = djui_checkbox_create(body, DLANG(MENU_OPTIONS, PLAY_VANILLA_DEMOS), &configMenuDemos, stop_demo);
djui_base_set_enabled(&checkbox3->base, !gMenuStaffRoll);
djui_base_set_enabled(&checkbox3->base, !configMenuStaffRoll);
sVanillaDemosCheckbox = checkbox3;
}