Add hotkeys for incrementing/decrementing selected state slot (like RetroArch)

This commit is contained in:
askew-etc
2022-08-07 12:20:09 -05:00
parent 7b2b559743
commit 914f38753a
6 changed files with 35 additions and 1 deletions

View File

@ -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);