Thanks -- I was assuming these were setup, like InitializeComponent() in a WinForms app. It never occurred to me that the variable being passed in was state that might be changed.
This patch works for me, but there's no rush since I know you have a lot on your plate and you need to retest and tweak further. Or would you prefer a pull request? I could make an account for this.
Index: George.cs
===================================================================
--- George.cs (revision 27)
+++ George.cs (working copy)
@@ -1222,6 +1222,10 @@
Vector2 FlightPlanScrollbar = Vector2.zero;
public float flightPlanScrollHeight = 300;
public static float maxFlightPlanScrollbarHeight = 300;
+ private Vector2 FlightPlanPresetScrollbar = Vector2.zero;
+ //Unused since preset window is not resizable
+ public float flightPlanPresetScrollHeight = 300;
+ public static float maxFlightPlanPresetScrollbarHeight = 300;
float dragStart = 0;
float dragID = 0; // 0 = inactive, 1 = hdg, 2 = vert, 3 = thrt
@@ -3986,7 +3990,8 @@
GUILayout.Label(String.Format("<no flight plans for {0}>", planet.name));
}
else
- {
+ {
+ FlightPlanPresetScrollbar = GUILayout.BeginScrollView(FlightPlanPresetScrollbar, GUIStyle.none, GeneralUI.UISkin.verticalScrollbar, GUILayout.Height(Math.Min(flightPlanPresetScrollHeight, maxFlightPlanPresetScrollbarHeight)));
foreach (var fp in plans)
{
if (GUILayout.Button(new GUIContent(fp.name, fp.description),
@@ -3995,6 +4000,7 @@
ApplyPlan(fp);
}
}
+ GUILayout.EndScrollView();
}
if (Event.current.type == EventType.Repaint)
Thanks very much -- you guys literally did all the work for me. I claim no credit here.
(To be fair, I think anyone could handle copying and pasting five or six lines of code by hand. But I guess at work the job's not done until it's in source control, passes code review, and has been demoed -- "done, done, done" -- so I guess I had some silly anxiety about this not being in source control yet.)