public static void CheckoutVessel(WorkshopManager workshop_manager) { if (workshop_manager.Vessel == null) { return; } Workshops.Remove(workshop_manager.VesselID); DisplayOrder.Remove(workshop_manager.DisplayID); }
public static void CheckinVessel(WorkshopManager workshop_manager) { if (workshop_manager.Vessel == null || workshop_manager.Empty) { return; } Workshops[workshop_manager.VesselID] = workshop_manager; remove_display_entry(workshop_manager.VesselID); DisplayOrder[workshop_manager.DisplayID] = workshop_manager.VesselID; }
void main_window(int WindowID) { GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); if (CelestialBodies.Count > 0) { GUILayout.BeginVertical(); cb_scroll = GUILayout.BeginScrollView(cb_scroll, GUILayout.Height(height), GUILayout.Width(cb_width + 10)); foreach (var cb in CelestialBodies) { if (GUILayout.Button(new GUIContent(cb, "Show workshops on " + cb), CelestialBodyTab == cb? Styles.enabled : Styles.active, GUILayout.Width(cb_width))) { CelestialBodyTab = cb; } } GUILayout.EndScrollView(); GUILayout.EndVertical(); GUILayout.BeginVertical(Styles.white); workshops_scroll = GUILayout.BeginScrollView(workshops_scroll, GUILayout.Height(height), GUILayout.Width(workshops_width)); foreach (var item in DisplayOrder.Values) { var info = Workshops[item]; if (info.CB != CelestialBodyTab) { continue; } GUILayout.BeginHorizontal(); info.Draw(); if (info.IsActive) { GUILayout.Label(new GUIContent("◉", "This is the active vessel"), Styles.inactive, GUILayout.ExpandWidth(false)); } else if (GUILayout.Button(new GUIContent("◉", "Switch to this workshop"), Styles.enabled_button, GUILayout.ExpandWidth(false))) { switchto = info; } GUILayout.EndHorizontal(); } GUILayout.EndScrollView(); GUILayout.EndVertical(); } else { GUILayout.Label("No Operational Workshops", Styles.white, GUILayout.ExpandWidth(true)); } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); Utils.ButtonSwitch("Show Deploy Hints", ref ShowDeployHint, "Draw visual cues to help position a DIY Kit", GUILayout.ExpandWidth(false)); GUILayout.FlexibleSpace(); if (GUILayout.Button("Close", Styles.close_button, GUILayout.ExpandWidth(false))) { show_window = false; } GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUIWindowBase.TooltipsAndDragWindow(); }