(svn r14790) -Codechange: unify generation of default savegame/screenshot names (PhilSophus)

This commit is contained in:
rubidium
2009-01-02 22:49:43 +00:00
parent 1357b0a4c2
commit 3a0d966ae4
5 changed files with 22 additions and 19 deletions

View File

@@ -17,7 +17,7 @@
#include "core/alloc_func.hpp"
#include "core/endian_func.hpp"
#include "map_func.h"
#include "date_func.h"
#include "saveload.h"
#include "company_func.h"
#include "table/strings.h"
@@ -550,13 +550,10 @@ static char *MakeScreenshotName(const char *ext)
if (_game_mode == GM_EDITOR || _game_mode == GM_MENU || _local_company == COMPANY_SPECTATOR) {
strecpy(_screenshot_name, "screenshot", lastof(_screenshot_name));
} else {
SetDParam(0, _local_company);
SetDParam(1, _date);
GetString(_screenshot_name, STR_4004, lastof(_screenshot_name));
GenerateDefaultSaveName(_screenshot_name, lastof(_screenshot_name));
}
/* Add extension to screenshot file */
SanitizeFilename(_screenshot_name);
len = strlen(_screenshot_name);
snprintf(&_screenshot_name[len], lengthof(_screenshot_name) - len, ".%s", ext);
@@ -619,6 +616,3 @@ bool MakeScreenshot()
default: return false;
}
}