/// <summary> /// Called to draw the floating section window when the UI is enabled. /// </summary> private void OnGUI() { if (this.ParentSection == null || !this.ParentSection.IsVisible || (DisplayStack.Instance.Hidden && !this.ParentSection.IsHud) || !FlightEngineerCore.IsDisplayable) { return; } if (this.resizeRequested) { this.windowPosition.width = 0; this.windowPosition.height = 0; this.resizeRequested = false; } GUI.skin = null; this.windowPosition = GUILayout.Window(this.windowId, this.windowPosition, this.Window, string.Empty, (!this.ParentSection.IsHud || this.ParentSection.IsEditorVisible) ? this.windowStyle : this.ParentSection.IsHudBackground && this.ParentSection.LineCount > 0 ? this.hudWindowBgStyle : this.hudWindowStyle); windowPosition = (ParentSection.IsHud) ? windowPosition.ClampInsideScreen() : windowPosition.ClampToScreen(); this.ParentSection.FloatingPositionX = this.windowPosition.x; this.ParentSection.FloatingPositionY = this.windowPosition.y; }