public virtual void Hide() { this.Visible = false; Configuration.SetValue(this.configurationNodeName, this.window); Configuration.Save(); foreach (GUIWindow child in this.children) { child.Hide(); } this.parent = null; this.children.Clear(); }
public void Show(GUIWindow parentWindow) { this.window = Configuration.GetValue(this.configurationNodeName, this.window); this.window.x = Mathf.Clamp(this.window.x, this.minimumDimensions.x, Screen.width - this.window.width); this.window.y = Mathf.Clamp(this.window.y, this.minimumDimensions.y, Screen.height - this.window.height); this.window.width = Mathf.Clamp(this.window.width, this.minimumDimensions.width, Screen.width - this.window.x); this.window.height = Mathf.Clamp(this.window.height, this.minimumDimensions.height, Screen.height - this.window.y); this.Visible = true; if (parentWindow != null) { this.parent = parentWindow; this.parent.children.Add(this); } }
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; } } }
private void partWizardWindow_OnVisibleChanged(GUIWindow window, bool visible) { this.UpdateToolbarIcon(); }
public void Show(GUIWindow parentWindow) { this.window = Configuration.GetValue(this.configurationNodeName, this.window); this.window.x = Mathf.Clamp(this.window.x, this.minimumDimensions.x, Screen.width - this.window.width); this.window.y = Mathf.Clamp(this.window.y, this.minimumDimensions.y, Screen.height - this.window.height); this.window.width = Mathf.Clamp(this.window.width, this.minimumDimensions.width, Screen.width - this.window.x); this.window.height = Mathf.Clamp(this.window.height, this.minimumDimensions.height, Screen.height - this.window.y); this.Visible = true; if(parentWindow != null) { this.parent = parentWindow; this.parent.children.Add(this); } }
public virtual void Hide() { this.Visible = false; Configuration.SetValue(this.configurationNodeName, this.window); Configuration.Save(); foreach(GUIWindow child in this.children) { child.Hide(); } this.parent = null; this.children.Clear(); }