Add ctrl+e shortcut to cycle through edge modes

This commit is contained in:
jacob1 2023-10-05 21:34:01 -04:00
parent 29ea811642
commit fde1211cd9
No known key found for this signature in database
GPG Key ID: 4E58A32D510E1995
4 changed files with 33 additions and 1 deletions

View File

@ -82,6 +82,7 @@ Controls
| I | Invert Pressure and Velocity map |
| W | Cycle gravity modes (use with Ctrl when STK2 is out) |
| Y | Cycle air modes |
| Ctrl + E | Cycle edge modes |
| B | Enter decoration editor menu |
| Ctrl + B | Toggle decorations on/off |
| N | Toggle Newtonian Gravity on/off |

View File

@ -1012,6 +1012,32 @@ int GameController::GetTemperatureScale()
return gameModel->GetTemperatureScale();
}
int GameController::GetEdgeMode()
{
return gameModel->GetEdgeMode();
}
void GameController::SetEdgeMode(int edgeMode)
{
if (edgeMode < 0 || edgeMode >= NUM_EDGE_MODES)
edgeMode = 0;
gameModel->SetEdgeMode(edgeMode);
switch (edgeMode)
{
case EDGE_VOID:
gameModel->SetInfoTip("Edge Mode: Void");
break;
case EDGE_SOLID:
gameModel->SetInfoTip("Edge Mode: Solid");
break;
case EDGE_LOOP:
gameModel->SetInfoTip("Edge Mode: Loop");
break;
}
}
void GameController::SetActiveColourPreset(int preset)
{
gameModel->SetActiveColourPreset(preset);

View File

@ -116,6 +116,8 @@ public:
bool GetDebugHUD();
void SetTemperatureScale(int temperatureScale);
int GetTemperatureScale();
int GetEdgeMode();
void SetEdgeMode(int edgeMode);
void SetDebugFlags(unsigned int flags) { debugFlags = flags; }
void SetActiveMenu(int menuID);
std::vector<Menu*> GetMenuList();

View File

@ -1427,7 +1427,10 @@ void GameView::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl,
c->ReloadSim();
break;
case SDL_SCANCODE_E:
c->OpenElementSearch();
if (ctrl)
c->SetEdgeMode(c->GetEdgeMode() + 1);
else
c->OpenElementSearch();
break;
case SDL_SCANCODE_F:
if (ctrl)