Ctrl + G gravity grid toggle
This commit is contained in:
parent
3ad7cf4539
commit
e773abdcc8
@ -860,6 +860,12 @@ void GameController::SetDecoration()
|
||||
gameModel->SetDecoration(!gameModel->GetDecoration());
|
||||
}
|
||||
|
||||
void GameController::ShowGravityGrid()
|
||||
{
|
||||
gameModel->ShowGravityGrid(!gameModel->GetGravityGrid());
|
||||
gameModel->UpdateQuickOptions();
|
||||
}
|
||||
|
||||
void GameController::SetActiveColourPreset(int preset)
|
||||
{
|
||||
gameModel->SetActiveColourPreset(preset);
|
||||
|
@ -94,6 +94,7 @@ public:
|
||||
void SetPaused();
|
||||
void SetDecoration(bool decorationState);
|
||||
void SetDecoration();
|
||||
void ShowGravityGrid();
|
||||
void SetActiveMenu(Menu * menu);
|
||||
void SetActiveTool(int toolSelection, Tool * tool);
|
||||
void SetActiveColourPreset(int preset);
|
||||
|
@ -802,6 +802,20 @@ bool GameModel::GetAHeatEnable()
|
||||
return sim->aheat_enable;
|
||||
}
|
||||
|
||||
void GameModel::ShowGravityGrid(bool showGrid)
|
||||
{
|
||||
ren->gravityFieldEnabled = showGrid;
|
||||
if (showGrid)
|
||||
SetInfoTip("Gravity Grid: On");
|
||||
else
|
||||
SetInfoTip("Gravity Grid: Off");
|
||||
}
|
||||
|
||||
bool GameModel::GetGravityGrid()
|
||||
{
|
||||
return ren->gravityFieldEnabled;
|
||||
}
|
||||
|
||||
void GameModel::FrameStep(int frames)
|
||||
{
|
||||
sim->framerender += frames;
|
||||
|
@ -162,6 +162,8 @@ public:
|
||||
void SetDecoration(bool decorationState);
|
||||
bool GetAHeatEnable();
|
||||
void SetAHeatEnable(bool aHeat);
|
||||
bool GetGravityGrid();
|
||||
void ShowGravityGrid(bool showGrid);
|
||||
void ClearSimulation();
|
||||
vector<Menu*> GetMenuList();
|
||||
vector<Tool*> GetUnlistedTools();
|
||||
|
@ -1271,7 +1271,9 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
|
||||
c->FrameStep();
|
||||
break;
|
||||
case 'g':
|
||||
if(shift)
|
||||
if (ctrl)
|
||||
c->ShowGravityGrid();
|
||||
else if(shift)
|
||||
c->AdjustGridSize(-1);
|
||||
else
|
||||
c->AdjustGridSize(1);
|
||||
@ -1419,7 +1421,7 @@ void GameView::OnBlur()
|
||||
void GameView::OnTick(float dt)
|
||||
{
|
||||
if(selectMode==PlaceSave && !placeSaveThumb)
|
||||
selectMode = SelectNone;
|
||||
selectMode = SelectNone;
|
||||
if(zoomEnabled && !zoomCursorFixed)
|
||||
c->SetZoomPosition(currentMouse);
|
||||
if(drawMode == DrawPoints)
|
||||
|
@ -29,11 +29,11 @@ public:
|
||||
}
|
||||
virtual bool GetToggle()
|
||||
{
|
||||
return m->GetRenderer()->gravityFieldEnabled;
|
||||
return m->GetGravityGrid();
|
||||
}
|
||||
virtual void perform()
|
||||
{
|
||||
m->GetRenderer()->gravityFieldEnabled = !m->GetRenderer()->gravityFieldEnabled;
|
||||
m->ShowGravityGrid(!m->GetGravityGrid());
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user