From 1954c2ce095d2bbd4f2d66050a5ab47ad2a810ee Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Sun, 23 Aug 2020 20:08:22 -0400 Subject: [PATCH] pcsx2-gui: Add handlers for new menu options --- pcsx2/gui/MainFrame.cpp | 3 +++ pcsx2/gui/MainFrame.h | 5 ++++- pcsx2/gui/MainMenuClicks.cpp | 20 +++++++++++++++++++- 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index 3d30ec65f2..628201b655 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -276,6 +276,9 @@ void MainEmuFrame::ConnectMenus() Bind(wxEVT_MENU, &MainEmuFrame::Menu_Recording_New_Click, this, MenuId_Recording_New); Bind(wxEVT_MENU, &MainEmuFrame::Menu_Recording_Play_Click, this, MenuId_Recording_Play); Bind(wxEVT_MENU, &MainEmuFrame::Menu_Recording_Stop_Click, this, MenuId_Recording_Stop); + Bind(wxEVT_MENU, &MainEmuFrame::Menu_Recording_TogglePause_Click, this, MenuId_Recording_TogglePause); + Bind(wxEVT_MENU, &MainEmuFrame::Menu_Recording_FrameAdvance_Click, this, MenuId_Recording_FrameAdvance); + Bind(wxEVT_MENU, &MainEmuFrame::Menu_Recording_ToggleRecordingMode_Click, this, MenuId_Recording_ToggleRecordingMode); Bind(wxEVT_MENU, &MainEmuFrame::Menu_Recording_VirtualPad_Open_Click, this, MenuId_Recording_VirtualPad_Port0); Bind(wxEVT_MENU, &MainEmuFrame::Menu_Recording_VirtualPad_Open_Click, this, MenuId_Recording_VirtualPad_Port1); #endif diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index 33ebec42a1..42930abe6a 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -167,7 +167,7 @@ public: void AppendKeycodeNamesToMenuOptions(); void UpdateStatusBar(); #ifndef DISABLE_RECORDING - void AppendKeycodeNamesToRecordingMenuOptions(MenuIdentifiers menuId, wxString keyCodeStr); + void appendKeycodeNamesToRecordingMenuOptions(MenuIdentifiers menuId, wxString keyCodeStr); #endif protected: @@ -247,6 +247,9 @@ protected: void Menu_Recording_New_Click(wxCommandEvent &event); void Menu_Recording_Play_Click(wxCommandEvent &event); void Menu_Recording_Stop_Click(wxCommandEvent &event); + void Menu_Recording_TogglePause_Click(wxCommandEvent &event); + void Menu_Recording_FrameAdvance_Click(wxCommandEvent &event); + void Menu_Recording_ToggleRecordingMode_Click(wxCommandEvent &event); void Menu_Recording_VirtualPad_Open_Click(wxCommandEvent &event); #endif diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 86bf4cb582..a5fe89b43d 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -972,7 +972,25 @@ void MainEmuFrame::Menu_Recording_Stop_Click(wxCommandEvent &event) m_menuRecording.FindChildItem(MenuId_Recording_Stop)->Enable(false); } -void MainEmuFrame::Menu_Recording_VirtualPad_Open_Click(wxCommandEvent &event) +void MainEmuFrame::Menu_Recording_TogglePause_Click(wxCommandEvent& event) +{ + if (g_Conf->EmuOptions.EnableRecordingTools) + g_RecordingControls.TogglePause(); +} + +void MainEmuFrame::Menu_Recording_FrameAdvance_Click(wxCommandEvent& event) +{ + if (g_Conf->EmuOptions.EnableRecordingTools) + g_RecordingControls.FrameAdvance(); +} + +void MainEmuFrame::Menu_Recording_ToggleRecordingMode_Click(wxCommandEvent& event) +{ + if (g_Conf->EmuOptions.EnableRecordingTools) + g_InputRecording.RecordModeToggle(); +} + +void MainEmuFrame::Menu_Recording_VirtualPad_Open_Click(wxCommandEvent& event) { wxGetApp().GetVirtualPadPtr(event.GetId() - MenuId_Recording_VirtualPad_Port0)->Show(); }