diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-01-14 22:45:51 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-01-14 22:45:51 +0300 |
commit | 1b7fa30e602ae18a68153d4e5acec8e4d9ea9e33 (patch) | |
tree | e06c3f015bd14d7c63c090b0bb7b016bc8d665e9 | |
parent | 1ae3d65ebcb0ac5b139d1b64670374726fb2a4aa (diff) | |
download | manaverse-1b7fa30e602ae18a68153d4e5acec8e4d9ea9e33.tar.gz manaverse-1b7fa30e602ae18a68153d4e5acec8e4d9ea9e33.tar.bz2 manaverse-1b7fa30e602ae18a68153d4e5acec8e4d9ea9e33.tar.xz manaverse-1b7fa30e602ae18a68153d4e5acec8e4d9ea9e33.zip |
Show server host name in screenshot file names.
-rw-r--r-- | src/game.cpp | 17 |
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++; |