private void OnGUI()
        {
            GeneralUI.Styles();

            if (bDisplayOptions)
            {
                window = GUILayout.Window(0984653, window, optionsWindow, "", GUILayout.Width(0), GUILayout.Height(0));
            }
        }
Exemple #2
0
        public void drawGUI()
        {
            GUI.skin = GeneralUI.UISkin;
            GeneralUI.Styles();

            // SAS toggle button
            if (bArmed)
            {
                if (SurfSAS.ActivityCheck())
                {
                    GUI.backgroundColor = GeneralUI.ActiveBackground;
                }
                else
                {
                    GUI.backgroundColor = GeneralUI.InActiveBackground;
                }

                if (GUI.Button(new Rect(Screen.width / 2 + 50, Screen.height - 200, 50, 30), "SSAS"))
                {
                    ActivitySwitch(!ActivityCheck());
                    updateTarget();
                    if (ActivityCheck())
                    {
                        setStockSAS(false);
                    }
                }
                GUI.backgroundColor = GeneralUI.stockBackgroundGUIColor;
            }

            // Main and preset window stuff
            if (!AppLauncherFlight.bDisplaySAS)
            {
                return;
            }
            Draw();
        }
Exemple #3
0
        public void Draw()
        {
            GUI.skin = GeneralUI.UISkin;
            GeneralUI.Styles();

            // Window resizing (scroll views dont work nicely with GUILayout)
            // Have to put the width changes before the draw so the close button is correctly placed
            if (showPIDLimits)
            {
                window.width = 370;
            }
            else
            {
                window.width = 233;
            }

            if (bShowHdg)
            {
                hdgScrollHeight = 0;
                if (!bWingLeveller)
                {
                    hdgScrollHeight += 55;
                }
                if ((Utils.GetAsst(PIDList.HdgBank).bShow || Utils.GetAsst(PIDList.HdgYaw).bShow) && !bWingLeveller)
                {
                    hdgScrollHeight += 150;
                }
                else if (showControlSurfaces)
                {
                    hdgScrollHeight += 50;
                    if (Utils.GetAsst(PIDList.Aileron).bShow || Utils.GetAsst(PIDList.Rudder).bShow)
                    {
                        hdgScrollHeight += 100;
                    }
                }
            }
            if (bShowVert)
            {
                vertScrollHeight = 38;
                if (bAltitudeHold)
                {
                    vertScrollHeight += 27;
                }
                if ((Utils.GetAsst(PIDList.Altitude).bShow&& bAltitudeHold) || (Utils.GetAsst(PIDList.VertSpeed).bShow))
                {
                    vertScrollHeight += 150;
                }
                else if (showControlSurfaces)
                {
                    vertScrollHeight += 27;
                    if (Utils.GetAsst(PIDList.Elevator).bShow)
                    {
                        vertScrollHeight += 123;
                    }
                }
            }

            GUI.backgroundColor = GeneralUI.stockBackgroundGUIColor;
            window = GUILayout.Window(34244, window, displayWindow, "Pilot Assistant", GUILayout.Height(0), GUILayout.MinWidth(233));

            presetWindow.x = window.x + window.width;
            presetWindow.y = window.y;
            if (showPresets)
            {
                presetWindow = GUILayout.Window(34245, presetWindow, displayPresetWindow, "Pilot Assistant Presets", GUILayout.Width(200), GUILayout.Height(0));
            }
        }