Skip to content
This repository was archived by the owner on Feb 28, 2025. It is now read-only.

Commit 075bc7d

Browse files
authored
Fix popped-out windows sometimes getting bugged
2 parents 88d21f9 + 2aa0f9d commit 075bc7d

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

MicroEngineerProject/MicroEngineer/Entries/BodyEntries.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public ReferenceBodyConstants_StandardGravitationParameter()
5858
Category = MicroEntryCategory.Body;
5959
IsDefault = false;
6060
BaseUnit = "μ";
61-
NumberOfDecimalDigits = 4;
61+
NumberOfDecimalDigits = 3;
6262
Formatting = "e";
6363
}
6464

MicroEngineerProject/MicroEngineer/Managers/UI.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private void OnGUI_Flight()
6464

6565
if (!ShowGuiFlight || Utility.ActiveVessel == null) return;
6666

67-
MainGuiWindow mainGui = (MainGuiWindow)Windows.Find(w => w is MainGuiWindow); // window => window.MainWindow == MainWindow.MainGui);
67+
MainGuiWindow mainGui = (MainGuiWindow)Windows.Find(w => w is MainGuiWindow);
6868

6969
// Draw main GUI that contains docked windows
7070
mainGui.FlightRect = GUILayout.Window(
@@ -96,11 +96,10 @@ private void OnGUI_Flight()
9696
// If window is locked set alpha to 20%
9797
if (window.IsLocked)
9898
GUI.color = new Color(GUI.color.r, GUI.color.g, GUI.color.b, 0.2f);
99-
10099
window.FlightRect = GUILayout.Window(
101-
index,
100+
GUIUtility.GetControlID(FocusType.Passive),
102101
window.FlightRect,
103-
DrawPopoutWindow,
102+
(id) => DrawPopoutWindow(window),
104103
"",
105104
Styles.PopoutWindowStyle,
106105
GUILayout.Height(0),
@@ -345,11 +344,8 @@ private void FillMainGUI(int windowID)
345344
/// Draws all windows that are toggled and popped out
346345
/// </summary>
347346
/// <param name="windowIndex"></param>
348-
private void DrawPopoutWindow(int windowIndex)
347+
private void DrawPopoutWindow(EntryWindow w)
349348
{
350-
List<EntryWindow> entryWindows = Windows.FindAll(w => w is EntryWindow).Cast<EntryWindow>().ToList();
351-
EntryWindow w = Windows.FindAll(w => w is EntryWindow).Cast<EntryWindow>().ToList()[windowIndex];
352-
353349
GUILayout.Space(-5);
354350
DrawSectionHeader(w.Name, ref w.IsFlightPoppedOut, w.IsLocked);
355351

MicroEngineerProject/MicroEngineer/MicroEngineerMod.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
namespace MicroMod
1010
{
11-
[BepInPlugin("com.micrologist.microengineer", "MicroEngineer", "1.0.1")]
11+
[BepInPlugin("com.micrologist.microengineer", "MicroEngineer", "1.0.2")]
1212
[BepInDependency(SpaceWarpPlugin.ModGuid, SpaceWarpPlugin.ModVer)]
1313
public class MicroEngineerMod : BaseSpaceWarpPlugin
1414
{

Staging/BepInEx/plugins/micro_engineer/swinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "Micro Engineer",
55
"description": "Get in-flight and VAB information about your current vessel",
66
"source": "https://github.com/Micrologist/MicroEngineer",
7-
"version": "1.0.1",
7+
"version": "1.0.2",
88
"version_check": "https://raw.githubusercontent.com/Micrologist/MicroEngineer/main/Staging/BepInEx/plugins/micro_engineer/swinfo.json",
99
"dependencies": [
1010
{

0 commit comments

Comments
 (0)