From e4846de692472db11094b2fbecf163716c32449a Mon Sep 17 00:00:00 2001 From: Rachel Bryk Date: Sun, 30 Jun 2013 19:01:30 -0400 Subject: [PATCH] Add hotkeys for save/load state to/from file. --- Source/Core/Core/Src/ConfigManager.cpp | 2 ++ Source/Core/Core/Src/CoreParameter.h | 2 ++ Source/Core/DolphinWX/Src/Frame.cpp | 2 ++ Source/Core/DolphinWX/Src/FrameTools.cpp | 10 ++++++++-- Source/Core/DolphinWX/Src/HotkeyDlg.cpp | 4 +++- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/ConfigManager.cpp b/Source/Core/Core/Src/ConfigManager.cpp index f3d3107aeb..ffca141b46 100644 --- a/Source/Core/Core/Src/ConfigManager.cpp +++ b/Source/Core/Core/Src/ConfigManager.cpp @@ -98,6 +98,8 @@ static const struct { { "SaveFirstState", 0, 0 /* wxMOD_NONE */ }, { "UndoLoadState", 351 /* WXK_F12 */, 0 /* wxMOD_NONE */ }, { "UndoSaveState", 351 /* WXK_F12 */, 4 /* wxMOD_SHIFT */ }, + { "SaveStateFile", 0, 0 /* wxMOD_NONE */ }, + { "LoadStateFile", 0, 0 /* wxMOD_NONE */ }, }; SConfig::SConfig() diff --git a/Source/Core/Core/Src/CoreParameter.h b/Source/Core/Core/Src/CoreParameter.h index c69d79eb9d..679fb0d425 100644 --- a/Source/Core/Core/Src/CoreParameter.h +++ b/Source/Core/Core/Src/CoreParameter.h @@ -64,6 +64,8 @@ enum Hotkey HK_SAVE_FIRST_STATE, HK_UNDO_LOAD_STATE, HK_UNDO_SAVE_STATE, + HK_SAVE_STATE_FILE, + HK_LOAD_STATE_FILE, NUM_HOTKEYS, }; diff --git a/Source/Core/DolphinWX/Src/Frame.cpp b/Source/Core/DolphinWX/Src/Frame.cpp index dd2b0f1cd4..14a1276eef 100644 --- a/Source/Core/DolphinWX/Src/Frame.cpp +++ b/Source/Core/DolphinWX/Src/Frame.cpp @@ -771,6 +771,8 @@ int GetCmdForHotkey(unsigned int key) case HK_SAVE_FIRST_STATE: return IDM_SAVEFIRSTSTATE; case HK_UNDO_LOAD_STATE: return IDM_UNDOLOADSTATE; case HK_UNDO_SAVE_STATE: return IDM_UNDOSAVESTATE; + case HK_LOAD_STATE_FILE: return IDM_LOADSTATEFILE; + case HK_SAVE_STATE_FILE: return IDM_SAVESTATEFILE; } return -1; diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 6a23e15d16..3b59352585 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -149,12 +149,12 @@ void CFrame::CreateMenu() emulationMenu->Append(IDM_LOADSTATE, _("&Load State"), loadMenu); emulationMenu->Append(IDM_SAVESTATE, _("Sa&ve State"), saveMenu); - saveMenu->Append(IDM_SAVESTATEFILE, _("Save State...")); + saveMenu->Append(IDM_SAVESTATEFILE, GetMenuLabel(HK_SAVE_STATE_FILE)); saveMenu->Append(IDM_SAVEFIRSTSTATE, GetMenuLabel(HK_SAVE_FIRST_STATE)); loadMenu->Append(IDM_UNDOSAVESTATE, GetMenuLabel(HK_UNDO_SAVE_STATE)); saveMenu->AppendSeparator(); - loadMenu->Append(IDM_LOADSTATEFILE, _("Load State...")); + loadMenu->Append(IDM_LOADSTATEFILE, GetMenuLabel(HK_LOAD_STATE_FILE)); loadMenu->Append(IDM_UNDOLOADSTATE, GetMenuLabel(HK_UNDO_LOAD_STATE)); loadMenu->AppendSeparator(); @@ -397,6 +397,9 @@ wxString CFrame::GetMenuLabel(int Id) Label = wxString::Format(_("Slot %i"), Id - HK_SAVE_STATE_SLOT_1 + 1); break; + case HK_SAVE_STATE_FILE: + Label = _("Save State..."); + break; case HK_LOAD_LAST_STATE_1: case HK_LOAD_LAST_STATE_2: @@ -409,6 +412,9 @@ wxString CFrame::GetMenuLabel(int Id) Label = wxString::Format(_("Last %i"), Id - HK_LOAD_LAST_STATE_1 + 1); break; + case HK_LOAD_STATE_FILE: + Label = _("Load State..."); + break; case HK_SAVE_FIRST_STATE: Label = wxString("Save Oldest State"); break; case HK_UNDO_LOAD_STATE: Label = wxString("Undo Load State"); break; diff --git a/Source/Core/DolphinWX/Src/HotkeyDlg.cpp b/Source/Core/DolphinWX/Src/HotkeyDlg.cpp index 487b310bf7..fad602f19e 100644 --- a/Source/Core/DolphinWX/Src/HotkeyDlg.cpp +++ b/Source/Core/DolphinWX/Src/HotkeyDlg.cpp @@ -216,7 +216,9 @@ void HotkeyConfigDialog::CreateHotkeyGUIControls(void) _("Save Oldest State"), _("Undo Load State"), - _("Undo Save State") + _("Undo Save State"), + _("Save State"), + _("Load State"), }; const int page_breaks[3] = {HK_OPEN, HK_LOAD_STATE_SLOT_1, NUM_HOTKEYS};