Merge pull request #9627 from unknownbrackets/devmenu

UI: Proxy devmenu keypress through an event
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2017-04-18 09:34:18 +02:00
commit 6f58d4d30e
5 files changed
+11 -6

No files matched your search

+6 -2
View File
@@ -122,6 +122,8 @@ EmuScreen::EmuScreen(const std::string &filename)
frameStep_ = false;
lastNumFlips = gpuStats.numFlips;
startDumping = false;
OnDevMenu.Handle(this, &EmuScreen::OnDevTools);
}
void EmuScreen::bootGame(const std::string &filename) {
@@ -453,9 +455,11 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) {
break;
case VIRTKEY_DEVMENU:
releaseButtons();
screenManager()->push(new DevMenu());
{
UI::EventParams e{};
OnDevMenu.Trigger(e);
break;
}
case VIRTKEY_AXIS_X_MIN:
case VIRTKEY_AXIS_X_MAX:
+2
View File
@@ -67,6 +67,8 @@ private:
void autoLoad();
void checkPowerDown();
UI::Event OnDevMenu;
bool bootPending_;
std::string gamePath_;
+2 -2
View File
@@ -519,7 +519,7 @@ void GameSettingsScreen::CreateViews() {
// Combo key setup
Choice *comboKey = controlsSettings->Add(new Choice(co->T("Combo Key Setup")));
comboKey->OnClick.Handle(this, &GameSettingsScreen::OnCombo_key);
comboKey->OnClick.Handle(this, &GameSettingsScreen::OnComboKey);
comboKey->SetEnabledPtr(&g_Config.bShowTouchControls);
// On non iOS systems, offer to let the user see this button.
@@ -1122,7 +1122,7 @@ UI::EventReturn GameSettingsScreen::OnChangeMacAddress(UI::EventParams &e) {
return UI::EVENT_DONE;
}
UI::EventReturn GameSettingsScreen::OnCombo_key(UI::EventParams &e) {
UI::EventReturn GameSettingsScreen::OnComboKey(UI::EventParams &e) {
screenManager()->push(new Combo_keyScreen(&g_Config.iComboMode));
return UI::EVENT_DONE;
}
+1 -1
View File
@@ -66,7 +66,7 @@ private:
UI::EventReturn OnReloadCheats(UI::EventParams &e);
UI::EventReturn OnTiltTypeChange(UI::EventParams &e);
UI::EventReturn OnTiltCustomize(UI::EventParams &e);
UI::EventReturn OnCombo_key(UI::EventParams &e);
UI::EventReturn OnComboKey(UI::EventParams &e);
// Global settings handlers
UI::EventReturn OnLanguage(UI::EventParams &e);
-1
View File
@@ -1100,7 +1100,6 @@ UI::EventReturn MainScreen::OnGameSelectedInstant(UI::EventParams &e) {
}
UI::EventReturn MainScreen::OnGameSettings(UI::EventParams &e) {
// screenManager()->push(new SettingsScreen());
auto gameSettings = new GameSettingsScreen("", "");
gameSettings->OnRecentChanged.Handle(this, &MainScreen::OnRecentChange);
screenManager()->push(gameSettings);