UpdateMousePosition();
SetWindowTitle();
+
+ // required if executed from outside setup menu
+ SaveSetupIfNeeded();
}
}
#if defined(PLATFORM_ANDROID)
TYPE_SWITCH,
&setup.show_undo_redo_buttons, "show_undo_redo_buttons"
},
+ {
+ TYPE_SWITCH,
+ &setup.show_menu_to_save_setup, "show_menu_to_save_setup"
+ },
{
TYPE_STRING,
&setup.scores_in_highscore_list, "scores_in_highscore_list"
si->small_game_graphics = FALSE;
si->show_load_save_buttons = FALSE;
si->show_undo_redo_buttons = FALSE;
+ si->show_menu_to_save_setup = FALSE;
si->scores_in_highscore_list = getStringCopy(STR_SCORES_TYPE_DEFAULT);
si->graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR);
SaveSetup_EditorCascade();
}
+void SaveSetupIfNeeded(void)
+{
+ // save changed setup value if "save and exit" menu disabled
+ if (!setup.show_menu_to_save_setup)
+ SaveSetup();
+}
+
static void SaveSetup_WriteGameControllerMappings(SetupFileHash *mappings_hash,
char *filename)
{
void LoadSetup(void);
void SaveSetup(void);
+void SaveSetupIfNeeded(void);
void SaveSetup_AddGameControllerMapping(char *);
boolean small_game_graphics;
boolean show_load_save_buttons;
boolean show_undo_redo_buttons;
+ boolean show_menu_to_save_setup;
char *scores_in_highscore_list;
char *graphics_set;
static boolean OfferUploadTapes(void);
static void execOfferUploadTapes(void);
+static void execSaveAndExitSetup(void);
static void DrawHallOfFame_setScoreEntries(void);
static void HandleHallOfFame_SelectLevel(int, int);
execSetupTouch();
else
execSetupArtwork();
+
+ SaveSetupIfNeeded();
}
else
{
{ TYPE_STRING, &snapshot_mode_text, "" },
{ TYPE_SWITCH, &setup.show_load_save_buttons, "Show Load/Save Buttons:" },
{ TYPE_SWITCH, &setup.show_undo_redo_buttons, "Show Undo/Redo Buttons:" },
+ { TYPE_SWITCH, &setup.show_menu_to_save_setup, "Show Menu to Save Setup:" },
{ TYPE_EMPTY, NULL, "" },
{ TYPE_LEAVE_MENU, execSetupMain, "Back" },
// update old setup options from new setup options
if (si->value == &setup.allow_skipping_levels)
UpdateHandicapAndSkipLevels();
+
+ SaveSetupIfNeeded();
}
static struct TokenInfo *getSetupInfoFinal(struct TokenInfo *setup_info_orig)
{
setup_info = setup_info_main;
title_string = STR_SETUP_MAIN;
+
+ if (!setup.show_menu_to_save_setup)
+ setHideSetupEntry(execSaveAndExitSetup);
+ else
+ removeHideSetupEntry(execSaveAndExitSetup);
}
else if (setup_mode == SETUP_MODE_GAME)
{
#include "libgame/libgame.h"
#include "tools.h"
+#include "files.h"
#include "init.h"
#include "game.h"
#include "events.h"
// set setup value according to successfully changed fullscreen mode
setup.fullscreen = video.fullscreen_enabled;
+
+ // required if executed from outside setup menu
+ SaveSetupIfNeeded();
}
void ChangeWindowScalingIfNeeded(void)
// set setup value according to successfully changed window scaling
setup.window_scaling_percent = video.window_scaling_percent;
+
+ // required if executed from outside setup menu
+ SaveSetupIfNeeded();
}
void ChangeVsyncModeIfNeeded(void)