diff --git a/ChangeLog.txt b/ChangeLog.txt index 74e0b92..a02a4fe 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,9 @@ ChangeLog +0.5.0.4 + Fixed issue with symmetric parts config window + Fixed issue with showing config window for multiple parts + 0.5.0.3 Fixed missing rope when returning to vessel (using AirPark) diff --git a/GameData/KerBalloons/KerBalloons.version b/GameData/KerBalloons/KerBalloons.version index 4b7c864..05308de 100644 --- a/GameData/KerBalloons/KerBalloons.version +++ b/GameData/KerBalloons/KerBalloons.version @@ -11,7 +11,7 @@ "MAJOR": 0, "MINOR": 5, "PATCH": 0, - "BUILD": 2 + "BUILD": 3 }, "KSP_VERSION": { "MAJOR": 1, diff --git a/KerBalloons.version b/KerBalloons.version index 05308de..a3dff74 100644 --- a/KerBalloons.version +++ b/KerBalloons.version @@ -11,7 +11,7 @@ "MAJOR": 0, "MINOR": 5, "PATCH": 0, - "BUILD": 3 + "BUILD": 4 }, "KSP_VERSION": { "MAJOR": 1, diff --git a/Kerballoons/AssemblyVersion.cs b/Kerballoons/AssemblyVersion.cs index 71f32a3..b6188fd 100644 --- a/Kerballoons/AssemblyVersion.cs +++ b/Kerballoons/AssemblyVersion.cs @@ -5,4 +5,4 @@ using System.Reflection; - [assembly: AssemblyVersion("0.5.0.2")] + [assembly: AssemblyVersion("0.5.0.3")] diff --git a/Kerballoons/ModuleKerBalloon.cs b/Kerballoons/ModuleKerBalloon.cs index c918d1c..f12e2e3 100644 --- a/Kerballoons/ModuleKerBalloon.cs +++ b/Kerballoons/ModuleKerBalloon.cs @@ -175,16 +175,31 @@ public override void OnStart(StartState state) int winId = WindowHelper.NextWindowId("ModuleKerBalloonConfig"); int infoId = WindowHelper.NextWindowId("ModuleKerBalloonInfo"); bool visibleShowInfo = false; - bool visible = false; + bool visibleConfig = false; [KSPEvent(guiActive = false, guiActiveEditor = true, guiName = "Configure Balloon")] public void ConfigureBalloon() { - ConfigureWinPos(); + ConfigureWinPos(true); } - void ConfigureWinPos() + static readonly object locked = new object(); + + void ConfigureWinPos(bool ignoreLock = false) { - visible = true; + if (!ignoreLock) + { + uint activePartId = part.persistentId; + lock (locked) + { + foreach (var p in part.symmetryCounterparts) + { + if (p.persistentId < activePartId) + return; + } + } + } + winId = WindowHelper.NextWindowId("ModuleKerBalloonConfig" + part.persistentId); + visibleConfig = true; winRect.x = Mouse.screenPos.x; winRect.y = Mouse.screenPos.y; @@ -200,7 +215,7 @@ void OnGUI() GUI.skin = HighLogic.Skin; infoRect = ClickThruBlocker.GUILayoutWindow(infoId, infoRect, InfoBalloonWin, "KerBalloon"); } - if (visible && HighLogic.LoadedSceneIsEditor) + if (visibleConfig && HighLogic.LoadedSceneIsEditor) { if (!visibleShowInfo && !HighLogic.CurrentGame.Parameters.CustomParams().altskin) GUI.skin = HighLogic.Skin; @@ -263,6 +278,8 @@ void SetValues(BalloonInfo b) List availPayloads = new List(); int selectedPayload = 0; + + void ConfigBalloonWin(int id) { GUILayout.BeginHorizontal(); @@ -337,7 +354,7 @@ void ConfigBalloonWin(int id) } GUILayout.FlexibleSpace(); if (GUILayout.Button("Close")) - visible = false; + visibleConfig = false; GUI.DragWindow(); } @@ -580,6 +597,8 @@ static public GameObject getChildGameObject(GameObject fromGameObject, string wi public void ShowInfo() { visibleShowInfo = !visibleShowInfo; + availPlanets.Clear(); + availPayloads.Clear(); } Vector2 infoPos;