diff --git a/Source/Core/Core/HotkeyManager.cpp b/Source/Core/Core/HotkeyManager.cpp index b7c5c161c2..b305db6fa9 100644 --- a/Source/Core/Core/HotkeyManager.cpp +++ b/Source/Core/Core/HotkeyManager.cpp @@ -179,6 +179,8 @@ constexpr std::array s_hotkey_labels{{ _trans("Undo Save State"), _trans("Save State"), _trans("Load State"), + _trans("Increase Selected State Slot"), + _trans("Decrease Selected State Slot"), _trans("Load ROM"), _trans("Unload ROM"), @@ -349,7 +351,7 @@ constexpr std::array s_groups_info = { {_trans("Save State"), HK_SAVE_STATE_SLOT_1, HK_SAVE_STATE_SLOT_SELECTED}, {_trans("Select State"), HK_SELECT_STATE_SLOT_1, HK_SELECT_STATE_SLOT_10}, {_trans("Load Last State"), HK_LOAD_LAST_STATE_1, HK_LOAD_LAST_STATE_10}, - {_trans("Other State Hotkeys"), HK_SAVE_FIRST_STATE, HK_LOAD_STATE_FILE}, + {_trans("Other State Hotkeys"), HK_SAVE_FIRST_STATE, HK_DECREMENT_SELECTED_STATE_SLOT}, {_trans("GBA Core"), HK_GBA_LOAD, HK_GBA_RESET, true}, {_trans("GBA Volume"), HK_GBA_VOLUME_DOWN, HK_GBA_TOGGLE_MUTE, true}, {_trans("GBA Window Size"), HK_GBA_1X, HK_GBA_4X, true}}}; diff --git a/Source/Core/Core/HotkeyManager.h b/Source/Core/Core/HotkeyManager.h index b58f9c2828..134eba8e58 100644 --- a/Source/Core/Core/HotkeyManager.h +++ b/Source/Core/Core/HotkeyManager.h @@ -164,6 +164,8 @@ enum Hotkey HK_UNDO_SAVE_STATE, HK_SAVE_STATE_FILE, HK_LOAD_STATE_FILE, + HK_INCREMENT_SELECTED_STATE_SLOT, + HK_DECREMENT_SELECTED_STATE_SLOT, HK_GBA_LOAD, HK_GBA_UNLOAD, diff --git a/Source/Core/DolphinQt/HotkeyScheduler.cpp b/Source/Core/DolphinQt/HotkeyScheduler.cpp index 6d7c91a6ee..99abe3f588 100644 --- a/Source/Core/DolphinQt/HotkeyScheduler.cpp +++ b/Source/Core/DolphinQt/HotkeyScheduler.cpp @@ -490,6 +490,12 @@ void HotkeyScheduler::Run() if (IsHotkey(HK_LOAD_STATE_SLOT_SELECTED)) emit StateLoadSlotHotkey(); + if (IsHotkey(HK_INCREMENT_SELECTED_STATE_SLOT)) + emit IncrementSelectedStateSlotHotkey(); + + if (IsHotkey(HK_DECREMENT_SELECTED_STATE_SLOT)) + emit DecrementSelectedStateSlotHotkey(); + // Stereoscopy if (IsHotkey(HK_TOGGLE_STEREO_SBS)) { diff --git a/Source/Core/DolphinQt/HotkeyScheduler.h b/Source/Core/DolphinQt/HotkeyScheduler.h index 122e57b97e..15f17fff93 100644 --- a/Source/Core/DolphinQt/HotkeyScheduler.h +++ b/Source/Core/DolphinQt/HotkeyScheduler.h @@ -36,6 +36,8 @@ signals: void ScreenShotHotkey(); void RefreshGameListHotkey(); void SetStateSlotHotkey(int slot); + void IncrementSelectedStateSlotHotkey(); + void DecrementSelectedStateSlotHotkey(); void StateLoadSlotHotkey(); void StateSaveSlotHotkey(); void StateLoadSlot(int state); diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index 7c4e0a0dd7..52a2a0290c 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -595,6 +595,10 @@ void MainWindow::ConnectHotkeys() &MainWindow::StateSaveSlot); connect(m_hotkey_scheduler, &HotkeyScheduler::SetStateSlotHotkey, this, &MainWindow::SetStateSlot); + connect(m_hotkey_scheduler, &HotkeyScheduler::IncrementSelectedStateSlotHotkey, this, + &MainWindow::IncrementSelectedStateSlot); + connect(m_hotkey_scheduler, &HotkeyScheduler::DecrementSelectedStateSlotHotkey, this, + &MainWindow::DecrementSelectedStateSlot); connect(m_hotkey_scheduler, &HotkeyScheduler::StartRecording, this, &MainWindow::OnStartRecording); connect(m_hotkey_scheduler, &HotkeyScheduler::PlayRecording, this, &MainWindow::OnPlayRecording); @@ -1358,6 +1362,22 @@ void MainWindow::SetStateSlot(int slot) 2500); } +void MainWindow::IncrementSelectedStateSlot() +{ + int state_slot = m_state_slot + 1; + if (state_slot > State::NUM_STATES) + state_slot = 1; + m_menu_bar->SetStateSlot(state_slot); +} + +void MainWindow::DecrementSelectedStateSlot() +{ + int state_slot = m_state_slot - 1; + if (state_slot < 1) + state_slot = State::NUM_STATES; + m_menu_bar->SetStateSlot(state_slot); +} + void MainWindow::PerformOnlineUpdate(const std::string& region) { WiiUpdate::PerformOnlineUpdate(region, this); diff --git a/Source/Core/DolphinQt/MainWindow.h b/Source/Core/DolphinQt/MainWindow.h index 5f9eb34bb2..60880a5275 100644 --- a/Source/Core/DolphinQt/MainWindow.h +++ b/Source/Core/DolphinQt/MainWindow.h @@ -102,6 +102,8 @@ private: void StateSaveUndo(); void StateSaveOldest(); void SetStateSlot(int slot); + void IncrementSelectedStateSlot(); + void DecrementSelectedStateSlot(); void BootWiiSystemMenu(); void PerformOnlineUpdate(const std::string& region);