Permalink
Browse files

fix some compile errors with last commit, remove snapshot version inf…

…o from HUD and add to intro text instead, add tpt.version.snapshot
  • Loading branch information...
jacob1 committed Sep 26, 2015
1 parent 908f60d commit cae8c9e095d171d6dc2ed7ae6569eef5656c0eb6
Showing with 18 additions and 14 deletions.
  1. +3 −0 data/IntroText.h
  2. +6 −6 src/client/Client.cpp
  3. +3 −3 src/gui/game/GameController.cpp
  4. +0 −5 src/gui/game/GameView.cpp
  5. +6 −0 src/lua/LuaScriptInterface.cpp
@@ -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
@@ -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,23 +830,23 @@ 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
#ifdef SNAPSHOT
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
@@ -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
@@ -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();
@@ -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);

0 comments on commit cae8c9e

Please sign in to comment.