multiple fixes, variable typo fixes, adherence to a certain style. Fixed initialization of the new function, defaults to 0

This commit is contained in:
Vova 2025-01-08 22:45:33 +10:00
parent 37b4dd2133
commit b6667a8352
22 changed files with 59 additions and 57 deletions

View File

@ -254,16 +254,16 @@ namespace Ryujinx.Input.SDL2
} }
private static bool hotButtonMinus = false; private static bool hotButtonMinus = false;
private static bool HotExit = false; private static bool hotExit = false;
public bool spetialExit() public bool SpecialExit()
{ {
if (hotButtonMinus) if (hotButtonMinus)
{ {
hotButtonMinus = false; hotButtonMinus = false;
return HotExit; return hotExit;
} }
return HotExit = false; return hotExit = false;
} }
public GamepadStateSnapshot GetMappedStateSnapshot() public GamepadStateSnapshot GetMappedStateSnapshot()
@ -299,7 +299,7 @@ namespace Ryujinx.Input.SDL2
if (rawState.IsPressed(entry.To) && hotButtonMinus) if (rawState.IsPressed(entry.To) && hotButtonMinus)
{ {
HotExit = true; hotExit = true;
} }
} }

View File

@ -329,7 +329,7 @@ namespace Ryujinx.Input.SDL2
return result; return result;
} }
public bool spetialExit() public bool SpecialExit()
{ {
return false; return false;
} }

View File

@ -25,7 +25,7 @@ namespace Ryujinx.Input.SDL2
{ {
_driver = driver; _driver = driver;
} }
public bool spetialExit() public bool SpecialExit()
{ {
return false; return false;
} }

View File

@ -284,7 +284,7 @@ namespace Ryujinx.Input.HLE
{ {
State = gamepad.GetMappedStateSnapshot(); State = gamepad.GetMappedStateSnapshot();
if (gamepad.spetialExit()) if (gamepad.SpecialExit())
{ {
return true; return true;
} }

View File

@ -202,7 +202,7 @@ namespace Ryujinx.Input.HLE
public bool Update(float aspectRatio = 1) public bool Update(float aspectRatio = 1)
{ {
bool spetialExit = false; bool specialExit = false;
lock (_lock) lock (_lock)
{ {
@ -227,7 +227,9 @@ namespace Ryujinx.Input.HLE
DriverConfigurationUpdate(ref controller, inputConfig); DriverConfigurationUpdate(ref controller, inputConfig);
controller.UpdateUserConfiguration(inputConfig); controller.UpdateUserConfiguration(inputConfig);
spetialExit = controller.Update(); //hotkey press check
specialExit = controller.Update(); //hotkey press check
controller.UpdateRumble(_device.Hid.Npads.GetRumbleQueue(playerIndex)); controller.UpdateRumble(_device.Hid.Npads.GetRumbleQueue(playerIndex));
inputState = controller.GetHLEInputState(); inputState = controller.GetHLEInputState();
@ -318,7 +320,7 @@ namespace Ryujinx.Input.HLE
_device.TamperMachine.UpdateInput(hleInputStates); _device.TamperMachine.UpdateInput(hleInputStates);
} }
return spetialExit; return specialExit;
} }
internal InputConfig GetPlayerInputConfigByIndex(int index) internal InputConfig GetPlayerInputConfigByIndex(int index)

View File

@ -83,7 +83,7 @@ namespace Ryujinx.Input
/// Gets the state if the minus and plus buttons were pressed on the gamepad. /// Gets the state if the minus and plus buttons were pressed on the gamepad.
/// </summary> /// </summary>
/// <returns>returns true if the buttons were pressed.</returns> /// <returns>returns true if the buttons were pressed.</returns>
bool spetialExit(); bool SpecialExit();
/// <summary> /// <summary>
/// Get a snaphost of the state of the gamepad. /// Get a snaphost of the state of the gamepad.

View File

@ -71,7 +71,7 @@ namespace Ryujinx.Ava
private const float MaxResolutionScale = 4.0f; // Max resolution hotkeys can scale to before wrapping. private const float MaxResolutionScale = 4.0f; // Max resolution hotkeys can scale to before wrapping.
private const int TargetFps = 60; private const int TargetFps = 60;
private const float VolumeDelta = 0.05f; private const float VolumeDelta = 0.05f;
static bool spetialExit = false; static bool SpecialExit = false;
private static readonly Cursor _invisibleCursor = new(StandardCursorType.None); private static readonly Cursor _invisibleCursor = new(StandardCursorType.None);
private readonly nint _invisibleCursorWin; private readonly nint _invisibleCursorWin;
@ -512,7 +512,7 @@ namespace Ryujinx.Ava
public bool IsSpecialExit() public bool IsSpecialExit()
{ {
return spetialExit; return SpecialExit;
} }
private void UpdateIgnoreMissingServicesState(object sender, ReactiveEventArgs<bool> args) private void UpdateIgnoreMissingServicesState(object sender, ReactiveEventArgs<bool> args)
@ -1212,9 +1212,9 @@ namespace Ryujinx.Ava
if (NpadManager.Update(ConfigurationState.Instance.Graphics.AspectRatio.Value.ToFloat())) if (NpadManager.Update(ConfigurationState.Instance.Graphics.AspectRatio.Value.ToFloat()))
{ {
if (ConfigurationState.Instance.Hid.SpetialExitEmulator.Value == 1) if (ConfigurationState.Instance.Hid.specialExitEmulator.Value == 1)
{ {
spetialExit = true; SpecialExit = true;
} }
@ -1223,11 +1223,11 @@ namespace Ryujinx.Ava
if (NpadManager.Update(ConfigurationState.Instance.Graphics.AspectRatio.Value.ToFloat())) if (NpadManager.Update(ConfigurationState.Instance.Graphics.AspectRatio.Value.ToFloat()))
{ {
if (ConfigurationState.Instance.Hid.SpetialExitEmulator.Value == 1) if (ConfigurationState.Instance.Hid.specialExitEmulator.Value == 1)
{ {
spetialExit = true; // close App SpecialExit = true; // close App
} }
if (ConfigurationState.Instance.Hid.SpetialExitEmulator.Value > 0) if (ConfigurationState.Instance.Hid.specialExitEmulator.Value > 0)
{ {
_isActive = false; //close game _isActive = false; //close game

View File

@ -15248,7 +15248,7 @@
} }
}, },
{ {
"ID": "spetialExitTooltip", "ID": "SpecialExitTooltip",
"Translations": { "Translations": {
"ar_SA": "يقوم بتفعيل مفاتيح الاختصار 'زائد' و 'ناقص'.\nاضغط على زرّي زائد وناقص في نفس الوقت لتنفيذ إحدى العمليات:\n\n1) إغلاق التطبيق باستخدام مفاتيح الاختصار.\n2) الخروج من اللعبة دون إغلاق التطبيق.\n\nيعمل فقط مع أذرع التحكم.", "ar_SA": "يقوم بتفعيل مفاتيح الاختصار 'زائد' و 'ناقص'.\nاضغط على زرّي زائد وناقص في نفس الوقت لتنفيذ إحدى العمليات:\n\n1) إغلاق التطبيق باستخدام مفاتيح الاختصار.\n2) الخروج من اللعبة دون إغلاق التطبيق.\n\nيعمل فقط مع أذرع التحكم.",
"de_DE": "Aktiviert die Hotkeys 'Plus' und 'Minus'.\nDrücken Sie gleichzeitig die Plus- und Minus-Tasten, um eine der folgenden Aktionen auszuführen:\n\n1) Schließt die Anwendung durch Drücken der Hotkeys.\n2) Beendet das Spiel, ohne die Anwendung zu schließen.\n\nFunktioniert nur mit Gamepads.", "de_DE": "Aktiviert die Hotkeys 'Plus' und 'Minus'.\nDrücken Sie gleichzeitig die Plus- und Minus-Tasten, um eine der folgenden Aktionen auszuführen:\n\n1) Schließt die Anwendung durch Drücken der Hotkeys.\n2) Beendet das Spiel, ohne die Anwendung zu schließen.\n\nFunktioniert nur mit Gamepads.",

View File

@ -350,11 +350,11 @@ namespace Ryujinx.Headless
{ {
return options.GraphicsBackend switch return options.GraphicsBackend switch
{ {
GraphicsBackend.Vulkan => new VulkanWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableMouse, options.HideCursorMode, options.IgnoreControllerApplet, options.spetialExit), GraphicsBackend.Vulkan => new VulkanWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableMouse, options.HideCursorMode, options.IgnoreControllerApplet, options.SpecialExit),
GraphicsBackend.Metal => OperatingSystem.IsMacOS() ? GraphicsBackend.Metal => OperatingSystem.IsMacOS() ?
new MetalWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableKeyboard, options.HideCursorMode, options.IgnoreControllerApplet, options.spetialExit) : new MetalWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableKeyboard, options.HideCursorMode, options.IgnoreControllerApplet, options.SpecialExit) :
throw new Exception("Attempted to use Metal renderer on non-macOS platform!"), throw new Exception("Attempted to use Metal renderer on non-macOS platform!"),
_ => new OpenGLWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableMouse, options.HideCursorMode, options.IgnoreControllerApplet, options.spetialExit) _ => new OpenGLWindow(_inputManager, options.LoggingGraphicsDebugLevel, options.AspectRatio, options.EnableMouse, options.HideCursorMode, options.IgnoreControllerApplet, options.SpecialExit)
}; };
} }

View File

@ -24,8 +24,8 @@ namespace Ryujinx.Headless
bool enableMouse, bool enableMouse,
HideCursorMode hideCursorMode, HideCursorMode hideCursorMode,
bool ignoreControllerApplet, bool ignoreControllerApplet,
int SpetialExitEmulator) int specialExitEmulator)
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet, SpetialExitEmulator) { } : base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet, specialExitEmulator) { }
public override SDL_WindowFlags GetWindowFlags() => SDL_WindowFlags.SDL_WINDOW_METAL; public override SDL_WindowFlags GetWindowFlags() => SDL_WindowFlags.SDL_WINDOW_METAL;

View File

@ -119,8 +119,8 @@ namespace Ryujinx.Headless
bool enableMouse, bool enableMouse,
HideCursorMode hideCursorMode, HideCursorMode hideCursorMode,
bool ignoreControllerApplet, bool ignoreControllerApplet,
int SpetialExitEmulator) int specialExitEmulator)
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet, SpetialExitEmulator) : base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet, specialExitEmulator)
{ {
_glLogLevel = glLogLevel; _glLogLevel = glLogLevel;
} }

View File

@ -151,8 +151,8 @@ namespace Ryujinx.Headless
if (NeedsOverride(nameof(IgnoreControllerApplet))) if (NeedsOverride(nameof(IgnoreControllerApplet)))
IgnoreControllerApplet = configurationState.IgnoreApplet; IgnoreControllerApplet = configurationState.IgnoreApplet;
if (NeedsOverride(nameof(spetialExit))) if (NeedsOverride(nameof(SpecialExit)))
spetialExit = configurationState.Hid.SpetialExitEmulator; SpecialExit = configurationState.Hid.specialExitEmulator;
return; return;
@ -278,7 +278,7 @@ namespace Ryujinx.Headless
public bool EnableMouse { get; set; } public bool EnableMouse { get; set; }
[Option("enable-press-hotkeys-to-exit", Required = false, Default = 0, HelpText = "press the minus and plus buttons to: 0 -disable, 1 - exit app, 2 - exit game.")] [Option("enable-press-hotkeys-to-exit", Required = false, Default = 0, HelpText = "press the minus and plus buttons to: 0 -disable, 1 - exit app, 2 - exit game.")]
public int spetialExit { get; set; } public int SpecialExit { get; set; }
[Option("hide-cursor", Required = false, Default = HideCursorMode.OnIdle, HelpText = "Change when the cursor gets hidden.")] [Option("hide-cursor", Required = false, Default = HideCursorMode.OnIdle, HelpText = "Change when the cursor gets hidden.")]
public HideCursorMode HideCursorMode { get; set; } public HideCursorMode HideCursorMode { get; set; }

View File

@ -19,8 +19,8 @@ namespace Ryujinx.Headless
bool enableMouse, bool enableMouse,
HideCursorMode hideCursorMode, HideCursorMode hideCursorMode,
bool ignoreControllerApplet, bool ignoreControllerApplet,
int SpetialExitEmulator) int specialExitEmulator)
: base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet, SpetialExitEmulator) : base(inputManager, glLogLevel, aspectRatio, enableMouse, hideCursorMode, ignoreControllerApplet, specialExitEmulator)
{ {
_glLogLevel = glLogLevel; _glLogLevel = glLogLevel;
} }

View File

@ -88,7 +88,7 @@ namespace Ryujinx.Headless
private readonly AspectRatio _aspectRatio; private readonly AspectRatio _aspectRatio;
private readonly bool _enableMouse; private readonly bool _enableMouse;
private readonly int _SpetialExitEmulator; private readonly int _specialExitEmulator;
private readonly bool _ignoreControllerApplet; private readonly bool _ignoreControllerApplet;
public WindowBase( public WindowBase(
@ -98,7 +98,7 @@ namespace Ryujinx.Headless
bool enableMouse, bool enableMouse,
HideCursorMode hideCursorMode, HideCursorMode hideCursorMode,
bool ignoreControllerApplet, bool ignoreControllerApplet,
int SpetialExitEmulator) int specialExitEmulator)
{ {
MouseDriver = new SDL2MouseDriver(hideCursorMode); MouseDriver = new SDL2MouseDriver(hideCursorMode);
_inputManager = inputManager; _inputManager = inputManager;
@ -114,7 +114,7 @@ namespace Ryujinx.Headless
_gpuDoneEvent = new ManualResetEvent(false); _gpuDoneEvent = new ManualResetEvent(false);
_aspectRatio = aspectRatio; _aspectRatio = aspectRatio;
_enableMouse = enableMouse; _enableMouse = enableMouse;
_SpetialExitEmulator = SpetialExitEmulator; _specialExitEmulator = specialExitEmulator;
_ignoreControllerApplet = ignoreControllerApplet; _ignoreControllerApplet = ignoreControllerApplet;
HostUITheme = new HeadlessHostUiTheme(); HostUITheme = new HeadlessHostUiTheme();

View File

@ -30,7 +30,7 @@ namespace Ryujinx.Ava.Input
public readonly Key From = from; public readonly Key From = from;
} }
public bool spetialExit() public bool SpecialExit()
{ {
return false; return false;
} }

View File

@ -13,7 +13,7 @@ namespace Ryujinx.Ava.Input
public string Id => "0"; public string Id => "0";
public string Name => "AvaloniaMouse"; public string Name => "AvaloniaMouse";
public bool spetialExit() public bool SpecialExit()
{ {
return false; return false;
} }

View File

@ -128,7 +128,7 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool EnableDockedMode { get; set; } public bool EnableDockedMode { get; set; }
public bool EnableKeyboard { get; set; } public bool EnableKeyboard { get; set; }
public bool EnableMouse { get; set; } public bool EnableMouse { get; set; }
public int EnableSpetialExit { get; set; } public int EnableSpecialExit { get; set; }
public VSyncMode VSyncMode public VSyncMode VSyncMode
{ {
get => _vSyncMode; get => _vSyncMode;
@ -514,12 +514,12 @@ namespace Ryujinx.Ava.UI.ViewModels
EnableDockedMode = config.System.EnableDockedMode; EnableDockedMode = config.System.EnableDockedMode;
EnableKeyboard = config.Hid.EnableKeyboard; EnableKeyboard = config.Hid.EnableKeyboard;
EnableMouse = config.Hid.EnableMouse; EnableMouse = config.Hid.EnableMouse;
EnableSpetialExit = config.Hid.SpetialExitEmulator.Value switch EnableSpecialExit = config.Hid.specialExitEmulator.Value switch
{ {
0=> 0, //"Hotkey 'Exit' is Disabled" 0=> 0, // "Hotkey 'Exit' is Disabled"
1=> 1, //"Close app. by hotkey" 1=> 1, // "Close app. by hotkey"
2=> 2, // "Close game by hotkey" 2=> 2, // "Close game by hotkey"
_ => 0 //"Hotkey 'Exit' is Disabled" _ => 0 // "Hotkey 'Exit' is Disabled"
}; };
// Keyboard Hotkeys // Keyboard Hotkeys
@ -628,12 +628,12 @@ namespace Ryujinx.Ava.UI.ViewModels
config.System.EnableDockedMode.Value = EnableDockedMode; config.System.EnableDockedMode.Value = EnableDockedMode;
config.Hid.EnableKeyboard.Value = EnableKeyboard; config.Hid.EnableKeyboard.Value = EnableKeyboard;
config.Hid.EnableMouse.Value = EnableMouse; config.Hid.EnableMouse.Value = EnableMouse;
config.Hid.SpetialExitEmulator.Value = EnableSpetialExit switch config.Hid.specialExitEmulator.Value = EnableSpecialExit switch
{ {
0 => 0, //"Hotkey 'Exit' is Disabled", 0 => 0, // "Hotkey 'Exit' is Disabled",
1 => 1, //"Close app. by hotkey", 1 => 1, // "Close app. by hotkey",
2 => 2, //"Close game by hotkey", 2 => 2, // "Close game by hotkey",
_ => 0, //"Hotkey 'Exit' is Disabled" _ => 0, // "Hotkey 'Exit' is Disabled"
}; };
// Keyboard Hotkeys // Keyboard Hotkeys

View File

@ -58,8 +58,8 @@
<TextBlock <TextBlock
Text="{ext:Locale SettingsTabInputDirectMouseAccess}" /> Text="{ext:Locale SettingsTabInputDirectMouseAccess}" />
</CheckBox> </CheckBox>
<ComboBox SelectedIndex="{Binding EnableSpetialExit}" <ComboBox SelectedIndex="{Binding EnableSpecialExit}"
ToolTip.Tip="{ext:Locale spetialExitTooltip}" ToolTip.Tip="{ext:Locale SpecialExitTooltip}"
HorizontalContentAlignment="Left" HorizontalContentAlignment="Left"
MinWidth="160"> MinWidth="160">
<ComboBoxItem> <ComboBoxItem>

View File

@ -369,7 +369,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
/// <summary> /// <summary>
/// Allows you to choose from three options: do nothing, exit the application, exit the emulator /// Allows you to choose from three options: do nothing, exit the application, exit the emulator
/// </summary> /// </summary>
public int SpetialExitEmulator { get; set; } public int specialExitEmulator { get; set; }
/// <summary> /// <summary>
/// Hotkey Keyboard Bindings /// Hotkey Keyboard Bindings

View File

@ -136,7 +136,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
Hid.EnableKeyboard.Value = cff.EnableKeyboard; Hid.EnableKeyboard.Value = cff.EnableKeyboard;
Hid.EnableMouse.Value = cff.EnableMouse; Hid.EnableMouse.Value = cff.EnableMouse;
Hid.SpetialExitEmulator.Value = cff.SpetialExitEmulator; Hid.specialExitEmulator.Value = cff.specialExitEmulator;
Hid.Hotkeys.Value = cff.Hotkeys; Hid.Hotkeys.Value = cff.Hotkeys;
Hid.InputConfig.Value = cff.InputConfig ?? []; Hid.InputConfig.Value = cff.InputConfig ?? [];
@ -418,7 +418,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
}), }),
(60, static cff => (60, static cff =>
{ {
cff.SpetialExitEmulator = 1; cff.specialExitEmulator = 0;
}) })
); );
} }

View File

@ -423,7 +423,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
/// <summary> /// <summary>
/// Allows you to choose from three options: do nothing, exit the application, exit the emulator /// Allows you to choose from three options: do nothing, exit the application, exit the emulator
/// </summary> /// </summary>
public ReactiveObject<int> SpetialExitEmulator { get; private set; } public ReactiveObject<int> specialExitEmulator { get; private set; }
/// <summary> /// <summary>
/// Hotkey Keyboard Bindings /// Hotkey Keyboard Bindings
@ -441,7 +441,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
{ {
EnableKeyboard = new ReactiveObject<bool>(); EnableKeyboard = new ReactiveObject<bool>();
EnableMouse = new ReactiveObject<bool>(); EnableMouse = new ReactiveObject<bool>();
SpetialExitEmulator = new ReactiveObject<int>(); specialExitEmulator = new ReactiveObject<int>();
Hotkeys = new ReactiveObject<KeyboardHotkeys>(); Hotkeys = new ReactiveObject<KeyboardHotkeys>();
InputConfig = new ReactiveObject<List<InputConfig>>(); InputConfig = new ReactiveObject<List<InputConfig>>();
} }

View File

@ -128,7 +128,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
ShowConsole = UI.ShowConsole, ShowConsole = UI.ShowConsole,
EnableKeyboard = Hid.EnableKeyboard, EnableKeyboard = Hid.EnableKeyboard,
EnableMouse = Hid.EnableMouse, EnableMouse = Hid.EnableMouse,
SpetialExitEmulator = Hid.SpetialExitEmulator, specialExitEmulator = Hid.specialExitEmulator,
Hotkeys = Hid.Hotkeys, Hotkeys = Hid.Hotkeys,
KeyboardConfig = [], KeyboardConfig = [],
ControllerConfig = [], ControllerConfig = [],
@ -242,7 +242,7 @@ namespace Ryujinx.Ava.Utilities.Configuration
UI.WindowStartup.WindowMaximized.Value = false; UI.WindowStartup.WindowMaximized.Value = false;
Hid.EnableKeyboard.Value = false; Hid.EnableKeyboard.Value = false;
Hid.EnableMouse.Value = false; Hid.EnableMouse.Value = false;
Hid.SpetialExitEmulator.Value = 0; Hid.specialExitEmulator.Value = 0;
Hid.Hotkeys.Value = new KeyboardHotkeys Hid.Hotkeys.Value = new KeyboardHotkeys
{ {
ToggleVSyncMode = Key.F1, ToggleVSyncMode = Key.F1,