private void DrawLaunchToGPS(float line) { GUIStyle guardStyle = islandRunway ? HighLogic.Skin.box : HighLogic.Skin.button; var saveRect = new Rect(LeftIndent * 1.5f, ContentTop + line * entryHeight, contentWidth * 0.9f, entryHeight); if (!gps) { if (GUI.Button(saveRect, "Launch to GPS", guardStyle)) { if (!launchSiteChanged) { launchSiteChanged = true; gps = true; EditorLogic.fetch.launchVessel(); } } } else { if (GUI.Button(saveRect, "Launch to GPS", guardStyle)) { ResetLaunchCoords(); } } }
private void DrawKerbiniAtol(float line) { GUIStyle guardStyle = KerbiniAtol ? HighLogic.Skin.box : HighLogic.Skin.button; var saveRect = new Rect(LeftIndent * 1.5f, ContentTop + line * entryHeight, contentWidth * 0.9f, entryHeight); if (!KerbiniAtol) { if (GUI.Button(saveRect, "Kerbini Atol", guardStyle)) { if (!launchSiteChanged) { launchSiteChanged = true; KerbiniAtol = true; EditorLogic.fetch.launchVessel(); } } } else { if (GUI.Button(saveRect, "Kerbini Atol", guardStyle)) { ResetLaunchCoords(); } } }
void SettingsWindowFcn(int windowID) { GUILayout.BeginHorizontal(); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label("Enter desired hotkey: "); GUILayout.Label(hotkey.ToString(), GUI.skin.textField); if (_lastKeyPressed != KeyCode.None) { hotkey = _lastKeyPressed; _lastKeyPressed = KeyCode.None; } // look at EEX GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("OK", GUILayout.Width(60))) { active = false; completed = true; } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); GUI.DragWindow(); }
protected void DrawTooltip() { if (ToolTip != null && ToolTip.Trim().Length > 0) { GUI.Label(tooltipRect, ToolTip, HighLogic.Skin.label); } }
/* * Overwrite Message */ private void HandleOverwriteDisplay(int windowID) { string welding_pathname = this.welding_pathname; // Caching the pathname GUILayout.BeginVertical(); GUILayout.BeginHorizontal(); GUILayout.Label(Constants.guiDialOverwrite); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.Label(welding_pathname); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); GUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button(Constants.guiOK)) { WriteCfg(welding_pathname); this.state = DisplayState.savedWindow; } if (GUILayout.Button(Constants.guiCancel)) { this.state = DisplayState.infoWindow; } GUILayout.EndVertical(); GUI.DragWindow(); } //private void OnErrorDisplay()
public void Draw() { if (isOpen) { position = GUI.Window(windowId, position, OnWindowGUI, $"Historian: v {Historian.Instance.AssemblyFileVersion}", HighLogic.Skin.window); } }
private void OnDraw() { Log.dbg("NavUtils: NavUtilLibApp.OnDraw()"); Log.dbg("HSI: OnDraw()"); if (CameraManager.Instance.currentCameraMode == CameraManager.CameraMode.Flight || ((CameraManager.Instance.currentCameraMode == CameraManager.CameraMode.Internal || CameraManager.Instance.currentCameraMode == CameraManager.CameraMode.IVA) && GlobalVariables.Settings.enableWindowsInIVA)) { if ((windowPosition.xMin + windowPosition.width) < 20) { windowPosition.xMin = 20 - windowPosition.width; } if (windowPosition.yMin + windowPosition.height < 20) { windowPosition.yMin = 20 - windowPosition.height; } if (windowPosition.xMin > Screen.width - 20) { windowPosition.xMin = Screen.width - 20; } if (windowPosition.yMin > Screen.height - 20) { windowPosition.yMin = Screen.height - 20; } windowPosition = new Rect(windowPosition.x, windowPosition.y, (int)(var.Settings.hsiPosition.width * var.Settings.hsiGUIscale), (int)(var.Settings.hsiPosition.height * var.Settings.hsiGUIscale) ); windowPosition = GUI.Window(-471466245, windowPosition, OnWindow, "Horizontal Situation Indicator"); } Log.dbg("{0}", windowPosition); }
private void DrawkscIslandNewHarbor(float line) { GUIStyle guardStyle = kscHarborEast ? HighLogic.Skin.box : HighLogic.Skin.button; var saveRect = new Rect(LeftIndent * 1.5f, ContentTop + line * entryHeight, contentWidth * 0.9f, entryHeight); if (!kscIslandNewHarbor) { if (GUI.Button(saveRect, "KSC Island Harbor", guardStyle)) { if (!launchSiteChanged) { launchSiteChanged = true; kscIslandNewHarbor = true; EditorLogic.fetch.launchVessel(); } } } else { if (GUI.Button(saveRect, "KSC Island Harbor", guardStyle)) { ResetLaunchCoords(); } } }
public static void DrawDiamond(Rect rect, Color color) { if (diamondTex == null) { CreateDiamondTex(); } // Save the current GUI matrix, since we're going to make changes to it. Matrix4x4 matrix = GUI.matrix; // Store current GUI color, so we can switch it back later, // and set the GUI color to the color parameter Color savedColor = GUI.color; GUI.color = color; // Finally, draw the actual line. // We're really only drawing a 1x1 texture from pointA. // The matrix operations done with ScaleAroundPivot and RotateAroundPivot will make this // render with the proper width, length, and angle. GUI.DrawTexture(rect, diamondTex); // We're done. Restore the GUI matrix and GUI color to whatever they were before. GUI.matrix = matrix; GUI.color = savedColor; }
void OnGUI() { if (toolbarButton != null) { if (HighLogic.CurrentGame.Parameters.CustomParams <AR>().useKSPSkin) { GUI.skin = HighLogic.Skin; } } if (windowEnabled) { if (anyresWinRect.x + anyresWinRect.width > Screen.width) { anyresWinRect.x = Screen.width - anyresWinRect.width; } if (anyresWinRect.y + anyresWinRect.height > Screen.height) { anyresWinRect.y = Screen.height - anyresWinRect.height; } anyresWinRect.x = Math.Max(anyresWinRect.x, 0); anyresWinRect.y = Math.Max(anyresWinRect.y, 0); anyresWinRect = GUI.Window(09271, anyresWinRect, GUIActive, "AnyRes"); } if (confirmDeleteEnabled) { deleteRect = GUI.Window(09276, deleteRect, ConfirmDelete, "Confirm"); } }
private void DrawMissileRange200Island(float line) { GUIStyle guardStyle = MissileRange200Island ? HighLogic.Skin.box : HighLogic.Skin.button; var saveRect = new Rect(LeftIndent * 1.5f, ContentTop + line * entryHeight, contentWidth * 0.9f, entryHeight); if (!MissileRange200Island) { if (GUI.Button(saveRect, "Missile Range 200", guardStyle)) { if (!launchSiteChanged) { launchSiteChanged = true; MissileRange200Island = true; EditorLogic.fetch.launchVessel(); } } } else { if (GUI.Button(saveRect, "Missile Range 200", guardStyle)) { ResetLaunchCoords(); } } }
private void DrawShadowedMessage(string message) { GUIStyle style = new GUIStyle(HighLogic.Skin.label); style.fontSize = 22; style.alignment = TextAnchor.UpperCenter; Rect labelRect = new Rect(0, (Screen.height * 0.25f) + (Mathf.Sin(2 * Time.time) * 5), Screen.width, 200); //shadow GUIStyle shadowStyle = new GUIStyle(style); shadowStyle.normal.textColor = new Color(0, 0, 0, 0.15f); Vector3 shadowOffset = 2 * Vector3.up; for (int i = 0; i < 16; i++) { Rect shadowRect = new Rect(labelRect); shadowRect.x += shadowOffset.x; shadowRect.y += shadowOffset.y; GUI.Label(shadowRect, message, shadowStyle); shadowOffset = Quaternion.AngleAxis(22.5f, Vector3.forward) * shadowOffset; } GUI.Label(labelRect, message, style); }
private void OnGUI() { if (GuiEnabledMLGPS) { _windowRect = GUI.Window(627252316, _windowRect, GuiWindowMLGPS, ""); } }
/* * Saved Message */ private void HandleSavedDisplay(int windowID) { bool MMPathLoaderIsReady = DatabaseHandler.isModuleManagerInstalled ? (bool)DatabaseHandler.DynaInvokeMMPatchLoaderMethod("IsReady") : false; GUILayout.BeginVertical(); if (DatabaseHandler.isReloading) { ScreenMessages.PostScreenMessage(string.Concat(Constants.guiDBReloading1, "\n", Constants.guiDBReloading2), Time.deltaTime, ScreenMessageStyle.UPPER_CENTER); GUILayout.Label(Constants.guiDBReloading1); GUILayout.Label(Constants.guiDBReloading2); if (!MMPathLoaderIsReady) { GUILayout.Label(String.Format("ModuleManager progress: {0:P0}", (float)DatabaseHandler.DynaInvokeMMPatchLoaderMethod("ProgressFraction"))); // GUILayout.Label(String.Format("{0}", (string)DatabaseHandler.DynaInvokeMMPatchLoaderMethod("ProgressTitle"))); } } else { GUILayout.Label(Constants.guiDialSaved); GUILayout.FlexibleSpace(); if (GUILayout.Button(Constants.guiOK)) { this.state = DisplayState.none; ClearEditor(); } } GUILayout.EndVertical(); GUI.DragWindow(); } //private void OnErrorDisplay()
private void DrawTrunkPeninsula(float line) { GUIStyle guardStyle = TrunkPeninsula ? HighLogic.Skin.box : HighLogic.Skin.button; var saveRect = new Rect(LeftIndent * 1.5f, ContentTop + line * entryHeight, contentWidth * 0.9f, entryHeight); if (!TrunkPeninsula) { if (GUI.Button(saveRect, "Trunk Peninsula", guardStyle)) { if (!launchSiteChanged) { launchSiteChanged = true; TrunkPeninsula = true; EditorLogic.fetch.launchVessel(); } } } else { if (GUI.Button(saveRect, "Trunk Peninsula", guardStyle)) { ResetLaunchCoords(); } } }
private void DrawAltitudeSlider(float line) { var saveRect = new Rect(LeftIndent * 1.5f, ContentTop + line * entryHeight, contentWidth * 0.9f, entryHeight); GUI.Label(new Rect(10, ContentTop + line * entryHeight, contentWidth * 0.9f, 20), "0"); GUI.Label(new Rect(95, ContentTop + line * entryHeight, contentWidth * 0.9f, 20), "|"); GUI.Label(new Rect(178, ContentTop + line * entryHeight, contentWidth * 0.9f, 20), "20"); altAdjust = GUI.HorizontalSlider(saveRect, altAdjust, 0, 20); }
/*************************************************************************************************************************/ public void DebugGUI(int windowID) { GUILayout.BeginVertical(); GUILayout.Space(10); //GUI.Toggle(new Rect(5, 3, 25, 25), plugin_active, " "); GUILayout.BeginHorizontal(); if (GUILayout.Button("print savefile", button_small, GUILayout.Width(132))) { write_save_values_to_file(); } if (GUILayout.Button("read savefile", button_small, GUILayout.Width(132))) { load_save_file(); } GUILayout.EndHorizontal(); GUILayout.Space(5); if (GUILayout.Button("mark bug", button_small, GUILayout.Width(115))) { Log.info("##################### BUG MARKER #####################"); } GUILayout.Space(5); debug_message[0] = _SAVE_Switched_To_Savefile; debug_message[1] = loaded_vessels.Count.ToString(); //debug_message[2] = ""; //debug_message[3] = ""; //debug_message[4] = ""; //debug_message[5] = ""; //debug_message[6] = ""; //debug_message[7] = ""; //debug_message[8] = ""; //debug_message[9] = ""; //debug_message[10] = ""; //debug_message[11] = ""; //debug_message[12] = ""; //debug_message[13] = ""; //debug_message[14] = ""; //debug_message[15] = ""; //debug_message[16] = ""; //debug_message[17] = ""; //debug_message[18] = ""; //debug_message[19] = ""; foreach (string temp_string in debug_message) { if (temp_string != "") { GUILayout.Box(temp_string, text_main, GUILayout.Width(266)); } } GUILayout.EndVertical(); GUI.DragWindow(new Rect(0, 0, 10000, 20)); }
internal static void ShowToolTip(Vector2 toolTipPos, string toolTip) { Vector2 size = ToolTipStyle.CalcSize(new GUIContent(toolTip)); Position = new Rect(toolTipPos.x + 5, toolTipPos.y + 5, size.x, size.y); RepositionToolTip(); GUI.Window(0, Position, EmptyWindow, toolTip, ToolTipStyle); GUI.BringWindowToFront(0); }
private void DrawDropVessel(float line) { var saveRect = new Rect(LeftIndent * 1.5f, ContentTop + line * entryHeight, contentWidth * 0.9f, entryHeight); if (GUI.Button(saveRect, "Drop Vessel")) { DropVessel(); DisableGuiF(); } }
private void OnMainWindow(int windowID) { GUIStyle style = new GUIStyle(GUI.skin.toggle); GUILayout.BeginVertical(); GUILayout.TextArea("Hello World!", GUILayout.ExpandHeight(true), GUILayout.MaxHeight(100)); GUILayout.EndVertical(); GUI.DragWindow(); }
private void DrawGetGPS(float line) { var saveRect = new Rect(LeftIndent * 1.5f, ContentTop + line * entryHeight, contentWidth * 0.9f, entryHeight); if (GUI.Button(saveRect, "LOG GPS COORDS")) { GetGPS(); } }
private void windowGUI(int ID) { GUILayout.BeginVertical(); SmokeScreenConfig.Instance.globalCollideDisable = GUILayout.Toggle(SmokeScreenConfig.Instance.globalCollideDisable, "Globally disable Collide"); SmokeScreenConfig.Instance.globalPhysicalDisable = GUILayout.Toggle(SmokeScreenConfig.Instance.globalPhysicalDisable, "Globally disable Physical"); SmokeScreenConfig.Instance.forceEmitOnUpdate = GUILayout.Toggle(SmokeScreenConfig.Instance.forceEmitOnUpdate, "Globally force emitOnUpdate"); SmokeScreenConfig.Instance.forceDecluster = GUILayout.Toggle(SmokeScreenConfig.Instance.forceDecluster, "Globally force decluster"); SmokeScreenConfig.Instance.shareManualInput = GUILayout.Toggle(SmokeScreenConfig.Instance.shareManualInput, "Share manual input values across effects"); GUILayout.Space(10); GUILayout.BeginHorizontal(); GUILayout.Label("maximumActiveParticles", GUILayout.ExpandWidth(true)); int.TryParse( GUILayout.TextField( SmokeScreenConfig.Instance.maximumActiveParticles.ToString(), GUILayout.ExpandWidth(true), GUILayout.Width(100)), out SmokeScreenConfig.Instance.maximumActiveParticles); GUILayout.EndHorizontal(); // 'SmokeScreenConfig.activeParticles' isn't accurate anymore int activeParticles = 0; ModelMultiShurikenPersistFX.List.ForEach(x => activeParticles += x.CurrentlyActiveParticles); GUILayout.Label($"Active particles: {activeParticles}"); GUILayout.Space(10); GUILayout.Label("Open ModelMultiShurikenPersistFX UI :"); foreach (var mmFX in ModelMultiShurikenPersistFX.List) { if (mmFX.hostPart != null) { // Changed to string interpolation, and added current particle count alongside max particle count per plume mmFX.showUI = GUILayout.Toggle( mmFX.showUI, $"{mmFX.hostPart.name}: {mmFX.effectName}, {mmFX.instanceName}: {mmFX.CurrentlyActiveParticles} ({mmFX.MaxActiveParticles} max)" ); } } GUILayout.EndVertical(); GUI.DragWindow(); }
protected override void OnDraw(Rect bounds) { UpdateTexture(); if (backgroundTexture != null) { GUI.DrawTexture(bounds, backgroundTexture); } GUI.DrawTexture(bounds, texture); }
private static void OnWindow(int winID) { if (GUI.Button(new Rect(5, 15, 65, 20), "Previous")) { NavUtilLib.GlobalVariables.FlightData.rwyIdx--; NavUtilLib.GlobalVariables.FlightData.rwyIdx = NavUtilLib.Utils.indexChecker(NavUtilLib.GlobalVariables.FlightData.rwyIdx, NavUtilLib.GlobalVariables.FlightData.currentBodyRunways.Count() - 1, 0); } if (GUI.Button(new Rect(75, 15, 95, 20), "Runway list")) { RunwayListGUI.show(winPos); } if (GUI.Button(new Rect(175, 15, 65, 20), "Next")) { NavUtilLib.GlobalVariables.FlightData.rwyIdx++; NavUtilLib.GlobalVariables.FlightData.rwyIdx = NavUtilLib.Utils.indexChecker(NavUtilLib.GlobalVariables.FlightData.rwyIdx, NavUtilLib.GlobalVariables.FlightData.currentBodyRunways.Count() - 1, 0); } if (GUI.Button(new Rect(5, 40, 115, 20), "Previous G/S")) { NavUtilLib.GlobalVariables.FlightData.gsIdx--; NavUtilLib.GlobalVariables.FlightData.gsIdx = NavUtilLib.Utils.indexChecker(NavUtilLib.GlobalVariables.FlightData.gsIdx, NavUtilLib.GlobalVariables.FlightData.gsList.Count() - 1, 0); } if (GUI.Button(new Rect(130, 40, 115, 20), "Next G/S")) { NavUtilLib.GlobalVariables.FlightData.gsIdx++; NavUtilLib.GlobalVariables.FlightData.gsIdx = NavUtilLib.Utils.indexChecker(NavUtilLib.GlobalVariables.FlightData.gsIdx, NavUtilLib.GlobalVariables.FlightData.gsList.Count() - 1, 0); } GUI.Label(new Rect(5, 75, 115, 25), "HSI GUI scale"); if (GUI.Button(new Rect(130, 75, 100, 25), "Default Scale")) { NavUtilLib.GlobalVariables.Settings.hsiGUIscale = 0.5f; } if (GUI.Button(new Rect(5, 150, 115, 20), "Custom Rwys")) { NavUtilGUI.RunwaysEditor.startGUI(); } //GUI.Label(new Rect(125, 150, 90, 20), "Popup in IVA?"); GlobalVariables.Settings.hideNavBallWaypoint = GUI.Toggle(new Rect(30, 120, 240, 20), GlobalVariables.Settings.hideNavBallWaypoint, "Hide NavBall waypoint icon"); GlobalVariables.Settings.enableWindowsInIVA = GUI.Toggle(new Rect(125, 150, 120, 20), GlobalVariables.Settings.enableWindowsInIVA, "Popup in IVA"); NavUtilLib.GlobalVariables.Settings.hsiGUIscale = GUI.HorizontalSlider(new Rect(5, 105, 240, 30), NavUtilLib.GlobalVariables.Settings.hsiGUIscale, 0.1f, 1.0f); GUI.DragWindow(); }
private void GuiWindowML(int ML) { GUI.DragWindow(new Rect(0, 0, WindowWidth, DraggableHeight)); float line = 0; _contentWidth = WindowWidth - 2 * LeftIndent; DrawTitle(line); line++; DrawIslandRunway(line); line++; DrawIslandBeach(line); line++; DrawkscHarborEast(line); line++; DrawkscIsandChannel(line); line++; DrawkscIslandNewHarbor(line); line++; DrawTirpitzBay(line); line++; DrawKerbiniAtol(line); line++; DrawKerbiniIsland(line); line++; DrawMissileRange200Island(line); line++; DrawBaikerbanur(line); line++; DrawPyramids(line); line++; DrawNorthPole(line); line++; DrawSouthPole(line); // DrawMidwayIsland(line); // line++; // DrawTrunkPeninsula(line); // line++; line++; line++; DrawText(line); line++; DrawX(line); line++; DrawY(line); line++; DrawZ(line); line++; DrawLaunchToGPS(line); _windowHeight = ContentTop + line * entryHeight + entryHeight + (entryHeight / 2); _windowRect.height = _windowHeight; }
/*************************************************************************************************************************/ public void BetaGUI(int windowID) { GUILayout.BeginVertical(); if (GUILayout.Button("mark bug", button_small, GUILayout.Width(115))) { Log.info("##################### BUG MARKER #####################"); } GUILayout.EndVertical(); GUI.DragWindow(new Rect(0, 0, 10000, 20)); }
private void DrawZ(float line) { var leftLabel = new GUIStyle(); leftLabel.alignment = TextAnchor.UpperLeft; leftLabel.normal.textColor = Color.white; GUI.Label(new Rect(LeftIndent, ContentTop + line * entryHeight, 60, entryHeight), "Altitude", leftLabel); float textFieldWidth = 80; var fwdFieldRect = new Rect(LeftIndent + contentWidth - textFieldWidth, ContentTop + line * entryHeight, textFieldWidth, entryHeight); _guiZ = GUI.TextField(fwdFieldRect, _guiZ); }
private void OnGUI() { if (null == airParkInstance) { return; // Should not be necessary (see OnVesselChange), but better safe than sorry. } if (toolbarGuiEnabled) { GUI.Window(999666, toolbarRect, ToolbarWindow, "AirPark", HighLogic.Skin.window); } button.Status = AirParkInstance.ParkedState; }
private void DrawTitle(float line) { var centerLabel = new GUIStyle { alignment = TextAnchor.UpperCenter, normal = { textColor = Color.white } }; var titleStyle = new GUIStyle(centerLabel) { fontSize = 14, alignment = TextAnchor.MiddleCenter }; GUI.Label(new Rect(0, 0, WindowWidth, 20), "Move Launch", titleStyle); }
private void DrawNameEntry(float line) { var leftLabel = new GUIStyle(); leftLabel.alignment = TextAnchor.UpperLeft; leftLabel.normal.textColor = Color.white; GUI.Label(new Rect(LeftIndent, ContentTop + line * entryHeight, 60, entryHeight), "Name", leftLabel); float textFieldWidth = 140; var fwdFieldRect = new Rect(LeftIndent + contentWidth - textFieldWidth, ContentTop + line * entryHeight, textFieldWidth, entryHeight); GPSname = GUI.TextField(fwdFieldRect, GPSname); }