Add ctrl+u shortcut to reset ambient heat

This commit is contained in:
jacob1 2020-04-27 23:20:54 -04:00
parent 4efe5875ab
commit 899a2a046c
6 changed files with 23 additions and 6 deletions

2
.gitignore vendored
View File

@ -69,5 +69,7 @@ site_scons/site_tools/mfprogram/*.pyc
site_scons/site_tools/gch/*.pyc
.vscode/
.vs/
# Intentional merge conflict (meson stuff)
subprojects/
screenshot_*

View File

@ -885,6 +885,11 @@ bool GameController::GetAHeatEnable()
return gameModel->GetAHeatEnable();
}
void GameController::ResetAHeat()
{
gameModel->ResetAHeat();
}
void GameController::ToggleNewtonianGravity()
{
gameModel->SetNewtonianGravity(!gameModel->GetNewtonianGrvity());

View File

@ -161,6 +161,7 @@ public:
void SwitchAir();
void ToggleAHeat();
bool GetAHeatEnable();
void ResetAHeat();
void ToggleNewtonianGravity();
bool LoadClipboard();

View File

@ -1018,6 +1018,11 @@ bool GameModel::GetAHeatEnable()
return sim->aheat_enable;
}
void GameModel::ResetAHeat()
{
sim->air->ClearAirH();
}
void GameModel::SetNewtonianGravity(bool newtonainGravity)
{
if (newtonainGravity)

View File

@ -171,16 +171,17 @@ public:
void SetSaveFile(SaveFile * newSave, bool invertIncludePressure);
void AddObserver(GameView * observer);
bool GetPaused();
void SetPaused(bool pauseState);
bool GetDecoration();
bool GetPaused();
void SetDecoration(bool decorationState);
bool GetAHeatEnable();
bool GetDecoration();
void SetAHeatEnable(bool aHeat);
bool GetNewtonianGrvity();
bool GetAHeatEnable();
void ResetAHeat();
void SetNewtonianGravity(bool newtonainGravity);
bool GetGravityGrid();
bool GetNewtonianGrvity();
void ShowGravityGrid(bool showGrid);
bool GetGravityGrid();
void ClearSimulation();
std::vector<Menu*> GetMenuList();
std::vector<QuickOption*> GetQuickOptions();

View File

@ -1387,7 +1387,10 @@ void GameView::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl,
ui::Engine::Ref().ConfirmExit();
break;
case SDL_SCANCODE_U:
c->ToggleAHeat();
if (ctrl)
c->ResetAHeat();
else
c->ToggleAHeat();
break;
case SDL_SCANCODE_N:
c->ToggleNewtonianGravity();