Skip to content

Commit

Permalink
Disabled ESC to exit in practice setup
Browse files Browse the repository at this point in the history
This is to reduce confusion between practice setup / play
  • Loading branch information
123jimin committed Jul 17, 2020
1 parent c69c529 commit ecef76b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
1 change: 1 addition & 0 deletions Main/include/PracticeModeSettingsDialog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class PracticeModeSettingsDialog : public BaseGameSettingsDialog
Delegate<float> onSpeedChange;
Delegate<> onSettingChange;
Delegate<> onPressStart;
Delegate<> onPressExit;

private:
Tab m_CreateMainSettingTab();
Expand Down
9 changes: 3 additions & 6 deletions Main/src/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1981,11 +1981,9 @@ class Game_Impl : public Game
switch (buttonCode)
{
case Input::Button::Back:
TriggerManualExit();
break;
case Input::Button::FX_0:
case Input::Button::FX_1:
if (g_input.GetButton(buttonCode == Input::Button::FX_0 ? Input::Button::FX_1 : Input::Button::FX_0))
if (buttonCode == Input::Button::Back || g_input.GetButton(buttonCode == Input::Button::FX_0 ? Input::Button::FX_1 : Input::Button::FX_0))
{
m_audioPlayback.Pause();
m_paused = true;
Expand Down Expand Up @@ -2160,9 +2158,8 @@ class Game_Impl : public Game
JumpTo(m_lastMapTime);
}
});
m_practiceSetupDialog->onPressStart.AddLambda([this]() {
StartPractice();
});
m_practiceSetupDialog->onPressStart.Add(this, &Game_Impl::StartPractice);
m_practiceSetupDialog->onPressExit.Add(this, &Game_Impl::TriggerManualExit);
}

void RevertToPracticeSetup()
Expand Down
1 change: 1 addition & 0 deletions Main/src/PracticeModeSettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ PracticeModeSettingsDialog::Tab PracticeModeSettingsDialog::m_CreateMainSettingT
mainSettingTab->settings.emplace_back(std::move(speedSetting));

mainSettingTab->settings.emplace_back(CreateButton("Start practice", [this](const auto&) { onPressStart.Call(); }));
mainSettingTab->settings.emplace_back(CreateButton("Exit to song selection", [this](const auto&) { onPressExit.Call(); }));

return mainSettingTab;
}
Expand Down

0 comments on commit ecef76b

Please sign in to comment.