Exemplo n.º 1
0
        public void OnGUI()
        {
            horizontalSectionCount = 0;
            verticalSectionCount   = 0;

            if (!isOpen)
            {
                wasOpenLastPaint = false;
                return;
            }

            // Sorting the list is expensive.  Only do it when the window is first re-opened, not on every single repaint:
            if (!wasOpenLastPaint)
            {
                kOSProcessor.SortAllInstances();
            }
            wasOpenLastPaint = true;

            if (uiGloballyHidden && kOS.Safe.Utilities.SafeHouse.Config.ObeyHideUI)
            {
                return;
            }

            GUI.skin = HighLogic.Skin;

            windowRect = GUILayout.Window(UNIQUE_ID, windowRect, DrawWindow, "kOS " + versionString);
            windowRect = RectExtensions.ClampToRectAngle(windowRect, rectToFit);
        }
Exemplo n.º 2
0
        public void OnGUI()
        {
            horizontalSectionCount = 0;
            verticalSectionCount   = 0;

            if (!isOpen)
            {
                return;
            }

            GUI.skin = HighLogic.Skin;

            windowRect = GUILayout.Window(UNIQUE_ID, windowRect, DrawWindow, "kOS " + versionString);
            windowRect = RectExtensions.ClampToRectAngle(windowRect, rectToFit);
        }
Exemplo n.º 3
0
        public void OnGUI()
        {
            horizontalSectionCount = 0;
            verticalSectionCount   = 0;

            if (!isOpen)
            {
                return;
            }

            if (uiGloballyHidden && kOS.Safe.Utilities.SafeHouse.Config.ObeyHideUI)
            {
                return;
            }

            GUI.skin = HighLogic.Skin;

            windowRect = GUILayout.Window(UNIQUE_ID, windowRect, DrawWindow, "kOS " + versionString);
            windowRect = RectExtensions.ClampToRectAngle(windowRect, rectToFit);
        }
Exemplo n.º 4
0
        void OnGUI()
        {
            if (!IsOpen)
            {
                return;
            }

            if (FlightResultsDialog.isDisplaying)
            {
                return;
            }
            if (uiGloballyHidden)
            {
                kOS.Safe.Encapsulation.IConfig cfg = kOS.Safe.Utilities.SafeHouse.Config;
                if (cfg == null || cfg.ObeyHideUI)
                {
                    return;
                }
            }

            GUI.skin = HighLogic.Skin;

            WindowRect = GUILayout.Window(UniqueId, WindowRect, WidgetGui, TitleText, style);

            if (currentPopup != null)
            {
                var r = RectExtensions.EnsureCompletelyVisible(currentPopup.popupRect);
                if (Event.current.type == EventType.MouseDown && !r.Contains(Event.current.mousePosition))
                {
                    currentPopup.PopDown();
                }
                else
                {
                    GUI.BringWindowToFront(UniqueId + 1);
                    currentPopup.popupRect = GUILayout.Window(UniqueId + 1, r, PopupGui, "", style);
                }
            }
        }