Esempio n. 1
0
        private static void OnWindow(int winID)
        {
            if (GUI.Button(new Rect(5, 15, 65, 20), "Previous"))
            {
                NavUtilLib.GlobalVariables.FlightData.rwyIdx--;
                NavUtilLib.GlobalVariables.FlightData.rwyIdx = NavUtilLib.Utils.indexChecker(NavUtilLib.GlobalVariables.FlightData.rwyIdx, NavUtilLib.GlobalVariables.FlightData.currentBodyRunways.Count() - 1, 0);
            }

            if (GUI.Button(new Rect(75, 15, 95, 20), "Runway list"))
            {
                RunwayListGUI.show(winPos);
            }

            if (GUI.Button(new Rect(175, 15, 65, 20), "Next"))
            {
                NavUtilLib.GlobalVariables.FlightData.rwyIdx++;
                NavUtilLib.GlobalVariables.FlightData.rwyIdx = NavUtilLib.Utils.indexChecker(NavUtilLib.GlobalVariables.FlightData.rwyIdx, NavUtilLib.GlobalVariables.FlightData.currentBodyRunways.Count() - 1, 0);
            }

            if (GUI.Button(new Rect(5, 40, 115, 20), "Previous G/S"))
            {
                NavUtilLib.GlobalVariables.FlightData.gsIdx--;
                NavUtilLib.GlobalVariables.FlightData.gsIdx = NavUtilLib.Utils.indexChecker(NavUtilLib.GlobalVariables.FlightData.gsIdx, NavUtilLib.GlobalVariables.FlightData.gsList.Count() - 1, 0);
            }

            if (GUI.Button(new Rect(130, 40, 115, 20), "Next G/S"))
            {
                NavUtilLib.GlobalVariables.FlightData.gsIdx++;
                NavUtilLib.GlobalVariables.FlightData.gsIdx = NavUtilLib.Utils.indexChecker(NavUtilLib.GlobalVariables.FlightData.gsIdx, NavUtilLib.GlobalVariables.FlightData.gsList.Count() - 1, 0);
            }

            GUI.Label(new Rect(5, 75, 115, 25), "HSI GUI scale");

            if (GUI.Button(new Rect(130, 75, 100, 25), "Default Scale"))
            {
                NavUtilLib.GlobalVariables.Settings.hsiGUIscale = 0.5f;
            }

            if (GUI.Button(new Rect(5, 150, 115, 20), "Custom Rwys"))
            {
                NavUtilGUI.RunwaysEditor.startGUI();
            }

            //GUI.Label(new Rect(125, 150, 90, 20), "Popup in IVA?");

            GlobalVariables.Settings.hideNavBallWaypoint = GUI.Toggle(new Rect(30, 120, 240, 20), GlobalVariables.Settings.hideNavBallWaypoint, "Hide NavBall waypoint icon");

            GlobalVariables.Settings.enableWindowsInIVA = GUI.Toggle(new Rect(125, 150, 120, 20), GlobalVariables.Settings.enableWindowsInIVA, "Popup in IVA");


            NavUtilLib.GlobalVariables.Settings.hsiGUIscale = GUI.HorizontalSlider(new Rect(5, 105, 240, 30), NavUtilLib.GlobalVariables.Settings.hsiGUIscale, 0.1f, 1.0f);

            GUI.DragWindow();
        }
Esempio n. 2
0
        private void OnWindow(int WindowID)
        {
            Log.dbg("NavUtils: NavUtilLibApp.OnWindow()");

            Log.dbg("HSI: OnWindow()");



            Rect rwyBtn = new Rect(20 * var.Settings.hsiGUIscale,
                                   13 * var.Settings.hsiGUIscale,
                                   200 * var.Settings.hsiGUIscale,
                                   20 * var.Settings.hsiGUIscale);

            Rect gsBtn = new Rect(20 * var.Settings.hsiGUIscale,
                                  38 * var.Settings.hsiGUIscale,
                                  200 * var.Settings.hsiGUIscale,
                                  20 * var.Settings.hsiGUIscale);

            Rect closeBtn = new Rect(330 * var.Settings.hsiGUIscale,
                                     580 * var.Settings.hsiGUIscale,
                                     300 * var.Settings.hsiGUIscale,
                                     50 * var.Settings.hsiGUIscale);

            if (GUI.Button(closeBtn, new GUIContent("CloseBtn", "closeOn")))
            {
                //displayHSI();
                Log.dbg("CloseHSI");
                appButton.SetFalse(true);
                //goto CloseWindow;
            }

            if (GUI.tooltip == "closeOn")
            {
                closeHover = true;
            }
            else
            {
                closeHover = false;
            }


            if (GUI.Button(rwyBtn, new GUIContent("Next Runway", "rwyOn")) && !var.FlightData.isINSMode()) //doesn't let runway to be switched in INS mode
            {
                if (Event.current.alt)
                {
                    RunwayListGUI.show(windowPosition);
                }
                else
                {
                    if (Event.current.button == 0)
                    {
                        var.FlightData.rwyIdx++;
                    }
                    else
                    {
                        var.FlightData.rwyIdx--;
                    }

                    var.FlightData.rwyIdx = NavUtilLib.Utils.indexChecker(var.FlightData.rwyIdx, var.FlightData.currentBodyRunways.Count - 1, 0);
                }
            }

            if (GUI.tooltip == "rwyOn")
            {
                rwyHover = true;
            }
            else
            {
                rwyHover = false;
            }


            if (GUI.Button(gsBtn, new GUIContent("Next G/S", "gsOn")))
            {
                if (Event.current.button == 0)
                {
                    var.FlightData.gsIdx++;
                }
                else
                {
                    var.FlightData.gsIdx--;
                }

                var.FlightData.gsIdx = NavUtilLib.Utils.indexChecker(var.FlightData.gsIdx, var.FlightData.gsList.Count - 1, 0);
            }

            if (GUI.tooltip == "gsOn")
            {
                gsHover = true;
            }
            else
            {
                gsHover = false;
            }

            rt.Create();

            DrawGauge(rt);
            GUI.DrawTexture(new Rect(0, 0, windowPosition.width, windowPosition.height), rt, ScaleMode.ScaleToFit);

            //GUI.DrawTexture(new Rect(0, 0, windowPosition.width, windowPosition.height), var.Materials.Instance.overlay.mainTexture);

            GUI.DragWindow();
        }