diff options
| author | jacob1 <jfu614@gmail.com> | 2013-06-08 04:23:06 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-06-08 04:23:06 (GMT) |
| commit | a1f9da2d0cedd4733102f1c1831cab5b51955ac2 (patch) | |
| tree | ef63821023901cb401b7f97fe0a54872c4d5275d /src/gui/game/GameController.cpp | |
| parent | 69961956bfae1529e6c451c57804b0d2aa93f422 (diff) | |
| download | powder-a1f9da2d0cedd4733102f1c1831cab5b51955ac2.zip powder-a1f9da2d0cedd4733102f1c1831cab5b51955ac2.tar.gz | |
fix tpt.selectedl not changing sometimes when using the element search or sample tool. Assume that new saves will get the auto-vote, so set that too.
Diffstat (limited to 'src/gui/game/GameController.cpp')
| -rw-r--r-- | src/gui/game/GameController.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/gui/game/GameController.cpp b/src/gui/game/GameController.cpp index 6ae9ae2..b873360 100644 --- a/src/gui/game/GameController.cpp +++ b/src/gui/game/GameController.cpp @@ -965,12 +965,7 @@ void GameController::SetActiveMenu(int menuID) if(menuID == SC_DECO) gameModel->SetColourSelectorVisibility(true); else - { gameModel->SetColourSelectorVisibility(false); - ActiveToolChanged(0, gameModel->GetActiveTool(0)); - ActiveToolChanged(1, gameModel->GetActiveTool(1)); - ActiveToolChanged(2, gameModel->GetActiveTool(2)); - } } std::vector<Menu*> GameController::GetMenuList() @@ -983,6 +978,11 @@ void GameController::ActiveToolChanged(int toolSelection, Tool *tool) commandInterface->OnActiveToolChanged(toolSelection, tool); } +Tool * GameController::GetActiveTool(int selection) +{ + return gameModel->GetActiveTool(selection); +} + void GameController::SetActiveTool(int toolSelection, Tool * tool) { gameModel->SetActiveTool(toolSelection, tool); @@ -1126,7 +1126,7 @@ void GameController::OpenElementSearch() } vector<Tool*> hiddenTools = gameModel->GetUnlistedTools(); toolList.insert(toolList.end(), hiddenTools.begin(), hiddenTools.end()); - new ElementSearchActivity(gameModel, toolList); + new ElementSearchActivity(this, toolList); } void GameController::OpenColourPicker() @@ -1210,6 +1210,8 @@ void GameController::OpenSaveWindow() virtual ~SaveUploadedCallback() {}; virtual void SaveUploaded(SaveInfo save) { + save.SetVote(1); + save.SetVotesUp(1); c->LoadSave(&save); } }; |
