summaryrefslogtreecommitdiff
path: root/src/misc_gui.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-12-28 04:20:56 +0000
committerbelugas <belugas@openttd.org>2007-12-28 04:20:56 +0000
commite9a039b845afb5296a37d8413c8c651b1eb699fb (patch)
tree3e955cb6c9b2d6c09572877bb7dfe3a00eb7a9cc /src/misc_gui.cpp
parent5087a6cdd76276118bcba6bd4c14425da76eef7d (diff)
downloadopenttd-e9a039b845afb5296a37d8413c8c651b1eb699fb.tar.xz
(svn r11714) -Fix[FS#1569]: Do not allow player inauguration date on scenarios to be bigger than current year.
This will not (yet) be true if you are loading a scenario with the "-g" command line option.
Diffstat (limited to 'src/misc_gui.cpp')
-rw-r--r--src/misc_gui.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp
index 606ff4499..679cefe42 100644
--- a/src/misc_gui.cpp
+++ b/src/misc_gui.cpp
@@ -1671,6 +1671,17 @@ static const WindowDesc _save_dialog_desc = {
SaveLoadDlgWndProc,
};
+/** These values are used to convert the file/operations mode into a corresponding file type.
+ * So each entry, as expressed by the related comment, is based on the enum */
+static const FileType _file_modetotype[] = {
+ FT_SAVEGAME, ///< used for SLD_LOAD_GAME
+ FT_SCENARIO, ///< used for SLD_LOAD_SCENARIO
+ FT_SAVEGAME, ///< used for SLD_SAVE_GAME
+ FT_SCENARIO, ///< used for SLD_SAVE_SCENARIO
+ FT_HEIGHTMAP, ///< used for SLD_LOAD_HEIGHTMAP
+ FT_SAVEGAME, ///< SLD_NEW_GAME
+};
+
void ShowSaveLoadDialog(SaveLoadDialogMode mode)
{
static const StringID saveload_captions[] = {
@@ -1692,6 +1703,9 @@ void ShowSaveLoadDialog(SaveLoadDialogMode mode)
_saveload_mode = mode;
SetBit(_no_scroll, SCROLL_SAVE);
+ /* Use an array to define what will be the current file type being handled
+ * by current file mode */
+ _file_to_saveload.filetype = _file_modetotype[mode];
switch (mode) {
case SLD_SAVE_GAME: GenerateFileName(); break;
case SLD_SAVE_SCENARIO: strcpy(_edit_str_buf, "UNNAMED"); break;