Fix bug with line tool while WIND is selected (id:2554353)
This commit is contained in:
parent
a9f07dc5b0
commit
688b4bec30
@ -487,38 +487,28 @@ bool GameView::GetPlacingZoom()
|
|||||||
|
|
||||||
void GameView::NotifyActiveToolsChanged(GameModel * sender)
|
void GameView::NotifyActiveToolsChanged(GameModel * sender)
|
||||||
{
|
{
|
||||||
decoBrush = false;
|
|
||||||
for (size_t i = 0; i < toolButtons.size(); i++)
|
for (size_t i = 0; i < toolButtons.size(); i++)
|
||||||
{
|
{
|
||||||
auto *tool = toolButtons[i]->tool;
|
auto *tool = toolButtons[i]->tool;
|
||||||
if(sender->GetActiveTool(0) == tool)
|
// Primary
|
||||||
{
|
if (sender->GetActiveTool(0) == tool)
|
||||||
toolButtons[i]->SetSelectionState(0); //Primary
|
toolButtons[i]->SetSelectionState(0);
|
||||||
windTool = tool->GetIdentifier() == "DEFAULT_UI_WIND";
|
// Secondary
|
||||||
|
else if (sender->GetActiveTool(1) == tool)
|
||||||
if (sender->GetActiveTool(0)->GetIdentifier().BeginsWith("DEFAULT_DECOR_"))
|
toolButtons[i]->SetSelectionState(1);
|
||||||
decoBrush = true;
|
// Tertiary
|
||||||
}
|
else if (sender->GetActiveTool(2) == tool)
|
||||||
else if(sender->GetActiveTool(1) == tool)
|
toolButtons[i]->SetSelectionState(2);
|
||||||
{
|
// Replace Mode
|
||||||
toolButtons[i]->SetSelectionState(1); //Secondary
|
else if (sender->GetActiveTool(3) == tool)
|
||||||
if (sender->GetActiveTool(1)->GetIdentifier().BeginsWith("DEFAULT_DECOR_"))
|
toolButtons[i]->SetSelectionState(3);
|
||||||
decoBrush = true;
|
// Not selected at all
|
||||||
}
|
|
||||||
else if(sender->GetActiveTool(2) == tool)
|
|
||||||
{
|
|
||||||
toolButtons[i]->SetSelectionState(2); //Tertiary
|
|
||||||
}
|
|
||||||
else if(sender->GetActiveTool(3) == tool)
|
|
||||||
{
|
|
||||||
toolButtons[i]->SetSelectionState(3); //Replace Mode
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
toolButtons[i]->SetSelectionState(-1);
|
toolButtons[i]->SetSelectionState(-1);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
decoBrush = sender->GetActiveTool(0)->GetIdentifier().BeginsWith("DEFAULT_DECOR_");
|
||||||
|
|
||||||
if (sender->GetRenderer()->findingElement)
|
if (sender->GetRenderer()->findingElement)
|
||||||
{
|
{
|
||||||
Tool *active = sender->GetActiveTool(0);
|
Tool *active = sender->GetActiveTool(0);
|
||||||
@ -1037,6 +1027,9 @@ void GameView::OnMouseDown(int x, int y, unsigned button)
|
|||||||
return;
|
return;
|
||||||
Tool *lastTool = c->GetActiveTool(toolIndex);
|
Tool *lastTool = c->GetActiveTool(toolIndex);
|
||||||
c->SetLastTool(lastTool);
|
c->SetLastTool(lastTool);
|
||||||
|
windTool = lastTool->GetIdentifier() == "DEFAULT_UI_WIND";
|
||||||
|
decoBrush = lastTool->GetIdentifier().BeginsWith("DEFAULT_DECOR_");
|
||||||
|
|
||||||
UpdateDrawMode();
|
UpdateDrawMode();
|
||||||
|
|
||||||
isMouseDown = true;
|
isMouseDown = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user