Beispiel #1
0
        /// <summary>Draws the GUI on screen and handles user selections.</summary>
        /// <param name="id">Required parameter: purpose unknown.</param>
        private void DrawSelectorHandler(int id)
        {
            var haveKerbals   = false;
            var haveLocations = false;

            GUILayout.BeginHorizontal();
            {
                GUILayout.BeginVertical();
                {
                    GUILayout.BeginHorizontal();
                    {
                        haveKerbals = DrawKerbalSelector();
                        DrawFacilitySelector();
                        haveLocations = DrawLocationSelector();
                    }
                    GUILayout.EndHorizontal();
                    DrawAddItemsButton();
                    DrawActionButton(haveKerbals, haveLocations);
                    DrawCancelButton();
                }
                GUILayout.EndVertical();
                DrawItemSelection();
            }
            GUILayout.EndHorizontal();

            DrawDebugButton(_coordinates);
            GuiResizer.DrawResizingButton(_coordinates, _minGuiSize);

            GUI.DragWindow();
        }
Beispiel #2
0
        /// <summary>Called regularly to draw the GUI on screen.</summary>
        /// <returns>A value indicating whether or not the GUI was displayed.</returns>
        internal bool Display()
        {
            if (!IsActive)
            {
                return(false);
            }
            if (_elementStyles == null)
            {
                _elementStyles = new GuiElementStyles();
            }

            GuiCoordinates = ClickThruBlocker.GUIWindow(34531230, GuiCoordinates, DrawSelectorHandler, _windowTitle);
            GuiCoordinates = GuiResizer.HandleResizing(GuiCoordinates);

            return(true);
        }
        /// <summary>
        /// Draws the GUI on screen and handles user selections.
        /// </summary>
        /// <param name="id">Required parameter: purpose unknown.</param>
        private void DrawSelectorHandler(int id)
        {
            //if (_elementStyles == null) _elementStyles = new GuiElementStyles();

            GUILayout.BeginVertical();
            {
                DrawLocationNameInput();
                DrawFacilitySelector();
                DrawActionButton();
                DrawCancelButton();
                DrawClosestLocation();
            }
            GUILayout.EndVertical();

            GuiResizer.DrawResizingButton(GuiCoordinates);
            GUI.DragWindow(new Rect(0, 0, GuiCoordinates.width, GuiCoordinates.height));
        }
        /// <summary>
        /// Called regularly to draw the GUI on screen.
        /// </summary>
        /// <returns>A value indicating whether or not the GUI was displayed.</returns>
        internal bool Display()
        {
            if (!IsActive || CommonKspAccess.IsPauseMenuOpen)
            {
                return(false);
            }

            if (_elementStyles == null)
            {
                _elementStyles = new GuiElementStyles();
            }

            GuiCoordinates = ClickThruBlocker.GUILayoutWindow(34534565,
                                                              GuiCoordinates,
                                                              DrawSelectorHandler,
                                                              $"{Constants.ModName} - Add");
            GuiCoordinates = GuiResizer.HandleResizing(GuiCoordinates);

            return(true);
        }