summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-01-14 22:45:51 +0300
committerAndrei Karas <akaras@inbox.ru>2014-01-14 22:45:51 +0300
commit1b7fa30e602ae18a68153d4e5acec8e4d9ea9e33 (patch)
treee06c3f015bd14d7c63c090b0bb7b016bc8d665e9 /src
parent1ae3d65ebcb0ac5b139d1b64670374726fb2a4aa (diff)
downloadmv-1b7fa30e602ae18a68153d4e5acec8e4d9ea9e33.tar.gz
mv-1b7fa30e602ae18a68153d4e5acec8e4d9ea9e33.tar.bz2
mv-1b7fa30e602ae18a68153d4e5acec8e4d9ea9e33.tar.xz
mv-1b7fa30e602ae18a68153d4e5acec8e4d9ea9e33.zip
Show server host name in screenshot file names.
Diffstat (limited to 'src')
-rw-r--r--src/game.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/game.cpp b/src/game.cpp
index 11bc81910..91a9038c8 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -536,8 +536,21 @@ bool Game::saveScreenshot(SDL_Surface *const screenshot)
struct tm *const timeinfo = localtime(&rawtime);
strftime(buffer, 99, "%Y-%m-%d_%H-%M-%S", timeinfo);
- const std::string screenShortStr = strprintf("%s_Screenshot_%s_",
- branding.getValue("appName", "ManaPlus").c_str(), buffer);
+ const std::string serverName = client->getServerName();
+ std::string screenShortStr;
+ if (serverName.empty())
+ {
+ screenShortStr = strprintf("%s_Screenshot_%s_",
+ branding.getValue("appName", "ManaPlus").c_str(),
+ buffer);
+ }
+ else
+ {
+ screenShortStr = strprintf("%s_Screenshot_%s_%s_",
+ branding.getValue("appName", "ManaPlus").c_str(),
+ serverName.c_str(), buffer);
+ }
+
do
{
screenshotCount++;