Stick Visualizer #579

Merged
GreemDev merged 28 commits from xeyes into master 2025-03-03 02:43:31 +00:00
Showing only changes of commit 43ece083b2 - Show all commits

View File

@ -29,10 +29,6 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
private IGamepad _selectedGamepad;
// Offset from origin for UI stick visualization.
private (float, float) _uiStickLeft;
private (float, float) _uiStickRight;
private float _vectorLength;
private float _vectorMultiplier;
@ -69,6 +65,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
public InputViewModel ParentModel { get; }
private (float, float) _uiStickLeft;
public (float, float) UiStickLeft
{
get => (_uiStickLeft.Item1 * DrawStickScaleFactor, _uiStickLeft.Item2 * DrawStickScaleFactor);
@ -83,6 +81,7 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
}
}
private (float, float) _uiStickRight;
public (float, float) UiStickRight
{
get => (_uiStickRight.Item1 * DrawStickScaleFactor, _uiStickRight.Item2 * DrawStickScaleFactor);
@ -121,8 +120,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
{
get
{
_vectorMultiplier = 1;
_vectorLength = GetVectorLength(UiStickLeft);
_vectorMultiplier = 1;
_vectorLength = GetVectorLength(UiStickLeft);
if (_vectorLength > MaxVectorLength)
{
@ -137,8 +136,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
{
get
{
_vectorMultiplier = 1;
_vectorLength = GetVectorLength(UiStickRight);
_vectorMultiplier = 1;
_vectorLength = GetVectorLength(UiStickRight);
if (_vectorLength > MaxVectorLength)
{
@ -153,8 +152,8 @@ namespace Ryujinx.Ava.UI.ViewModels.Input
{
get
{
_vectorMultiplier = 1;
_vectorLength = GetVectorLength(UiStickRight);
_vectorMultiplier = 1;
_vectorLength = GetVectorLength(UiStickRight);
if (_vectorLength > MaxVectorLength)
{