Ejemplo n.º 1
0
		//METHODS:
#if UNITY_EDITOR
		public override void Draw(E.SceneView sceneView)
		{
			base.Draw(sceneView);
			EditorUtil.BeginColorPocket(m_color);
			G.DrawTexture(GetPositionedRect(sceneView), image);
			EditorUtil.EndColorPocket();
		}
Ejemplo n.º 2
0
 void OnGUI()
 {
     if (GUI.Button(new Rect(10, 10, 100, 30), "Start"))
     {
         SceneManager.LoadScene("Main");
     }
 }
Ejemplo n.º 3
0
		//METHODS:
#if UNITY_EDITOR
		public override void Draw(E.SceneView sceneView)
		{
			base.Draw(sceneView);
			EditorUtil.BeginColorPocket(m_color);
			G.Label(GetPositionedRect(sceneView), m_text, guiStyle);
			EditorUtil.EndColorPocket();
		}
Ejemplo n.º 4
0
			internal LayoutedWindow(GUI.WindowFunction f, Rect _screenRect, GUIContent _content, GUILayoutOption[] _options, GUIStyle _style)
			{
				this.func = f;
				this.screenRect = _screenRect;
				this.options = _options;
				this.style = _style;
			}
Ejemplo n.º 5
0
 public void mainWindow(int windowid)
 {
     GUILayout.BeginVertical();
     if (GUILayout.Button("Overlay"))
     {
         showOverlayWindow = !showOverlayWindow;
     }
     GUILayout.Space(1);
     GUILayout.Space(1);
     if (MapOverlay.getHoverCell().HasValue)
     {
         Cell cell = MapOverlay.getHoverCell().Value;
         GUILayout.Label("Temperature: " + WeatherFunctions.GetCellTemperature(PD.index, currentLayer, cell) + " °K");
         GUILayout.Label("Pressure: " + WeatherFunctions.GetCellPressure(PD.index, currentLayer, cell) + " Pa");
         GUILayout.Label("Rel Humidity: " + WeatherFunctions.GetCellRH(PD.index, currentLayer, cell) * 100 + " %");
         GUILayout.Label("Air Density: " + String.Format("{0:0.000000}", WeatherFunctions.D_Wet(PD.index, cell, WeatherFunctions.GetCellAltitude(PD.index, currentLayer, cell))) + " Kg/m³");
         GUILayout.Label("wind horz: " + String.Format("{0:0.0000}", WeatherFunctions.GetCellwindH(PD.index, currentLayer, cell)) + " m/s");
         GUILayout.Label("wind Dir : " + String.Format("{0:000.0}", WeatherFunctions.GetCellwindDir(PD.index, currentLayer, cell)) + " °");
         GUILayout.Label("wind vert : " + String.Format("{0:+0.00000;-0.00000}", WeatherFunctions.GetCellwindV(PD.index, currentLayer, cell)) + " m/s");
         GUILayout.Label("CCN : " + WeatherFunctions.GetCellCCN(PD.index, currentLayer, cell) * 100 + " %");
         GUILayout.Label("Cloud water : " + WeatherFunctions.GetCellWaterContent(PD.index, currentLayer, cell) + " Kg/m³");
         int Iced = Math.Sign(WeatherFunctions.GetCelldropletSize(PD.index, currentLayer, cell));
         GUILayout.Label("droplet Size: " + Math.Abs(WeatherFunctions.GetCelldropletSize(PD.index, currentLayer, cell) * 1000.0f) + " mm");
         GUILayout.Label("cloud thickness: " + WeatherFunctions.GetCellthickness(PD.index, currentLayer, cell) + " m " + (Iced < 0 ? "Iced" : Iced > 0 ? "Liqd" : "None"));
         GUILayout.Label("rain duration: " + WeatherFunctions.GetCellrainDuration(PD.index, currentLayer, cell) + " cycles");
         GUILayout.Label("rain decay: " + WeatherFunctions.GetCellrainDecay(PD.index, currentLayer, cell) / 256.0f);
     }
     GUILayout.EndVertical();
     GUI.DragWindow();
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Closes the Navigation Field. (Optional) Draws additional controls on top of the content.
        /// </summary>
        public static void EndNavigationField(bool showNativeControls = true)
        {
            Gl.EndArea();             //end offset area
            if (lastDrawnNavField != null)
            {
                if (showNativeControls)
                {
                    if (G.Button(new U.Rect(lastDrawnNavField.backupRect.width - lastDrawnNavField.border - 23, 5, 20, 20), new U.GUIContent("+", "Center View")))
                    {
                        lastDrawnNavField.CenterView();
                    }
                }

#if UNITY_EDITOR
                G.Button(new U.Rect(0, 0, lastDrawnNavField.backupRect.width, lastDrawnNavField.backupRect.height), "", "Label");                 //force hot control
#endif
            }

            Gl.EndArea();             //end field viewport area

            if (lastDrawnNavField != null)
            {
                lastDrawnNavField.DragUpdate();
            }

            lastDrawnNavField = null;
        }
Ejemplo n.º 7
0
        public static void SelectionGrid(Rect position, Setting <int> value, string[] labels, int xCount)
        {
            int koeff = (int)(labels.Length / xCount);

            position.height = (position.height * koeff) + (Style.VerticalMargin * koeff - Style.VerticalMargin);
            value.Value     = UGUI.SelectionGrid(position, value.Value, labels, xCount, Style.SelectionGrid);
        }
Ejemplo n.º 8
0
 public static void LabelCenter(SmartRect position, string content, bool move = false)
 {
     UGUI.Label(position.ToRect(), content, Style.LabelCenter);
     if (move)
     {
         position.MoveY();
     }
 }
Ejemplo n.º 9
0
 public static void ToggleButton(Rect position, Setting <bool> val, string label)
 {
     UGUI.Label(position, label, Style.Label);
     if (UGUI.Button(position, val.Value ? LabelEnabled : LabelDisabled, Style.TextButton))
     {
         val.Value = !val.Value;
     }
 }
Ejemplo n.º 10
0
 public static void DrawTexture(SmartRect position, Texture tex, bool move = false)
 {
     UGUI.DrawTexture(position.ToRect(), tex);
     if (move)
     {
         position.MoveY();
     }
 }
Ejemplo n.º 11
0
 public static void Box(SmartRect position, string text, bool move = true)
 {
     UGUI.Box(position.ToRect(), text, Style.Box);
     if (move)
     {
         position.MoveY();
     }
 }
Ejemplo n.º 12
0
 public void OnGUI()
 {
     mainGUI = GUI.Window(mainGUID, mainGUI, mainWindow, "Weather Data~");
     if (showOverlayWindow)
     {
         overlayGUI = GUI.Window(overlayGUID, overlayGUI, overlayWindow, "Overlay~");
     }
 }
Ejemplo n.º 13
0
        public static void BackgroundColor(Rect rect, Color color)
        {
            var oldColor = GUI.color;

            GUI.color = color;

            GUI.DrawTexture(rect, EditorGUIUtility.whiteTexture);
            GUI.color = oldColor;
        }
Ejemplo n.º 14
0
 public static Vector2 BeginScrollView(SmartRect position, Vector2 scrollView, Rect viewRect, bool alwaysHorizontal, bool alwaysVertical, bool move = false)
 {
     scrollView = UGUI.BeginScrollView(position.ToRect(), scrollView, viewRect, alwaysHorizontal, alwaysVertical, Style.ScrollView, Style.ScrollView);
     if (move)
     {
         position.MoveY();
     }
     return(scrollView);
 }
Ejemplo n.º 15
0
 public static bool ToggleButton(Rect position, bool val, string label)
 {
     UGUI.Label(position, label, Style.Label);
     if (UGUI.Button(position, val ? LabelEnabled : LabelDisabled, Style.TextButton))
     {
         return(!val);
     }
     return(val);
 }
Ejemplo n.º 16
0
        public void overlayWindow(int windowid)
        {
            GUILayout.BeginVertical();
            if (GUILayout.Button("Show overlay"))
            {
                MapOverlay.ToggleOverlay();
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label("Opacity: ");
            //byte temp0 = 0;
            opacity          = (byte)GUILayout.HorizontalSlider(opacity, 0, 255);
            MapOverlay.alpha = opacity;
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("<"))
            {
                MapOverlay.prevResource(); RegrabVals();
            }
            GUILayout.TextField(MapOverlay.resource.Resource);
            if (GUILayout.Button(">"))
            {
                MapOverlay.nextResource(); RegrabVals();
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            minVal = GUILayout.TextField(minVal);
            maxVal = GUILayout.TextField(maxVal);
            double temp1, temp2;

            double.TryParse(maxVal, out temp1);
            double.TryParse(minVal, out temp2);
            MapOverlay.resource.MaxQuantity = temp1;
            MapOverlay.resource.MinQuantity = temp2;
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            GUILayout.Label("Layer:");
            if (GUILayout.Button("-"))
            {
                currentLayer = currentLayer > 0 ? currentLayer - 1 : 0; MapOverlay.currentLayer = currentLayer;
            }
            GUILayout.Label("" + currentLayer);
            if (GUILayout.Button("+"))
            {
                currentLayer = currentLayer == PD.LiveMap.Count + PD.LiveStratoMap.Count - 1 ? PD.LiveMap.Count + PD.LiveStratoMap.Count - 1 : currentLayer + 1; MapOverlay.currentLayer = currentLayer;
            }
            GUILayout.EndHorizontal();
            if (GUILayout.Button("Apply"))
            {
                MapOverlay.refreshCellColours();
            }
            int height = MapOverlay.getOverlayTextureScale(MapOverlay.resource.Resource).height;

            GUI.DrawTexture(new Rect(25, 192, 150, height), MapOverlay.getOverlayTextureScale(MapOverlay.resource.Resource));
            GUILayout.Label("Colour Scale");
            GUILayout.EndVertical();
            GUI.DragWindow();
        }
Ejemplo n.º 17
0
 public static void TextField(Rect position, Setting <string> value, string label, float offset)
 {
     if (offset > 0f)
     {
         UGUI.Label(position, label, Style.Label);
         position.x     += offset;
         position.width -= offset;
     }
     value.Value = UGUI.TextField(position, value.Value, Style.TextField);
 }
Ejemplo n.º 18
0
 public static string TextField(Rect position, string value, string label, float offset)
 {
     if (offset > 0f)
     {
         UGUI.Label(position, label, Style.Label);
         position.x     += offset;
         position.width -= offset;
     }
     return(UGUI.TextField(position, value, Style.TextField));
 }
Ejemplo n.º 19
0
 public static void HorizontalSlider(Rect position, Setting <float> value, string label, float min, float max, float offset)
 {
     if (offset > 0f)
     {
         UGUI.Label(position, label, Style.Label);
         position.x     += offset;
         position.width -= offset;
     }
     value.Value = UGUI.HorizontalSlider(position, value.Value, min, max, Style.Slider, Style.SliderBody);
 }
Ejemplo n.º 20
0
 public static float HorizontalSlider(Rect position, float value, string label, float min, float max, float offset)
 {
     if (offset > 0f)
     {
         UGUI.Label(position, label, Style.Label);
         position.x     += offset;
         position.width -= offset;
     }
     return(UGUI.HorizontalSlider(position, value, min, max, Style.Slider, Style.SliderBody));
 }
Ejemplo n.º 21
0
        public static bool Button(SmartRect position, string text, bool move = true)
        {
            bool value = UGUI.Button(position.ToRect(), text, Style.Button);

            if (move)
            {
                position.MoveY();
            }
            return(value);
        }
Ejemplo n.º 22
0
 public static void Toggle(SmartRect position, Setting <bool> val, string label, float offset, bool move = false)
 {
     UGUI.Label(position.ToRect(), label, Style.Label);
     position.MoveOffsetX(position.width - Style.Height);
     val.Value = UGUI.Toggle(position.ToRect(), val.Value, string.Empty, Style.Toggle);
     position.ResetX();
     if (move)
     {
         position.MoveY();
     }
 }
Ejemplo n.º 23
0
 public static bool Toggle(SmartRect position, bool val, string label, bool move = false)
 {
     UGUI.Label(position.ToRect(), label, Style.Label);
     position.MoveOffsetX(position.width - Height);
     val = UGUI.Toggle(position.ToRect(), val, string.Empty, Style.Toggle);
     position.ResetX();
     if (move)
     {
         position.MoveY();
     }
     return(val);
 }
Ejemplo n.º 24
0
 public static void ToggleButton(SmartRect position, Setting <bool> val, string label, bool move = false)
 {
     UGUI.Label(position.ToRect(), label, Style.Label);
     if (UGUI.Button(position.ToRect(), val.Value ? LabelEnabled : LabelDisabled, Style.TextButton))
     {
         val.Value = !val.Value;
     }
     if (move)
     {
         position.MoveY();
     }
 }
Ejemplo n.º 25
0
		//METHODS:
#if UNITY_EDITOR
		public override void Draw(E.SceneView sceneView)
		{
			base.Draw(sceneView);
			EditorUtil.BeginColorPocket(m_color);
			if (G.Button(GetPositionedRect(sceneView), m_text, guiStyle))
				if (onClick != null) {
					onClick();
					onClick = null;
					EditorUtil.UnsubGUIDelegate();
				}

			EditorUtil.EndColorPocket();
		}
Ejemplo n.º 26
0
        public static void SelectionGrid(SmartRect position, Setting <int> value, string[] labels, int xCount, bool move = false)
        {
            float old   = position.height;
            int   koeff = (int)(labels.Length / xCount);

            position.height = (old * koeff) + (Style.VerticalMargin * koeff - Style.VerticalMargin);
            value.Value     = UGUI.SelectionGrid(position.ToRect(), value.Value, labels, xCount, Style.SelectionGrid);
            if (move)
            {
                position.MoveY();
            }
            position.height = old;
        }
Ejemplo n.º 27
0
 public static bool ToggleButton(SmartRect position, bool val, string label, bool move = false)
 {
     UGUI.Label(position.ToRect(), label, Style.Label);
     if (UGUI.Button(position.ToRect(), val ? LabelEnabled : LabelDisabled, Style.TextButton))
     {
         val = !val;
     }
     if (move)
     {
         position.MoveY();
     }
     return(val);
 }
Ejemplo n.º 28
0
 public static void TextField(SmartRect position, Setting <string> value, string label, float offset, bool move = false)
 {
     if (offset > 0f)
     {
         UGUI.Label(position.ToRect(), label, Style.Label);
         position.MoveOffsetX(offset);
     }
     value.Value = UGUI.TextField(position.ToRect(), value.Value, Style.TextField);
     position.ResetX();
     if (move)
     {
         position.MoveY();
     }
 }
Ejemplo n.º 29
0
 public void DrawNode(int i,GUI.WindowFunction DoWindow)
 {
     if (is_selected) {
         Color pre_color = GUI.color;
         GUI.color = new Color(106.0f/255,132.0f/255,219.0f/255);
         this.windowRect = GUI.Window (i, this.windowRect, DoWindow, new GUIContent ("haha"));
         GUI.color = pre_color;
     } else {
         Color pre_color = GUI.color;
         GUI.color = new Color(0,1,0);
         this.windowRect = GUI.Window (i, this.windowRect, DoWindow, new GUIContent ("haha"));
         GUI.color = pre_color;
     }
 }
Ejemplo n.º 30
0
 public static void HorizontalSlider(SmartRect position, Setting <float> value, string label, float min, float max, float offset, bool move = false)
 {
     if (offset > 0f)
     {
         UGUI.Label(position.ToRect(), label, Style.Label);
         position.MoveOffsetX(offset);
     }
     value.Value = UGUI.HorizontalSlider(position.ToRect(), value.Value, min, max, Style.Slider, Style.SliderBody);
     position.ResetX();
     if (move)
     {
         position.MoveY();
     }
 }
        private void WindowFunc(int windowID)
        {
            const int border  = 10;
            const int width   = 50;
            const int height  = 25;
            const int spacing = 10;

            Rect l = new Rect(
                border, border + spacing,
                this.windowRect.width - border * 2, this.windowRect.height - border * 2 - height - spacing
                );

            if (this.text_style is null)
            {
                UGUI.Label(l, this.msg);
            }
            else
            {
                UGUI.Label(l, this.msg, this.text_style);
            }

            Rect b = new Rect(
                this.windowRect.width - width - border,
                this.windowRect.height - height - border,
                width,
                height);

            if (this.action is null)
            {
                if (UGUI.Button(b, "OK"))
                {
                    Destroy(this.gameObject);
                }
            }
            else
            {
                if (UGUI.Button(b, "OK"))
                {
                    this.action(); Destroy(this.gameObject);
                }

                Rect b1 = new Rect(b);
                b1.x -= b.width + spacing;
                if (UGUI.Button(b1, "Cancel"))
                {
                    Destroy(this.gameObject);
                }
            }
        }
Ejemplo n.º 32
0
 public static float HorizontalSlider(SmartRect position, float value, string label, float offset, bool move = false)
 {
     if (offset > 0f)
     {
         UGUI.Label(position.ToRect(), label, Style.Label);
         position.MoveOffsetX(offset);
     }
     value = UGUI.HorizontalSlider(position.ToRect(), value, 0f, 1f, Style.Slider, Style.SliderBody);
     position.ResetX();
     if (move)
     {
         position.MoveY();
     }
     return(value);
 }
Ejemplo n.º 33
0
		public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, Texture image, GUIStyle style)
		{
			return GUI.DoModalWindow(id, clientRect, func, GUIContent.Temp(image), style, GUI.skin);
		}
Ejemplo n.º 34
0
 internal LayoutedWindow(GUI.WindowFunction f, Rect screenRect, GUIContent content, GUILayoutOption[] options, GUIStyle style)
 {
     this.m_Func = f;
     this.m_ScreenRect = screenRect;
     this.m_Options = options;
     this.m_Style = style;
 }
Ejemplo n.º 35
0
 public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, string text, GUIStyle style)
 {
   GUIUtility.CheckOnGUI();
   return GUI.DoModalWindow(id, clientRect, func, GUIContent.Temp(text), style, GUI.skin);
 }
Ejemplo n.º 36
0
        public static void SetGUIPositions(GUI.WindowFunction OnWindow)
        {
            GUISkin oldSkin = GUI.skin;
            if (HighLogic.LoadedScene == GameScenes.SPACECENTER && windowSkin == null)
                windowSkin = GUI.skin;
            GUI.skin = windowSkin;

            if (validScenes.Contains(HighLogic.LoadedScene)) //&& KCT_GameStates.settings.enabledForSave)//!(HighLogic.CurrentGame.Mode == Game.Modes.SANDBOX && !KCT_GameStates.settings.SandboxEnabled))
            {
                /*if (!ToolbarManager.ToolbarAvailable && GUI.Button(iconPosition, "KCT", GUI.skin.button))
                {
                    onClick();
                }*/
                if (ToolbarManager.ToolbarAvailable && KCT_GameStates.kctToolbarButton != null)
                {
                    KCT_GameStates.kctToolbarButton.TexturePath = KCT_Utilities.GetButtonTexture(); //Set texture, allowing for flashing of icon.
                }

                if (showSettings)
                    //settingsPosition = GUILayout.Window(8955, settingsPosition, KCT_GUI.DrawSettings, "KCT Settings", HighLogic.Skin.window);
                    presetPosition = GUILayout.Window(8955, presetPosition, KCT_GUI.DrawPresetWindow, "KCT Settings", HighLogic.Skin.window);
                if (!KCT_PresetManager.Instance.ActivePreset.generalSettings.Enabled)
                    return;

                if (showMainGUI)
                    mainWindowPosition = GUILayout.Window(8950, mainWindowPosition, KCT_GUI.DrawMainGUI, "Kerbal Construction Time", HighLogic.Skin.window);
                if (showEditorGUI)
                    editorWindowPosition = GUILayout.Window(8953, editorWindowPosition, KCT_GUI.DrawEditorGUI, "Kerbal Construction Time", HighLogic.Skin.window);
                if (showSOIAlert)
                    SOIAlertPosition = GUILayout.Window(8951, SOIAlertPosition, KCT_GUI.DrawSOIAlertWindow, "SOI Change", HighLogic.Skin.window);
                if (showLaunchAlert)
                    centralWindowPosition = GUILayout.Window(8951, centralWindowPosition, KCT_GUI.DrawLaunchAlert, "KCT", HighLogic.Skin.window);
                if (showSimulationCompleteEditor)
                    centralWindowPosition = GUILayout.Window(8951, centralWindowPosition, KCT_GUI.DrawSimulationCompleteEditor, "Simulation Complete!", HighLogic.Skin.window);
                if (showSimulationCompleteFlight)
                    centralWindowPosition = GUILayout.Window(8952, centralWindowPosition, KCT_GUI.DrawSimulationCompleteFlight, "Simulation Complete!", HighLogic.Skin.window);
                if (showSimulationWindow)
                    simulationWindowPosition = GUILayout.Window(8955, simulationWindowPosition, KCT_GUI.DrawSimulationWindow, "KCT Simulation", HighLogic.Skin.window);
                if (showTimeRemaining && KCT_GameStates.simulationTimeLimit > 0)
                    timeRemainingPosition = GUILayout.Window(8951, timeRemainingPosition, KCT_GUI.DrawSimulationTimeWindow, "Time left:", HighLogic.Skin.window);
                if (showBuildList)
                    buildListWindowPosition = GUILayout.Window(8950, buildListWindowPosition, KCT_GUI.DrawBuildListWindow, "Build List", HighLogic.Skin.window);
                if (showClearLaunch)
                    centralWindowPosition = GUILayout.Window(8952, centralWindowPosition, KCT_GUI.DrawClearLaunch, "Launch site not clear!", HighLogic.Skin.window);
                if (showShipRoster)
                    crewListWindowPosition = GUILayout.Window(8955, crewListWindowPosition, KCT_GUI.DrawShipRoster, "Select Crew", HighLogic.Skin.window);
                if (showCrewSelect)
                    crewListWindowPosition = GUILayout.Window(8954, crewListWindowPosition, KCT_GUI.DrawCrewSelect, "Select Crew", HighLogic.Skin.window);
                if (showSimConfig)
                    simulationConfigPosition = GUILayout.Window(8951, simulationConfigPosition, KCT_GUI.DrawSimulationConfigure, "Simulation Configuration", HighLogic.Skin.window);
                if (showBodyChooser)
                    centralWindowPosition = GUILayout.Window(8952, centralWindowPosition, KCT_GUI.DrawBodyChooser, "Choose Body", HighLogic.Skin.window);
                if (showUpgradeWindow)
                    upgradePosition = GUILayout.Window(8952, upgradePosition, KCT_GUI.DrawUpgradeWindow, "Upgrades", HighLogic.Skin.window);
                if (showBLPlus)
                    bLPlusPosition = GUILayout.Window(8953, bLPlusPosition, KCT_GUI.DrawBLPlusWindow, "Options", HighLogic.Skin.window);
                if (showRename)
                    centralWindowPosition = GUILayout.Window(8954, centralWindowPosition, KCT_GUI.DrawRenameWindow, "Rename", HighLogic.Skin.window);
                if (showFirstRun)
                    centralWindowPosition = GUILayout.Window(8954, centralWindowPosition, KCT_GUI.DrawFirstRun, "Kerbal Construction Time", HighLogic.Skin.window);
                if (showSimLengthChooser)
                    centralWindowPosition = GUILayout.Window(8952, centralWindowPosition, KCT_GUI.DrawSimLengthChooser, "Time Limit", HighLogic.Skin.window);
                if (showPresetSaver)
                    presetNamingWindowPosition = GUILayout.Window(8952, presetNamingWindowPosition, KCT_GUI.DrawPresetSaveWindow, "Save as New Preset", HighLogic.Skin.window);
                if (showLaunchSiteSelector)
                    centralWindowPosition = GUILayout.Window(8952, centralWindowPosition, DrawLaunchSiteChooser, "Select Site", HighLogic.Skin.window);

                if (unlockEditor)
                {
                    EditorLogic.fetch.Unlock("KCTGUILock");
                    unlockEditor = false;
                }

                //Disable KSC things when certain windows are shown.
                if (showFirstRun || showRename || showUpgradeWindow || showSettings || showCrewSelect || showShipRoster || showClearLaunch)
                {
                    if (!isKSCLocked)
                    {
                        InputLockManager.SetControlLock(ControlTypes.KSC_FACILITIES, "KCTKSCLock");
                        isKSCLocked = true;
                    }
                }
                else //if (!showBuildList)
                {
                    if (isKSCLocked)
                    {
                        InputLockManager.RemoveControlLock("KCTKSCLock");
                        isKSCLocked = false;
                    }
                }
                GUI.skin = oldSkin;
            }
        }
Ejemplo n.º 37
0
 public static Rect Window(int id, Rect screenRect, GUI.WindowFunction func, GUIContent content, GUIStyle style, params GUILayoutOption[] options)
 {
     return DoWindow(id, screenRect, func, content, style, options);
 }
Ejemplo n.º 38
0
		private static extern Rect INTERNAL_CALL_DoWindow(int id, ref Rect clientRect, GUI.WindowFunction func, GUIContent title, GUIStyle style, GUISkin skin, bool forceRectOnLayout);
Ejemplo n.º 39
0
		public static Rect Window(int id, Rect screenRect, GUI.WindowFunction func, GUIContent content, params GUILayoutOption[] options)
		{
			return GUILayout.DoWindow(id, screenRect, func, content, GUI.skin.window, options);
		}
Ejemplo n.º 40
0
		internal static void CallWindowDelegate(GUI.WindowFunction func, int id, GUISkin _skin, int forceRect, float width, float height, GUIStyle style)
		{
			GUILayoutUtility.SelectIDList(id, true);
			GUISkin skin = GUI.skin;
			if (Event.current.type == EventType.Layout)
			{
				if (forceRect != 0)
				{
					GUILayoutOption[] options = new GUILayoutOption[]
					{
						GUILayout.Width(width),
						GUILayout.Height(height)
					};
					GUILayoutUtility.BeginWindow(id, style, options);
				}
				else
				{
					GUILayoutUtility.BeginWindow(id, style, null);
				}
			}
			GUI.skin = _skin;
			func(id);
			if (Event.current.type == EventType.Layout)
			{
				GUILayoutUtility.Layout();
			}
			GUI.skin = skin;
		}
Ejemplo n.º 41
0
		private static Rect DoWindow(int id, Rect clientRect, GUI.WindowFunction func, GUIContent title, GUIStyle style, GUISkin skin, bool forceRectOnLayout)
		{
			return GUI.INTERNAL_CALL_DoWindow(id, ref clientRect, func, title, style, skin, forceRectOnLayout);
		}
Ejemplo n.º 42
0
		private static extern Rect INTERNAL_CALL_DoModalWindow(int id, ref Rect clientRect, GUI.WindowFunction func, GUIContent content, GUIStyle style, GUISkin skin);
Ejemplo n.º 43
0
		private static Rect DoModalWindow(int id, Rect clientRect, GUI.WindowFunction func, GUIContent content, GUIStyle style, GUISkin skin)
		{
			return GUI.INTERNAL_CALL_DoModalWindow(id, ref clientRect, func, content, style, skin);
		}
Ejemplo n.º 44
0
		public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, GUIContent content, GUIStyle style)
		{
			return GUI.DoModalWindow(id, clientRect, func, content, style, GUI.skin);
		}
Ejemplo n.º 45
0
		public static Rect Window(int id, Rect clientRect, GUI.WindowFunction func, GUIContent content)
		{
			return GUI.DoWindow(id, clientRect, func, content, GUI.skin.window, GUI.skin, true);
		}
Ejemplo n.º 46
0
 public static Rect Window(int id, Rect clientRect, GUI.WindowFunction func, GUIContent content)
 {
     return default(Rect);
 }
Ejemplo n.º 47
0
		public static Rect Window(int id, Rect clientRect, GUI.WindowFunction func, Texture image)
		{
			return GUI.DoWindow(id, clientRect, func, GUIContent.Temp(image), GUI.skin.window, GUI.skin, true);
		}
Ejemplo n.º 48
0
 public static Rect Window(int id, Rect clientRect, GUI.WindowFunction func, string text, GUIStyle style)
 {
     return default(Rect);
 }
Ejemplo n.º 49
0
 public void SetGUIPositions(GUI.WindowFunction OnWindow)
 {
     if (showMain) MainGUIPos = GUILayout.Window(7349, MainGUIPos, DrawMainGUI, "Flight School");
 }
Ejemplo n.º 50
0
 public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, string text)
 {
     return default(Rect);
 }
Ejemplo n.º 51
0
 public static Rect Window(int id, Rect screenRect, GUI.WindowFunction func, string text, params GUILayoutOption[] options)
 {
     return DoWindow(id, screenRect, func, GUIContent.Temp(text), GUI.skin.window, options);
 }
Ejemplo n.º 52
0
 public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, GUIContent content, GUIStyle style)
 {
     return default(Rect);
 }
Ejemplo n.º 53
0
 public static Rect Window(int id, Rect screenRect, GUI.WindowFunction func, Texture image, GUIStyle style, params GUILayoutOption[] options)
 {
     return DoWindow(id, screenRect, func, GUIContent.Temp(image), style, options);
 }
Ejemplo n.º 54
0
 public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, Texture image, GUIStyle style)
 {
     return default(Rect);
 }
Ejemplo n.º 55
0
 private static Rect DoWindow(int id, Rect screenRect, GUI.WindowFunction func, GUIContent content, GUIStyle style, GUILayoutOption[] options)
 {
     GUIUtility.CheckOnGUI();
     LayoutedWindow window = new LayoutedWindow(func, screenRect, content, options, style);
     return GUI.Window(id, screenRect, new GUI.WindowFunction(window.DoWindow), content, style);
 }
Ejemplo n.º 56
0
        public static void SetGUIPositions(GUI.WindowFunction OnWindow)
        {
            if (GUI.Button(iconPosition, "KCT", GUI.skin.button))
            {
                if (HighLogic.LoadedScene == GameScenes.FLIGHT)
                {
                    KCT_GameStates.showMainGUI = !KCT_GameStates.showMainGUI;
                }
                else if ((HighLogic.LoadedScene == GameScenes.EDITOR) || (HighLogic.LoadedScene == GameScenes.SPH))
                {
                    KCT_GameStates.showEditorGUI = !KCT_GameStates.showEditorGUI;
                }

            }

            if (KCT_GameStates.showMainGUI)
            {
                mainWindowPosition = GUILayout.Window(8950, mainWindowPosition, KCT_GUI.DrawMainGUI, "Kerbal Construction Time", windowStyle);

            }

            if (KCT_GameStates.showEditorGUI)
            {
                editorWindowPosition = GUILayout.Window(8950, editorWindowPosition, KCT_GUI.DrawEditorGUI, "Kerbal Construction Time", windowStyle);

            }

            if (KCT_GameStates.showSOIAlert)
            {
                SOIAlertPosition = GUILayout.Window(8951, SOIAlertPosition, KCT_GUI.DrawSOIAlertWindow, "SOI Change", windowStyle);

            }
        }
Ejemplo n.º 57
0
 public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, GUIContent content)
 {
   GUIUtility.CheckOnGUI();
   return GUI.DoModalWindow(id, clientRect, func, content, GUI.skin.window, GUI.skin);
 }
Ejemplo n.º 58
0
		public static Rect Window(int id, Rect clientRect, GUI.WindowFunction func, string text, GUIStyle style)
		{
			return GUI.DoWindow(id, clientRect, func, GUIContent.Temp(text), style, GUI.skin, true);
		}
Ejemplo n.º 59
0
		public static Rect Window(int id, Rect clientRect, GUI.WindowFunction func, GUIContent title, GUIStyle style)
		{
			return GUI.DoWindow(id, clientRect, func, title, style, GUI.skin, true);
		}
Ejemplo n.º 60
0
		public static Rect ModalWindow(int id, Rect clientRect, GUI.WindowFunction func, string text)
		{
			return GUI.DoModalWindow(id, clientRect, func, GUIContent.Temp(text), GUI.skin.window, GUI.skin);
		}