From debf6caa4602e57a60874d219705c77385a8ea55 Mon Sep 17 00:00:00 2001 From: asarium Date: Sun, 11 Aug 2013 19:58:21 +0200 Subject: [PATCH 1/3] Actually display the glideslope values from the config. --- PAPIPlugin/Impl/PAPITypeManager.cs | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/PAPIPlugin/Impl/PAPITypeManager.cs b/PAPIPlugin/Impl/PAPITypeManager.cs index ea26484..4d9fa2b 100644 --- a/PAPIPlugin/Impl/PAPITypeManager.cs +++ b/PAPIPlugin/Impl/PAPITypeManager.cs @@ -23,6 +23,10 @@ public class PAPITypeManager : ILightTypeManager private bool _guiInitialized = false; + private double _initialGlideslopeValue = PAPIArray.DefaultTargetGlidePath; + + private double _initialTargetGlideslopeValue = PAPIArray.DefaultGlideslopeTolerance; + #region ILightTypeManager Members public void Initialize(ILightGroup group) @@ -31,26 +35,33 @@ public void Initialize(ILightGroup group) foreach (var lightArray in group.LightArrays.OfType()) { - Util.LogInfo(lightArray); _papiArrays.Add(lightArray); + + _initialTargetGlideslopeValue = lightArray.GlideslopeTolerance; + _initialGlideslopeValue = lightArray.TargetGlideslope; } group.LightArrayAdded += (sender, arguments) => - { - var papi = arguments.Array as PAPIArray; - if (papi != null) { + var papi = arguments.Array as PAPIArray; + if (papi == null) + { + return; + } + _papiArrays.Add(papi); - } - }; + + _initialTargetGlideslopeValue = papi.GlideslopeTolerance; + _initialGlideslopeValue = papi.TargetGlideslope; + }; } public void OnGui(int windowID) { if (!_guiInitialized) { - _glideslopeField = new EditableGUIField(PAPIArray.DefaultTargetGlidePath, DoubleConvertDelegate); - _glideslopeToleranceField = new EditableGUIField(PAPIArray.DefaultGlideslopeTolerance, DoubleConvertDelegate); + _glideslopeField = new EditableGUIField(_initialGlideslopeValue, DoubleConvertDelegate); + _glideslopeToleranceField = new EditableGUIField(_initialTargetGlideslopeValue, DoubleConvertDelegate); _guiInitialized = true; } @@ -63,7 +74,7 @@ public void OnGui(int windowID) #endregion - private void DoDegreeField(string name, EditableGUIField field) + private static void DoDegreeField(string name, EditableGUIField field) { GUILayout.BeginHorizontal(); { From 1ae9812888dcdcf98ed94faed6bbe2681ed9ec99 Mon Sep 17 00:00:00 2001 From: asarium Date: Sun, 11 Aug 2013 19:59:07 +0200 Subject: [PATCH 2/3] Sync the two PAPI array values. --- assets/GameData/PAPIPlugin/lights.cfg | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/assets/GameData/PAPIPlugin/lights.cfg b/assets/GameData/PAPIPlugin/lights.cfg index ea467e4..40cbf50 100644 --- a/assets/GameData/PAPIPlugin/lights.cfg +++ b/assets/GameData/PAPIPlugin/lights.cfg @@ -31,5 +31,13 @@ LightGroup Longitude = -74.511944 Heading = 90 + + // Example values + GlideslopeTolerance = 1.5 + TargetGlideslope = 6 + HeightAboveTerrain = 5 + PartCount = 4 + LightRadius = 8 + LightDistance = 6 } } From 3a5f50846269ad173a73419a7fa70dd5ad40bd98 Mon Sep 17 00:00:00 2001 From: asarium Date: Fri, 18 Oct 2013 10:57:47 +0200 Subject: [PATCH 3/3] Fix placement for 0.22 --- assets/GameData/PAPIPlugin/lights.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/GameData/PAPIPlugin/lights.cfg b/assets/GameData/PAPIPlugin/lights.cfg index 40cbf50..61e9fc6 100644 --- a/assets/GameData/PAPIPlugin/lights.cfg +++ b/assets/GameData/PAPIPlugin/lights.cfg @@ -8,7 +8,7 @@ LightGroup Type = PAPIArray Namespace = PAPIPlugin.Arrays - Latitude = -0.0468 + Latitude = -0.054 Longitude = -74.701944 Heading = 270 @@ -27,7 +27,7 @@ LightGroup Type = PAPIArray Namespace = PAPIPlugin.Arrays - Latitude = -0.036 + Latitude = -0.044 Longitude = -74.511944 Heading = 90