From 3557e895fea5cdb9d963a03917246fa165c1e400 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Thu, 11 Jun 2020 06:12:03 +0300 Subject: [PATCH] add apply button to display settings --- include/text_options_strings.h.in | 2 ++ src/game/options_menu.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/text_options_strings.h.in b/include/text_options_strings.h.in index 20b36f5c..194ddbbb 100644 --- a/include/text_options_strings.h.in +++ b/include/text_options_strings.h.in @@ -52,6 +52,7 @@ #define TEXT_RESET_WINDOW _("RESET WINDOW") #define TEXT_OPT_HUD _("HUD") #define TEXT_OPT_THREEPOINT _("THREE POINT") +#define TEXT_OPT_APPLY _("APPLY") #define TEXT_BIND_A _("A BUTTON") #define TEXT_BIND_B _("B BUTTON") @@ -111,6 +112,7 @@ #define TEXT_RESET_WINDOW _("Reset Window") #define TEXT_OPT_HUD _("HUD") #define TEXT_OPT_THREEPOINT _("Three-point") +#define TEXT_OPT_APPLY _("Apply") #define TEXT_BIND_A _("A Button") #define TEXT_BIND_B _("B Button") diff --git a/src/game/options_menu.c b/src/game/options_menu.c index 6b2c5bf8..5700700d 100644 --- a/src/game/options_menu.c +++ b/src/game/options_menu.c @@ -81,6 +81,7 @@ static const u8 optsVideoStr[][32] = { { TEXT_OPT_DOUBLE }, { TEXT_OPT_HUD }, { TEXT_OPT_THREEPOINT }, + { TEXT_OPT_APPLY }, }; static const u8 optsAudioStr[][32] = { @@ -206,6 +207,10 @@ static void optvideo_reset_window(UNUSED struct Option *self, s32 arg) { } } +static void optvideo_apply(UNUSED struct Option *self, s32 arg) { + if (!arg) configWindow.settings_changed = true; +} + /* submenu option lists */ #ifdef BETTERCAMERA @@ -247,8 +252,9 @@ static struct Option optsVideo[] = { DEF_OPT_TOGGLE( optsVideoStr[0], &configWindow.fullscreen ), DEF_OPT_CHOICE( optsVideoStr[5], &configWindow.vsync, vsyncChoices ), DEF_OPT_CHOICE( optsVideoStr[1], &configFiltering, filterChoices ), - DEF_OPT_BUTTON( optsVideoStr[4], optvideo_reset_window ), DEF_OPT_TOGGLE( optsVideoStr[7], &configHUD ), + DEF_OPT_BUTTON( optsVideoStr[4], optvideo_reset_window ), + DEF_OPT_BUTTON( optsVideoStr[9], optvideo_apply ), }; static struct Option optsAudio[] = {