Added new option "exit by pressing plus and minus buttons" to the input section.

This commit is contained in:
Vova
2025-01-08 21:43:18 +10:00
parent 007d3bc045
commit 37b4dd2133
24 changed files with 333 additions and 25 deletions

View File

@@ -1046,6 +1046,7 @@ namespace Ryujinx.Ava.UI.ViewModels
private void InitializeGame()
{
RendererHostControl.WindowCreated += RendererHost_Created;
AppHost.StatusUpdatedEvent += Update_StatusBar;
@@ -1055,7 +1056,13 @@ namespace Ryujinx.Ava.UI.ViewModels
AppHost?.Start();
if (AppHost?.IsSpecialExit() == true)
{
Window.ForceExit();
}
AppHost?.DisposeContext();
}
private async Task HandleRelaunch()

View File

@@ -128,6 +128,7 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool EnableDockedMode { get; set; }
public bool EnableKeyboard { get; set; }
public bool EnableMouse { get; set; }
public int EnableSpetialExit { get; set; }
public VSyncMode VSyncMode
{
get => _vSyncMode;
@@ -259,6 +260,8 @@ namespace Ryujinx.Ava.UI.ViewModels
public int OpenglDebugLevel { get; set; }
public int MemoryMode { get; set; }
public int BaseStyleIndex { get; set; }
public int GraphicsBackendIndex
{
get => _graphicsBackendIndex;
@@ -511,6 +514,13 @@ namespace Ryujinx.Ava.UI.ViewModels
EnableDockedMode = config.System.EnableDockedMode;
EnableKeyboard = config.Hid.EnableKeyboard;
EnableMouse = config.Hid.EnableMouse;
EnableSpetialExit = config.Hid.SpetialExitEmulator.Value switch
{
0=> 0, //"Hotkey 'Exit' is Disabled"
1=> 1, //"Close app. by hotkey"
2=> 2, // "Close game by hotkey"
_ => 0 //"Hotkey 'Exit' is Disabled"
};
// Keyboard Hotkeys
KeyboardHotkey = new HotkeyConfig(config.Hid.Hotkeys.Value);
@@ -618,6 +628,13 @@ namespace Ryujinx.Ava.UI.ViewModels
config.System.EnableDockedMode.Value = EnableDockedMode;
config.Hid.EnableKeyboard.Value = EnableKeyboard;
config.Hid.EnableMouse.Value = EnableMouse;
config.Hid.SpetialExitEmulator.Value = EnableSpetialExit switch
{
0 => 0, //"Hotkey 'Exit' is Disabled",
1 => 1, //"Close app. by hotkey",
2 => 2, //"Close game by hotkey",
_ => 0, //"Hotkey 'Exit' is Disabled"
};
// Keyboard Hotkeys
config.Hid.Hotkeys.Value = KeyboardHotkey.GetConfig();