diff --git a/pcsx2/gui/MainFrame.cpp b/pcsx2/gui/MainFrame.cpp index 51ab3c2176..9500928d03 100644 --- a/pcsx2/gui/MainFrame.cpp +++ b/pcsx2/gui/MainFrame.cpp @@ -26,27 +26,17 @@ #include "svnrev.h" #endif -// ------------------------------------------------------------------------ -/*wxMenu* MainEmuFrame::MakeStatesMenu() -{ - wxMenu* mnuStates = new wxMenu(); - - mnuStates->Append( Menu_State_Load, _("Load"), &m_LoadStatesSubmenu, wxEmptyString ); - mnuStates->Append( Menu_State_Save, _("Save"), &m_SaveStatesSubmenu, wxEmptyString ); - return mnuStates; -}*/ - // ------------------------------------------------------------------------ wxMenu* MainEmuFrame::MakeStatesSubMenu( int baseid ) const { wxMenu* mnuSubstates = new wxMenu(); - mnuSubstates->Append( baseid+1, _("Slot 0") ); - mnuSubstates->Append( baseid+2, _("Slot 1") ); - mnuSubstates->Append( baseid+3, _("Slot 2") ); - mnuSubstates->Append( baseid+4, _("Slot 3") ); - mnuSubstates->Append( baseid+5, _("Slot 4") ); - mnuSubstates->Append( baseid, _("Other...") ); + for (int i = 0; i < 10; i++) + { + mnuSubstates->Append( baseid+i+1, wxsFormat(L"Slot %d", i) ); + } + mnuSubstates->AppendSeparator(); + mnuSubstates->Append( baseid - 1, _("Other...") ); return mnuSubstates; } @@ -205,6 +195,15 @@ void MainEmuFrame::ConnectMenus() ConnectMenu( MenuId_Emu_Reset, Menu_EmuReset_Click ); ConnectMenu( MenuId_State_LoadOther, Menu_LoadStateOther_Click ); + + for (int i = MenuId_State_Load01 + 1; i <= (MenuId_State_Load01 + 10); i++) + ConnectMenu(i, Menu_LoadStates_Click); + + ConnectMenu( MenuId_State_SaveOther, Menu_SaveStateOther_Click ); + + for (int i = MenuId_State_Save01 + 1; i <= (MenuId_State_Save01 + 10); i++) + ConnectMenu(i, Menu_SaveStates_Click); + ConnectMenu( MenuId_State_SaveOther, Menu_SaveStateOther_Click ); ConnectMenu( MenuId_Debug_Open, Menu_Debug_Open_Click ); diff --git a/pcsx2/gui/MainFrame.h b/pcsx2/gui/MainFrame.h index f620731f4b..cfc11f0345 100644 --- a/pcsx2/gui/MainFrame.h +++ b/pcsx2/gui/MainFrame.h @@ -29,7 +29,7 @@ class MainEmuFrame: public wxFrame // ------------------------------------------------------------------------ // MainEmuFrame Protected Variables // ------------------------------------------------------------------------ - + protected: wxFileHistory* m_RecentIsoList; wxStatusBar& m_statusbar; @@ -66,7 +66,7 @@ public: void UpdateIsoSrcFile(); void UpdateIsoSrcSelection(); void ApplySettings(); - + protected: void InitLogBoxPosition( AppConfig::ConsoleLogOptions& conf ); @@ -83,6 +83,8 @@ protected: void Menu_BootCdvd_Click(wxCommandEvent &event); void Menu_OpenELF_Click(wxCommandEvent &event); void Menu_CdvdSource_Click(wxCommandEvent &event); + void Menu_LoadStates_Click(wxCommandEvent &event); + void Menu_SaveStates_Click(wxCommandEvent &event); void Menu_LoadStateOther_Click(wxCommandEvent &event); void Menu_SaveStateOther_Click(wxCommandEvent &event); void Menu_Exit_Click(wxCommandEvent &event); diff --git a/pcsx2/gui/MainMenuClicks.cpp b/pcsx2/gui/MainMenuClicks.cpp index 892d97c361..8ff1ca2820 100644 --- a/pcsx2/gui/MainMenuClicks.cpp +++ b/pcsx2/gui/MainMenuClicks.cpp @@ -51,7 +51,7 @@ void MainEmuFrame::Menu_CdvdSource_Click( wxCommandEvent &event ) case MenuId_Src_Iso: g_Conf->CdvdSource = CDVDsrc_Iso; break; case MenuId_Src_Plugin: g_Conf->CdvdSource = CDVDsrc_Plugin; break; case MenuId_Src_NoDisc: g_Conf->CdvdSource = CDVDsrc_NoDisc; break; - + jNO_DEFAULT } UpdateIsoSrcSelection(); @@ -119,7 +119,7 @@ void MainEmuFrame::Menu_RunIso_Click( wxCommandEvent &event ) SysResume(); return; } - + SysEndExecution(); g_Conf->Folders.RunIso = wxFileName( ctrl.GetPath() ).GetPath(); @@ -148,7 +148,7 @@ void MainEmuFrame::Menu_RunIso_Click( wxCommandEvent &event ) // PS2 game. Valid! elf_file = ename; break; - + jNO_DEFAULT } } @@ -187,13 +187,37 @@ void MainEmuFrame::Menu_IsoRecent_Click(wxCommandEvent &event) void MainEmuFrame::Menu_OpenELF_Click(wxCommandEvent &event) { } + +void MainEmuFrame::Menu_LoadStates_Click(wxCommandEvent &event) +{ + int id = event.GetId() - MenuId_State_Load01 - 1; + if (id == -1) // Bad, I know. If I figure out why Load Other... gets connected here, I'll remove it. + { + Menu_LoadStateOther_Click(event); + return; + } + Console::WriteLn("If this were hooked up, it would load slot %d.", params id); +} + +void MainEmuFrame::Menu_SaveStates_Click(wxCommandEvent &event) +{ + int id = event.GetId() - MenuId_State_Save01 - 1; + if (id == -1) + { + Menu_SaveStateOther_Click(event); + return; + } + Console::WriteLn("If this were hooked up, it would save slot %d.", params id); +} void MainEmuFrame::Menu_LoadStateOther_Click(wxCommandEvent &event) -{ +{ + Console::WriteLn("If this were hooked up, it would load a savestate file."); } void MainEmuFrame::Menu_SaveStateOther_Click(wxCommandEvent &event) -{ +{ + Console::WriteLn("If this were hooked up, it would save a savestate file."); } void MainEmuFrame::Menu_Exit_Click(wxCommandEvent &event)