WIP backup savegames to network

This commit is contained in:
pelya
2014-08-25 01:49:35 +03:00
parent b7ae49dda0
commit 35baed064a
5 changed files with 19 additions and 1 deletions

View File

@@ -107,6 +107,7 @@ static const NWidgetPart _nested_load_dialog_widgets[] = {
EndContainer(),
NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(),
NWidget(WWT_PUSHTXTBTN, COLOUR_GREY, WID_SL_LOAD_NETWORK_BUTTON), SetDataTip(STR_SAVELOAD_LOAD_NETWORK_BUTTON, STR_SAVELOAD_LOAD_NETWORK_TOOLTIP), SetFill(1, 0), SetResize(1, 0),
EndContainer(),
EndContainer(),
};
@@ -178,7 +179,7 @@ static const NWidgetPart _nested_save_dialog_widgets[] = {
NWidget(WWT_PANEL, COLOUR_GREY),
NWidget(WWT_EMPTY, INVALID_COLOUR, WID_SL_DETAILS), SetResize(1, 1), SetFill(1, 1),
NWidget(NWID_HORIZONTAL),
NWidget(NWID_SPACER), SetResize(1, 0), SetFill(1, 1),
NWidget(WWT_TEXTBTN, COLOUR_GREY, WID_SL_SAVE_NETWORK_BUTTON), SetDataTip(STR_SAVELOAD_SAVE_NETWORK_BUTTON, STR_SAVELOAD_SAVE_NETWORK_TOOLTIP), SetFill(1, 1), SetResize(1, 0),
NWidget(WWT_RESIZEBOX, COLOUR_GREY),
EndContainer(),
EndContainer(),

View File

@@ -2716,6 +2716,10 @@ STR_SAVELOAD_SAVE_TOOLTIP :{BLACK}Save the
STR_SAVELOAD_LOAD_BUTTON :{BLACK}Load
STR_SAVELOAD_LOAD_TOOLTIP :{BLACK}Load the selected game
STR_SAVELOAD_LOAD_HEIGHTMAP_TOOLTIP :{BLACK}Load the selected heightmap
STR_SAVELOAD_LOAD_NETWORK_BUTTON :{BLACK}Load from network
STR_SAVELOAD_LOAD_NETWORK_TOOLTIP :{BLACK}Load a game from the network storage
STR_SAVELOAD_SAVE_NETWORK_BUTTON :{BLACK}Save to network
STR_SAVELOAD_SAVE_NETWORK_TOOLTIP :{BLACK}Back up the game to the network storage
STR_SAVELOAD_DETAIL_CAPTION :{BLACK}Game Details
STR_SAVELOAD_DETAIL_NOT_AVAILABLE :{BLACK}No information available
STR_SAVELOAD_DETAIL_COMPANY_INDEX :{SILVER}{COMMA}: {WHITE}{STRING1}

View File

@@ -105,6 +105,7 @@ struct GUISettings {
ZoomLevelByte zoom_max; ///< maximum zoom out level
bool disable_unsuitable_building; ///< disable infrastructure building when no suitable vehicles are available
byte autosave; ///< how often should we do autosaves?
byte save_to_network; ///< backup all savegames to network
bool threaded_saves; ///< should we do threaded saves?
bool keep_all_autosave; ///< name the autosave in a different way
bool autosave_on_exit; ///< save an autosave when you quit the game, but do not ask "Do you really want to quit?"

View File

@@ -19,6 +19,7 @@ static const char *_locale_units = "imperial|metric|si";
static const char *_town_names = "english|french|german|american|latin|silly|swedish|dutch|finnish|polish|slovak|norwegian|hungarian|austrian|romanian|czech|swiss|danish|turkish|italian|catalan";
static const char *_climates = "temperate|arctic|tropic|toyland";
static const char *_autosave_interval = "off|monthly|quarterly|half year|yearly";
static const char *_save_to_network = "ask|enabled|disabled";
static const char *_roadsides = "left|right";
static const char *_savegame_date = "long|short|iso";
#ifdef ENABLE_NETWORK
@@ -173,6 +174,15 @@ max = 4
full = _autosave_interval
cat = SC_BASIC
[SDTC_OMANY]
var = gui.save_to_network
type = SLE_UINT8
flags = SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC
def = 0
max = 2
full = _save_to_network
cat = SC_BASIC
[SDT_OMANY]
base = GameSettings
var = vehicle.road_side

View File

@@ -31,6 +31,8 @@ enum SaveLoadWidgets {
WID_SL_NEWGRF_INFO, ///< Button to open NewGgrf configuration.
WID_SL_LOAD_BUTTON, ///< Button to load game/scenario.
WID_SL_MISSING_NEWGRFS, ///< Button to find missing NewGRFs online.
WID_SL_SAVE_NETWORK_BUTTON, ///< Toggle button to back up savegame to the network storage.
WID_SL_LOAD_NETWORK_BUTTON, ///< Button to load game from the network storage.
};
#endif /* WIDGETS_FIOS_WIDGET_H */