Jump to content

mspencer

Members
  • Posts

    4
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. So . . . I just created an RSS/RP-0 install, put my Kramax build with Aelfhe1m and linuxgugugamer's code changes, and found there's nothing for Earth. And I have nothing to do today (until a 1 AM conference bridge because apparently I have to learn our ops procedures for prod servers, because whee devops) so I'm prepared to make something today if it doesn't exist. First question: is this work already done? Is there a .cfg ready for Kramax to ingest which adds runways and waypoints for Earth as well as Kerbin? Second question: if not, is there an existing source for Earth navigation info, other than NACO data? (I don't have and won't be using Jeppesen charts) Are there KerbinSide-like mods for adding extra airports to RSS Earth that I should look into?
  2. 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.)
  3. Sorry for coming back with another question, but I think I've stumbled on a problem caused by the existing resize code. So far I've basically just done what you said, stealing parameters from other uses of BeginScrollBar() in the same file: Index: George.cs =================================================================== --- George.cs (revision 27) +++ George.cs (working copy) @@ -3986,7 +3986,8 @@ GUILayout.Label(String.Format("<no flight plans for {0}>", planet.name)); } else - { + { + GUILayout.BeginScrollView(Vector2.zero, GUIStyle.none, GeneralUI.UISkin.verticalScrollbar, GUILayout.Height(maxFlightPlanScrollbarHeight)); foreach (var fp in plans) { if (GUILayout.Button(new GUIContent(fp.name, fp.description), @@ -3995,6 +3996,7 @@ ApplyPlan(fp); } } + GUILayout.EndScrollView(); } if (Event.current.type == EventType.Repaint) I end up with a reasonably-sized scroll bar, with a scroll button that correctly represents the ratio of visible buttons to total buttons -- but the scroll bar doesn't do anything. If I double-click near the bottom of the scrollbar I get some very brief visible jumping of the scroll view contents. My hunch is the drag-to-resize code is constantly rebuilding the GUI when I'm trying to operate the scrollbar. Looking at George.cs lines 2881, 3050, 3189, and 3363, I think I need to stop dragId from being set non-zero if the horizontal position of the mouse on mouse-down appears to be in the flight plan list. I can see from 1230 and 1232 the widths are 300 and 200 px, but (since it's so painful to recompile, load my mod-laden KSP, and retest) are those coordinates window-local or screen-local? Sorry for being full of noob here...
  4. I've got this problem as well, but I found a workaround: One could always just accept some contracts, exit and reconfigure flight plans, and then load the game again. I've got Kramax open in Visual Studio and am trying to get up to speed. (I'm a professional C# dev of about 5 years but (a) I have very little Unity experience, and (b) my track record for home projects is really poor, as I seem to finish like 5% of the things I start.) If anyone is familiar with the source, how would you recommend I go about changing the flight plan view to add a scroll bar, in twenty words or less? I'll go fish for details and figure things out, but I'd prefer someone experienced recommend a starting point.
×
×
  • Create New...