示例#1
0
        private void OnGUI()
        {
            if (!showGui)
            {
                return;
            }

            GuiUtils.CheckSkin();

            GUI.skin = GuiUtils.skin;

            if (this == vessel.GetMasterMechJeb() &&
                ((HighLogic.LoadedSceneIsEditor) || ((FlightGlobals.ready) && (vessel == FlightGlobals.ActiveVessel) && (part.State != PartStates.DEAD))))
            {
                foreach (DisplayModule module in GetComputerModules <DisplayModule>())
                {
                    if (module.enabled)
                    {
                        module.DrawGUI(HighLogic.LoadedSceneIsEditor);
                    }
                }

                if (HighLogic.LoadedSceneIsEditor)
                {
                    PreventEditorClickthrough();
                }
            }
        }
示例#2
0
        private void OnGUI()
        {
            if (!showGui)
            {
                return;
            }

            GuiUtils.CheckSkin();

            GUI.skin = GuiUtils.skin;

            if (this == vessel.GetMasterMechJeb() &&
                ((HighLogic.LoadedSceneIsEditor) || ((FlightGlobals.ready) && (vessel == FlightGlobals.ActiveVessel) && (part.State != PartStates.DEAD))))
            {
                foreach (DisplayModule module in GetComputerModules <DisplayModule>())
                {
                    try
                    {
                        if (module.enabled)
                        {
                            module.DrawGUI(HighLogic.LoadedSceneIsEditor);
                        }
                    }
                    catch (Exception e)
                    {
                        Debug.LogError("MechJeb module " + module.GetType().Name + " threw an exception in DrawGUI: " + e);
                    }
                }

                if (HighLogic.LoadedSceneIsEditor)
                {
                    PreventEditorClickthrough();
                }
            }
        }
示例#3
0
        private void OnGUI()
        {
            if (!showGui || this != vessel.GetMasterMechJeb())
            {
                return;
            }

            if (HighLogic.LoadedSceneIsEditor || (FlightGlobals.ready && (vessel == FlightGlobals.ActiveVessel) && (part.State != PartStates.DEAD)))
            {
                Matrix4x4 previousGuiMatrix = GUI.matrix;
                GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(GuiUtils.scale, GuiUtils.scale, 1));

                GuiUtils.ComboBox.DrawGUI();

                GuiUtils.LoadSkin((GuiUtils.SkinType)GetComputerModule <MechJebModuleSettings>().skinId);

                GuiUtils.CheckSkin();

                GUI.skin = GuiUtils.skin;

                foreach (DisplayModule module in GetComputerModules <DisplayModule>())
                {
                    try
                    {
                        if (module.enabled)
                        {
                            module.DrawGUI(HighLogic.LoadedSceneIsEditor);
                        }
                    }
                    catch (Exception e)
                    {
                        Debug.LogError("MechJeb module " + module.GetType().Name + " threw an exception in DrawGUI: " + e);
                    }
                }

                if (HighLogic.LoadedSceneIsEditor)
                {
                    PreventEditorClickthrough();
                }
                if (HighLogic.LoadedSceneIsFlight || HighLogic.LoadedSceneHasPlanetarium)
                {
                    PreventInFlightClickthrough();
                }
                GUI.matrix = previousGuiMatrix;
            }
        }