Merge pull request #10962 from askew-etc/inc-dec-select-state-hotkeys

Add hotkeys for incrementing/decrementing select state slot
This commit is contained in:
Admiral H. Curtiss
2022-08-10 01:41:32 +02:00
committed by GitHub
6 changed files with 35 additions and 1 deletions

View File

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

View File

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

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

View File

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