Skip to content

Commit

Permalink
Use SubMenu() to open options menu
Browse files Browse the repository at this point in the history
  • Loading branch information
fragglet committed Nov 30, 2024
1 parent 42ed26b commit 5d34721
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
7 changes: 1 addition & 6 deletions src/swconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
3 changes: 2 additions & 1 deletion src/swconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 1 addition & 8 deletions src/swtitle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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},
Expand Down

0 comments on commit 5d34721

Please sign in to comment.