From 5d347212ab6c7a927df541e39ba7cecca1da5d1d Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 30 Nov 2024 14:59:07 -0500 Subject: [PATCH] Use `SubMenu()` to open options menu --- src/swconf.c | 7 +------ src/swconf.h | 3 ++- src/swtitle.c | 9 +-------- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/swconf.c b/src/swconf.c index f072041..e6fa19d 100644 --- a/src/swconf.c +++ b/src/swconf.c @@ -301,12 +301,7 @@ static const struct menuitem options_menu_items[] = { {0, NULL}, }; -static const struct menu options_menu = { +const struct menu options_menu = { FullscreenBackground, "OPTIONS > KEY BINDINGS", options_menu_items, }; - -void setconfig(void) -{ - RunMenu(&options_menu); -} diff --git a/src/swconf.h b/src/swconf.h index 4e55f48..396e6f7 100644 --- a/src/swconf.h +++ b/src/swconf.h @@ -35,6 +35,7 @@ extern const struct conf_option *ConfOptionByName(const char *name); extern void swloadconf(void); extern void swsaveconf(void); -extern void setconfig(void); // config menu + +extern const struct menu options_menu; #endif diff --git a/src/swtitle.c b/src/swtitle.c index 492a50d..62a4287 100644 --- a/src/swtitle.c +++ b/src/swtitle.c @@ -211,13 +211,6 @@ static enum menu_action StartVsComputer(const struct menuitem *item) return MENU_ACTION_RETURN; } -// TODO: This function is unnecessary. -static enum menu_action OpenOptionsMenu(const struct menuitem *item) -{ - setconfig(); - return MENU_ACTION_NONE; -} - #ifdef __EMSCRIPTEN__ static enum menu_action OpenManual(const struct menuitem *item) { @@ -246,7 +239,7 @@ static const struct menuitem main_menu_items[] = { #ifdef TCPIP {'N', "network game", SubMenu, &netgame_menu}, #endif - {'O', "game options", OpenOptionsMenu}, + {'O', "game options", SubMenu, &options_menu}, #ifdef __EMSCRIPTEN__ {'M', "open manual", OpenManual}, {'I', "install as app", InstallApp},