diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp index 4b815d492..dc018332a 100644 --- a/src/gui/game/GameView.cpp +++ b/src/gui/game/GameView.cpp @@ -487,38 +487,28 @@ bool GameView::GetPlacingZoom() void GameView::NotifyActiveToolsChanged(GameModel * sender) { - decoBrush = false; for (size_t i = 0; i < toolButtons.size(); i++) { auto *tool = toolButtons[i]->tool; - if(sender->GetActiveTool(0) == tool) - { - toolButtons[i]->SetSelectionState(0); //Primary - windTool = tool->GetIdentifier() == "DEFAULT_UI_WIND"; - - if (sender->GetActiveTool(0)->GetIdentifier().BeginsWith("DEFAULT_DECOR_")) - decoBrush = true; - } - else if(sender->GetActiveTool(1) == tool) - { - toolButtons[i]->SetSelectionState(1); //Secondary - if (sender->GetActiveTool(1)->GetIdentifier().BeginsWith("DEFAULT_DECOR_")) - decoBrush = true; - } - else if(sender->GetActiveTool(2) == tool) - { - toolButtons[i]->SetSelectionState(2); //Tertiary - } - else if(sender->GetActiveTool(3) == tool) - { - toolButtons[i]->SetSelectionState(3); //Replace Mode - } + // Primary + if (sender->GetActiveTool(0) == tool) + toolButtons[i]->SetSelectionState(0); + // Secondary + else if (sender->GetActiveTool(1) == tool) + toolButtons[i]->SetSelectionState(1); + // Tertiary + else if (sender->GetActiveTool(2) == tool) + toolButtons[i]->SetSelectionState(2); + // Replace Mode + else if (sender->GetActiveTool(3) == tool) + toolButtons[i]->SetSelectionState(3); + // Not selected at all else - { toolButtons[i]->SetSelectionState(-1); - } } + decoBrush = sender->GetActiveTool(0)->GetIdentifier().BeginsWith("DEFAULT_DECOR_"); + if (sender->GetRenderer()->findingElement) { Tool *active = sender->GetActiveTool(0); @@ -1037,6 +1027,9 @@ void GameView::OnMouseDown(int x, int y, unsigned button) return; Tool *lastTool = c->GetActiveTool(toolIndex); c->SetLastTool(lastTool); + windTool = lastTool->GetIdentifier() == "DEFAULT_UI_WIND"; + decoBrush = lastTool->GetIdentifier().BeginsWith("DEFAULT_DECOR_"); + UpdateDrawMode(); isMouseDown = true;