private void OnGUI() { if (!GUIEnabled) { return; } if (!initted) { InitGUIStuff(); } if (windowStyle == null) { GUI.color = Color.grey; windowStyle = new GUIStyle(HighLogic.Skin.window); windowStyle.active.background = windowStyle.normal.background; Texture2D tex = windowStyle.normal.background; Color32[] pixels = tex.GetPixels32(); for (int i = 0; i < pixels.Length; ++i) { pixels[i].a = 255; } tex.SetPixels32(pixels); tex.Apply(); windowStyle.active.background = windowStyle.focused.background = windowStyle.normal.background = tex; } WindowRect = GUILayout.Window(4946386, WindowRect, DoWindow, "Toolbar Controller", windowStyle); }
public void OnGUI() { if (windowStyle == null) { GUI.color = Color.grey; windowStyle = new GUIStyle(HighLogic.Skin.window); windowStyle.active.background = windowStyle.normal.background; Texture2D tex = windowStyle.normal.background; Color32[] pixels = tex.GetPixels32(); for (int i = 0; i < pixels.Length; ++i) { pixels[i].a = 255; } tex.SetPixels32(pixels); tex.Apply(); windowStyle.active.background = windowStyle.focused.background = windowStyle.normal.background = tex; } if (!showHelp) { return; } introWindow = GUILayout.Window(introWindowId, introWindow, IntroWindow, "Toolbar Controller Intro", windowStyle); if (automoved < 2) { introWindow.x = (Screen.width - introWindow.width) / 2; introWindow.y = (Screen.height - introWindow.height) / 2; automoved++; } }
internal void draw() { if (showWindow) { windowRect = GUILayout.Window(windowId, windowRect, drawWindow, ""); } }
private void OnGUI() { if (WindowVisable) { //Set the GUI Skin //GUI.skin = HighLogic.Skin; CLSStyles.SetupGuiStyles(); _windowPosition = GUILayout.Window(947695, _windowPosition, OnWindow, _clsLocTitle, _windowStyle, GUILayout.MinHeight(80), GUILayout.MinWidth(400), GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true), GUILayout.Width(400), GUILayout.Height(80)); if (!_optionsVisible) { return; } if (_windowOptionsPosition == new Rect(0, 0, 0, 0)) { _windowOptionsPosition = new Rect(_windowPosition.x + _windowPosition.width + 10, _windowPosition.y, 260, 120); } _windowOptionsPosition = GUILayout.Window(947696, _windowOptionsPosition, DisplayOptionWindow, _clsLocOptions, _windowStyle, GUILayout.MinHeight(120), GUILayout.ExpandWidth(true)); } else { if (WindowSelectedSpace <= -1) { return; } _vessel.Spaces[WindowSelectedSpace].Highlight(false); WindowSelectedSpace = -1; } }
public void drawGUI() { if (HideFMRSUI) { return; } if (!skin_init) { init_skin(); } GUI.skin = HighLogic.Skin; if (main_ui_active) { windowPos = GUILayout.Window(baseWindowID + 1, windowPos, MainGUI, "FMRS " /* + mod_vers */, GUILayout.MinWidth(100)); windowPos.x = Mathf.Clamp(windowPos.x, 0, Screen.width - windowPos.width); windowPos.y = Mathf.Clamp(windowPos.y, 0, Screen.height - windowPos.height); #if BETA && !DEBUG //************************** beta_windowPos.x = windowPos.x; beta_windowPos.y = windowPos.y + windowPos.height; beta_windowPos = ClickThruBlocker.GUILayoutWindow(baseWindowID = 3, beta_windowPos, BetaGUI, "FMRS Beta"); #endif //************************** } #if DEBUG //************************** if (main_ui_active) { debug_windowPos.x = windowPos.x; debug_windowPos.y = windowPos.y + windowPos.height; debug_windowPos = GUILayout.Window(baseWindowID + 2, debug_windowPos, DebugGUI, "FMRS Debug Info"); } #endif //************************** }
private void OnGUI() { if (showUI) { winPos = GUILayout.Window(winID, winPos, windowGUI, "SmokeScreen", GUILayout.MinWidth(300)); } }
protected void Show() { if (this.IsDeactivated()) { return; } Log.dbg("Window.Show"); this.windowRect = GUILayout.Window(this.window_id, this.windowRect, this.Draw, this.tittle, this.style.window); }
internal virtual void draw() { if (GUIStyle == null) { GUIStyle = GUI.skin.window; } Rect = GUILayout.Window(id, AutoClampToScreen ? Rect.clampToScreen() : Rect, windowId => drawContentsInternal(), Title, GUIStyle, GUILayoutOptions); editorLock.draw(Modal || Rect.Contains(Utils.getMousePosition())); }
public void OnGUI() { GUI.skin = HighLogic.Skin; GUI.skin.toggle.margin = new RectOffset(0, 0, 0, 0); if (showGUI) { GUILayout.BeginArea(windowRect); windowRect = GUILayout.Window(837190, windowRect, MotionDetectorWindow, "Motion Detector"); GUILayout.EndArea(); } }
///////////////////////////////////// public void OnGUI() { try { if (this.Visible()) { this.bounds = GUILayout.Window(this.GetInstanceID(), this.bounds, this.Window, AS.TITLE, HighLogic.Skin.window); } } catch (Exception e) { Log.err("exception: {0}", e.Message); } }
/// <summary> /// Public Eventcall at the GuiDraw /// </summary> private void HandleGUI() { if (!_guiVisible) { //TODO: Play a "uh-uh" (nops) sound. Log.dbgGui(this, "GUI is set to invisible!"); return; } GUI.skin = _guiskin; switch (this.state) { case DisplayState.none: EditorLockManager.unlockEditor(Constants.settingPreventClickThroughLock); EditorLockManager.unlockEditor(Constants.settingWeldingLock); break; case DisplayState.weldError: _editorErrorDial = GUILayout.Window((int)this.state, _editorErrorDial, OnErrorDisplay, Constants.weldManufacturer); break; case DisplayState.weldWarning: _editorWarningDial = GUILayout.Window((int)this.state, _editorWarningDial, OnWarningDisplay, Constants.weldManufacturer); break; case DisplayState.infoWindow: _editorInfoWindow = GUI.Window((int)this.state, _editorInfoWindow, OnInfoWindow, Constants.weldManufacturer); PreventClickThrough(_editorInfoWindow); break; case DisplayState.savedWindow: _editorSavedDial = GUILayout.Window((int)this.state, _editorSavedDial, OnSavedDisplay, Constants.weldManufacturer); break; case DisplayState.overwriteDial: _editorOverwriteDial = GUILayout.Window((int)this.state, _editorOverwriteDial, OnOverwriteDisplay, Constants.weldManufacturer); break; case DisplayState.mainWindow: _editorMainWindow = GUI.Window((int)this.state, _editorMainWindow, OnMainWindow, Constants.weldManufacturer); PreventClickThrough(_editorMainWindow); break; case DisplayState.partSelection: ScreenMessages.PostScreenMessage(Constants.guiScreenMessagePartSelection, Time.deltaTime, ScreenMessageStyle.UPPER_CENTER); break; } } //private void OnDraw()
public void OnGUI() { if (showSettingsWindow) { GUILayout.BeginArea(morseSettingsRect); morseSettingsRect = GUILayout.Window(991237, morseSettingsRect, MorseSettingsWindow, Localizer.Format("#autoLOC_CL_0077")); GUILayout.EndArea(); } if (showAlphabetWindow) { GUILayout.BeginArea(morseAlphabetRect); morseAlphabetRect = GUILayout.Window(596064, morseAlphabetRect, MorseAlphabetWindow, Localizer.Format("#autoLOC_CL_0078")); GUILayout.EndArea(); } }
public void Render() { // Editor locking logic adapted from m4v's RCSBuildAid. Scene loadedScene = GUIWindow.SceneFromGameScenes(HighLogic.LoadedScene); if ((this.scene & loadedScene) == loadedScene) { if (this.Visible) { GUI.skin.window.clipping = TextClipping.Clip; this.window = GUILayout.Window(this.windowId, this.window, this.InternalRender, this.title); foreach (GUIWindow child in this.children) { child.Render(); } if (Event.current.type == EventType.Repaint) { this.mouseOver = GUIControls.MouseOverWindow(ref this.window); if (this.mouseOver && !this.editorLocked) { InputLockManager.SetControlLock(GUIWindow.EditorLockControlTypes, this.editorLockToken); this.editorLocked = true; } else if (!this.mouseOver && this.editorLocked) { InputLockManager.RemoveControlLock(this.editorLockToken); this.editorLocked = false; } } } else if (this.editorLocked) { InputLockManager.RemoveControlLock(this.editorLockToken); this.editorLocked = false; } } }
//Does stuff to draw the window. public void SetGUIPositions() { if (flightGUI.showFlightGUI) { flightGUI.flightWindowRect = GUILayout.Window(8940, flightGUI.flightWindowRect, flightGUI.DrawFlightGUI, "StageRecovery", HighLogic.Skin.window); } if (showBlacklist) { blacklistRect = GUILayout.Window(8941, blacklistRect, DrawBlacklistGUI, "Ignore List", HighLogic.Skin.window); } if (showWindow) { mainWindowRect = GUILayout.Window(8940, mainWindowRect, DrawSettingsGUI, "StageRecovery", HighLogic.Skin.window); } if (editorGUI.showEditorGUI) { editorGUI.EditorGUIRect = GUILayout.Window(8940, editorGUI.EditorGUIRect, editorGUI.DrawEditorGUI, "StageRecovery", HighLogic.Skin.window); } }
public void OnGUI() { if (Settings.guiIsActive && !isHideUI) { GUI.skin = HighLogic.Skin; // on showConfigs changed: resize window, save config if (Settings.showConfigs != showConfigs) { Settings.guiwindowPosition.height = 50; Settings.showConfigs = showConfigs; Settings.SaveToXml(); } // on vessel type changed: resize window if (vesselType != Gpws.ActiveVesselType) { Settings.guiwindowPosition.height = 50; } // draw Settings.guiwindowPosition = GUILayout.Window("GPWSSetting".GetHashCode(), Settings.guiwindowPosition, WindowFunc, "GPWS Setting", GUILayout.ExpandHeight(true)); } }
void OnGUI() { if (!active) { return; } if (Time.realtimeSinceStartup - lastTimeTic > 0.25) { active = false; return; } // The settings are only available in the space center GUI.skin = HighLogic.Skin; settingsRect = GUILayout.Window("HotKeySettings".GetHashCode(), settingsRect, SettingsWindowFcn, "EVA Fuel Settings", GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true)); }
private void OnGUI() { SetGuiStyles(); if (ShowUI && addCrewMembers && VesselSpawn.IsSelectingCrew) { _crewSelectRect = GUILayout.Window(401239, _crewSelectRect, CrewSelectionWindow, "Select Crew", HighLogic.Skin.window); if (!latch) { Log.info(_crewSelectRect.ToString()); } latch = true; } if (!ShowUI || !toolbarGuiEnabled || !VesselMove.Instance || !VesselSpawn.instance || VesselSpawn.instance.openingCraftBrowser || VesselSpawn.IsSelectingCrew) { return; } toolbarRect = GUI.Window(401240, toolbarRect, ToolbarWindow, "Vessel Mover", HighLogic.Skin.window); if (!VesselMove.Instance.IsMovingVessel) { if (!MouseIsInRect(svRectScreenSpace)) { return; } Vector2 mousePos = MouseGUIPos(); //Rect warningRect = new Rect(mousePos.x + 5, mousePos.y + 20, 200, 60); ShowToolTip(mousePos, "WARNING: Experimental. Launch clamps may be broken."); } else if (showMoveHelp) { GUI.Window(401241, new Rect(toolbarRect.x, toolbarRect.y + toolbarRect.height, toolbarRect.width, helpHeight), MoveHelp, "Controls", HighLogic.Skin.window); } }
private void drawGUI() { windowPos = GUILayout.Window(airshipWindowID, windowPos, WindowGUI, "HLAirships Build Aid", GUILayout.MinWidth(200)); }