diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-10 14:41:39 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-10 14:41:39 (GMT) |
| commit | cd051924d9ca6d5c39e02111bc311fda9126435e (patch) | |
| tree | 43624435bfcab57e69fb12068f24cd2a0518dfaa /src/game/GameController.cpp | |
| parent | 643128ac5f6f159acf9eb31104dde19f4511d2b9 (diff) | |
| download | powder-cd051924d9ca6d5c39e02111bc311fda9126435e.zip powder-cd051924d9ca6d5c39e02111bc311fda9126435e.tar.gz | |
Installation with Ctrl+I, fixes #77
Diffstat (limited to 'src/game/GameController.cpp')
| -rw-r--r-- | src/game/GameController.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index 622752b..9636c8f 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -10,6 +10,7 @@ #include "login/LoginController.h" #include "interface/Point.h" #include "dialogues/ErrorMessage.h" +#include "dialogues/InformationMessage.h" #include "dialogues/ConfirmPrompt.h" #include "GameModelException.h" #include "simulation/Air.h" @@ -172,6 +173,36 @@ void GameController::PlaceSave(ui::Point position) } } +void GameController::Install() +{ +#if defined(MACOSX) + new InformationMessage("No Installation necessary", "You don't need to install The Powder Toy on Mac OS X"); +#elif defined(WIN) || defined(LIN) + class InstallConfirmation: public ConfirmDialogueCallback { + public: + GameController * c; + InstallConfirmation(GameController * c_) { c = c_; } + virtual void ConfirmCallback(ConfirmPrompt::DialogueResult result) { + if (result == ConfirmPrompt::ResultOkay) + { + if(Client::Ref().DoInstallation()) + { + new InformationMessage("Install Success", "The installation completed without error"); + } + else + { + new ErrorMessage("Could not install", "The installation did not complete due to an error"); + } + } + } + virtual ~InstallConfirmation() { } + }; + new ConfirmPrompt("Install The Powder Toy", "You are about to install The Powder Toy onto this computer", new InstallConfirmation(this)); +#else + new ErrorMessage("Cannot install", "You cannot install The Powder Toy on this platform"); +#endif +} + void GameController::AdjustBrushSize(int direction, bool logarithmic, bool xAxis, bool yAxis) { if(xAxis && yAxis) |
