Fix menu options causing trouble with Staff Roll

This commit is contained in:
Agent X 2023-11-26 21:28:18 -05:00
parent 3498aec703
commit e50b57ac60

View file

@ -11,11 +11,17 @@
#include "src/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_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);
@ -83,9 +89,15 @@ void djui_panel_main_menu_create(struct DjuiBase* caller) {
sLevelBox = selectionbox1;
djui_checkbox_create(body, DLANG(MENU_OPTIONS, STAFF_ROLL), &configMenuStaffRoll, djui_panel_level_menu);
djui_checkbox_create(body, DLANG(MENU_OPTIONS, USE_STAGE_MUSIC), &configMenuSound, NULL);
djui_checkbox_create(body, DLANG(MENU_OPTIONS, RANDOM_STAGE), &configMenuRandom, djui_panel_level_menu);
djui_checkbox_create(body, DLANG(MENU_OPTIONS, PLAY_VANILLA_DEMOS), &configMenuDemos, stop_demo);
struct DjuiCheckbox* checkbox1 = djui_checkbox_create(body, DLANG(MENU_OPTIONS, USE_STAGE_MUSIC), &configMenuSound, NULL);
struct DjuiCheckbox* checkbox2 = djui_checkbox_create(body, DLANG(MENU_OPTIONS, RANDOM_STAGE), &configMenuRandom, djui_panel_level_menu);
struct DjuiCheckbox* checkbox3 = djui_checkbox_create(body, DLANG(MENU_OPTIONS, PLAY_VANILLA_DEMOS), &configMenuDemos, stop_demo);
djui_base_set_enabled(&checkbox1->base, !configMenuStaffRoll);
djui_base_set_enabled(&checkbox2->base, !configMenuStaffRoll);
djui_base_set_enabled(&checkbox3->base, !configMenuStaffRoll);
sUseStageMusicCheckbox = checkbox1;
sRandomStageCheckbox = checkbox2;
sVanillaDemosCheckbox = checkbox3;
}
djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back);