diff options
author | alberth <alberth@openttd.org> | 2016-09-04 12:44:42 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2016-09-04 12:44:42 +0000 |
commit | a52864ef27729b3d8458d003a999de4655d59341 (patch) | |
tree | b0f132e7fa0d1614123ca9a11b6388e1fbe3990d | |
parent | 9156d7bf346b77c40acc156d5c1de002d76790c9 (diff) | |
download | openttd-a52864ef27729b3d8458d003a999de4655d59341.tar.xz |
(svn r27633) -Codechange: Extract _saveload_mode use from BuildFileList
-rw-r--r-- | src/console_cmds.cpp | 4 | ||||
-rw-r--r-- | src/fios.h | 2 | ||||
-rw-r--r-- | src/fios_gui.cpp | 12 |
3 files changed, 9 insertions, 9 deletions
diff --git a/src/console_cmds.cpp b/src/console_cmds.cpp index 8d9e04113..8df5b15cd 100644 --- a/src/console_cmds.cpp +++ b/src/console_cmds.cpp @@ -324,7 +324,7 @@ DEF_CONSOLE_CMD(ConSaveConfig) static const FiosItem *GetFiosItem(const char *file) { _saveload_mode = SLD_LOAD_GAME; - BuildFileList(); + BuildFileList(_saveload_mode); for (const FiosItem *item = _fios_items.Begin(); item != _fios_items.End(); item++) { if (strcmp(file, item->name) == 0) return item; @@ -415,7 +415,7 @@ DEF_CONSOLE_CMD(ConListFiles) return true; } - BuildFileList(); + BuildFileList(_saveload_mode); for (uint i = 0; i < _fios_items.Length(); i++) { IConsolePrintF(CC_DEFAULT, "%d) %s", i, _fios_items[i].title); diff --git a/src/fios.h b/src/fios.h index b26fe0092..b9bf390bb 100644 --- a/src/fios.h +++ b/src/fios.h @@ -179,7 +179,7 @@ int CDECL CompareFiosItems(const FiosItem *a, const FiosItem *b); extern const TextColour _fios_colours[]; -void BuildFileList(); +void BuildFileList(SaveLoadDialogMode mode); void SetFiosType(const byte fiostype); #endif /* FIOS_H */ diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index 9316deb65..401cb8254 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -193,20 +193,20 @@ const TextColour _fios_colours[] = { TC_ORANGE, TC_LIGHT_BROWN, TC_ORANGE, TC_ORANGE, TC_YELLOW }; -void BuildFileList() +void BuildFileList(SaveLoadDialogMode mode) { _fios_path_changed = true; FiosFreeSavegameList(); - switch (_saveload_mode) { + switch (mode) { case SLD_LOAD_SCENARIO: case SLD_SAVE_SCENARIO: - FiosGetScenarioList(_saveload_mode); break; + FiosGetScenarioList(mode); break; case SLD_SAVE_HEIGHTMAP: case SLD_LOAD_HEIGHTMAP: - FiosGetHeightmapList(_saveload_mode); break; + FiosGetHeightmapList(mode); break; - default: FiosGetSavegameList(_saveload_mode); break; + default: FiosGetSavegameList(mode); break; } /* Invalidate saveload window */ @@ -683,7 +683,7 @@ public: this->selected = NULL; _load_check_data.Clear(); if (!gui_scope) break; - BuildFileList(); + BuildFileList(_saveload_mode); /* FALL THROUGH */ case 1: /* Selection changes */ |