diff --git a/JoystickProxyWin/Joystick Proxy/Form1.Designer.cs b/JoystickProxyWin/Joystick Proxy/Form1.Designer.cs index 0cab247..4e24dfb 100644 --- a/JoystickProxyWin/Joystick Proxy/Form1.Designer.cs +++ b/JoystickProxyWin/Joystick Proxy/Form1.Designer.cs @@ -42,7 +42,6 @@ private void InitializeComponent() this.InputValue = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.InputBindingSource = new System.Windows.Forms.BindingSource(this.components); this.ReadInputTimer = new System.Windows.Forms.Timer(this.components); - this.TipJarImage = new System.Windows.Forms.PictureBox(); this.ShowAllDevicesCheckBox = new System.Windows.Forms.CheckBox(); this.label1 = new System.Windows.Forms.Label(); this.SaveFileDialog = new System.Windows.Forms.SaveFileDialog(); @@ -56,7 +55,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.ControllerDeviceBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.DataGridView1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.InputBindingSource)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.TipJarImage)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.PollingRateInput)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.PortInput)).BeginInit(); this.SuspendLayout(); @@ -170,19 +168,6 @@ private void InitializeComponent() this.ReadInputTimer.Interval = global::Joystick_Proxy.Properties.Settings.Default.PollingRate; this.ReadInputTimer.Tick += new System.EventHandler(this.ReadInputTimer_Tick); // - // TipJarImage - // - this.TipJarImage.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.TipJarImage.Cursor = System.Windows.Forms.Cursors.Hand; - this.TipJarImage.Image = global::Joystick_Proxy.Properties.Resources.tipjar; - this.TipJarImage.Location = new System.Drawing.Point(778, 377); - this.TipJarImage.Name = "TipJarImage"; - this.TipJarImage.Size = new System.Drawing.Size(92, 20); - this.TipJarImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.TipJarImage.TabIndex = 3; - this.TipJarImage.TabStop = false; - this.TipJarImage.Click += new System.EventHandler(this.TipJar_Click); - // // ShowAllDevicesCheckBox // this.ShowAllDevicesCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -309,7 +294,6 @@ private void InitializeComponent() this.Controls.Add(this.label1); this.Controls.Add(this.VisualizerHostTextBox); this.Controls.Add(this.ShowAllDevicesCheckBox); - this.Controls.Add(this.TipJarImage); this.Controls.Add(this.DataGridView1); this.Controls.Add(this.DevicesDataGridView); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); @@ -321,7 +305,6 @@ private void InitializeComponent() ((System.ComponentModel.ISupportInitialize)(this.ControllerDeviceBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.DataGridView1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.InputBindingSource)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.TipJarImage)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.PollingRateInput)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.PortInput)).EndInit(); this.ResumeLayout(false); @@ -339,7 +322,6 @@ private void InitializeComponent() private System.Windows.Forms.Timer ReadInputTimer; private System.Windows.Forms.DataGridViewTextBoxColumn InputName; private System.Windows.Forms.DataGridViewTextBoxColumn InputValue; - private System.Windows.Forms.PictureBox TipJarImage; private System.Windows.Forms.CheckBox ShowAllDevicesCheckBox; private System.Windows.Forms.DataGridViewCheckBoxColumn DeviceEnabled; private System.Windows.Forms.DataGridViewTextBoxColumn NameDataGridViewTextBoxColumn; diff --git a/JoystickProxyWin/Joystick Proxy/settings.ini b/JoystickProxyWin/Joystick Proxy/settings.ini index 9cdea0e..0cbbd30 100644 --- a/JoystickProxyWin/Joystick Proxy/settings.ini +++ b/JoystickProxyWin/Joystick Proxy/settings.ini @@ -4,6 +4,7 @@ 044f:b678 = Thrustmaster T.Flight Rudder Car Mode 044f:b679 = Thrustmaster T.Flight Rudder 044f:b108 = Thrustmaster T.Flight HOTAS X +044f:b67c = Thrustmaster T.Flight HOTAS 4 044f:0402 = Thrustmaster Warthog Joystick 044f:0404 = Thrustmaster Warthog Throttle 044f:ffff = Thrustmaster Warthog Combined diff --git a/JoystickVisualizer/.vsconfig b/JoystickVisualizer/.vsconfig new file mode 100644 index 0000000..aade28f --- /dev/null +++ b/JoystickVisualizer/.vsconfig @@ -0,0 +1,6 @@ +{ + "version": "1.0", + "components": [ + "Microsoft.VisualStudio.Workload.ManagedGame" + ] +} diff --git a/JoystickVisualizer/Assets/JoystickVisualizerSettings.lighting b/JoystickVisualizer/Assets/JoystickVisualizerSettings.lighting index dadf06c..aced91a 100644 Binary files a/JoystickVisualizer/Assets/JoystickVisualizerSettings.lighting and b/JoystickVisualizer/Assets/JoystickVisualizerSettings.lighting differ diff --git a/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat b/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat index b33148f..42e5713 100644 Binary files a/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat and b/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_002.mat differ diff --git a/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat b/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat index 10966ff..58513d7 100644 Binary files a/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat and b/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_008.mat differ diff --git a/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat b/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat index 0ee4625..d463bc8 100644 Binary files a/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat and b/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-Color_009.mat differ diff --git a/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat b/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat index 300b03b..c690e46 100644 Binary files a/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat and b/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-TM Warthog Trottle.mat differ diff --git a/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat b/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat index 109cbf3..4b3cc0e 100644 Binary files a/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat and b/JoystickVisualizer/Assets/Models/HOTAS Warthog/Materials/Throttle - HOTAS Warthog-[Color_007]1.mat differ diff --git a/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4.meta b/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4.meta new file mode 100644 index 0000000..b8834f0 --- /dev/null +++ b/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1853f76ebf006514abb831113f04957f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4/ThrustmasterTFlightHOTAS4Stick.cs b/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4/ThrustmasterTFlightHOTAS4Stick.cs new file mode 100644 index 0000000..64dd648 --- /dev/null +++ b/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4/ThrustmasterTFlightHOTAS4Stick.cs @@ -0,0 +1,63 @@ +using Assets; +using System.Collections.Generic; +using UnityEngine; + +public class ThrustmasterTFlightHOTAS4Stick : MonoBehaviour { + public const string USB_ID = "044f:b67c"; + //public const string USB_ID = "044f:b108"; + //public const string USB_ID = "044f:0402"; + + public GameObject Model; + public GameObject Joystick; + + // Use this for initialization + void Start() + { + UDPListener.StickEventListener += StickEvent; + } + + // Update is called once per frame + void Update() + { + } + + void StickEvent(JoystickState state) + { + if (state.UsbID != USB_ID) + { + return; + } + + Model.SetActive(true); + + foreach (KeyValuePair entry in state.Data) + { + switch (entry.Key) + { + case "Connected": + if (Model.activeInHierarchy) + Model.SetActive(entry.Value == 1); + break; + + case "X": + Joystick.transform.localEulerAngles = new Vector3(Joystick.transform.localEulerAngles.x, Joystick.transform.localEulerAngles.y, ConvertRange(entry.Value, 0, 65535, 20, -20)); + break; + case "Y": + Joystick.transform.localEulerAngles = new Vector3(ConvertRange(entry.Value, 0, 65535, 20, -20), Joystick.transform.localEulerAngles.y, Joystick.transform.localEulerAngles.z); + break; + case "RotationZ": + Joystick.transform.localEulerAngles = new Vector3(Joystick.transform.localEulerAngles.x, ConvertRange(entry.Value, 0, 65535, -30, 30), Joystick.transform.localEulerAngles.z); + break; + } + } + } + + public static float ConvertRange( + double value, // value to convert + double originalStart, double originalEnd, // original range + double newStart, double newEnd) // desired range + { + double scale = (double)(newEnd - newStart) / (originalEnd - originalStart); + return (float)(newStart + ((value - originalStart) * scale)); + } +} diff --git a/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4/ThrustmasterTFlightHOTAS4Stick.cs.meta b/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4/ThrustmasterTFlightHOTAS4Stick.cs.meta new file mode 100644 index 0000000..a6142b8 --- /dev/null +++ b/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4/ThrustmasterTFlightHOTAS4Stick.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3361634c0b45754b84a8085a8306a63 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4/ThrustmasterTFlightHOTAS4Throttle.cs b/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4/ThrustmasterTFlightHOTAS4Throttle.cs new file mode 100644 index 0000000..2a8439c --- /dev/null +++ b/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4/ThrustmasterTFlightHOTAS4Throttle.cs @@ -0,0 +1,72 @@ +using Assets; +using System; +using System.Collections.Generic; +using UnityEngine; + +public class ThrustmasterTFlightHOTAS4Throttle : MonoBehaviour { + public const string USB_ID = "044f:b67c"; + //public const string USB_ID = "044f:b108"; + //public const string USB_ID = "044f:0404"; + + public GameObject Model; + public GameObject LeftThrottle; + public GameObject RightThrottle; + + private int ZVal = 32767; + private int Slider0Val = 32767; + + // Use this for initialization + void Start() + { + UDPListener.StickEventListener += StickEvent; + } + + // Update is called once per frame + void Update() + { + } + + void StickEvent(JoystickState state) + { + if (state.UsbID != USB_ID) + { + return; + } + + Model.SetActive(true); + + foreach (KeyValuePair entry in state.Data) + { + switch (entry.Key) + { + case "Connected": + if (Model.activeInHierarchy) + Model.SetActive(entry.Value == 1); + break; + + case "Z": + ZVal = entry.Value; + break; + + case "Sliders0": + Slider0Val = entry.Value; + break; + } + + int LeftValue = Math.Max(0, Math.Min(65535, ZVal + (Slider0Val - 32767) / 2)); + int RightValue = Math.Max(0, Math.Min(65535, ZVal - (Slider0Val - 32767) / 2)); + + RightThrottle.transform.localEulerAngles = new Vector3(ConvertRange(RightValue, 0, 65535, 30, -30), RightThrottle.transform.localEulerAngles.y, RightThrottle.transform.localEulerAngles.z); + LeftThrottle.transform.localEulerAngles = new Vector3(ConvertRange(LeftValue, 0, 65535, 30, -30), LeftThrottle.transform.localEulerAngles.y, LeftThrottle.transform.localEulerAngles.z); + } + } + + public static float ConvertRange( + double value, // value to convert + double originalStart, double originalEnd, // original range + double newStart, double newEnd) // desired range + { + double scale = (double)(newEnd - newStart) / (originalEnd - originalStart); + return (float)(newStart + ((value - originalStart) * scale)); + } +} diff --git a/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4/ThrustmasterTFlightHOTAS4Throttle.cs.meta b/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4/ThrustmasterTFlightHOTAS4Throttle.cs.meta new file mode 100644 index 0000000..a0ae4ef --- /dev/null +++ b/JoystickVisualizer/Assets/Models/Thrustmaster T.Flight HOTAS 4/ThrustmasterTFlightHOTAS4Throttle.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0d052ff860e85bb44acbc8ac7c46c00c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/JoystickVisualizer/Assets/Scenes/JoystickVisualizer.unity b/JoystickVisualizer/Assets/Scenes/JoystickVisualizer.unity index ea895ff..1ffe6fc 100644 Binary files a/JoystickVisualizer/Assets/Scenes/JoystickVisualizer.unity and b/JoystickVisualizer/Assets/Scenes/JoystickVisualizer.unity differ diff --git a/JoystickVisualizer/ProjectSettings/InputManager.asset b/JoystickVisualizer/ProjectSettings/InputManager.asset index 5799a17..358935b 100644 Binary files a/JoystickVisualizer/ProjectSettings/InputManager.asset and b/JoystickVisualizer/ProjectSettings/InputManager.asset differ diff --git a/JoystickVisualizer/ProjectSettings/PackageManagerSettings.asset b/JoystickVisualizer/ProjectSettings/PackageManagerSettings.asset index 8a409a7..102c612 100644 --- a/JoystickVisualizer/ProjectSettings/PackageManagerSettings.asset +++ b/JoystickVisualizer/ProjectSettings/PackageManagerSettings.asset @@ -12,18 +12,19 @@ MonoBehaviour: m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} m_Name: m_EditorClassIdentifier: - m_EnablePreviewPackages: 0 + m_EnablePreReleasePackages: 0 m_EnablePackageDependencies: 0 m_AdvancedSettingsExpanded: 1 m_ScopedRegistriesSettingsExpanded: 1 + m_SeeAllPackageVersions: 0 oneTimeWarningShown: 0 m_Registries: - m_Id: main m_Name: - m_Url: https://staging-packages.unity.com + m_Url: https://packages.unity.com m_Scopes: [] m_IsDefault: 1 - m_Capabilities: 0 + m_Capabilities: 7 m_UserSelectedRegistryName: m_UserAddingNewScopedRegistry: 0 m_RegistryInfoDraft: @@ -41,3 +42,4 @@ MonoBehaviour: m_Scopes: - m_SelectedScopeIndex: 0 + m_LoadAssets: 0 diff --git a/JoystickVisualizer/ProjectSettings/ProjectSettings.asset b/JoystickVisualizer/ProjectSettings/ProjectSettings.asset index bd76f78..875f8ae 100644 Binary files a/JoystickVisualizer/ProjectSettings/ProjectSettings.asset and b/JoystickVisualizer/ProjectSettings/ProjectSettings.asset differ diff --git a/JoystickVisualizer/ProjectSettings/QualitySettings.asset b/JoystickVisualizer/ProjectSettings/QualitySettings.asset index ee2f339..5b385fd 100644 Binary files a/JoystickVisualizer/ProjectSettings/QualitySettings.asset and b/JoystickVisualizer/ProjectSettings/QualitySettings.asset differ diff --git a/JoystickVisualizer/UserSettings/EditorUserSettings.asset b/JoystickVisualizer/UserSettings/EditorUserSettings.asset index b48ae81..c863cae 100644 --- a/JoystickVisualizer/UserSettings/EditorUserSettings.asset +++ b/JoystickVisualizer/UserSettings/EditorUserSettings.asset @@ -12,11 +12,14 @@ EditorUserSettings: value: 224247031146467102171f36192054261f040d2b20213c353f67083debf42d flags: 0 RecentlyUsedScenePath-2: - value: 22424703114646680e0b0227036c751f0f040c232f2310393e3c1c3febfa312aacf238e0f323 + value: 224247031146467508193a2b03365e1c1f0d1d38623d28393930 flags: 0 RecentlyUsedScenePath-3: value: 22424703114646680e0b0227036c72111f19352f223d68252320092a flags: 0 + RecentlyUsedScenePath-4: + value: 22424703114646680e0b0227036c751f0f040c232f2310393e3c1c3febfa312aacf238e0f323 + flags: 0 UnityEditor.ShaderGraph.FloatingWindowsLayout: value: 181344140043005e1a220d3b1f364b524c0c5a27130c293326201334cee5322ca0bd30e8eb293a707b0fd0180b3d0a36fc0d3d04e649500d1002ee0b5dbd1d2c27c00ad113cb1e10e41f1addc80993b98c9884a69ae6d8f0d1cda9e8fbfefaf9f9dea3fdb9ade882f0fbb0e1e380cafbf2c3adc18e9cd285a2908b80e88a9c8395949c9483d3888c97ddbd90eed2a5a892a2af949aa48bafb19f85bd75a7ed3a7d25658598b7b58bb4b76aaf777690ca2863946c72c6cd81b6b6708f9f879f88769589d91c8f888e64d20f935e796571755c6b546677696a486c781c073c713d756a66771753783a27353f4c504172674347264e2e7a16016a711e4d7d5f686758400216064d1b4f487873735e6d726f6b3f577c7d47786579002d5170ed3627f73426d6f730ff32e8f9df0bea067daaedb5e048565b50474359b151db824e4b94905899da07 flags: 0 diff --git a/JoystickVisualizer/UserSettings/Search.index b/JoystickVisualizer/UserSettings/Search.index new file mode 100644 index 0000000..299c246 --- /dev/null +++ b/JoystickVisualizer/UserSettings/Search.index @@ -0,0 +1,13 @@ +{ + "name": "Assets", + "roots": ["Assets"], + "includes": [], + "excludes": ["Temp/", "External/"], + "options": { + "types": true, + "properties": false, + "extended": false, + "dependencies": false + }, + "baseScore": 999 +} \ No newline at end of file diff --git a/JoystickVisualizer/UserSettings/Search.settings b/JoystickVisualizer/UserSettings/Search.settings index 9e26dfe..c312032 100644 --- a/JoystickVisualizer/UserSettings/Search.settings +++ b/JoystickVisualizer/UserSettings/Search.settings @@ -1 +1,60 @@ -{} \ No newline at end of file +trackSelection = true +fetchPreview = true +wantsMore = false +keepOpen = false +itemIconSize = 1 +queryFolder = "Assets" +onBoardingDoNotAskAgain = true +showPackageIndexes = false +showStatusBar = false +scopes = { + "last_search.785D90A9" = "deep profile" + "asset.785D90A9" = "True" + "menu.785D90A9" = "True" + "scene.785D90A9" = "True" + "settings.785D90A9" = "True" + "m_ShownPanels.785D90A9" = "3" + "m_SideBarSplitter.785D90A9" = "180" + "m_DetailsPanelSplitter.785D90A9" = "700" + "currentGroup.785D90A9" = "all" +} +providers = { + asset = { + active = true + priority = 25 + defaultAction = null + } + store = { + active = true + priority = 100 + defaultAction = null + } + find = { + active = true + priority = 25 + defaultAction = null + } + log = { + active = false + priority = 210 + defaultAction = null + } + packages = { + active = true + priority = 90 + defaultAction = null + } + scene = { + active = true + priority = 50 + defaultAction = null + } + query = { + active = true + priority = 100 + defaultAction = null + } +} +recentSearches = [ +] +savedSearchesSortOrder = 0 \ No newline at end of file