From 1b7fa30e602ae18a68153d4e5acec8e4d9ea9e33 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 14 Jan 2014 22:45:51 +0300 Subject: Show server host name in screenshot file names. --- src/game.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/game.cpp') 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++; -- cgit v1.2.3-70-g09d2