diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-09-13 17:33:12 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-09-13 17:33:12 (GMT) |
| commit | a11cd592cb9b985298dd16be78dec10226bf3e47 (patch) | |
| tree | c63a5d172970c4d5f28587c6263c689aca8fae95 /src/game/GameController.cpp | |
| parent | f7f51d5045a25a331b4cec3844f98584934d827e (diff) | |
| download | powder-a11cd592cb9b985298dd16be78dec10226bf3e47.zip powder-a11cd592cb9b985298dd16be78dec10226bf3e47.tar.gz | |
Show version info in update prompt. Fixes #177
Diffstat (limited to 'src/game/GameController.cpp')
| -rw-r--r-- | src/game/GameController.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index d2580b0..4aceec7 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -1226,7 +1226,24 @@ void GameController::NotifyUpdateAvailable(Client * sender) virtual void Action() { - new ConfirmPrompt("Run Updater", "Are you sure you want to run the updater, please save any changes before updating", new UpdateConfirmation(c)); + std::string currentVersion, newVersion; +#ifdef BETA + currentVersion = MTOS(SAVE_VERSION) "." MTOS(MINOR_VERSION) " Beta, Build " MTOS(BUILD_NUM); +#elif defined(SNAPSHOT) + currentVersion = "Snapshot " MTOS(SNAPSHOT_ID); +#else + currentVersion = MTOS(SAVE_VERSION) "." MTOS(MINOR_VERSION) " Stable, Build " MTOS(BUILD_NUM); +#endif + + UpdateInfo info = Client::Ref().GetUpdateInfo(); + if(info.Type == UpdateInfo::Beta) + newVersion = format::NumberToString<int>(info.Major) + " " + format::NumberToString<int>(info.Minor) + " Beta, Build " + format::NumberToString<int>(info.Build); + else if(info.Type == UpdateInfo::Snapshot) + newVersion = "Snapshot " + format::NumberToString<int>(info.Time); + else if(info.Type == UpdateInfo::Stable) + newVersion = format::NumberToString<int>(info.Major) + " " + format::NumberToString<int>(info.Minor) + " Stable, Build " + format::NumberToString<int>(info.Build); + + new ConfirmPrompt("Run Updater", "Are you sure you want to run the updater, please save any changes before updating.\n\nCurrent version:\n " + currentVersion + "\nNew version:\n " + newVersion, new UpdateConfirmation(c)); } }; |
