Skip to content

Commit

Permalink
fix some compile errors with last commit, remove snapshot version inf…
Browse files Browse the repository at this point in the history
…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 cae8c9e
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 14 deletions.
3 changes: 3 additions & 0 deletions data/IntroText.h
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions src/client/Client.cpp
Expand Up @@ -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

Expand All @@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/gui/game/GameController.cpp
Expand Up @@ -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
Expand Down
5 changes: 0 additions & 5 deletions src/gui/game/GameView.cpp
Expand Up @@ -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();
Expand Down
6 changes: 6 additions & 0 deletions src/lua/LuaScriptInterface.cpp
Expand Up @@ -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);
Expand Down

0 comments on commit cae8c9e

Please sign in to comment.