From 21c144c50a15e097dc6ab43beb294a159ec3b361 Mon Sep 17 00:00:00 2001 From: LM <33723142+Lord-Mustang@users.noreply.github.com> Date: Sat, 10 Sep 2022 02:33:20 +0200 Subject: [PATCH 1/4] Ka-50: Fixed collimator borders clipping of HUD Fixed clipping by the collimator borders on the Ka-50's HUD by adjusting the render position of the HUD-only viewport. Patch generated on 002_007_00017_29493_00000 Steam openbeta. --- .../aircraft/Ka-50/Cockpit/Scripts/device_init.lua.gpatch | 4 ++++ .../aircraft/Ka-50/Cockpit/Scripts/device_init.lua.grevert | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 Patching/Patches/DCS/002_007_00016_28111_00000/Viewports/Mods/aircraft/Ka-50/Cockpit/Scripts/device_init.lua.gpatch create mode 100644 Patching/Patches/DCS/002_007_00016_28111_00000/Viewports/Mods/aircraft/Ka-50/Cockpit/Scripts/device_init.lua.grevert diff --git a/Patching/Patches/DCS/002_007_00016_28111_00000/Viewports/Mods/aircraft/Ka-50/Cockpit/Scripts/device_init.lua.gpatch b/Patching/Patches/DCS/002_007_00016_28111_00000/Viewports/Mods/aircraft/Ka-50/Cockpit/Scripts/device_init.lua.gpatch new file mode 100644 index 000000000..3ac63744f --- /dev/null +++ b/Patching/Patches/DCS/002_007_00016_28111_00000/Viewports/Mods/aircraft/Ka-50/Cockpit/Scripts/device_init.lua.gpatch @@ -0,0 +1,4 @@ +@@ -24260,17 +24260,8 @@ + 0.0 +-499138832 + %7D%7D%7D%0D diff --git a/Patching/Patches/DCS/002_007_00016_28111_00000/Viewports/Mods/aircraft/Ka-50/Cockpit/Scripts/device_init.lua.grevert b/Patching/Patches/DCS/002_007_00016_28111_00000/Viewports/Mods/aircraft/Ka-50/Cockpit/Scripts/device_init.lua.grevert new file mode 100644 index 000000000..9ac90ca08 --- /dev/null +++ b/Patching/Patches/DCS/002_007_00016_28111_00000/Viewports/Mods/aircraft/Ka-50/Cockpit/Scripts/device_init.lua.grevert @@ -0,0 +1,4 @@ +@@ -24256,16 +24256,25 @@ + _l %3D 0.0 ++499138832 + %7D%7D%7D%0D%0Aind From 321bfe5caba4d1e9e9ea1997dabaca3a777392e3 Mon Sep 17 00:00:00 2001 From: LM <33723142+Lord-Mustang@users.noreply.github.com> Date: Sun, 25 Sep 2022 19:44:19 +0200 Subject: [PATCH 2/4] Added a bew ClickType LinearClickTypeDirectional, which can be used for linear controls that require directional input --- Helios/Controls/ClickType.cs | 14 ++++++++++++++ Helios/Controls/Metric.cs | 12 ++++++------ Helios/Controls/PotentiometerWithTranslate.cs | 6 +++--- .../PotentiometerWithTranslateBehaviorEditor.xaml | 2 +- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Helios/Controls/ClickType.cs b/Helios/Controls/ClickType.cs index d8ed5cdf1..948bcf4d8 100644 --- a/Helios/Controls/ClickType.cs +++ b/Helios/Controls/ClickType.cs @@ -48,4 +48,18 @@ public enum LinearClickType [Description("Swipe over the control in the direction it should move")] Swipe, } + + /// + /// interaction styles for linear controls that require a direction to work + /// + /// WARNING: these value names must never be changed, as they are serialized to Profile XML + /// + public enum LinearClickTypeDirectional + { + [Description("Touch the location towards which the control should move")] + Touch, + + [Description("Swipe over the control in the direction it should move")] + Swipe, + } } diff --git a/Helios/Controls/Metric.cs b/Helios/Controls/Metric.cs index ee09605f5..dce35b4bd 100644 --- a/Helios/Controls/Metric.cs +++ b/Helios/Controls/Metric.cs @@ -25,7 +25,7 @@ public abstract class Metric : HeliosVisual private bool _mouseDown = false; private Point _mouseDownLocation; - protected LinearClickType _clickType = LinearClickType.Swipe; + protected LinearClickTypeDirectional _clickType = LinearClickTypeDirectional.Swipe; private CalibrationPointCollectionDouble _swipeCalibration; private double _swipeThreshold = 10; private double _sensitivity = 0d; @@ -44,7 +44,7 @@ protected Metric ( string name, Size defaultSize ) #region Properties - public LinearClickType ClickType + public LinearClickTypeDirectional ClickType { get { @@ -54,7 +54,7 @@ public LinearClickType ClickType { if ( !_clickType.Equals( value ) ) { - LinearClickType oldValue = _clickType; + LinearClickTypeDirectional oldValue = _clickType; _clickType = value; OnPropertyChanged( "ClickType", oldValue, value, true ); } @@ -242,7 +242,7 @@ private double GetAngle ( Point startPoint, Point endPoint ) public override void MouseDown ( Point location ) { - if ( _clickType == LinearClickType.Touch ) + if ( _clickType == LinearClickTypeDirectional.Touch ) { if ( _clickableVertical ) { @@ -268,7 +268,7 @@ public override void MouseDown ( Point location ) // Parent.Profile.ProfileTick += new EventHandler( Profile_ProfileTick ); //} } - else if ( _clickType == LinearClickType.Swipe ) + else if ( _clickType == LinearClickTypeDirectional.Swipe ) { _mouseDown = true; _mouseDownLocation = location; @@ -301,7 +301,7 @@ void Profile_ProfileTick ( object sender, EventArgs e ) public override void MouseDrag ( Point location ) { - if ( _mouseDown && _clickType == LinearClickType.Swipe ) + if ( _mouseDown && _clickType == LinearClickTypeDirectional.Swipe ) { if ( DragOneForOne ) { diff --git a/Helios/Controls/PotentiometerWithTranslate.cs b/Helios/Controls/PotentiometerWithTranslate.cs index f984c7403..f7aeff219 100644 --- a/Helios/Controls/PotentiometerWithTranslate.cs +++ b/Helios/Controls/PotentiometerWithTranslate.cs @@ -679,7 +679,7 @@ public override void WriteXml ( XmlWriter writer ) writer.WriteStartElement( "ClickType" ); writer.WriteElementString( "Type", ClickType.ToString( ) ); - if ( ClickType == LinearClickType.Swipe ) + if ( ClickType == LinearClickTypeDirectional.Swipe ) { writer.WriteElementString( "Sensitivity", Sensitivity.ToString( CultureInfo.InvariantCulture ) ); } @@ -723,7 +723,7 @@ public override void ReadXml ( XmlReader reader ) if ( reader.Name.Equals( "ClickType" ) ) { reader.ReadStartElement( "ClickType" ); - ClickType = (LinearClickType)Enum.Parse( typeof( LinearClickType ), reader.ReadElementString( "Type" ) ); + ClickType = (LinearClickTypeDirectional)Enum.Parse( typeof( LinearClickTypeDirectional ), reader.ReadElementString( "Type" ) ); if (reader.Name == "Sensitivity") { Sensitivity = double.Parse( reader.ReadElementString( "Sensitivity" ), CultureInfo.InvariantCulture ); @@ -732,7 +732,7 @@ public override void ReadXml ( XmlReader reader ) } else { - ClickType = LinearClickType.Swipe; + ClickType = LinearClickTypeDirectional.Swipe; Sensitivity = 0d; } diff --git a/Helios/Controls/PotentiometerWithTranslateBehaviorEditor.xaml b/Helios/Controls/PotentiometerWithTranslateBehaviorEditor.xaml index 2e0ee57ca..c5a938e7a 100644 --- a/Helios/Controls/PotentiometerWithTranslateBehaviorEditor.xaml +++ b/Helios/Controls/PotentiometerWithTranslateBehaviorEditor.xaml @@ -10,7 +10,7 @@ DataContext="{Binding RelativeSource={RelativeSource Self}}" Height="609.143" Width="176.5"> - +