From 9655ffde6afd68fadfc33d02497cb83611af3246 Mon Sep 17 00:00:00 2001 From: CasperH Date: Fri, 31 May 2024 12:25:34 +0200 Subject: [PATCH] EA to Public files move --- HandheldCompanion/App.xaml | 3 +- HandheldCompanion/App.xaml.cs | 6 +- .../Controllers/DualSenseController.cs | 4 +- .../Controllers/IController.xaml.cs | 74 +- HandheldCompanion/Controls/Hints/IHint.xaml | 122 +- .../Controls/Hints/IHint.xaml.cs | 44 +- .../Converters/InverseAppThemeConverter.cs | 52 +- .../Devices/AOKZOE/AOKZOEA1Pro.cs | 32 +- HandheldCompanion/Devices/ASUS/AsusACPI.cs | 1022 +++++------ .../Devices/AYANEO/AYANEOAIR1S.cs | 4 +- .../Devices/AYANEO/AYANEODevice.cs | 2 +- .../Devices/Ayn/AynLokiMax6600U.cs | 24 +- .../Devices/Ayn/AynLokiMax6800U.cs | 24 +- .../Devices/Ayn/AynLokiMiniPro.cs | 24 +- HandheldCompanion/Devices/Ayn/AynLokiZero.cs | 24 +- HandheldCompanion/Devices/GPD/GPDWin2.cs | 30 +- HandheldCompanion/Devices/Lenovo/FanTable.cs | 178 +- HandheldCompanion/Devices/Lenovo/LegionGo.cs | 49 +- .../Devices/OneXPlayer/OneXPlayer2Pro.cs | 32 +- .../GraphicsProcessingUnit/AMDGPU.cs | 176 +- .../GraphicsProcessingUnit/GPU.cs | 2 + .../GraphicsProcessingUnit/IntelGPU.cs | 12 +- HandheldCompanion/Helpers/GamepadMotion.cs | 8 +- .../Managers/ControllerManager.cs | 13 +- HandheldCompanion/Managers/GPUManager.cs | 16 +- .../Managers/MultimediaManager.cs | 1168 ++++++------ HandheldCompanion/Managers/SensorsManager.cs | 27 +- HandheldCompanion/Misc/Dialog.cs | 192 +- HandheldCompanion/Misc/PnPDetails.cs | 414 ++--- HandheldCompanion/Misc/PnPUtil.cs | 276 +-- HandheldCompanion/Misc/Profile.cs | 10 +- HandheldCompanion/Platforms/Steam.cs | 7 +- .../Presets/ColorPresetResources.cs | 98 +- HandheldCompanion/Processors/AMD/RyzenAdj.cs | 1 + HandheldCompanion/Processors/AMDProcessor.cs | 158 +- .../Properties/Settings.Designer.cs | 1058 ++++------- HandheldCompanion/Sensors/IMUAccelerometer.cs | 276 +-- HandheldCompanion/Styles/NavigationView.xaml | 9 - HandheldCompanion/Targets/DualShock4Target.cs | 27 +- HandheldCompanion/Targets/ViGEmTarget.cs | 8 +- HandheldCompanion/Targets/Xbox360Target.cs | 25 +- HandheldCompanion/Utils/HIDUtils.cs | 28 +- HandheldCompanion/Utils/RegistryUtils.cs | 172 +- HandheldCompanion/Utils/ServiceUtils.cs | 272 +-- HandheldCompanion/Utils/WPFUtils.cs | 748 ++++---- .../Layout/Mappings/AxisMappingViewModel.cs | 2 +- .../Layout/Mappings/ButtonMappingViewModel.cs | 4 +- .../Layout/Mappings/GyroMappingViewModel.cs | 2 +- .../Mappings/TriggerMappingViewModel.cs | 2 +- .../ViewModels/Pages/AboutPageViewModel.cs | 92 +- .../Views/Classes/GamepadWindow.cs | 224 +-- .../Views/Classes/OverlayWindow.cs | 332 ++-- .../Views/Pages/ControllerPage.xaml.cs | 2 +- .../Views/Pages/ProfilesPage.xaml.cs | 63 +- .../QuickPages/QuickProfilesPage.xaml.cs | 22 +- .../Views/Windows/MainWindow.xaml.cs | 1598 ++++++++--------- HandheldCompanion/WMI.cs | 25 +- README.md | 2 +- utils/Utils.iss | 4 +- 59 files changed, 4465 insertions(+), 4860 deletions(-) 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 @@ - - - - - - - - - - - - - - - - - - - - -