(svn r11711) -Codechange: Name the Save Load Dialog Mode enum
authorbelugas
Thu, 27 Dec 2007 17:29:27 +0000
changeset 8645 83500ad80b08
parent 8644 7c12bf33e220
child 8646 cdf6b29351d0
(svn r11711) -Codechange: Name the Save Load Dialog Mode enum
src/fios.h
src/functions.h
src/intro_gui.cpp
src/main_gui.cpp
src/misc_gui.cpp
--- a/src/fios.h	Thu Dec 27 15:47:08 2007 +0000
+++ b/src/fios.h	Thu Dec 27 17:29:27 2007 +0000
@@ -31,6 +31,15 @@
 	char name[256 - 12 - 64];
 };
 
+enum SaveLoadDialogMode{
+	SLD_LOAD_GAME,
+	SLD_LOAD_SCENARIO,
+	SLD_SAVE_GAME,
+	SLD_SAVE_SCENARIO,
+	SLD_LOAD_HEIGHTMAP,
+	SLD_NEW_GAME,
+};
+
 enum {
 	FIOS_TYPE_DRIVE        =   0,
 	FIOS_TYPE_PARENT       =   1,
@@ -48,7 +57,10 @@
 /* Variables to display file lists */
 extern FiosItem *_fios_list; ///< defined in misc_gui.cpp
 extern int _fios_num;        ///< defined in fios.cpp, read_only version of _fios_count
-extern int _saveload_mode;   ///< defined in misc_gui.cpp
+extern SaveLoadDialogMode _saveload_mode;   ///< defined in misc_gui.cpp
+
+/* Launch save/load dialog */
+void ShowSaveLoadDialog(SaveLoadDialogMode mode);
 
 /* Get a list of savegames */
 FiosItem *FiosGetSavegameList(int mode);
--- a/src/functions.h	Thu Dec 27 15:47:08 2007 +0000
+++ b/src/functions.h	Thu Dec 27 17:29:27 2007 +0000
@@ -77,15 +77,6 @@
 
 void UpdateViewportSignPos(ViewportSign *sign, int left, int top, StringID str);
 
-enum {
-	SLD_LOAD_GAME,
-	SLD_LOAD_SCENARIO,
-	SLD_SAVE_GAME,
-	SLD_SAVE_SCENARIO,
-	SLD_LOAD_HEIGHTMAP,
-	SLD_NEW_GAME,
-};
-void ShowSaveLoadDialog(int mode);
 
 /* callback from drivers that is called if the game size changes dynamically */
 void GameSizeChanged();
--- a/src/intro_gui.cpp	Thu Dec 27 15:47:08 2007 +0000
+++ b/src/intro_gui.cpp	Thu Dec 27 17:29:27 2007 +0000
@@ -18,8 +18,8 @@
 #include "network/network_gui.h"
 #include "newgrf.h"
 #include "strings_func.h"
-#include "functions.h"
 #include "window_func.h"
+#include "fios.h"
 
 static const Widget _select_game_widgets[] = {
 {    WWT_CAPTION, RESIZE_NONE, 13,   0, 335,   0,  13, STR_0307_OPENTTD,         STR_NULL},
--- a/src/main_gui.cpp	Thu Dec 27 15:47:08 2007 +0000
+++ b/src/main_gui.cpp	Thu Dec 27 17:29:27 2007 +0000
@@ -41,6 +41,7 @@
 #include "date_func.h"
 #include "functions.h"
 #include "vehicle_func.h"
+#include "fios.h"
 
 #include "network/network_data.h"
 #include "network/network_client.h"
--- a/src/misc_gui.cpp	Thu Dec 27 15:47:08 2007 +0000
+++ b/src/misc_gui.cpp	Thu Dec 27 17:29:27 2007 +0000
@@ -43,7 +43,7 @@
 
 /* Variables to display file lists */
 FiosItem *_fios_list;
-int _saveload_mode;
+SaveLoadDialogMode _saveload_mode;
 
 
 static bool _fios_path_changed;
@@ -1671,7 +1671,7 @@
 	SaveLoadDlgWndProc,
 };
 
-void ShowSaveLoadDialog(int mode)
+void ShowSaveLoadDialog(SaveLoadDialogMode mode)
 {
 	static const StringID saveload_captions[] = {
 		STR_4001_LOAD_GAME,