mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-31 19:51:45 +02:00
Ctrl + G gravity grid toggle
This commit is contained in:
@@ -860,6 +860,12 @@ void GameController::SetDecoration()
|
|||||||
gameModel->SetDecoration(!gameModel->GetDecoration());
|
gameModel->SetDecoration(!gameModel->GetDecoration());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GameController::ShowGravityGrid()
|
||||||
|
{
|
||||||
|
gameModel->ShowGravityGrid(!gameModel->GetGravityGrid());
|
||||||
|
gameModel->UpdateQuickOptions();
|
||||||
|
}
|
||||||
|
|
||||||
void GameController::SetActiveColourPreset(int preset)
|
void GameController::SetActiveColourPreset(int preset)
|
||||||
{
|
{
|
||||||
gameModel->SetActiveColourPreset(preset);
|
gameModel->SetActiveColourPreset(preset);
|
||||||
|
@@ -94,6 +94,7 @@ public:
|
|||||||
void SetPaused();
|
void SetPaused();
|
||||||
void SetDecoration(bool decorationState);
|
void SetDecoration(bool decorationState);
|
||||||
void SetDecoration();
|
void SetDecoration();
|
||||||
|
void ShowGravityGrid();
|
||||||
void SetActiveMenu(Menu * menu);
|
void SetActiveMenu(Menu * menu);
|
||||||
void SetActiveTool(int toolSelection, Tool * tool);
|
void SetActiveTool(int toolSelection, Tool * tool);
|
||||||
void SetActiveColourPreset(int preset);
|
void SetActiveColourPreset(int preset);
|
||||||
|
@@ -802,6 +802,20 @@ bool GameModel::GetAHeatEnable()
|
|||||||
return sim->aheat_enable;
|
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)
|
void GameModel::FrameStep(int frames)
|
||||||
{
|
{
|
||||||
sim->framerender += frames;
|
sim->framerender += frames;
|
||||||
|
@@ -162,6 +162,8 @@ public:
|
|||||||
void SetDecoration(bool decorationState);
|
void SetDecoration(bool decorationState);
|
||||||
bool GetAHeatEnable();
|
bool GetAHeatEnable();
|
||||||
void SetAHeatEnable(bool aHeat);
|
void SetAHeatEnable(bool aHeat);
|
||||||
|
bool GetGravityGrid();
|
||||||
|
void ShowGravityGrid(bool showGrid);
|
||||||
void ClearSimulation();
|
void ClearSimulation();
|
||||||
vector<Menu*> GetMenuList();
|
vector<Menu*> GetMenuList();
|
||||||
vector<Tool*> GetUnlistedTools();
|
vector<Tool*> GetUnlistedTools();
|
||||||
|
@@ -1271,7 +1271,9 @@ void GameView::OnKeyPress(int key, Uint16 character, bool shift, bool ctrl, bool
|
|||||||
c->FrameStep();
|
c->FrameStep();
|
||||||
break;
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
if(shift)
|
if (ctrl)
|
||||||
|
c->ShowGravityGrid();
|
||||||
|
else if(shift)
|
||||||
c->AdjustGridSize(-1);
|
c->AdjustGridSize(-1);
|
||||||
else
|
else
|
||||||
c->AdjustGridSize(1);
|
c->AdjustGridSize(1);
|
||||||
@@ -1419,7 +1421,7 @@ void GameView::OnBlur()
|
|||||||
void GameView::OnTick(float dt)
|
void GameView::OnTick(float dt)
|
||||||
{
|
{
|
||||||
if(selectMode==PlaceSave && !placeSaveThumb)
|
if(selectMode==PlaceSave && !placeSaveThumb)
|
||||||
selectMode = SelectNone;
|
selectMode = SelectNone;
|
||||||
if(zoomEnabled && !zoomCursorFixed)
|
if(zoomEnabled && !zoomCursorFixed)
|
||||||
c->SetZoomPosition(currentMouse);
|
c->SetZoomPosition(currentMouse);
|
||||||
if(drawMode == DrawPoints)
|
if(drawMode == DrawPoints)
|
||||||
|
@@ -29,11 +29,11 @@ public:
|
|||||||
}
|
}
|
||||||
virtual bool GetToggle()
|
virtual bool GetToggle()
|
||||||
{
|
{
|
||||||
return m->GetRenderer()->gravityFieldEnabled;
|
return m->GetGravityGrid();
|
||||||
}
|
}
|
||||||
virtual void perform()
|
virtual void perform()
|
||||||
{
|
{
|
||||||
m->GetRenderer()->gravityFieldEnabled = !m->GetRenderer()->gravityFieldEnabled;
|
m->ShowGravityGrid(!m->GetGravityGrid());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user