mirror of
				https://github.com/PabloMK7/citra.git
				synced 2025-10-30 21:30:04 +00:00 
			
		
		
		
	Added save + load hotkeys
This commit is contained in:
		
							parent
							
								
									7ff985cef9
								
							
						
					
					
						commit
						e74b44042b
					
				
					 4 changed files with 14 additions and 3 deletions
				
			
		|  | @ -57,7 +57,7 @@ const std::array<std::array<int, 5>, Settings::NativeAnalog::NumAnalogs> Config: | |||
| // This must be in alphabetical order according to action name as it must have the same order as
 | ||||
| // UISetting::values.shortcuts, which is alphabetically ordered.
 | ||||
| // clang-format off
 | ||||
| const std::array<UISettings::Shortcut, 21> default_hotkeys{ | ||||
| const std::array<UISettings::Shortcut, 23> default_hotkeys{ | ||||
|     {{QStringLiteral("Advance Frame"),            QStringLiteral("Main Window"), {QStringLiteral("\\"), Qt::ApplicationShortcut}}, | ||||
|      {QStringLiteral("Capture Screenshot"),       QStringLiteral("Main Window"), {QStringLiteral("Ctrl+P"), Qt::ApplicationShortcut}}, | ||||
|      {QStringLiteral("Continue/Pause Emulation"), QStringLiteral("Main Window"), {QStringLiteral("F4"), Qt::WindowShortcut}}, | ||||
|  | @ -73,6 +73,8 @@ const std::array<UISettings::Shortcut, 21> default_hotkeys{ | |||
|      {QStringLiteral("Rotate Screens Upright"),   QStringLiteral("Main Window"), {QStringLiteral("F8"), Qt::WindowShortcut}}, | ||||
|      {QStringLiteral("Stop Emulation"),           QStringLiteral("Main Window"), {QStringLiteral("F5"), Qt::WindowShortcut}}, | ||||
|      {QStringLiteral("Swap Screens"),             QStringLiteral("Main Window"), {QStringLiteral("F9"), Qt::WindowShortcut}}, | ||||
|      {QStringLiteral("Save to Oldest Slot"),      QStringLiteral("Main Window"), {QStringLiteral("Ctrl+C"), Qt::WindowShortcut}}, | ||||
|      {QStringLiteral("Load from Newest Slot"),    QStringLiteral("Main Window"), {QStringLiteral("Ctrl+V"), Qt::WindowShortcut}}, | ||||
|      {QStringLiteral("Toggle Filter Bar"),        QStringLiteral("Main Window"), {QStringLiteral("Ctrl+F"), Qt::WindowShortcut}}, | ||||
|      {QStringLiteral("Toggle Frame Advancing"),   QStringLiteral("Main Window"), {QStringLiteral("Ctrl+A"), Qt::ApplicationShortcut}}, | ||||
|      {QStringLiteral("Toggle Screen Layout"),     QStringLiteral("Main Window"), {QStringLiteral("F10"), Qt::WindowShortcut}}, | ||||
|  |  | |||
|  | @ -524,6 +524,10 @@ void GMainWindow::InitializeHotkeys() { | |||
|                     OnCaptureScreenshot(); | ||||
|                 } | ||||
|             }); | ||||
|     connect(hotkey_registry.GetHotkey(main_window, ui.action_Load_from_Newest_Slot->text(), this), | ||||
|             &QShortcut::activated, ui.action_Load_from_Newest_Slot, &QAction::trigger); | ||||
|     connect(hotkey_registry.GetHotkey(main_window, ui.action_Save_to_Oldest_Slot->text(), this), | ||||
|             &QShortcut::activated, ui.action_Save_to_Oldest_Slot, &QAction::trigger); | ||||
| } | ||||
| 
 | ||||
| void GMainWindow::ShowUpdaterWidgets() { | ||||
|  | @ -1636,7 +1640,7 @@ void GMainWindow::OnSaveState() { | |||
|     assert(action); | ||||
| 
 | ||||
|     Core::System::GetInstance().SendSignal(Core::System::Signal::Save, action->data().toUInt()); | ||||
|     UpdateSaveStates(); | ||||
|     newest_slot = action->data().toUInt(); | ||||
| } | ||||
| 
 | ||||
| void GMainWindow::OnLoadState() { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue