fix bug where you had to start using a tool before setting it's strength
This commit is contained in:
parent
80380bbaa3
commit
b16524292e
@ -1473,7 +1473,7 @@ int LuaScriptInterface::simulation_ambientAirTemp(lua_State * l)
|
|||||||
lua_pushnumber(l, luacon_sim->air->ambientAirTemp);
|
lua_pushnumber(l, luacon_sim->air->ambientAirTemp);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
int ambientAirTemp = luaL_optint(l, 1, -1);
|
int ambientAirTemp = luaL_optint(l, 1, 295.15f);
|
||||||
luacon_sim->air->ambientAirTemp = ambientAirTemp;
|
luacon_sim->air->ambientAirTemp = ambientAirTemp;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -304,19 +304,18 @@ void GameModel::BuildMenus()
|
|||||||
//sim->wtypes[i]
|
//sim->wtypes[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
//Add special sign and prop tools
|
//Build menu for tools
|
||||||
menuList[SC_TOOL]->AddTool(new SampleTool(this));
|
|
||||||
menuList[SC_TOOL]->AddTool(new SignTool());
|
|
||||||
menuList[SC_TOOL]->AddTool(new PropertyTool());
|
|
||||||
menuList[SC_TOOL]->AddTool(new WindTool(0, "WIND", "Create air movement", 64, 64, 64, "DEFAULT_UI_WIND"));
|
|
||||||
|
|
||||||
//Build menu for simtools
|
|
||||||
for(int i = 0; i < sim->tools.size(); i++)
|
for(int i = 0; i < sim->tools.size(); i++)
|
||||||
{
|
{
|
||||||
Tool * tempTool;
|
Tool * tempTool;
|
||||||
tempTool = new Tool(i, sim->tools[i]->Name, sim->tools[i]->Description, PIXR(sim->tools[i]->Colour), PIXG(sim->tools[i]->Colour), PIXB(sim->tools[i]->Colour), sim->tools[i]->Identifier);
|
tempTool = new Tool(i, sim->tools[i]->Name, sim->tools[i]->Description, PIXR(sim->tools[i]->Colour), PIXG(sim->tools[i]->Colour), PIXB(sim->tools[i]->Colour), sim->tools[i]->Identifier);
|
||||||
menuList[SC_TOOL]->AddTool(tempTool);
|
menuList[SC_TOOL]->AddTool(tempTool);
|
||||||
}
|
}
|
||||||
|
//Add special sign and prop tools
|
||||||
|
menuList[SC_TOOL]->AddTool(new WindTool(0, "WIND", "Create air movement", 64, 64, 64, "DEFAULT_UI_WIND"));
|
||||||
|
menuList[SC_TOOL]->AddTool(new PropertyTool());
|
||||||
|
menuList[SC_TOOL]->AddTool(new SignTool());
|
||||||
|
menuList[SC_TOOL]->AddTool(new SampleTool(this));
|
||||||
|
|
||||||
//Add decoration tools to menu
|
//Add decoration tools to menu
|
||||||
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendAdd, "ADD", "Colour blending: Add", 0, 0, 0, "DEFAULT_DECOR_ADD"));
|
menuList[SC_DECO]->AddTool(new DecorationTool(DecorationTool::BlendAdd, "ADD", "Colour blending: Add", 0, 0, 0, "DEFAULT_DECOR_ADD"));
|
||||||
|
@ -182,6 +182,7 @@ GameView::GameView():
|
|||||||
introText(2048),
|
introText(2048),
|
||||||
introTextMessage(introTextData),
|
introTextMessage(introTextData),
|
||||||
wallBrush(false),
|
wallBrush(false),
|
||||||
|
toolBrush(false),
|
||||||
doScreenshot(false),
|
doScreenshot(false),
|
||||||
recording(false),
|
recording(false),
|
||||||
screenshotIndex(0),
|
screenshotIndex(0),
|
||||||
@ -642,13 +643,14 @@ void GameView::NotifyActiveToolsChanged(GameModel * sender)
|
|||||||
void GameView::NotifyLastToolChanged(GameModel * sender)
|
void GameView::NotifyLastToolChanged(GameModel * sender)
|
||||||
{
|
{
|
||||||
if(sender->GetLastTool() && sender->GetLastTool()->GetResolution() == CELL)
|
if(sender->GetLastTool() && sender->GetLastTool()->GetResolution() == CELL)
|
||||||
{
|
|
||||||
wallBrush = true;
|
wallBrush = true;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
wallBrush = false;
|
wallBrush = false;
|
||||||
}
|
|
||||||
|
if (sender->GetLastTool() && sender->GetLastTool()->GetIdentifier().find("DEFAULT_TOOL_") != sender->GetLastTool()->GetIdentifier().npos)
|
||||||
|
toolBrush = true;
|
||||||
|
else
|
||||||
|
toolBrush = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameView::NotifyToolListChanged(GameModel * sender)
|
void GameView::NotifyToolListChanged(GameModel * sender)
|
||||||
@ -1280,10 +1282,13 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
|
|||||||
drawModeReset = false;
|
drawModeReset = false;
|
||||||
else
|
else
|
||||||
drawPoint1 = currentMouse;
|
drawPoint1 = currentMouse;
|
||||||
if(shift)
|
if (!toolBrush)
|
||||||
drawMode = DrawFill;
|
{
|
||||||
else
|
if(shift)
|
||||||
drawMode = DrawRect;
|
drawMode = DrawFill;
|
||||||
|
else
|
||||||
|
drawMode = DrawRect;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
enableCtrlBehaviour();
|
enableCtrlBehaviour();
|
||||||
break;
|
break;
|
||||||
@ -1294,10 +1299,13 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
|
|||||||
drawModeReset = false;
|
drawModeReset = false;
|
||||||
else
|
else
|
||||||
drawPoint1 = currentMouse;
|
drawPoint1 = currentMouse;
|
||||||
if(ctrl)
|
if (!toolBrush)
|
||||||
drawMode = DrawFill;
|
{
|
||||||
else
|
if(ctrl)
|
||||||
drawMode = DrawLine;
|
drawMode = DrawFill;
|
||||||
|
else
|
||||||
|
drawMode = DrawLine;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
enableShiftBehaviour();
|
enableShiftBehaviour();
|
||||||
break;
|
break;
|
||||||
@ -1758,10 +1766,7 @@ void GameView::enableShiftBehaviour()
|
|||||||
if(!shiftBehaviour)
|
if(!shiftBehaviour)
|
||||||
{
|
{
|
||||||
shiftBehaviour = true;
|
shiftBehaviour = true;
|
||||||
if(isMouseDown)
|
c->SetToolStrength(10.0f);
|
||||||
{
|
|
||||||
c->SetToolStrength(10.0f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1806,13 +1811,10 @@ void GameView::enableCtrlBehaviour()
|
|||||||
searchButton->Appearance.TextInactive = searchButton->Appearance.TextHover = ui::Colour(0, 0, 0);
|
searchButton->Appearance.TextInactive = searchButton->Appearance.TextHover = ui::Colour(0, 0, 0);
|
||||||
if (currentSaveType == 2)
|
if (currentSaveType == 2)
|
||||||
((SplitButton*)saveSimulationButton)->SetShowSplit(true);
|
((SplitButton*)saveSimulationButton)->SetShowSplit(true);
|
||||||
if(isMouseDown)
|
if(!shiftBehaviour)
|
||||||
{
|
c->SetToolStrength(.1f);
|
||||||
if(!shiftBehaviour)
|
else
|
||||||
c->SetToolStrength(.1f);
|
c->SetToolStrength(10.0f);
|
||||||
else
|
|
||||||
c->SetToolStrength(10.0f);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,7 @@ private:
|
|||||||
bool showHud;
|
bool showHud;
|
||||||
bool showDebug;
|
bool showDebug;
|
||||||
bool wallBrush;
|
bool wallBrush;
|
||||||
|
bool toolBrush;
|
||||||
int introText;
|
int introText;
|
||||||
std::string introTextMessage;
|
std::string introTextMessage;
|
||||||
int toolIndex;
|
int toolIndex;
|
||||||
|
Reference in New Issue
Block a user