summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-01-03 00:58:59 +0000
committerrubidium <rubidium@openttd.org>2009-01-03 00:58:59 +0000
commit35f5783c62fd52fb07bf7c82224874d0a0084fd4 (patch)
tree9607ee17b88433bd8c52525be29f9105ea278417 /src
parentaff7feb767a4efa5221762b253fbe329ae65df10 (diff)
downloadopenttd-35f5783c62fd52fb07bf7c82224874d0a0084fd4.tar.xz
(svn r14792) -Feature: make the date format for default savegame/screenshot names configurable
Diffstat (limited to 'src')
-rw-r--r--src/lang/english.txt10
-rw-r--r--src/saveload.cpp8
-rw-r--r--src/settings.cpp1
-rw-r--r--src/settings_gui.cpp2
-rw-r--r--src/settings_type.h1
5 files changed, 20 insertions, 2 deletions
diff --git a/src/lang/english.txt b/src/lang/english.txt
index 3eedcec3b..5b1224f9f 100644
--- a/src/lang/english.txt
+++ b/src/lang/english.txt
@@ -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}
diff --git a/src/saveload.cpp b/src/saveload.cpp
index 79c81731c..2fb119e17 100644
--- a/src/saveload.cpp
+++ b/src/saveload.cpp
@@ -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);
}
diff --git a/src/settings.cpp b/src/settings.cpp
index bba8587a0..fe8715f18 100644
--- a/src/settings.cpp
+++ b/src/settings.cpp
@@ -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),
diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp
index c939d5f64..014a171e9 100644
--- a/src/settings_gui.cpp
+++ b/src/settings_gui.cpp
@@ -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,
diff --git a/src/settings_type.h b/src/settings_type.h
index 1414f5537..3cb58e960 100644
--- a/src/settings_type.h
+++ b/src/settings_type.h
@@ -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?