Compare commits
38 Commits
Canary-1.2
...
9d59c7265c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9d59c7265c | ||
|
|
1ca4484148 | ||
|
|
056f56bc70 | ||
|
|
bda699f68e | ||
|
|
b33fe6facc | ||
|
|
ceaaf4137c | ||
|
|
0db85d0aa9 | ||
|
|
3f2e189407 | ||
|
|
30e790ced4 | ||
|
|
5e8af26516 | ||
|
|
9356b68f26 | ||
|
|
14aafebaa6 | ||
|
|
4518666a04 | ||
|
|
4399edaa9f | ||
|
|
4e77bcb55a | ||
|
|
3cbd7dc1a1 | ||
|
|
536f792558 | ||
|
|
7a451ab160 | ||
|
|
99c7c3fb14 | ||
|
|
09e7b660f4 | ||
|
|
69dfd8c60e | ||
|
|
8e50dd9fa6 | ||
|
|
68c03051ad | ||
|
|
a837294b11 | ||
|
|
f1c0cc8076 | ||
|
|
6dec7ff8ba | ||
|
|
20fdbff964 | ||
|
|
e426680cb0 | ||
|
|
7863e97cb0 | ||
|
|
c4dea0ee28 | ||
|
|
e0b6a01e9d | ||
|
|
e509ffa716 | ||
|
|
714c68b548 | ||
|
|
fec197d9ec | ||
|
|
a4b2feef79 | ||
|
|
ad7d9d1ce0 | ||
|
|
86f9544910 | ||
|
|
e9ecbd44fc |
@@ -9,7 +9,8 @@ namespace Ryujinx.Common.Configuration
|
|||||||
public enum DirtyHack : byte
|
public enum DirtyHack : byte
|
||||||
{
|
{
|
||||||
Xc2MenuSoftlockFix = 1,
|
Xc2MenuSoftlockFix = 1,
|
||||||
ShaderTranslationDelay = 2
|
// ShaderTranslationDelay = 2
|
||||||
|
NifmServiceDisableIsAnyInternetRequestAccepted = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
public readonly struct EnabledDirtyHack(DirtyHack hack, int value)
|
public readonly struct EnabledDirtyHack(DirtyHack hack, int value)
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm
|
|||||||
// CreateGeneralServiceOld() -> object<nn::nifm::detail::IGeneralService>
|
// CreateGeneralServiceOld() -> object<nn::nifm::detail::IGeneralService>
|
||||||
public ResultCode CreateGeneralServiceOld(ServiceCtx context)
|
public ResultCode CreateGeneralServiceOld(ServiceCtx context)
|
||||||
{
|
{
|
||||||
MakeObject(context, new IGeneralService());
|
MakeObject(context, new IGeneralService(context));
|
||||||
|
|
||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
@@ -22,7 +22,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm
|
|||||||
// CreateGeneralService(u64, pid) -> object<nn::nifm::detail::IGeneralService>
|
// CreateGeneralService(u64, pid) -> object<nn::nifm::detail::IGeneralService>
|
||||||
public ResultCode CreateGeneralService(ServiceCtx context)
|
public ResultCode CreateGeneralService(ServiceCtx context)
|
||||||
{
|
{
|
||||||
MakeObject(context, new IGeneralService());
|
MakeObject(context, new IGeneralService(context));
|
||||||
|
|
||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
|
using Ryujinx.Common.Configuration;
|
||||||
using Ryujinx.Common.Logging;
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.Common.Utilities;
|
using Ryujinx.Common.Utilities;
|
||||||
using Ryujinx.HLE.HOS.Services.Nifm.StaticService.GeneralService;
|
using Ryujinx.HLE.HOS.Services.Nifm.StaticService.GeneralService;
|
||||||
@@ -17,12 +18,12 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
|
|||||||
private UnicastIPAddressInformation _targetAddressInfoCache = null;
|
private UnicastIPAddressInformation _targetAddressInfoCache = null;
|
||||||
private string _cacheChosenInterface = null;
|
private string _cacheChosenInterface = null;
|
||||||
|
|
||||||
public IGeneralService()
|
public IGeneralService(ServiceCtx context)
|
||||||
{
|
{
|
||||||
_generalServiceDetail = new GeneralServiceDetail
|
_generalServiceDetail = new GeneralServiceDetail
|
||||||
{
|
{
|
||||||
ClientId = GeneralServiceManager.Count,
|
ClientId = GeneralServiceManager.Count,
|
||||||
IsAnyInternetRequestAccepted = true, // NOTE: Why not accept any internet request?
|
IsAnyInternetRequestAccepted = !context.Device.DirtyHacks.IsEnabled(DirtyHack.NifmServiceDisableIsAnyInternetRequestAccepted), // NOTE: Why not accept any internet request?
|
||||||
};
|
};
|
||||||
|
|
||||||
NetworkChange.NetworkAddressChanged += LocalInterfaceCacheHandler;
|
NetworkChange.NetworkAddressChanged += LocalInterfaceCacheHandler;
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Ryujinx.Common.Logging;
|
||||||
using Ryujinx.SDL2.Common;
|
using Ryujinx.SDL2.Common;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -36,6 +37,7 @@ namespace Ryujinx.Input.SDL2
|
|||||||
SDL2Driver.Instance.Initialize();
|
SDL2Driver.Instance.Initialize();
|
||||||
SDL2Driver.Instance.OnJoyStickConnected += HandleJoyStickConnected;
|
SDL2Driver.Instance.OnJoyStickConnected += HandleJoyStickConnected;
|
||||||
SDL2Driver.Instance.OnJoystickDisconnected += HandleJoyStickDisconnected;
|
SDL2Driver.Instance.OnJoystickDisconnected += HandleJoyStickDisconnected;
|
||||||
|
SDL2Driver.Instance.OnJoyBatteryUpdated += HandleJoyBatteryUpdated;
|
||||||
|
|
||||||
// Add already connected gamepads
|
// Add already connected gamepads
|
||||||
int numJoysticks = SDL_NumJoysticks();
|
int numJoysticks = SDL_NumJoysticks();
|
||||||
@@ -83,19 +85,30 @@ namespace Ryujinx.Input.SDL2
|
|||||||
|
|
||||||
private void HandleJoyStickDisconnected(int joystickInstanceId)
|
private void HandleJoyStickDisconnected(int joystickInstanceId)
|
||||||
{
|
{
|
||||||
|
bool joyConPairDisconnected = false;
|
||||||
if (!_gamepadsInstanceIdsMapping.Remove(joystickInstanceId, out string id))
|
if (!_gamepadsInstanceIdsMapping.Remove(joystickInstanceId, out string id))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
{
|
{
|
||||||
_gamepadsIds.Remove(id);
|
_gamepadsIds.Remove(id);
|
||||||
|
if (!SDL2JoyConPair.IsCombinable(_gamepadsIds))
|
||||||
|
{
|
||||||
|
_gamepadsIds.Remove(SDL2JoyConPair.Id);
|
||||||
|
joyConPairDisconnected = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OnGamepadDisconnected?.Invoke(id);
|
OnGamepadDisconnected?.Invoke(id);
|
||||||
|
if (joyConPairDisconnected)
|
||||||
|
{
|
||||||
|
OnGamepadDisconnected?.Invoke(SDL2JoyConPair.Id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleJoyStickConnected(int joystickDeviceId, int joystickInstanceId)
|
private void HandleJoyStickConnected(int joystickDeviceId, int joystickInstanceId)
|
||||||
{
|
{
|
||||||
|
bool joyConPairConnected = false;
|
||||||
if (SDL_IsGameController(joystickDeviceId) == SDL_bool.SDL_TRUE)
|
if (SDL_IsGameController(joystickDeviceId) == SDL_bool.SDL_TRUE)
|
||||||
{
|
{
|
||||||
if (_gamepadsInstanceIdsMapping.ContainsKey(joystickInstanceId))
|
if (_gamepadsInstanceIdsMapping.ContainsKey(joystickInstanceId))
|
||||||
@@ -120,13 +133,29 @@ namespace Ryujinx.Input.SDL2
|
|||||||
_gamepadsIds.Insert(joystickDeviceId, id);
|
_gamepadsIds.Insert(joystickDeviceId, id);
|
||||||
else
|
else
|
||||||
_gamepadsIds.Add(id);
|
_gamepadsIds.Add(id);
|
||||||
|
if (SDL2JoyConPair.IsCombinable(_gamepadsIds))
|
||||||
|
{
|
||||||
|
_gamepadsIds.Remove(SDL2JoyConPair.Id);
|
||||||
|
_gamepadsIds.Add(SDL2JoyConPair.Id);
|
||||||
|
joyConPairConnected = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
OnGamepadConnected?.Invoke(id);
|
OnGamepadConnected?.Invoke(id);
|
||||||
|
if (joyConPairConnected)
|
||||||
|
{
|
||||||
|
OnGamepadConnected?.Invoke(SDL2JoyConPair.Id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void HandleJoyBatteryUpdated(int joystickDeviceId, SDL_JoystickPowerLevel powerLevel)
|
||||||
|
{
|
||||||
|
Logger.Info?.Print(LogClass.Hid,
|
||||||
|
$"{SDL_GameControllerNameForIndex(joystickDeviceId)} power level: {powerLevel}");
|
||||||
|
}
|
||||||
|
|
||||||
protected virtual void Dispose(bool disposing)
|
protected virtual void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
if (disposing)
|
if (disposing)
|
||||||
@@ -157,6 +186,14 @@ namespace Ryujinx.Input.SDL2
|
|||||||
|
|
||||||
public IGamepad GetGamepad(string id)
|
public IGamepad GetGamepad(string id)
|
||||||
{
|
{
|
||||||
|
if (id == SDL2JoyConPair.Id)
|
||||||
|
{
|
||||||
|
lock (_lock)
|
||||||
|
{
|
||||||
|
return SDL2JoyConPair.GetGamepad(_gamepadsIds);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int joystickIndex = GetJoystickIndexByGamepadId(id);
|
int joystickIndex = GetJoystickIndexByGamepadId(id);
|
||||||
|
|
||||||
if (joystickIndex == -1)
|
if (joystickIndex == -1)
|
||||||
@@ -165,12 +202,16 @@ namespace Ryujinx.Input.SDL2
|
|||||||
}
|
}
|
||||||
|
|
||||||
nint gamepadHandle = SDL_GameControllerOpen(joystickIndex);
|
nint gamepadHandle = SDL_GameControllerOpen(joystickIndex);
|
||||||
|
|
||||||
if (gamepadHandle == nint.Zero)
|
if (gamepadHandle == nint.Zero)
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SDL_GameControllerName(gamepadHandle).StartsWith(SDL2JoyCon.Prefix))
|
||||||
|
{
|
||||||
|
return new SDL2JoyCon(gamepadHandle, id);
|
||||||
|
}
|
||||||
|
|
||||||
return new SDL2Gamepad(gamepadHandle, id);
|
return new SDL2Gamepad(gamepadHandle, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
413
src/Ryujinx.Input.SDL2/SDL2JoyCon.cs
Normal file
413
src/Ryujinx.Input.SDL2/SDL2JoyCon.cs
Normal file
@@ -0,0 +1,413 @@
|
|||||||
|
using Ryujinx.Common.Configuration.Hid;
|
||||||
|
using Ryujinx.Common.Configuration.Hid.Controller;
|
||||||
|
using Ryujinx.Common.Logging;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Numerics;
|
||||||
|
using System.Threading;
|
||||||
|
using static SDL2.SDL;
|
||||||
|
|
||||||
|
namespace Ryujinx.Input.SDL2
|
||||||
|
{
|
||||||
|
internal class SDL2JoyCon : IGamepad
|
||||||
|
{
|
||||||
|
private bool HasConfiguration => _configuration != null;
|
||||||
|
|
||||||
|
private readonly record struct ButtonMappingEntry(GamepadButtonInputId To, GamepadButtonInputId From)
|
||||||
|
{
|
||||||
|
public bool IsValid => To is not GamepadButtonInputId.Unbound && From is not GamepadButtonInputId.Unbound;
|
||||||
|
}
|
||||||
|
|
||||||
|
private StandardControllerInputConfig _configuration;
|
||||||
|
|
||||||
|
private readonly Dictionary<GamepadButtonInputId,SDL_GameControllerButton> _leftButtonsDriverMapping = new()
|
||||||
|
{
|
||||||
|
{ GamepadButtonInputId.LeftStick , SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_LEFTSTICK },
|
||||||
|
{GamepadButtonInputId.DpadUp ,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_Y},
|
||||||
|
{GamepadButtonInputId.DpadDown ,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_A},
|
||||||
|
{GamepadButtonInputId.DpadLeft ,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_B},
|
||||||
|
{GamepadButtonInputId.DpadRight ,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_X},
|
||||||
|
{GamepadButtonInputId.Minus ,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_START},
|
||||||
|
{GamepadButtonInputId.LeftShoulder,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_PADDLE2},
|
||||||
|
{GamepadButtonInputId.LeftTrigger,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_PADDLE4},
|
||||||
|
{GamepadButtonInputId.SingleRightTrigger0,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_RIGHTSHOULDER},
|
||||||
|
{GamepadButtonInputId.SingleLeftTrigger0,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_LEFTSHOULDER},
|
||||||
|
};
|
||||||
|
private readonly Dictionary<GamepadButtonInputId,SDL_GameControllerButton> _rightButtonsDriverMapping = new()
|
||||||
|
{
|
||||||
|
{GamepadButtonInputId.RightStick,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_LEFTSTICK},
|
||||||
|
{GamepadButtonInputId.A,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_B},
|
||||||
|
{GamepadButtonInputId.B,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_Y},
|
||||||
|
{GamepadButtonInputId.X,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_A},
|
||||||
|
{GamepadButtonInputId.Y,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_X},
|
||||||
|
{GamepadButtonInputId.Plus,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_START},
|
||||||
|
{GamepadButtonInputId.RightShoulder,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_PADDLE1},
|
||||||
|
{GamepadButtonInputId.RightTrigger,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_PADDLE3},
|
||||||
|
{GamepadButtonInputId.SingleRightTrigger1,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_RIGHTSHOULDER},
|
||||||
|
{GamepadButtonInputId.SingleLeftTrigger1,SDL_GameControllerButton.SDL_CONTROLLER_BUTTON_LEFTSHOULDER}
|
||||||
|
};
|
||||||
|
|
||||||
|
private readonly Dictionary<GamepadButtonInputId, SDL_GameControllerButton> _buttonsDriverMapping;
|
||||||
|
private readonly Lock _userMappingLock = new();
|
||||||
|
|
||||||
|
private readonly List<ButtonMappingEntry> _buttonsUserMapping;
|
||||||
|
|
||||||
|
private readonly StickInputId[] _stickUserMapping = new StickInputId[(int)StickInputId.Count]
|
||||||
|
{
|
||||||
|
StickInputId.Unbound, StickInputId.Left, StickInputId.Right,
|
||||||
|
};
|
||||||
|
|
||||||
|
public GamepadFeaturesFlag Features { get; }
|
||||||
|
|
||||||
|
private nint _gamepadHandle;
|
||||||
|
|
||||||
|
private enum JoyConType
|
||||||
|
{
|
||||||
|
Left, Right
|
||||||
|
}
|
||||||
|
|
||||||
|
public const string Prefix = "Nintendo Switch Joy-Con";
|
||||||
|
public const string LeftName = "Nintendo Switch Joy-Con (L)";
|
||||||
|
public const string RightName = "Nintendo Switch Joy-Con (R)";
|
||||||
|
|
||||||
|
private readonly JoyConType _joyConType;
|
||||||
|
|
||||||
|
public SDL2JoyCon(nint gamepadHandle, string driverId)
|
||||||
|
{
|
||||||
|
_gamepadHandle = gamepadHandle;
|
||||||
|
_buttonsUserMapping = new List<ButtonMappingEntry>(10);
|
||||||
|
|
||||||
|
Name = SDL_GameControllerName(_gamepadHandle);
|
||||||
|
Id = driverId;
|
||||||
|
Features = GetFeaturesFlag();
|
||||||
|
|
||||||
|
// Enable motion tracking
|
||||||
|
if (Features.HasFlag(GamepadFeaturesFlag.Motion))
|
||||||
|
{
|
||||||
|
if (SDL_GameControllerSetSensorEnabled(_gamepadHandle, SDL_SensorType.SDL_SENSOR_ACCEL,
|
||||||
|
SDL_bool.SDL_TRUE) != 0)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Hid,
|
||||||
|
$"Could not enable data reporting for SensorType {SDL_SensorType.SDL_SENSOR_ACCEL}.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (SDL_GameControllerSetSensorEnabled(_gamepadHandle, SDL_SensorType.SDL_SENSOR_GYRO,
|
||||||
|
SDL_bool.SDL_TRUE) != 0)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Hid,
|
||||||
|
$"Could not enable data reporting for SensorType {SDL_SensorType.SDL_SENSOR_GYRO}.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (Name)
|
||||||
|
{
|
||||||
|
case LeftName:
|
||||||
|
{
|
||||||
|
_buttonsDriverMapping = _leftButtonsDriverMapping;
|
||||||
|
_joyConType = JoyConType.Left;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case RightName:
|
||||||
|
{
|
||||||
|
_buttonsDriverMapping = _rightButtonsDriverMapping;
|
||||||
|
_joyConType = JoyConType.Right;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private GamepadFeaturesFlag GetFeaturesFlag()
|
||||||
|
{
|
||||||
|
GamepadFeaturesFlag result = GamepadFeaturesFlag.None;
|
||||||
|
|
||||||
|
if (SDL_GameControllerHasSensor(_gamepadHandle, SDL_SensorType.SDL_SENSOR_ACCEL) == SDL_bool.SDL_TRUE &&
|
||||||
|
SDL_GameControllerHasSensor(_gamepadHandle, SDL_SensorType.SDL_SENSOR_GYRO) == SDL_bool.SDL_TRUE)
|
||||||
|
{
|
||||||
|
result |= GamepadFeaturesFlag.Motion;
|
||||||
|
}
|
||||||
|
|
||||||
|
int error = SDL_GameControllerRumble(_gamepadHandle, 0, 0, 100);
|
||||||
|
|
||||||
|
if (error == 0)
|
||||||
|
{
|
||||||
|
result |= GamepadFeaturesFlag.Rumble;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Id { get; }
|
||||||
|
public string Name { get; }
|
||||||
|
public bool IsConnected => SDL_GameControllerGetAttached(_gamepadHandle) == SDL_bool.SDL_TRUE;
|
||||||
|
|
||||||
|
protected virtual void Dispose(bool disposing)
|
||||||
|
{
|
||||||
|
if (disposing && _gamepadHandle != nint.Zero)
|
||||||
|
{
|
||||||
|
SDL_GameControllerClose(_gamepadHandle);
|
||||||
|
|
||||||
|
_gamepadHandle = nint.Zero;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
Dispose(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void SetTriggerThreshold(float triggerThreshold)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Rumble(float lowFrequency, float highFrequency, uint durationMs)
|
||||||
|
{
|
||||||
|
if (!Features.HasFlag(GamepadFeaturesFlag.Rumble))
|
||||||
|
return;
|
||||||
|
|
||||||
|
ushort lowFrequencyRaw = (ushort)(lowFrequency * ushort.MaxValue);
|
||||||
|
ushort highFrequencyRaw = (ushort)(highFrequency * ushort.MaxValue);
|
||||||
|
|
||||||
|
if (durationMs == uint.MaxValue)
|
||||||
|
{
|
||||||
|
if (SDL_GameControllerRumble(_gamepadHandle, lowFrequencyRaw, highFrequencyRaw, SDL_HAPTIC_INFINITY) !=
|
||||||
|
0)
|
||||||
|
Logger.Error?.Print(LogClass.Hid, "Rumble is not supported on this game controller.");
|
||||||
|
}
|
||||||
|
else if (durationMs > SDL_HAPTIC_INFINITY)
|
||||||
|
{
|
||||||
|
Logger.Error?.Print(LogClass.Hid, $"Unsupported rumble duration {durationMs}");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (SDL_GameControllerRumble(_gamepadHandle, lowFrequencyRaw, highFrequencyRaw, durationMs) != 0)
|
||||||
|
Logger.Error?.Print(LogClass.Hid, "Rumble is not supported on this game controller.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector3 GetMotionData(MotionInputId inputId)
|
||||||
|
{
|
||||||
|
SDL_SensorType sensorType = inputId switch
|
||||||
|
{
|
||||||
|
MotionInputId.Accelerometer => SDL_SensorType.SDL_SENSOR_ACCEL,
|
||||||
|
MotionInputId.Gyroscope => SDL_SensorType.SDL_SENSOR_GYRO,
|
||||||
|
_ => SDL_SensorType.SDL_SENSOR_INVALID
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!Features.HasFlag(GamepadFeaturesFlag.Motion) || sensorType is SDL_SensorType.SDL_SENSOR_INVALID)
|
||||||
|
return Vector3.Zero;
|
||||||
|
|
||||||
|
const int ElementCount = 3;
|
||||||
|
|
||||||
|
unsafe
|
||||||
|
{
|
||||||
|
float* values = stackalloc float[ElementCount];
|
||||||
|
|
||||||
|
int result = SDL_GameControllerGetSensorData(_gamepadHandle, sensorType, (nint)values, ElementCount);
|
||||||
|
|
||||||
|
if (result != 0)
|
||||||
|
return Vector3.Zero;
|
||||||
|
|
||||||
|
Vector3 value = _joyConType switch
|
||||||
|
{
|
||||||
|
JoyConType.Left => new Vector3(-values[2], values[1], values[0]),
|
||||||
|
JoyConType.Right => new Vector3(values[2], values[1], -values[0])
|
||||||
|
};
|
||||||
|
|
||||||
|
return inputId switch
|
||||||
|
{
|
||||||
|
MotionInputId.Gyroscope => RadToDegree(value),
|
||||||
|
MotionInputId.Accelerometer => GsToMs2(value),
|
||||||
|
_ => value
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Vector3 RadToDegree(Vector3 rad) => rad * (180 / MathF.PI);
|
||||||
|
|
||||||
|
private static Vector3 GsToMs2(Vector3 gs) => gs / SDL_STANDARD_GRAVITY;
|
||||||
|
|
||||||
|
public void SetConfiguration(InputConfig configuration)
|
||||||
|
{
|
||||||
|
lock (_userMappingLock)
|
||||||
|
{
|
||||||
|
_configuration = (StandardControllerInputConfig)configuration;
|
||||||
|
|
||||||
|
_buttonsUserMapping.Clear();
|
||||||
|
|
||||||
|
// First update sticks
|
||||||
|
_stickUserMapping[(int)StickInputId.Left] = (StickInputId)_configuration.LeftJoyconStick.Joystick;
|
||||||
|
_stickUserMapping[(int)StickInputId.Right] = (StickInputId)_configuration.RightJoyconStick.Joystick;
|
||||||
|
|
||||||
|
|
||||||
|
switch (_joyConType)
|
||||||
|
{
|
||||||
|
case JoyConType.Left:
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.LeftStick, (GamepadButtonInputId)_configuration.LeftJoyconStick.StickButton));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.DpadUp, (GamepadButtonInputId)_configuration.LeftJoycon.DpadUp));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.DpadDown, (GamepadButtonInputId)_configuration.LeftJoycon.DpadDown));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.DpadLeft, (GamepadButtonInputId)_configuration.LeftJoycon.DpadLeft));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.DpadRight, (GamepadButtonInputId)_configuration.LeftJoycon.DpadRight));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.Minus, (GamepadButtonInputId)_configuration.LeftJoycon.ButtonMinus));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.LeftShoulder, (GamepadButtonInputId)_configuration.LeftJoycon.ButtonL));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.LeftTrigger, (GamepadButtonInputId)_configuration.LeftJoycon.ButtonZl));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.SingleRightTrigger0, (GamepadButtonInputId)_configuration.LeftJoycon.ButtonSr));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.SingleLeftTrigger0, (GamepadButtonInputId)_configuration.LeftJoycon.ButtonSl));
|
||||||
|
break;
|
||||||
|
case JoyConType.Right:
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.RightStick, (GamepadButtonInputId)_configuration.RightJoyconStick.StickButton));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.A, (GamepadButtonInputId)_configuration.RightJoycon.ButtonA));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.B, (GamepadButtonInputId)_configuration.RightJoycon.ButtonB));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.X, (GamepadButtonInputId)_configuration.RightJoycon.ButtonX));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.Y, (GamepadButtonInputId)_configuration.RightJoycon.ButtonY));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.Plus, (GamepadButtonInputId)_configuration.RightJoycon.ButtonPlus));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.RightShoulder, (GamepadButtonInputId)_configuration.RightJoycon.ButtonR));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.RightTrigger, (GamepadButtonInputId)_configuration.RightJoycon.ButtonZr));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.SingleRightTrigger1, (GamepadButtonInputId)_configuration.RightJoycon.ButtonSr));
|
||||||
|
_buttonsUserMapping.Add(new ButtonMappingEntry(GamepadButtonInputId.SingleLeftTrigger1, (GamepadButtonInputId)_configuration.RightJoycon.ButtonSl));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new ArgumentOutOfRangeException();
|
||||||
|
}
|
||||||
|
|
||||||
|
SetTriggerThreshold(_configuration.TriggerThreshold);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetLed(uint packedRgb)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public GamepadStateSnapshot GetStateSnapshot()
|
||||||
|
{
|
||||||
|
return IGamepad.GetStateSnapshot(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GamepadStateSnapshot GetMappedStateSnapshot()
|
||||||
|
{
|
||||||
|
GamepadStateSnapshot rawState = GetStateSnapshot();
|
||||||
|
GamepadStateSnapshot result = default;
|
||||||
|
|
||||||
|
lock (_userMappingLock)
|
||||||
|
{
|
||||||
|
if (_buttonsUserMapping.Count == 0)
|
||||||
|
return rawState;
|
||||||
|
|
||||||
|
|
||||||
|
// ReSharper disable once ForeachCanBePartlyConvertedToQueryUsingAnotherGetEnumerator
|
||||||
|
foreach (ButtonMappingEntry entry in _buttonsUserMapping)
|
||||||
|
{
|
||||||
|
if (!entry.IsValid)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// Do not touch state of button already pressed
|
||||||
|
if (!result.IsPressed(entry.To))
|
||||||
|
{
|
||||||
|
result.SetPressed(entry.To, rawState.IsPressed(entry.From));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
(float leftStickX, float leftStickY) = rawState.GetStick(_stickUserMapping[(int)StickInputId.Left]);
|
||||||
|
(float rightStickX, float rightStickY) = rawState.GetStick(_stickUserMapping[(int)StickInputId.Right]);
|
||||||
|
|
||||||
|
result.SetStick(StickInputId.Left, leftStickX, leftStickY);
|
||||||
|
result.SetStick(StickInputId.Right, rightStickX, rightStickY);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static float ConvertRawStickValue(short value)
|
||||||
|
{
|
||||||
|
const float ConvertRate = 1.0f / (short.MaxValue + 0.5f);
|
||||||
|
|
||||||
|
return value * ConvertRate;
|
||||||
|
}
|
||||||
|
|
||||||
|
private JoyconConfigControllerStick<GamepadInputId, Common.Configuration.Hid.Controller.StickInputId>
|
||||||
|
GetLogicalJoyStickConfig(StickInputId inputId)
|
||||||
|
{
|
||||||
|
switch (inputId)
|
||||||
|
{
|
||||||
|
case StickInputId.Left:
|
||||||
|
if (_configuration.RightJoyconStick.Joystick ==
|
||||||
|
Common.Configuration.Hid.Controller.StickInputId.Left)
|
||||||
|
return _configuration.RightJoyconStick;
|
||||||
|
else
|
||||||
|
return _configuration.LeftJoyconStick;
|
||||||
|
case StickInputId.Right:
|
||||||
|
if (_configuration.LeftJoyconStick.Joystick ==
|
||||||
|
Common.Configuration.Hid.Controller.StickInputId.Right)
|
||||||
|
return _configuration.LeftJoyconStick;
|
||||||
|
else
|
||||||
|
return _configuration.RightJoyconStick;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public (float, float) GetStick(StickInputId inputId)
|
||||||
|
{
|
||||||
|
if (inputId == StickInputId.Unbound)
|
||||||
|
return (0.0f, 0.0f);
|
||||||
|
|
||||||
|
if (inputId == StickInputId.Left && _joyConType == JoyConType.Right || inputId == StickInputId.Right && _joyConType == JoyConType.Left)
|
||||||
|
{
|
||||||
|
return (0.0f, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
(short stickX, short stickY) = GetStickXY();
|
||||||
|
|
||||||
|
float resultX = ConvertRawStickValue(stickX);
|
||||||
|
float resultY = -ConvertRawStickValue(stickY);
|
||||||
|
|
||||||
|
if (HasConfiguration)
|
||||||
|
{
|
||||||
|
var joyconStickConfig = GetLogicalJoyStickConfig(inputId);
|
||||||
|
|
||||||
|
if (joyconStickConfig != null)
|
||||||
|
{
|
||||||
|
if (joyconStickConfig.InvertStickX)
|
||||||
|
resultX = -resultX;
|
||||||
|
|
||||||
|
if (joyconStickConfig.InvertStickY)
|
||||||
|
resultY = -resultY;
|
||||||
|
|
||||||
|
if (joyconStickConfig.Rotate90CW)
|
||||||
|
{
|
||||||
|
float temp = resultX;
|
||||||
|
resultX = resultY;
|
||||||
|
resultY = -temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return inputId switch
|
||||||
|
{
|
||||||
|
StickInputId.Left when _joyConType == JoyConType.Left => (resultY, -resultX),
|
||||||
|
StickInputId.Right when _joyConType == JoyConType.Right => (-resultY, resultX),
|
||||||
|
_ => (0.0f, 0.0f)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private (short, short) GetStickXY()
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
SDL_GameControllerGetAxis(_gamepadHandle, SDL_GameControllerAxis.SDL_CONTROLLER_AXIS_LEFTX),
|
||||||
|
SDL_GameControllerGetAxis(_gamepadHandle, SDL_GameControllerAxis.SDL_CONTROLLER_AXIS_LEFTY));
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsPressed(GamepadButtonInputId inputId)
|
||||||
|
{
|
||||||
|
if (!_buttonsDriverMapping.TryGetValue(inputId, out var button))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SDL_GameControllerGetButton(_gamepadHandle, button) == 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
146
src/Ryujinx.Input.SDL2/SDL2JoyConPair.cs
Normal file
146
src/Ryujinx.Input.SDL2/SDL2JoyConPair.cs
Normal file
@@ -0,0 +1,146 @@
|
|||||||
|
using Ryujinx.Common.Configuration.Hid;
|
||||||
|
using Ryujinx.Common.Configuration.Hid.Controller;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Numerics;
|
||||||
|
using static SDL2.SDL;
|
||||||
|
|
||||||
|
namespace Ryujinx.Input.SDL2
|
||||||
|
{
|
||||||
|
internal class SDL2JoyConPair(IGamepad left, IGamepad right) : IGamepad
|
||||||
|
{
|
||||||
|
private StandardControllerInputConfig _configuration;
|
||||||
|
|
||||||
|
private readonly StickInputId[] _stickUserMapping =
|
||||||
|
[
|
||||||
|
StickInputId.Unbound,
|
||||||
|
StickInputId.Left,
|
||||||
|
StickInputId.Right
|
||||||
|
];
|
||||||
|
|
||||||
|
public GamepadFeaturesFlag Features => (left?.Features ?? GamepadFeaturesFlag.None) |
|
||||||
|
(right?.Features ?? GamepadFeaturesFlag.None);
|
||||||
|
|
||||||
|
public const string Id = "JoyConPair";
|
||||||
|
string IGamepad.Id => Id;
|
||||||
|
|
||||||
|
public string Name => "* Nintendo Switch Joy-Con (L/R)";
|
||||||
|
public bool IsConnected => left is { IsConnected: true } && right is { IsConnected: true };
|
||||||
|
|
||||||
|
public void Dispose()
|
||||||
|
{
|
||||||
|
left?.Dispose();
|
||||||
|
right?.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
public GamepadStateSnapshot GetMappedStateSnapshot()
|
||||||
|
{
|
||||||
|
return GetStateSnapshot();
|
||||||
|
}
|
||||||
|
|
||||||
|
public Vector3 GetMotionData(MotionInputId inputId)
|
||||||
|
{
|
||||||
|
return inputId switch
|
||||||
|
{
|
||||||
|
MotionInputId.Accelerometer or
|
||||||
|
MotionInputId.Gyroscope => left.GetMotionData(inputId),
|
||||||
|
MotionInputId.SecondAccelerometer => right.GetMotionData(MotionInputId.Accelerometer),
|
||||||
|
MotionInputId.SecondGyroscope => right.GetMotionData(MotionInputId.Gyroscope),
|
||||||
|
_ => Vector3.Zero
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public GamepadStateSnapshot GetStateSnapshot()
|
||||||
|
{
|
||||||
|
return IGamepad.GetStateSnapshot(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
public (float, float) GetStick(StickInputId inputId)
|
||||||
|
{
|
||||||
|
return inputId switch
|
||||||
|
{
|
||||||
|
StickInputId.Left => left.GetStick(StickInputId.Left),
|
||||||
|
StickInputId.Right => right.GetStick(StickInputId.Right),
|
||||||
|
_ => (0, 0)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsPressed(GamepadButtonInputId inputId)
|
||||||
|
{
|
||||||
|
return left.IsPressed(inputId) || right.IsPressed(inputId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Rumble(float lowFrequency, float highFrequency, uint durationMs)
|
||||||
|
{
|
||||||
|
if (lowFrequency != 0)
|
||||||
|
{
|
||||||
|
right.Rumble(lowFrequency, lowFrequency, durationMs);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (highFrequency != 0)
|
||||||
|
{
|
||||||
|
left.Rumble(highFrequency, highFrequency, durationMs);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lowFrequency == 0 && highFrequency == 0)
|
||||||
|
{
|
||||||
|
left.Rumble(0, 0, durationMs);
|
||||||
|
right.Rumble(0, 0, durationMs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetConfiguration(InputConfig configuration)
|
||||||
|
{
|
||||||
|
left.SetConfiguration(configuration);
|
||||||
|
right.SetConfiguration(configuration);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetLed(uint packedRgb)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetTriggerThreshold(float triggerThreshold)
|
||||||
|
{
|
||||||
|
left.SetTriggerThreshold(triggerThreshold);
|
||||||
|
right.SetTriggerThreshold(triggerThreshold);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsCombinable(List<string> gamepadsIds)
|
||||||
|
{
|
||||||
|
(int leftIndex, int rightIndex) = DetectJoyConPair(gamepadsIds);
|
||||||
|
return leftIndex >= 0 && rightIndex >= 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static (int leftIndex, int rightIndex) DetectJoyConPair(List<string> gamepadsIds)
|
||||||
|
{
|
||||||
|
var gamepadNames = gamepadsIds.Where(gamepadId => gamepadId != Id)
|
||||||
|
.Select((_, index) => SDL_GameControllerNameForIndex(index)).ToList();
|
||||||
|
int leftIndex = gamepadNames.IndexOf(SDL2JoyCon.LeftName);
|
||||||
|
int rightIndex = gamepadNames.IndexOf(SDL2JoyCon.RightName);
|
||||||
|
|
||||||
|
return (leftIndex, rightIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IGamepad GetGamepad(List<string> gamepadsIds)
|
||||||
|
{
|
||||||
|
(int leftIndex, int rightIndex) = DetectJoyConPair(gamepadsIds);
|
||||||
|
if (leftIndex == -1 || rightIndex == -1)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
nint leftGamepadHandle = SDL_GameControllerOpen(leftIndex);
|
||||||
|
nint rightGamepadHandle = SDL_GameControllerOpen(rightIndex);
|
||||||
|
|
||||||
|
if (leftGamepadHandle == nint.Zero || rightGamepadHandle == nint.Zero)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return new SDL2JoyConPair(new SDL2JoyCon(leftGamepadHandle, gamepadsIds[leftIndex]),
|
||||||
|
new SDL2JoyCon(rightGamepadHandle, gamepadsIds[rightIndex]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -269,6 +269,7 @@ namespace Ryujinx.Input.HLE
|
|||||||
if (motionConfig.MotionBackend != MotionInputBackendType.CemuHook)
|
if (motionConfig.MotionBackend != MotionInputBackendType.CemuHook)
|
||||||
{
|
{
|
||||||
_leftMotionInput = new MotionInput();
|
_leftMotionInput = new MotionInput();
|
||||||
|
_rightMotionInput = new MotionInput();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -301,7 +302,20 @@ namespace Ryujinx.Input.HLE
|
|||||||
|
|
||||||
if (controllerConfig.ControllerType == ConfigControllerType.JoyconPair)
|
if (controllerConfig.ControllerType == ConfigControllerType.JoyconPair)
|
||||||
{
|
{
|
||||||
_rightMotionInput = _leftMotionInput;
|
if (gamepad.Id== "JoyConPair")
|
||||||
|
{
|
||||||
|
Vector3 rightAccelerometer = gamepad.GetMotionData(MotionInputId.SecondAccelerometer);
|
||||||
|
Vector3 rightGyroscope = gamepad.GetMotionData(MotionInputId.SecondGyroscope);
|
||||||
|
|
||||||
|
rightAccelerometer = new Vector3(rightAccelerometer.X, -rightAccelerometer.Z, rightAccelerometer.Y);
|
||||||
|
rightGyroscope = new Vector3(rightGyroscope.X, -rightGyroscope.Z, rightGyroscope.Y);
|
||||||
|
|
||||||
|
_rightMotionInput.Update(rightAccelerometer, rightGyroscope, (ulong)PerformanceCounter.ElapsedNanoseconds / 1000, controllerConfig.Motion.Sensitivity, (float)controllerConfig.Motion.GyroDeadzone);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_rightMotionInput = _leftMotionInput;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -336,6 +350,7 @@ namespace Ryujinx.Input.HLE
|
|||||||
// Reset states
|
// Reset states
|
||||||
State = default;
|
State = default;
|
||||||
_leftMotionInput = null;
|
_leftMotionInput = null;
|
||||||
|
_rightMotionInput = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -21,5 +21,17 @@ namespace Ryujinx.Input
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>Values are in degrees</remarks>
|
/// <remarks>Values are in degrees</remarks>
|
||||||
Gyroscope,
|
Gyroscope,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Second accelerometer.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>Values are in m/s^2</remarks>
|
||||||
|
SecondAccelerometer,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Second gyroscope.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>Values are in degrees</remarks>
|
||||||
|
SecondGyroscope
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,14 +25,17 @@ namespace Ryujinx.SDL2.Common
|
|||||||
|
|
||||||
public static Action<Action> MainThreadDispatcher { get; set; }
|
public static Action<Action> MainThreadDispatcher { get; set; }
|
||||||
|
|
||||||
private const uint SdlInitFlags = SDL_INIT_EVENTS | SDL_INIT_GAMECONTROLLER | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO | SDL_INIT_VIDEO;
|
private const uint SdlInitFlags = SDL_INIT_EVENTS | SDL_INIT_GAMECONTROLLER | SDL_INIT_JOYSTICK |
|
||||||
|
SDL_INIT_AUDIO | SDL_INIT_VIDEO;
|
||||||
|
|
||||||
private bool _isRunning;
|
private bool _isRunning;
|
||||||
private uint _refereceCount;
|
private uint _refereceCount;
|
||||||
private Thread _worker;
|
private Thread _worker;
|
||||||
|
|
||||||
|
private const uint SDL_JOYBATTERYUPDATED = 1543;
|
||||||
public event Action<int, int> OnJoyStickConnected;
|
public event Action<int, int> OnJoyStickConnected;
|
||||||
public event Action<int> OnJoystickDisconnected;
|
public event Action<int> OnJoystickDisconnected;
|
||||||
|
public event Action<int, SDL_JoystickPowerLevel> OnJoyBatteryUpdated;
|
||||||
|
|
||||||
private ConcurrentDictionary<uint, Action<SDL_Event>> _registeredWindowHandlers;
|
private ConcurrentDictionary<uint, Action<SDL_Event>> _registeredWindowHandlers;
|
||||||
|
|
||||||
@@ -78,12 +81,14 @@ namespace Ryujinx.SDL2.Common
|
|||||||
// First ensure that we only enable joystick events (for connected/disconnected).
|
// First ensure that we only enable joystick events (for connected/disconnected).
|
||||||
if (SDL_GameControllerEventState(SDL_IGNORE) != SDL_IGNORE)
|
if (SDL_GameControllerEventState(SDL_IGNORE) != SDL_IGNORE)
|
||||||
{
|
{
|
||||||
Logger.Error?.PrintMsg(LogClass.Application, "Couldn't change the state of game controller events.");
|
Logger.Error?.PrintMsg(LogClass.Application,
|
||||||
|
"Couldn't change the state of game controller events.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (SDL_JoystickEventState(SDL_ENABLE) < 0)
|
if (SDL_JoystickEventState(SDL_ENABLE) < 0)
|
||||||
{
|
{
|
||||||
Logger.Error?.PrintMsg(LogClass.Application, $"Failed to enable joystick event polling: {SDL_GetError()}");
|
Logger.Error?.PrintMsg(LogClass.Application,
|
||||||
|
$"Failed to enable joystick event polling: {SDL_GetError()}");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Disable all joysticks information, we don't need them no need to flood the event queue for that.
|
// Disable all joysticks information, we don't need them no need to flood the event queue for that.
|
||||||
@@ -143,7 +148,12 @@ namespace Ryujinx.SDL2.Common
|
|||||||
|
|
||||||
OnJoystickDisconnected?.Invoke(evnt.cbutton.which);
|
OnJoystickDisconnected?.Invoke(evnt.cbutton.which);
|
||||||
}
|
}
|
||||||
else if (evnt.type is SDL_EventType.SDL_WINDOWEVENT or SDL_EventType.SDL_MOUSEBUTTONDOWN or SDL_EventType.SDL_MOUSEBUTTONUP)
|
else if ((uint)evnt.type == SDL_JOYBATTERYUPDATED)
|
||||||
|
{
|
||||||
|
OnJoyBatteryUpdated?.Invoke(evnt.cbutton.which, (SDL_JoystickPowerLevel)evnt.user.code);
|
||||||
|
}
|
||||||
|
else if (evnt.type is SDL_EventType.SDL_WINDOWEVENT or SDL_EventType.SDL_MOUSEBUTTONDOWN
|
||||||
|
or SDL_EventType.SDL_MOUSEBUTTONUP)
|
||||||
{
|
{
|
||||||
if (_registeredWindowHandlers.TryGetValue(evnt.window.windowID, out Action<SDL_Event> handler))
|
if (_registeredWindowHandlers.TryGetValue(evnt.window.windowID, out Action<SDL_Event> handler))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -161,8 +161,6 @@ namespace Ryujinx.Ava.Systems.Configuration
|
|||||||
|
|
||||||
Hacks.Xc2MenuSoftlockFix.Value = hacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix);
|
Hacks.Xc2MenuSoftlockFix.Value = hacks.IsEnabled(DirtyHack.Xc2MenuSoftlockFix);
|
||||||
|
|
||||||
Hacks.EnableShaderTranslationDelay.Value = hacks.IsEnabled(DirtyHack.ShaderTranslationDelay);
|
|
||||||
Hacks.ShaderTranslationDelay.Value = hacks[DirtyHack.ShaderTranslationDelay].CoerceAtLeast(0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (configurationFileUpdated)
|
if (configurationFileUpdated)
|
||||||
|
|||||||
@@ -683,18 +683,15 @@ namespace Ryujinx.Ava.Systems.Configuration
|
|||||||
|
|
||||||
public ReactiveObject<bool> Xc2MenuSoftlockFix { get; private set; }
|
public ReactiveObject<bool> Xc2MenuSoftlockFix { get; private set; }
|
||||||
|
|
||||||
public ReactiveObject<bool> EnableShaderTranslationDelay { get; private set; }
|
public ReactiveObject<bool> DisableNifmIsAnyInternetRequestAccepted { get; private set; }
|
||||||
|
|
||||||
public ReactiveObject<int> ShaderTranslationDelay { get; private set; }
|
|
||||||
|
|
||||||
public HacksSection()
|
public HacksSection()
|
||||||
{
|
{
|
||||||
ShowDirtyHacks = new ReactiveObject<bool>();
|
ShowDirtyHacks = new ReactiveObject<bool>();
|
||||||
Xc2MenuSoftlockFix = new ReactiveObject<bool>();
|
Xc2MenuSoftlockFix = new ReactiveObject<bool>();
|
||||||
Xc2MenuSoftlockFix.Event += HackChanged;
|
Xc2MenuSoftlockFix.Event += HackChanged;
|
||||||
EnableShaderTranslationDelay = new ReactiveObject<bool>();
|
DisableNifmIsAnyInternetRequestAccepted = new ReactiveObject<bool>();
|
||||||
EnableShaderTranslationDelay.Event += HackChanged;
|
DisableNifmIsAnyInternetRequestAccepted.Event += HackChanged;
|
||||||
ShaderTranslationDelay = new ReactiveObject<int>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HackChanged(object sender, ReactiveEventArgs<bool> rxe)
|
private void HackChanged(object sender, ReactiveEventArgs<bool> rxe)
|
||||||
@@ -725,8 +722,8 @@ namespace Ryujinx.Ava.Systems.Configuration
|
|||||||
if (Xc2MenuSoftlockFix)
|
if (Xc2MenuSoftlockFix)
|
||||||
Apply(DirtyHack.Xc2MenuSoftlockFix);
|
Apply(DirtyHack.Xc2MenuSoftlockFix);
|
||||||
|
|
||||||
if (EnableShaderTranslationDelay)
|
if (DisableNifmIsAnyInternetRequestAccepted)
|
||||||
Apply(DirtyHack.ShaderTranslationDelay, ShaderTranslationDelay);
|
Apply(DirtyHack.NifmServiceDisableIsAnyInternetRequestAccepted);
|
||||||
|
|
||||||
return enabledHacks.ToArray();
|
return enabledHacks.ToArray();
|
||||||
|
|
||||||
|
|||||||
@@ -16,11 +16,12 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
}
|
}
|
||||||
|
|
||||||
[ObservableProperty] private bool _xc2MenuSoftlockFix = ConfigurationState.Instance.Hacks.Xc2MenuSoftlockFix;
|
[ObservableProperty] private bool _xc2MenuSoftlockFix = ConfigurationState.Instance.Hacks.Xc2MenuSoftlockFix;
|
||||||
|
[ObservableProperty] private bool _nifmDisableIsAnyInternetRequestAccepted = ConfigurationState.Instance.Hacks.DisableNifmIsAnyInternetRequestAccepted;
|
||||||
|
|
||||||
public static string Xc2MenuFixTooltip { get; } = Lambda.String(sb =>
|
public static string Xc2MenuFixTooltip { get; } = Lambda.String(sb =>
|
||||||
{
|
{
|
||||||
sb.AppendLine(
|
sb.AppendLine(
|
||||||
"This fix applies a 2ms delay (via 'Thread.Sleep(2)') every time the game tries to read data from the emulated Switch filesystem.")
|
"This hack applies a 2ms delay (via 'Thread.Sleep(2)') every time the game tries to read data from the emulated Switch filesystem.")
|
||||||
.AppendLine();
|
.AppendLine();
|
||||||
|
|
||||||
sb.AppendLine("From the issue on GitHub:").AppendLine();
|
sb.AppendLine("From the issue on GitHub:").AppendLine();
|
||||||
@@ -29,5 +30,14 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
"there is a low chance that the game will softlock, " +
|
"there is a low chance that the game will softlock, " +
|
||||||
"the submenu won't show up, while background music is still there.");
|
"the submenu won't show up, while background music is still there.");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
public static string NifmDisableIsAnyInternetRequestAcceptedTooltip { get; } = Lambda.String(sb =>
|
||||||
|
{
|
||||||
|
sb.AppendLine(
|
||||||
|
"This hack simply sets 'IsAnyInternetRequestAccepted' to 'false' when initializing the Nifm IGeneralService.")
|
||||||
|
.AppendLine();
|
||||||
|
|
||||||
|
sb.Append("Lets DOOM 2016 go in game.");
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -757,6 +757,8 @@ namespace Ryujinx.Ava.UI.ViewModels
|
|||||||
|
|
||||||
// Dirty Hacks
|
// Dirty Hacks
|
||||||
config.Hacks.Xc2MenuSoftlockFix.Value = DirtyHacks.Xc2MenuSoftlockFix;
|
config.Hacks.Xc2MenuSoftlockFix.Value = DirtyHacks.Xc2MenuSoftlockFix;
|
||||||
|
config.Hacks.DisableNifmIsAnyInternetRequestAccepted.Value =
|
||||||
|
DirtyHacks.NifmDisableIsAnyInternetRequestAccepted;
|
||||||
|
|
||||||
config.ToFileFormat().SaveConfig(Program.ConfigurationPath);
|
config.ToFileFormat().SaveConfig(Program.ConfigurationPath);
|
||||||
|
|
||||||
|
|||||||
@@ -4,10 +4,10 @@
|
|||||||
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
|
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
|
|
||||||
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
|
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
|
||||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input"
|
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels.Input"
|
||||||
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
xmlns:helpers="clr-namespace:Ryujinx.Ava.UI.Helpers"
|
||||||
|
xmlns:pt="using:Projektanker.Icons.Avalonia"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
d:DesignHeight="800"
|
d:DesignHeight="800"
|
||||||
@@ -507,65 +507,49 @@
|
|||||||
CornerRadius="5"
|
CornerRadius="5"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
HorizontalAlignment="Stretch">
|
HorizontalAlignment="Stretch">
|
||||||
<Grid ColumnDefinitions="*,Auto">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||||
<CheckBox
|
<StackPanel Orientation="Vertical" Spacing="5">
|
||||||
Margin="10"
|
<CheckBox
|
||||||
MinWidth="0"
|
Margin="10, 10, 10, 0"
|
||||||
Grid.Column="0"
|
MinWidth="0"
|
||||||
IsChecked="{Binding Config.EnableMotion, Mode=TwoWay}">
|
IsChecked="{Binding Config.EnableMotion, Mode=TwoWay}">
|
||||||
<TextBlock Text="{ext:Locale ControllerSettingsMotion}" />
|
<TextBlock Text="{ext:Locale ControllerSettingsMotion}" />
|
||||||
</CheckBox>
|
</CheckBox>
|
||||||
<Button
|
<Button
|
||||||
Margin="10"
|
Margin="10, 0, 10, 10"
|
||||||
Grid.Column="1"
|
Command="{Binding ShowMotionConfig}">
|
||||||
Command="{Binding ShowMotionConfig}">
|
<pt:Icon Value="fa-solid fa-gear" />
|
||||||
<TextBlock Text="{ext:Locale ControllerSettingsConfigureGeneral}" />
|
</Button>
|
||||||
</Button>
|
</StackPanel>
|
||||||
</Grid>
|
<controls:MiniVerticalSeparator Height="64"/>
|
||||||
</Border>
|
<StackPanel Orientation="Vertical" Spacing="5">
|
||||||
<Border
|
<CheckBox
|
||||||
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
Margin="10, 10, 10, 0"
|
||||||
BorderThickness="1"
|
MinWidth="0"
|
||||||
CornerRadius="5"
|
IsChecked="{Binding Config.EnableRumble, Mode=TwoWay}">
|
||||||
HorizontalAlignment="Stretch"
|
<TextBlock Text="{ext:Locale ControllerSettingsRumble}" />
|
||||||
Margin="0,-1,0,0">
|
</CheckBox>
|
||||||
<Grid ColumnDefinitions="*,Auto">
|
<Button
|
||||||
<CheckBox
|
Margin="10, 0, 10, 10"
|
||||||
Margin="10"
|
Command="{Binding ShowRumbleConfig}">
|
||||||
MinWidth="0"
|
<pt:Icon Value="fa-solid fa-gear" />
|
||||||
Grid.Column="0"
|
</Button>
|
||||||
IsChecked="{Binding Config.EnableRumble, Mode=TwoWay}">
|
</StackPanel>
|
||||||
<TextBlock Text="{ext:Locale ControllerSettingsRumble}" />
|
<controls:MiniVerticalSeparator Height="64" IsVisible="{Binding ParentModel.HasLed}"/>
|
||||||
</CheckBox>
|
<StackPanel Orientation="Vertical" Spacing="5">
|
||||||
<Button
|
<CheckBox
|
||||||
Margin="10"
|
Margin="10, 10, 10, 0"
|
||||||
Grid.Column="1"
|
MinWidth="0"
|
||||||
Command="{Binding ShowRumbleConfig}">
|
IsChecked="{Binding Config.EnableLedChanging, Mode=TwoWay}">
|
||||||
<TextBlock Text="{ext:Locale ControllerSettingsConfigureGeneral}" />
|
<TextBlock Text="{ext:Locale ControllerSettingsLed}" />
|
||||||
</Button>
|
</CheckBox>
|
||||||
</Grid>
|
<Button
|
||||||
</Border>
|
Margin="10, 0, 10, 10"
|
||||||
<Border
|
Command="{Binding ShowLedConfig}">
|
||||||
BorderBrush="{DynamicResource ThemeControlBorderColor}"
|
<pt:Icon Value="fa-solid fa-gear" />
|
||||||
BorderThickness="1"
|
</Button>
|
||||||
CornerRadius="5"
|
</StackPanel>
|
||||||
HorizontalAlignment="Stretch"
|
</StackPanel>
|
||||||
Margin="0,-1,0,0">
|
|
||||||
<Grid IsVisible="{Binding ParentModel.HasLed}" ColumnDefinitions="*,Auto">
|
|
||||||
<CheckBox
|
|
||||||
Margin="10, 10, 5, 10"
|
|
||||||
MinWidth="0"
|
|
||||||
Grid.Column="0"
|
|
||||||
IsChecked="{Binding Config.EnableLedChanging, Mode=TwoWay}">
|
|
||||||
<TextBlock Text="{ext:Locale ControllerSettingsLed}" />
|
|
||||||
</CheckBox>
|
|
||||||
<Button
|
|
||||||
Margin="10"
|
|
||||||
Grid.Column="1"
|
|
||||||
Command="{Binding ShowLedConfig}">
|
|
||||||
<TextBlock Text="{ext:Locale ControllerSettingsConfigureGeneral}" />
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
|
||||||
</Border>
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
<TextBlock
|
<TextBlock
|
||||||
Foreground="{DynamicResource SecondaryTextColor}"
|
Foreground="{DynamicResource SecondaryTextColor}"
|
||||||
TextDecorations="Underline"
|
TextDecorations="Underline"
|
||||||
Text="Highly specific hacks & tricks to alleviate performance issues, crashing, or freezing. Will cause issues." />
|
Text="Highly specific hacks & tricks to alleviate performance issues, crashing, or freezing. Can cause issues." />
|
||||||
<StackPanel
|
<StackPanel
|
||||||
Margin="0,10,0,0"
|
Margin="0,10,0,0"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
@@ -43,6 +43,18 @@
|
|||||||
Text="Xenoblade Chronicles 2 Menu Softlock Fix" />
|
Text="Xenoblade Chronicles 2 Menu Softlock Fix" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Separator/>
|
<Separator/>
|
||||||
|
<StackPanel
|
||||||
|
Margin="0,10,0,0"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
ToolTip.Tip="{Binding DirtyHacks.NifmDisableIsAnyInternetRequestAcceptedTooltip}">
|
||||||
|
<CheckBox
|
||||||
|
Margin="0"
|
||||||
|
IsChecked="{Binding DirtyHacks.NifmDisableIsAnyInternetRequestAccepted}"/>
|
||||||
|
<TextBlock
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="Disable IsAnyInternetRequestAccepted" />
|
||||||
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|||||||
@@ -6,7 +6,6 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
|
xmlns:ext="clr-namespace:Ryujinx.Ava.Common.Markup"
|
||||||
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
xmlns:viewModels="clr-namespace:Ryujinx.Ava.UI.ViewModels"
|
||||||
xmlns:helper="clr-namespace:Ryujinx.Common.Helper;assembly=Ryujinx.Common"
|
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
x:DataType="viewModels:SettingsViewModel">
|
x:DataType="viewModels:SettingsViewModel">
|
||||||
<Design.DataContext>
|
<Design.DataContext>
|
||||||
@@ -19,246 +18,265 @@
|
|||||||
HorizontalScrollBarVisibility="Disabled"
|
HorizontalScrollBarVisibility="Disabled"
|
||||||
VerticalScrollBarVisibility="Auto">
|
VerticalScrollBarVisibility="Auto">
|
||||||
<Border Classes="settings">
|
<Border Classes="settings">
|
||||||
<StackPanel
|
<Grid ColumnDefinitions="Auto,Auto,*" HorizontalAlignment="Stretch">
|
||||||
Margin="10"
|
<StackPanel
|
||||||
HorizontalAlignment="Stretch"
|
Grid.Column="0"
|
||||||
Orientation="Vertical"
|
Margin="10"
|
||||||
Spacing="10">
|
HorizontalAlignment="Stretch"
|
||||||
<TextBlock Classes="h1" Text="{ext:Locale SettingsTabGeneralGeneral}" />
|
Orientation="Vertical"
|
||||||
<StackPanel Margin="10,0,0,0" Orientation="Vertical">
|
Spacing="10">
|
||||||
<CheckBox IsChecked="{Binding EnableDiscordIntegration}">
|
<TextBlock Classes="h1" Text="{ext:Locale SettingsTabGeneralGeneral}" />
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Margin="10,0,0,0" Orientation="Vertical">
|
||||||
|
<CheckBox IsChecked="{Binding EnableDiscordIntegration}">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock VerticalAlignment="Center"
|
||||||
|
ToolTip.Tip="{ext:Locale ToggleDiscordTooltip}"
|
||||||
|
Text="{ext:Locale SettingsTabGeneralEnableDiscordRichPresence}" />
|
||||||
|
</StackPanel>
|
||||||
|
</CheckBox>
|
||||||
|
<CheckBox
|
||||||
|
IsEnabled="{Binding !IsGameTitleNotNull}"
|
||||||
|
Opacity="{Binding PanelOpacity}"
|
||||||
|
IsChecked="{Binding ShowConfirmExit}">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralShowConfirmExitDialog}" />
|
||||||
|
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}" />
|
||||||
|
</StackPanel>
|
||||||
|
</CheckBox>
|
||||||
|
<CheckBox
|
||||||
|
IsEnabled="{Binding !IsGameTitleNotNull}"
|
||||||
|
Opacity="{Binding PanelOpacity}"
|
||||||
|
IsChecked="{Binding RememberWindowState}">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralRememberWindowState}" />
|
||||||
|
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}" />
|
||||||
|
</StackPanel>
|
||||||
|
</CheckBox>
|
||||||
|
<CheckBox
|
||||||
|
IsEnabled="{Binding !IsGameTitleNotNull}"
|
||||||
|
Opacity="{Binding PanelOpacity}"
|
||||||
|
IsChecked="{Binding ShowOldUI}"
|
||||||
|
ToolTip.Tip="{ext:Locale SettingsTabGeneralShowOldUIToolTip}">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralShowOldUI}" />
|
||||||
|
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}" />
|
||||||
|
</StackPanel>
|
||||||
|
</CheckBox>
|
||||||
|
<StackPanel
|
||||||
|
Margin="0, 15, 0, 0"
|
||||||
|
Orientation="Horizontal">
|
||||||
<TextBlock VerticalAlignment="Center"
|
<TextBlock VerticalAlignment="Center"
|
||||||
ToolTip.Tip="{ext:Locale ToggleDiscordTooltip}"
|
Text="{ext:Locale SettingsTabGeneralFocusLossType}"
|
||||||
Text="{ext:Locale SettingsTabGeneralEnableDiscordRichPresence}" />
|
Width="150" />
|
||||||
|
<ComboBox SelectedIndex="{Binding FocusLostActionType}"
|
||||||
|
HorizontalContentAlignment="Left"
|
||||||
|
MinWidth="100">
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralFocusLossTypeDoNothing}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralFocusLossTypeBlockInput}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralFocusLossTypeMuteAudio}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock
|
||||||
|
Text="{ext:Locale SettingsTabGeneralFocusLossTypeBlockInputAndMuteAudio}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralFocusLossTypePauseEmulation}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
</ComboBox>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</CheckBox>
|
<StackPanel
|
||||||
<CheckBox
|
IsEnabled="{Binding !IsGameTitleNotNull}"
|
||||||
IsEnabled="{Binding !IsGameTitleNotNull}"
|
Opacity="{Binding PanelOpacity}"
|
||||||
Opacity="{Binding PanelOpacity}"
|
Margin="0, 15, 0, 0"
|
||||||
IsChecked="{Binding ShowConfirmExit}">
|
Orientation="Horizontal">
|
||||||
<StackPanel Orientation="Horizontal">
|
<TextBlock VerticalAlignment="Center"
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralShowConfirmExitDialog}" />
|
Text="{ext:Locale SettingsTabGeneralCheckUpdatesOnLaunch}"
|
||||||
|
Width="150" />
|
||||||
|
<ComboBox SelectedIndex="{Binding UpdateCheckerType}"
|
||||||
|
HorizontalContentAlignment="Left"
|
||||||
|
MinWidth="100">
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralCheckUpdatesOnLaunchOff}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock
|
||||||
|
Text="{ext:Locale SettingsTabGeneralCheckUpdatesOnLaunchPromptAtStartup}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralCheckUpdatesOnLaunchBackground}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
</ComboBox>
|
||||||
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}" />
|
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</CheckBox>
|
<StackPanel
|
||||||
<CheckBox
|
Margin="0, 15, 0, 0"
|
||||||
IsEnabled="{Binding !IsGameTitleNotNull}"
|
Orientation="Horizontal">
|
||||||
Opacity="{Binding PanelOpacity}"
|
<TextBlock VerticalAlignment="Center"
|
||||||
IsChecked="{Binding RememberWindowState}">
|
Text="{ext:Locale SettingsTabGeneralHideCursor}"
|
||||||
<StackPanel Orientation="Horizontal">
|
Width="150" />
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralRememberWindowState}" />
|
<ComboBox SelectedIndex="{Binding HideCursor}"
|
||||||
|
HorizontalContentAlignment="Left"
|
||||||
|
MinWidth="100">
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralHideCursorNever}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralHideCursorOnIdle}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralHideCursorAlways}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
</ComboBox>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
IsEnabled="{Binding !IsGameTitleNotNull}"
|
||||||
|
Opacity="{Binding PanelOpacity}"
|
||||||
|
Margin="0, 15, 0, 10"
|
||||||
|
Orientation="Horizontal">
|
||||||
|
<TextBlock
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Text="{ext:Locale SettingsTabGeneralTheme}"
|
||||||
|
Width="150" />
|
||||||
|
<ComboBox SelectedIndex="{Binding BaseStyleIndex}"
|
||||||
|
HorizontalContentAlignment="Left"
|
||||||
|
MinWidth="100">
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralThemeAuto}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralThemeLight}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
<ComboBoxItem>
|
||||||
|
<TextBlock Text="{ext:Locale SettingsTabGeneralThemeDark}" />
|
||||||
|
</ComboBoxItem>
|
||||||
|
</ComboBox>
|
||||||
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}" />
|
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</CheckBox>
|
|
||||||
<CheckBox
|
|
||||||
IsEnabled="{Binding !IsGameTitleNotNull}"
|
|
||||||
Opacity="{Binding PanelOpacity}"
|
|
||||||
IsChecked="{Binding ShowOldUI}"
|
|
||||||
ToolTip.Tip="{ext:Locale SettingsTabGeneralShowOldUIToolTip}">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralShowOldUI}" />
|
|
||||||
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}" />
|
|
||||||
</StackPanel>
|
|
||||||
</CheckBox>
|
|
||||||
<StackPanel
|
|
||||||
Margin="0, 15, 0, 0"
|
|
||||||
Orientation="Horizontal">
|
|
||||||
<TextBlock VerticalAlignment="Center"
|
|
||||||
Text="{ext:Locale SettingsTabGeneralFocusLossType}"
|
|
||||||
Width="150" />
|
|
||||||
<ComboBox SelectedIndex="{Binding FocusLostActionType}"
|
|
||||||
HorizontalContentAlignment="Left"
|
|
||||||
MinWidth="100">
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralFocusLossTypeDoNothing}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralFocusLossTypeBlockInput}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralFocusLossTypeMuteAudio}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralFocusLossTypeBlockInputAndMuteAudio}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralFocusLossTypePauseEmulation}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
</ComboBox>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel
|
|
||||||
IsEnabled="{Binding !IsGameTitleNotNull}"
|
|
||||||
Opacity="{Binding PanelOpacity}"
|
|
||||||
Margin="0, 15, 0, 0"
|
|
||||||
Orientation="Horizontal">
|
|
||||||
<TextBlock VerticalAlignment="Center"
|
|
||||||
Text="{ext:Locale SettingsTabGeneralCheckUpdatesOnLaunch}"
|
|
||||||
Width="150" />
|
|
||||||
<ComboBox SelectedIndex="{Binding UpdateCheckerType}"
|
|
||||||
HorizontalContentAlignment="Left"
|
|
||||||
MinWidth="100">
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralCheckUpdatesOnLaunchOff}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralCheckUpdatesOnLaunchPromptAtStartup}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralCheckUpdatesOnLaunchBackground}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
</ComboBox>
|
|
||||||
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}"/>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel
|
|
||||||
Margin="0, 15, 0, 0"
|
|
||||||
Orientation="Horizontal">
|
|
||||||
<TextBlock VerticalAlignment="Center"
|
|
||||||
Text="{ext:Locale SettingsTabGeneralHideCursor}"
|
|
||||||
Width="150" />
|
|
||||||
<ComboBox SelectedIndex="{Binding HideCursor}"
|
|
||||||
HorizontalContentAlignment="Left"
|
|
||||||
MinWidth="100">
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralHideCursorNever}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralHideCursorOnIdle}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralHideCursorAlways}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
</ComboBox>
|
|
||||||
</StackPanel>
|
|
||||||
<StackPanel
|
|
||||||
IsEnabled="{Binding !IsGameTitleNotNull}"
|
|
||||||
Opacity="{Binding PanelOpacity}"
|
|
||||||
Margin="0, 15, 0, 10"
|
|
||||||
Orientation="Horizontal">
|
|
||||||
<TextBlock
|
|
||||||
VerticalAlignment="Center"
|
|
||||||
Text="{ext:Locale SettingsTabGeneralTheme}"
|
|
||||||
Width="150" />
|
|
||||||
<ComboBox SelectedIndex="{Binding BaseStyleIndex}"
|
|
||||||
HorizontalContentAlignment="Left"
|
|
||||||
MinWidth="100">
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralThemeAuto}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralThemeLight}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
<ComboBoxItem>
|
|
||||||
<TextBlock Text="{ext:Locale SettingsTabGeneralThemeDark}" />
|
|
||||||
</ComboBoxItem>
|
|
||||||
</ComboBox>
|
|
||||||
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<Separator Height="1" />
|
<Border Grid.Column="1"
|
||||||
<StackPanel Orientation="Horizontal">
|
HorizontalAlignment="Center"
|
||||||
<TextBlock Classes="h1" Text="{ext:Locale SettingsTabGeneralGameDirectories}" />
|
VerticalAlignment="Top"
|
||||||
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}"/>
|
Margin="10, 10, 10, 0"
|
||||||
</StackPanel>
|
Height="405"
|
||||||
|
BorderBrush="Gray"
|
||||||
|
Background="Gray"
|
||||||
|
Width="1" />
|
||||||
<StackPanel
|
<StackPanel
|
||||||
IsEnabled="{Binding !IsGameTitleNotNull}"
|
Margin="10"
|
||||||
Opacity="{Binding PanelOpacity}"
|
Spacing="10"
|
||||||
Margin="10,0,0,0"
|
Grid.Column="2"
|
||||||
HorizontalAlignment="Stretch"
|
Orientation="Vertical" HorizontalAlignment="Stretch">
|
||||||
Orientation="Vertical"
|
|
||||||
Spacing="10">
|
|
||||||
<ListBox
|
|
||||||
Name="GameDirsList"
|
|
||||||
MinHeight="120"
|
|
||||||
ItemsSource="{Binding GameDirectories}">
|
|
||||||
<ListBox.Styles>
|
|
||||||
<Style Selector="ListBoxItem">
|
|
||||||
<Setter Property="Padding" Value="10" />
|
|
||||||
<Setter Property="Background" Value="{DynamicResource ListBoxBackground}" />
|
|
||||||
</Style>
|
|
||||||
</ListBox.Styles>
|
|
||||||
</ListBox>
|
|
||||||
<Grid HorizontalAlignment="Stretch" ColumnDefinitions="*,Auto,Auto">
|
|
||||||
<TextBox
|
|
||||||
Name="GameDirPathBox"
|
|
||||||
Margin="0"
|
|
||||||
ToolTip.Tip="{ext:Locale AddGameDirBoxTooltip}"
|
|
||||||
VerticalAlignment="Stretch" />
|
|
||||||
<Button
|
|
||||||
Name="AddGameDirButton"
|
|
||||||
Grid.Column="1"
|
|
||||||
MinWidth="90"
|
|
||||||
Margin="10,0,0,0"
|
|
||||||
ToolTip.Tip="{ext:Locale AddGameDirTooltip}">
|
|
||||||
<TextBlock HorizontalAlignment="Center"
|
|
||||||
Text="{ext:Locale SettingsTabGeneralAdd}" />
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
Name="RemoveGameDirButton"
|
|
||||||
Grid.Column="2"
|
|
||||||
MinWidth="90"
|
|
||||||
Margin="10,0,0,0"
|
|
||||||
ToolTip.Tip="{ext:Locale RemoveGameDirTooltip}"
|
|
||||||
Click="RemoveGameDirButton_OnClick">
|
|
||||||
<TextBlock HorizontalAlignment="Center"
|
|
||||||
Text="{ext:Locale SettingsTabGeneralRemove}" />
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
<Separator Height="1" />
|
|
||||||
<StackPanel Orientation="Vertical" Spacing="5">
|
|
||||||
<StackPanel Orientation="Horizontal">
|
<StackPanel Orientation="Horizontal">
|
||||||
<TextBlock Classes="h1" Text="{ext:Locale SettingsTabGeneralAutoloadDirectories}" />
|
<TextBlock Classes="h1" Text="{ext:Locale SettingsTabGeneralGameDirectories}" />
|
||||||
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}"/>
|
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
IsEnabled="{Binding !IsGameTitleNotNull}"
|
||||||
|
Opacity="{Binding PanelOpacity}"
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Orientation="Vertical"
|
||||||
|
Spacing="10">
|
||||||
|
<ListBox
|
||||||
|
Name="GameDirsList"
|
||||||
|
MinHeight="120"
|
||||||
|
ItemsSource="{Binding GameDirectories}">
|
||||||
|
<ListBox.Styles>
|
||||||
|
<Style Selector="ListBoxItem">
|
||||||
|
<Setter Property="Padding" Value="10" />
|
||||||
|
<Setter Property="Background" Value="{DynamicResource ListBoxBackground}" />
|
||||||
|
</Style>
|
||||||
|
</ListBox.Styles>
|
||||||
|
</ListBox>
|
||||||
|
<Grid HorizontalAlignment="Stretch" ColumnDefinitions="*,Auto,Auto">
|
||||||
|
<TextBox
|
||||||
|
Name="GameDirPathBox"
|
||||||
|
Margin="0"
|
||||||
|
ToolTip.Tip="{ext:Locale AddGameDirBoxTooltip}"
|
||||||
|
VerticalAlignment="Stretch" />
|
||||||
|
<Button
|
||||||
|
Name="AddGameDirButton"
|
||||||
|
Grid.Column="1"
|
||||||
|
MinWidth="90"
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
ToolTip.Tip="{ext:Locale AddGameDirTooltip}">
|
||||||
|
<TextBlock HorizontalAlignment="Center"
|
||||||
|
Text="{ext:Locale SettingsTabGeneralAdd}" />
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
Name="RemoveGameDirButton"
|
||||||
|
Grid.Column="2"
|
||||||
|
MinWidth="90"
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
ToolTip.Tip="{ext:Locale RemoveGameDirTooltip}"
|
||||||
|
Click="RemoveGameDirButton_OnClick">
|
||||||
|
<TextBlock HorizontalAlignment="Center"
|
||||||
|
Text="{ext:Locale SettingsTabGeneralRemove}" />
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
<Separator Height="1" />
|
||||||
|
<StackPanel Orientation="Vertical" Spacing="5">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<TextBlock Classes="h1" Text="{ext:Locale SettingsTabGeneralAutoloadDirectories}" />
|
||||||
|
<TextBlock Classes="globalConfigMarker" IsVisible="{Binding IsGameTitleNotNull}" />
|
||||||
|
</StackPanel>
|
||||||
|
<TextBlock Foreground="{DynamicResource SecondaryTextColor}"
|
||||||
|
Text="{ext:Locale SettingsTabGeneralAutoloadNote}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel
|
||||||
|
IsEnabled="{Binding !IsGameTitleNotNull}"
|
||||||
|
Opacity="{Binding PanelOpacity}"
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Orientation="Vertical"
|
||||||
|
Spacing="10">
|
||||||
|
<ListBox
|
||||||
|
Name="AutoloadDirsList"
|
||||||
|
MinHeight="100"
|
||||||
|
ItemsSource="{Binding AutoloadDirectories}">
|
||||||
|
<ListBox.Styles>
|
||||||
|
<Style Selector="ListBoxItem">
|
||||||
|
<Setter Property="Padding" Value="10" />
|
||||||
|
<Setter Property="Background" Value="{DynamicResource ListBoxBackground}" />
|
||||||
|
</Style>
|
||||||
|
</ListBox.Styles>
|
||||||
|
</ListBox>
|
||||||
|
<Grid HorizontalAlignment="Stretch" ColumnDefinitions="*,Auto,Auto">
|
||||||
|
<TextBox
|
||||||
|
Name="AutoloadDirPathBox"
|
||||||
|
Margin="0"
|
||||||
|
ToolTip.Tip="{ext:Locale AddAutoloadDirBoxTooltip}"
|
||||||
|
VerticalAlignment="Stretch" />
|
||||||
|
<Button
|
||||||
|
Name="AddAutoloadDirButton"
|
||||||
|
Grid.Column="1"
|
||||||
|
MinWidth="90"
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
ToolTip.Tip="{ext:Locale AddAutoloadDirTooltip}">
|
||||||
|
<TextBlock HorizontalAlignment="Center"
|
||||||
|
Text="{ext:Locale SettingsTabGeneralAdd}" />
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
Name="RemoveAutoloadDirButton"
|
||||||
|
Grid.Column="2"
|
||||||
|
MinWidth="90"
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
ToolTip.Tip="{ext:Locale RemoveAutoloadDirTooltip}"
|
||||||
|
Click="RemoveAutoloadDirButton_OnClick">
|
||||||
|
<TextBlock HorizontalAlignment="Center"
|
||||||
|
Text="{ext:Locale SettingsTabGeneralRemove}" />
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<TextBlock Foreground="{DynamicResource SecondaryTextColor}" Text="{ext:Locale SettingsTabGeneralAutoloadNote}" />
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<StackPanel
|
</Grid>
|
||||||
IsEnabled="{Binding !IsGameTitleNotNull}"
|
|
||||||
Opacity="{Binding PanelOpacity}"
|
|
||||||
Margin="10,0,0,0"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Orientation="Vertical"
|
|
||||||
Spacing="10">
|
|
||||||
<ListBox
|
|
||||||
Name="AutoloadDirsList"
|
|
||||||
MinHeight="100"
|
|
||||||
ItemsSource="{Binding AutoloadDirectories}">
|
|
||||||
<ListBox.Styles>
|
|
||||||
<Style Selector="ListBoxItem">
|
|
||||||
<Setter Property="Padding" Value="10" />
|
|
||||||
<Setter Property="Background" Value="{DynamicResource ListBoxBackground}" />
|
|
||||||
</Style>
|
|
||||||
</ListBox.Styles>
|
|
||||||
</ListBox>
|
|
||||||
<Grid HorizontalAlignment="Stretch" ColumnDefinitions="*,Auto,Auto">
|
|
||||||
<TextBox
|
|
||||||
Name="AutoloadDirPathBox"
|
|
||||||
Margin="0"
|
|
||||||
ToolTip.Tip="{ext:Locale AddAutoloadDirBoxTooltip}"
|
|
||||||
VerticalAlignment="Stretch" />
|
|
||||||
<Button
|
|
||||||
Name="AddAutoloadDirButton"
|
|
||||||
Grid.Column="1"
|
|
||||||
MinWidth="90"
|
|
||||||
Margin="10,0,0,0"
|
|
||||||
ToolTip.Tip="{ext:Locale AddAutoloadDirTooltip}">
|
|
||||||
<TextBlock HorizontalAlignment="Center"
|
|
||||||
Text="{ext:Locale SettingsTabGeneralAdd}" />
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
Name="RemoveAutoloadDirButton"
|
|
||||||
Grid.Column="2"
|
|
||||||
MinWidth="90"
|
|
||||||
Margin="10,0,0,0"
|
|
||||||
ToolTip.Tip="{ext:Locale RemoveAutoloadDirTooltip}"
|
|
||||||
Click="RemoveAutoloadDirButton_OnClick">
|
|
||||||
<TextBlock HorizontalAlignment="Center"
|
|
||||||
Text="{ext:Locale SettingsTabGeneralRemove}" />
|
|
||||||
</Button>
|
|
||||||
</Grid>
|
|
||||||
</StackPanel>
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
</Border>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
<DataTemplate DataType="{x:Type systems:CompatibilityEntry}">
|
<DataTemplate DataType="{x:Type systems:CompatibilityEntry}">
|
||||||
<Grid MinWidth="800"
|
<Grid MinWidth="800"
|
||||||
Margin="10"
|
Margin="10"
|
||||||
ColumnDefinitions="*,Auto,Auto,*"
|
ColumnDefinitions="Auto,Auto,Auto,*"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
ToolTip.Tip="{Binding LocalizedLastUpdated}">
|
ToolTip.Tip="{Binding LocalizedLastUpdated}">
|
||||||
<TextBlock Grid.Column="0"
|
<TextBlock Grid.Column="0"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
xmlns:helper="clr-namespace:Ryujinx.Common.Helper;assembly=Ryujinx.Common"
|
xmlns:helper="clr-namespace:Ryujinx.Common.Helper;assembly=Ryujinx.Common"
|
||||||
Width="1100"
|
Width="1100"
|
||||||
Height="910"
|
Height="910"
|
||||||
MinWidth="800"
|
MinWidth="1037"
|
||||||
MinHeight="480"
|
MinHeight="480"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
x:DataType="viewModels:SettingsViewModel"
|
x:DataType="viewModels:SettingsViewModel"
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
xmlns:helper="clr-namespace:Ryujinx.Common.Helper;assembly=Ryujinx.Common"
|
xmlns:helper="clr-namespace:Ryujinx.Common.Helper;assembly=Ryujinx.Common"
|
||||||
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
|
xmlns:controls="clr-namespace:Ryujinx.Ava.UI.Controls"
|
||||||
Width="1100"
|
Width="1100"
|
||||||
MinWidth="800"
|
MinWidth="844"
|
||||||
MinHeight="480"
|
MinHeight="480"
|
||||||
Title="{ext:WindowTitle Settings}"
|
Title="{ext:WindowTitle Settings}"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ namespace Ryujinx.Ava.UI.Windows
|
|||||||
: NavigationViewPaneDisplayMode.Top;
|
: NavigationViewPaneDisplayMode.Top;
|
||||||
|
|
||||||
Height = ConfigurationState.Instance.ShowOldUI
|
Height = ConfigurationState.Instance.ShowOldUI
|
||||||
? 927
|
? 906
|
||||||
: 993; // nav panel is put on top with custom title bar so account for new height
|
: 954; // nav panel is put on top with custom title bar so account for new height
|
||||||
|
|
||||||
Load();
|
Load();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user