diff --git a/HandheldCompanion/App.xaml b/HandheldCompanion/App.xaml index 82527e020..f59b99fa7 100644 --- a/HandheldCompanion/App.xaml +++ b/HandheldCompanion/App.xaml @@ -3,6 +3,7 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:converters="clr-namespace:HandheldCompanion.Converters" + xmlns:local="clr-namespace:HandheldCompanion" xmlns:math="http://hexinnovation.com/math" xmlns:presets="clr-namespace:HandheldCompanion.Presets" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"> @@ -10,7 +11,7 @@ - + diff --git a/HandheldCompanion/App.xaml.cs b/HandheldCompanion/App.xaml.cs index 3e14c5c13..12e883481 100644 --- a/HandheldCompanion/App.xaml.cs +++ b/HandheldCompanion/App.xaml.cs @@ -16,6 +16,8 @@ namespace HandheldCompanion; /// public partial class App : Application { + public static bool IsMultiThreaded { get; } = false; + /// /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). @@ -36,8 +38,10 @@ protected override void OnStartup(StartupEventArgs args) var CurrentAssembly = Assembly.GetExecutingAssembly(); var fileVersionInfo = FileVersionInfo.GetVersionInfo(CurrentAssembly.Location); - // initialize log + // set environment variables Environment.SetEnvironmentVariable("APP_BASE_DIRECTORY", AppContext.BaseDirectory); + + // initialize log LogManager.Initialize("HandheldCompanion"); LogManager.LogInformation("{0} ({1})", CurrentAssembly.GetName(), fileVersionInfo.FileVersion); diff --git a/HandheldCompanion/Controllers/DualSenseController.cs b/HandheldCompanion/Controllers/DualSenseController.cs index 9c3dce616..34a63c15a 100644 --- a/HandheldCompanion/Controllers/DualSenseController.cs +++ b/HandheldCompanion/Controllers/DualSenseController.cs @@ -58,7 +58,7 @@ public override void UpdateInputs(long ticks, float delta) float joyShockY0 = JslGetTouchY(UserIndex); Inputs.AxisState[AxisFlags.LeftPadX] = (short)InputUtils.MapRange(joyShockX0, 0.0f, 1.0f, short.MinValue, short.MaxValue); - Inputs.AxisState[AxisFlags.LeftPadY] = (short)InputUtils.MapRange(joyShockY0, 0.0f, 1.0f, short.MaxValue, short.MinValue); + Inputs.AxisState[AxisFlags.LeftPadY] = (short)InputUtils.MapRange(joyShockY0, 0.0f, 1.1442206f, short.MaxValue, short.MinValue); } else { @@ -76,7 +76,7 @@ public override void UpdateInputs(long ticks, float delta) float joyShockY1 = JslGetTouchY(UserIndex, true); Inputs.AxisState[AxisFlags.RightPadX] = (short)InputUtils.MapRange(joyShockX1, 0.0f, 1.0f, short.MinValue, short.MaxValue); - Inputs.AxisState[AxisFlags.RightPadY] = (short)InputUtils.MapRange(joyShockY1, 0.0f, 1.0f, short.MaxValue, short.MinValue); + Inputs.AxisState[AxisFlags.RightPadY] = (short)InputUtils.MapRange(joyShockY1, 0.0f, 1.1442206f, short.MaxValue, short.MinValue); } else { diff --git a/HandheldCompanion/Controllers/IController.xaml.cs b/HandheldCompanion/Controllers/IController.xaml.cs index 0d79258ce..67144bbd0 100644 --- a/HandheldCompanion/Controllers/IController.xaml.cs +++ b/HandheldCompanion/Controllers/IController.xaml.cs @@ -573,13 +573,14 @@ public virtual string GetGlyph(ButtonFlags button) switch (button) { case ButtonFlags.DPadUp: - return "\u219F"; // Button A + return "\u219F"; case ButtonFlags.DPadDown: - return "\u21A1"; // Button B + return "\u21A1"; case ButtonFlags.DPadLeft: - return "\u219E"; // Button X + return "\u219E"; case ButtonFlags.DPadRight: - return "\u21A0"; // Button Y + return "\u21A0"; + case ButtonFlags.LeftStickClick: return "\u21BA"; case ButtonFlags.RightStickClick: @@ -600,10 +601,39 @@ public virtual string GetGlyph(ButtonFlags button) return "\u21BD"; case ButtonFlags.RightStickRight: return "\u21C1"; + case ButtonFlags.VolumeUp: return "\u21fe"; case ButtonFlags.VolumeDown: return "\u21fd"; + + case ButtonFlags.LeftPadTouch: + return "\u2268"; + case ButtonFlags.RightPadTouch: + return "\u2269"; + + case ButtonFlags.LeftPadClick: + return "\u2266"; + case ButtonFlags.RightPadClick: + return "\u2267"; + + case ButtonFlags.LeftPadClickDown: + return "\u2274"; + case ButtonFlags.LeftPadClickUp: + return "\u2270"; + case ButtonFlags.LeftPadClickRight: + return "\u2272"; + case ButtonFlags.LeftPadClickLeft: + return "\u226E"; + + case ButtonFlags.RightPadClickDown: + return "\u2275"; + case ButtonFlags.RightPadClickUp: + return "\u2271"; + case ButtonFlags.RightPadClickRight: + return "\u2273"; + case ButtonFlags.RightPadClickLeft: + return "\u226F"; } return defaultGlyph; @@ -621,6 +651,14 @@ public virtual string GetGlyph(AxisFlags axis) return "\u21C6"; case AxisFlags.RightStickY: return "\u21F5"; + + // Todo, need dedicated icons + case AxisFlags.LeftPadX: + case AxisFlags.LeftPadY: + return "\u2264"; + case AxisFlags.RightPadX: + case AxisFlags.RightPadY: + return "\u2265"; } return defaultGlyph; @@ -634,8 +672,14 @@ public virtual string GetGlyph(AxisLayoutFlags axis) return "\u21CB"; case AxisLayoutFlags.RightStick: return "\u21CC"; + case AxisLayoutFlags.Gyroscope: return "\u2B94"; + + case AxisLayoutFlags.LeftPad: + return "\u2264"; + case AxisLayoutFlags.RightPad: + return "\u2265"; } return defaultGlyph; @@ -643,26 +687,26 @@ public virtual string GetGlyph(AxisLayoutFlags axis) public GlyphIconInfo GetGlyphIconInfo(ButtonFlags button, int fontIconSize = 14) { - var glyph = GetGlyph(button); + string? glyph = GetGlyph(button); return new GlyphIconInfo { Name = GetButtonName(button), - Glyph = glyph, - FontSize = glyph is not null ? 28 : fontIconSize, - FontFamily = glyph is not null ? GlyphFontFamily : null, + Glyph = glyph is not null ? glyph : defaultGlyph, + FontSize = fontIconSize, + FontFamily = GlyphFontFamily, Foreground = GetGlyphColor(button) }; } public GlyphIconInfo GetGlyphIconInfo(AxisLayoutFlags axis, int fontIconSize = 14) { - var glyph = GetGlyph(axis); + string? glyph = GetGlyph(axis); return new GlyphIconInfo { Name = GetAxisName(axis), - Glyph = glyph, - FontSize = glyph is not null ? 28 : fontIconSize, - FontFamily = glyph is not null ? GlyphFontFamily : null, + Glyph = glyph is not null ? glyph : defaultGlyph, + FontSize = fontIconSize, + FontFamily = GlyphFontFamily, Foreground = GetGlyphColor(axis) }; } @@ -678,10 +722,7 @@ public FontIcon GetFontIcon(ButtonFlags button, int FontIconSize = 14) }; if (FontIcon.Glyph is not null) - { FontIcon.FontFamily = GlyphFontFamily; - FontIcon.FontSize = 28; - } return FontIcon; } @@ -698,10 +739,7 @@ public FontIcon GetFontIcon(AxisLayoutFlags axis, int FontIconSize = 14) }; if (FontIcon.Glyph is not null) - { FontIcon.FontFamily = GlyphFontFamily; - FontIcon.FontSize = 28; - } return FontIcon; } diff --git a/HandheldCompanion/Controls/Hints/IHint.xaml b/HandheldCompanion/Controls/Hints/IHint.xaml index b5a0c4f01..b93cf86f0 100644 --- a/HandheldCompanion/Controls/Hints/IHint.xaml +++ b/HandheldCompanion/Controls/Hints/IHint.xaml @@ -1,61 +1,61 @@ - - - - - - - - - - - - - - - - - - - - -