private void Window(int id) { GUI.DragWindow(this.drag); RealChuteSettings.Instance.AutoArm = GUILayout.Toggle(RealChuteSettings.Instance.AutoArm, "Automatically arm when staging"); RealChuteSettings.Instance.JokeActivated = GUILayout.Toggle(RealChuteSettings.Instance.JokeActivated, "Activate April Fools' joke (DANGER!!)"); RealChuteSettings.Instance.ActivateNyan = GUILayout.Toggle(RealChuteSettings.Instance.ActivateNyan, "Activate NyanMode™"); RealChuteSettings.Instance.GuiResizeUpdates = GUILayout.Toggle(RealChuteSettings.Instance.GuiResizeUpdates, "Part GUI resize updates canopy size"); RealChuteSettings.Instance.MustBeEngineer = GUILayout.Toggle(RealChuteSettings.Instance.MustBeEngineer, "Only engineers can repack in career"); if (!RealChuteSettings.Instance.MustBeEngineer) { GUI.enabled = false; } GuiUtils.CreateEntryArea("Engineer minimum level to repack:", ref this.level, 0, 5, 100); 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()); //Beginning scroll this.scroll = GUILayout.BeginScrollView(this.scroll, false, false, GUI.skin.horizontalScrollbar, GUI.skin.verticalScrollbar, GUI.skin.box); GUILayout.Space(5); GUILayout.Label("General:", GuiUtils.BoldLabel, GUILayout.Width(120)); //General labels builder = new StringBuilder("Autocut speed: ").Append(this.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(this.chuteCount); } else { builder.Append("Spare chutes: inf"); } GUILayout.Label(builder.ToString()); //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].RenderGUI(); } //End scroll GUILayout.EndScrollView(); //Copy button if in flight if (HighLogic.LoadedSceneIsFlight && this.part.symmetryCounterparts.Count > 0) { GuiUtils.CenteredButton("Copy to others chutes", CopyToCounterparts); } //Close button GuiUtils.CenteredButton("Close", () => this.visible = false); //Closer GUILayout.EndVertical(); }