diff --git a/data/IntroText.h b/data/IntroText.h index 4901cbfb94..718aebe9fd 100644 --- a/data/IntroText.h +++ b/data/IntroText.h @@ -29,6 +29,9 @@ static const char *introTextData = #endif "\n" "\bt" MTOS(SAVE_VERSION) "." MTOS(MINOR_VERSION) "." MTOS(BUILD_NUM) " " IDENT_PLATFORM " " +#ifdef SNAPSHOT + "SNAPSHOT " MTOS(SNAPSHOT_ID) " " +#endif #ifdef X86 "X86 " #endif diff --git a/src/client/Client.cpp b/src/client/Client.cpp index 750266a1a3..95ac31ec04 100644 --- a/src/client/Client.cpp +++ b/src/client/Client.cpp @@ -816,11 +816,11 @@ bool Client::CheckUpdate(void *updateRequest, bool checkSession) json::Number stableMinor = stableVersion["Minor"]; json::Number stableBuild = stableVersion["Build"]; json::String stableFile = stableVersion["File"]; - json::String changelog = stableVersion["Changelog"]; + json::String stableChangelog = stableVersion["Changelog"]; if (stableMajor.Value()>SAVE_VERSION || (stableMinor.Value()>MINOR_VERSION && stableMajor.Value()==SAVE_VERSION) || stableBuild.Value()>BUILD_NUM) { updateAvailable = true; - updateInfo = UpdateInfo(stableMajor.Value(), stableMinor.Value(), stableBuild.Value(), stableFile.Value(), changelog.Value(), UpdateInfo::Stable); + updateInfo = UpdateInfo(stableMajor.Value(), stableMinor.Value(), stableBuild.Value(), stableFile.Value(), stableChangelog.Value(), UpdateInfo::Stable); } #endif @@ -830,11 +830,11 @@ bool Client::CheckUpdate(void *updateRequest, bool checkSession) json::Number betaMinor = betaVersion["Minor"]; json::Number betaBuild = betaVersion["Build"]; json::String betaFile = betaVersion["File"]; - json::String changelog = stableVersion["Changelog"]; + json::String betaChangelog = betaVersion["Changelog"]; if (betaMajor.Value()>SAVE_VERSION || (betaMinor.Value()>MINOR_VERSION && betaMajor.Value()==SAVE_VERSION) || betaBuild.Value()>BUILD_NUM) { updateAvailable = true; - updateInfo = UpdateInfo(betaMajor.Value(), betaMinor.Value(), betaBuild.Value(), betaFile.Value(), changelog.Value(), UpdateInfo::Beta); + updateInfo = UpdateInfo(betaMajor.Value(), betaMinor.Value(), betaBuild.Value(), betaFile.Value(), betaChangelog.Value(), UpdateInfo::Beta); } #endif @@ -842,11 +842,11 @@ bool Client::CheckUpdate(void *updateRequest, bool checkSession) json::Object snapshotVersion = versions["Snapshot"]; json::Number snapshotSnapshot = snapshotVersion["Snapshot"]; json::String snapshotFile = snapshotVersion["File"]; - json::String changelog = stableVersion["Changelog"]; + json::String snapshotChangelog = snapshotVersion["Changelog"]; if (snapshotSnapshot.Value() > SNAPSHOT_ID) { updateAvailable = true; - updateInfo = UpdateInfo(snapshotSnapshot.Value(), snapshotFile.Value(), changelog.Value(), UpdateInfo::Snapshot); + updateInfo = UpdateInfo(snapshotSnapshot.Value(), snapshotFile.Value(), snapshotChangelog.Value(), UpdateInfo::Snapshot); } #endif diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index 3ecf6276c3..daa64b3216 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -1535,10 +1535,10 @@ void GameController::NotifyUpdateAvailable(Client * sender) std::stringstream updateMessage; updateMessage << "Are you sure you want to run the updater? Please save any changes before updating.\n\nCurrent version:\n "; -#ifdef BETA - updateMessage << SAVE_VERSION << "." << MINOR_VERSION << " Beta, Build " << BUILD_NUM; -#elif defined(SNAPSHOT) +#ifdef SNAPSHOT updateMessage << "Snapshot " << SNAPSHOT_ID; +#elif defined(BETA) + updateMessage << SAVE_VERSION << "." << MINOR_VERSION << " Beta, Build " << BUILD_NUM; #else updateMessage << SAVE_VERSION << "." << MINOR_VERSION << " Stable, Build " << BUILD_NUM; #endif diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index b30a8ad2fb..44b2034133 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -2358,11 +2358,6 @@ void GameView::OnDraw() //FPS and some version info std::stringstream fpsInfo; fpsInfo.precision(2); -#ifdef SNAPSHOT - fpsInfo << "Snapshot " << SNAPSHOT_ID << ", "; -#elif defined(BETA) - fpsInfo << "Beta " << SAVE_VERSION << "." << MINOR_VERSION << "." << BUILD_NUM << ", "; -#endif fpsInfo << "FPS: " << std::fixed << ui::Engine::Ref().GetFps(); #ifdef DEBUG fpsInfo << " Delta: " << std::fixed << ui::Engine::Ref().GetDelta(); diff --git a/src/lua/LuaScriptInterface.cpp b/src/lua/LuaScriptInterface.cpp index 3b36475ce7..c89d2741fc 100644 --- a/src/lua/LuaScriptInterface.cpp +++ b/src/lua/LuaScriptInterface.cpp @@ -236,6 +236,12 @@ LuaScriptInterface::LuaScriptInterface(GameController * c, GameModel * m): lua_setfield(l, tptPropertiesVersion, "minor"); lua_pushinteger(l, BUILD_NUM); lua_setfield(l, tptPropertiesVersion, "build"); +#ifdef SNAPSHOT + lua_pushinteger(l, SNAPSHOT_ID); +#else + lua_pushinteger(l, 0); +#endif + lua_setfield(l, tptPropertiesVersion, "snapshot"); lua_setfield(l, tptProperties, "version"); lua_sethook(l, &luacon_hook, LUA_MASKCOUNT, 200);