(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 761a3037c3
commit 4c1c6cd8e8
5 changed files with 20 additions and 2 deletions

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);
}