Add restart emulation command
- Add RestartEmulation() method to MainWindowViewModel - Add 'Restart Emulation' menu item with Ctrl+R keybinding - Add locale translations for all supported languages - No confirmation dialog (faster restart experience)
This commit is contained in:
parent
b70e2e44cb
commit
5275fa8232
@ -575,6 +575,31 @@
|
||||
"zh_TW": "停止模擬"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ID": "MenuBarOptionsRestartEmulation",
|
||||
"Translations": {
|
||||
"ar_SA": "إعادة تشغيل المحاكاة",
|
||||
"de_DE": "Emulation neu starten",
|
||||
"el_GR": "Επανεκκίνηση Εξομοίωσης",
|
||||
"en_US": "Restart Emulation",
|
||||
"es_ES": "Reiniciar Emulación",
|
||||
"fr_FR": "Redémarrer l'Émulation",
|
||||
"he_IL": "הפעל מחדש את האמולציה",
|
||||
"it_IT": "Riavvia l'emulazione",
|
||||
"ja_JP": "エミュレーションを再起動",
|
||||
"ko_KR": "에뮬레이션 재시작",
|
||||
"no_NO": "Start Emulering på nytt",
|
||||
"pl_PL": "Uruchom ponownie emulację",
|
||||
"pt_BR": "Reiniciar a Emulação",
|
||||
"ru_RU": "Перезапустить",
|
||||
"sv_SE": "Starta om emulering",
|
||||
"th_TH": "รีสตาร์ทการจำลอง",
|
||||
"tr_TR": "Emülasyonu Yeniden Başlat",
|
||||
"uk_UA": "Перезапустити емуляцію",
|
||||
"zh_CN": "重启模拟",
|
||||
"zh_TW": "重啟模擬"
|
||||
}
|
||||
},
|
||||
{
|
||||
"ID": "MenuBarOptionsSettings",
|
||||
"Translations": {
|
||||
@ -24851,4 +24876,4 @@
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@ -174,6 +174,7 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
private string _screenshotKey = "F8";
|
||||
private float _volume;
|
||||
private ApplicationData _currentApplicationData;
|
||||
private bool _pendingRestart;
|
||||
private readonly AutoResetEvent _rendererWaitEvent;
|
||||
private int _customVSyncInterval;
|
||||
private int _customVSyncIntervalPercentageProxy;
|
||||
@ -1250,6 +1251,12 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
|
||||
await LoadApplication(_currentApplicationData);
|
||||
}
|
||||
else if (_pendingRestart)
|
||||
{
|
||||
_pendingRestart = false;
|
||||
|
||||
await LoadApplication(_currentApplicationData);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Otherwise, clear state.
|
||||
@ -1258,6 +1265,17 @@ namespace Ryujinx.Ava.UI.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public void RestartEmulation()
|
||||
{
|
||||
if (AppHost is null || _currentApplicationData is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_pendingRestart = true;
|
||||
AppHost.Stop();
|
||||
}
|
||||
|
||||
private void Update_StatusBar(object sender, StatusUpdatedEventArgs args)
|
||||
{
|
||||
if (ShowMenuAndStatusBar && !ShowLoadProgress)
|
||||
|
||||
@ -167,6 +167,12 @@
|
||||
Icon="{ext:Icon fa-solid fa-stop}"
|
||||
InputGesture="Escape"
|
||||
IsEnabled="{Binding IsGameRunning}" />
|
||||
<MenuItem
|
||||
Name="RestartEmulationMenuItem"
|
||||
Header="{ext:Locale MenuBarOptionsRestartEmulation}"
|
||||
Icon="{ext:Icon fa-solid fa-rotate-right}"
|
||||
InputGesture="Ctrl + R"
|
||||
IsEnabled="{Binding IsGameRunning}" />
|
||||
<MenuItem Command="{Binding SimulateWakeUpMessage}" Header="{ext:Locale MenuBarOptionsSimulateWakeUpMessage}" Icon="{ext:Icon fa-solid fa-sun}" />
|
||||
<Separator />
|
||||
<MenuItem
|
||||
|
||||
@ -43,6 +43,7 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||
PauseEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.Pause());
|
||||
ResumeEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.Resume());
|
||||
StopEmulationMenuItem.Command = Commands.Create(() => ViewModel.AppHost?.ShowExitPrompt().OrCompleted());
|
||||
RestartEmulationMenuItem.Command = Commands.Create(() => ViewModel.RestartEmulation());
|
||||
CheatManagerMenuItem.Command = Commands.CreateSilentFail(OpenCheatManagerForCurrentApp);
|
||||
InstallFileTypesMenuItem.Command = Commands.Create(InstallFileTypes);
|
||||
UninstallFileTypesMenuItem.Command = Commands.Create(UninstallFileTypes);
|
||||
|
||||
@ -41,6 +41,7 @@
|
||||
<KeyBinding Gesture="Escape" Command="{Binding ExitCurrentState}" />
|
||||
<KeyBinding Gesture="Ctrl+A" Command="{Binding OpenAmiiboWindow}" />
|
||||
<KeyBinding Gesture="Ctrl+B" Command="{Binding OpenBinFile}" />
|
||||
<KeyBinding Gesture="Ctrl+R" Command="{Binding RestartEmulation}" />
|
||||
<KeyBinding Gesture="Ctrl+Shift+R" Command="{Binding ReloadRenderDocApi}" />
|
||||
<KeyBinding Gesture="Ctrl+Shift+C" Command="{Binding ToggleCapture}" />
|
||||
</Window.KeyBindings>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user