private void Window(int id) { GUI.DragWindow(drag); this.settings.autoArm = GUILayout.Toggle(this.settings.autoArm, "Automatically arm when staging", this.skins.toggle); this.settings.jokeActivated = GUILayout.Toggle(this.settings.jokeActivated, "Activate April Fools' joke (USE AT OWN RISK)", this.skins.toggle); this.settings.guiResizeUpdates = GUILayout.Toggle(this.settings.guiResizeUpdates, "Part GUI resize updates canopy size", this.skins.toggle); this.settings.mustBeEngineer = GUILayout.Toggle(this.settings.mustBeEngineer, "Only engineers can repack in career", this.skins.toggle); if (!this.settings.mustBeEngineer) { GUI.enabled = false; } GUIUtils.CreateEntryArea("Engineer minimum level to repack:", ref this.level, 0, 5, 100); if (!this.settings.mustBeEngineer) { GUI.enabled = true; } GUIUtils.CenteredButton("Close", CloseWindow, 100); }
//Info window private void Window(int id) { //Header GUI.DragWindow(this.drag); GUILayout.BeginVertical(); //Top info labels StringBuilder builder = new StringBuilder("Part name: ").AppendLine(this.part.partInfo.title); builder.Append("Symmetry counterparts: ").AppendLine(this.part.symmetryCounterparts.Count.ToString()); builder.Append("Part mass: ").Append(this.part.TotalMass().ToString("0.###")).Append("t"); GUILayout.Label(builder.ToString(), this.skins.label); //Beggining scroll this.scroll = GUILayout.BeginScrollView(this.scroll, false, false, this.skins.horizontalScrollbar, this.skins.verticalScrollbar, this.skins.box); GUILayout.Space(5); GUILayout.Label("General:", GUIUtils.boldLabel, GUILayout.Width(120)); //General labels builder = new StringBuilder("Autocut speed: ").Append(cutSpeed).AppendLine("m/s"); if (this.timer >= 60) { builder.Append("Deployment timer: ").AppendLine(RCUtils.ToMinutesSeconds(this.timer)); } else if (this.timer > 0) { builder.Append("Deployment timer: ").Append(this.timer.ToString("0.#")).AppendLine("s"); } if (this.mustGoDown) { builder.AppendLine("Must go downwards to deploy"); } if (this.deployOnGround) { builder.AppendLine("Automatically deploys on ground contact"); } if (this.spareChutes >= 0) { builder.Append("Spare chutes: ").Append(chuteCount); } else { builder.Append("Spare chutes: inf"); } GUILayout.Label(builder.ToString(), this.skins.label); //Specific labels for (int i = 0; i < this.parachutes.Count; i++) { GUILayout.Label("___________________________________________", GUIUtils.boldLabel); GUILayout.Space(3); GUILayout.Label(RCUtils.ParachuteNumber(i) + ":", GUIUtils.boldLabel, GUILayout.Width(120)); this.parachutes[i].UpdateGUI(); } //End scroll GUILayout.EndScrollView(); //Copy button if in flight if (HighLogic.LoadedSceneIsFlight && this.part.symmetryCounterparts.Count > 0) { GUIUtils.CenteredButton("Copy to others chutes", CopyToCouterparts); } //Close button GUIUtils.CenteredButton("Close", () => this.visible = false); //Closer GUILayout.EndVertical(); }