src/fios.h
branchnoai
changeset 9723 eee46cb39750
parent 9722 ebf0ece7d8f6
child 9724 b39bc69bb2f2
--- a/src/fios.h	Fri Nov 23 16:59:30 2007 +0000
+++ b/src/fios.h	Wed Jan 09 18:11:12 2008 +0000
@@ -23,12 +23,21 @@
 	MAX_FILE_SLOTS = 64
 };
 
-/* Deals with finding savegames */
-struct FiosItem {
-	byte type;
-	uint64 mtime;
-	char title[64];
-	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,
+};
+
+/* The different types of files been handled by the system */
+enum FileType {
+	FT_NONE,      ///< nothing to do
+	FT_SAVEGAME,  ///< old or new savegame
+	FT_SCENARIO,  ///< old or new scenario
+	FT_HEIGHTMAP, ///< heightmap file
 };
 
 enum {
@@ -45,10 +54,30 @@
 	FIOS_TYPE_INVALID      = 255,
 };
 
+/* Deals with finding savegames */
+struct FiosItem {
+	byte type;
+	uint64 mtime;
+	char title[64];
+	char name[256 - 12 - 64];
+};
+
+/* Deals with the type of the savegame, independent of extension */
+struct SmallFiosItem {
+	int mode;             ///< savegame/scenario type (old, new)
+	FileType filetype;    ///< what type of file are we dealing with
+	char name[MAX_PATH];  ///< name
+	char title[255];      ///< internal name of the game
+};
+
 /* 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 SmallFiosItem _file_to_saveload;
+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);