MenuBar: Update checkmarked Select State Slot when hotkey pressed

Update the checkmarked slot in the Select State Slot menu when the
Increase Selected State Slot or Decrease Selected State Slot hotkeys are
pressed.

The actual selected save slot was being changed correctly before this
commit; this just fixes the menu checkmark.
This commit is contained in:
Dentomologist committed 2024-08-13 12:53:29 -07:00
1 parent 5af0ae25e6
commit 134313e313
1 file changed
+4
+4
View File
@@ -408,6 +408,10 @@ void MenuBar::AddStateSlotMenu(QMenu* emu_menu)
action->setChecked(true);
connect(action, &QAction::triggered, this, [=, this]() { emit SetStateSlot(i); });
connect(this, &MenuBar::SetStateSlot, [action, i](const int slot) {
if (slot == i)
action->setChecked(true);
});
}
}