diff options
Diffstat (limited to 'src/game/GameController.cpp')
| -rw-r--r-- | src/game/GameController.cpp | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/game/GameController.cpp b/src/game/GameController.cpp index a1c4965..99315b0 100644 --- a/src/game/GameController.cpp +++ b/src/game/GameController.cpp @@ -146,6 +146,7 @@ GameController::GameController(): { gameView = new GameView(); gameModel = new GameModel(); + gameModel->BuildQuickOptionMenu(this); gameView->AttachController(this); gameModel->AddObserver(gameView); @@ -536,7 +537,7 @@ bool GameController::MouseUp(int x, int y, unsigned button) (*iter).pos(signx, signy, signw, signh); if (x>=signx && x<=signx+signw && y>=signy && y<=signy+signh) { - if (sregexp((*iter).text.c_str(), "^{c:[0-9]*|.*}$")==0) + if (sregexp((*iter).text.c_str(), "^{[c|t]:[0-9]*|.*}$")==0) { const char * signText = (*iter).text.c_str(); char buff[256]; @@ -550,8 +551,17 @@ bool GameController::MouseUp(int x, int y, unsigned button) buff[sldr-3] = '\0'; int tempSaveID = format::StringToNumber<int>(std::string(buff)); - if(tempSaveID) - OpenSavePreview(tempSaveID, 0); + if (tempSaveID) + { + if ((*iter).text.c_str()[1] == 'c') + OpenSavePreview(tempSaveID, 0); + else if ((*iter).text.c_str()[1] == 't') + { + char url[256]; + sprintf(url, "http://powdertoy.co.uk/Discussions/Thread/View.html?Thread=%i", tempSaveID); + OpenURI(url); + } + } break; } } @@ -744,8 +754,7 @@ void GameController::SwitchAir() void GameController::ToggleAHeat() { - gameModel->GetSimulation()->aheat_enable = !gameModel->GetSimulation()->aheat_enable; - gameModel->UpdateQuickOptions(); + gameModel->SetAHeatEnable(!gameModel->GetAHeatEnable()); } @@ -1101,8 +1110,7 @@ void GameController::SaveAsCurrent() virtual ~SaveUploadedCallback() {}; virtual void SaveUploaded(SaveInfo save) { - //Don't do anything - //c->LoadSave(&save); + c->LoadSave(&save); } }; |
