(svn r14792) -Feature: make the date format for default savegame/screenshot names configurable

This commit is contained in:
rubidium 2009-01-03 00:58:59 +00:00
parent aff7feb767
commit 35f5783c62
5 changed files with 20 additions and 2 deletions

View File

@ -1128,6 +1128,11 @@ STR_CONFIG_PATCHES_RIGHT_MOUSE_BTN_EMU_OFF :Off
STR_CONFIG_PATCHES_LEFT_MOUSE_BTN_SCROLLING :{LTBLUE}Left-click scrolling: {ORANGE}{STRING1}
STR_CONFIG_PATCHES_DATE_FORMAT_IN_SAVE_NAMES :{LTBLUE}Use the {ORANGE}{STRING1}{LTBLUE} date format for savegame names.
STR_CONFIG_PATCHES_DATE_FORMAT_IN_SAVE_NAMES_LONG :long (31st Dec 2008)
STR_CONFIG_PATCHES_DATE_FORMAT_IN_SAVE_NAMES_SHORT :short (31-12-2008)
STR_CONFIG_PATCHES_DATE_FORMAT_IN_SAVE_NAMES_ISO :ISO (2008-12-31)
STR_CONFIG_PATCHES_PAUSE_ON_NEW_GAME :{LTBLUE}Automatically pause when starting a new game: {ORANGE}{STRING1}
STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS :{LTBLUE}Use the advanced vehicle list: {ORANGE}{STRING1}
STR_CONFIG_PATCHES_ADVANCED_VEHICLE_LISTS_OFF :Off
@ -2011,7 +2016,7 @@ STR_4000_SAVE_GAME :{WHITE}Save Gam
STR_4001_LOAD_GAME :{WHITE}Load Game
STR_4002_SAVE :{BLACK}Save
STR_4003_DELETE :{BLACK}Delete
STR_4004 :{COMPANY}, {DATE_LONG}
STR_4004 :{COMPANY}, {STRING1}
STR_4005_BYTES_FREE :{BLACK}{COMMA} megabyte{P "" s} free
STR_4006_UNABLE_TO_READ_DRIVE :{BLACK}Unable to read drive
STR_4007_GAME_SAVE_FAILED :{WHITE}Game Save Failed{}{STRING}
@ -3506,6 +3511,9 @@ STR_DATE_SHORT :{STRING} {NUM}
STR_DATE_LONG :{STRING} {STRING} {NUM}
STR_DATE_ISO :{2:NUM}-{1:RAW_STRING}-{0:RAW_STRING}
STR_JUST_DATE_TINY :{DATE_TINY}
STR_JUST_DATE_LONG :{DATE_LONG}
STR_JUST_DATE_ISO :{DATE_ISO}
########
STR_FEEDER_CARGO_VALUE :{BLACK}Transfer Credits: {LTBLUE}{CURRENCY}

View File

@ -1829,7 +1829,13 @@ void GenerateDefaultSaveName(char *buf, const char *last)
/* Check if we are not a spectator who wants to generate a name..
* Let's use the name of company #0 for now. */
SetDParam(0, IsValidCompanyID(_local_company) ? _local_company : COMPANY_FIRST);
SetDParam(1, _date);
switch (_settings_client.gui.date_format_in_default_names) {
case 0: SetDParam(1, STR_JUST_DATE_LONG); break;
case 1: SetDParam(1, STR_JUST_DATE_TINY); break;
case 2: SetDParam(1, STR_JUST_DATE_ISO); break;
default: NOT_REACHED();
}
SetDParam(2, _date);
GetString(buf, STR_4004, last);
SanitizeFilename(buf);
}

View File

@ -1418,6 +1418,7 @@ const SettingDesc _patch_settings[] = {
/***************************************************************************/
/* Unsaved patch variables. */
SDTC_OMANY(gui.autosave, SLE_UINT8, S, 0, 1, 4, "off|monthly|quarterly|half year|yearly", STR_NULL, NULL),
SDTC_OMANY(gui.date_format_in_default_names,SLE_UINT8,S,MS, 0, 2, "long|short|iso", STR_CONFIG_PATCHES_DATE_FORMAT_IN_SAVE_NAMES, NULL),
SDTC_BOOL(gui.vehicle_speed, S, 0, true, STR_CONFIG_PATCHES_VEHICLESPEED, NULL),
SDTC_BOOL(gui.status_long_date, S, 0, true, STR_CONFIG_PATCHES_LONGDATE, NULL),
SDTC_BOOL(gui.show_finances, S, 0, true, STR_CONFIG_PATCHES_SHOWFINANCES, NULL),

View File

@ -586,6 +586,7 @@ void ShowGameDifficulty()
static const char *_patches_ui[] = {
"gui.vehicle_speed",
"gui.status_long_date",
"gui.date_format_in_default_names",
"gui.show_finances",
"gui.autoscroll",
"gui.reverse_scroll",
@ -889,6 +890,7 @@ struct PatchesSelectionWindow : Window {
switch (sdb->cmd) {
case SDT_BOOLX: value ^= 1; break;
case SDT_ONEOFMANY:
case SDT_NUMX: {
/* Add a dynamic step-size to the scroller. In a maximum of
* 50-steps you should be able to get from min to max,

View File

@ -61,6 +61,7 @@ struct GUISettings {
byte autosave; ///< how often should we do autosaves?
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?"
uint8 date_format_in_default_names; ///< should the default savegame/screenshot name use long dates (31th Dec 2008), short dates (31-12-2008) or ISO dates (2008-12-31)
byte max_num_autosaves; ///< controls how many autosavegames are made before the game starts to overwrite (names them 0 to max_num_autosaves - 1)
bool population_in_label; ///< show the population of a town in his label?
uint8 right_mouse_btn_emulation; ///< should we emulate right mouse clicking?