示例#1
0
        public static Material GetShader1(ShaderType1 type)
        {
            Material result;

            if (type != ShaderType1.OldTV)
            {
                result = type != ShaderType1.NightVisionNoise1 ? null : NightVisionNoise1;
            }
            else
            {
                result = OldTV;
            }
            return(result);
            //switch (type)
            //{
            //    case ShaderType1.OldTV: return OldTV;
            //    case ShaderType1.NightVisionNoise1: return NightVisionNoise1;
            //    default: return null;
            //}
        }
        public static Material GetShader1(ShaderType1 type)
        {
            Material result;

            if (type != ShaderType1.OldTV)
            {
                if (type != ShaderType1.NightVisionNoise1)
                {
                    result = null;
                }
                else
                {
                    result = NightVisionNoise1;
                }
            }
            else
            {
                result = OldTV;
            }
            return(result);
        }
示例#3
0
        public static Material GetShader1(ShaderType1 type)
        {
#if false
            Material result;
            if (type != ShaderType1.CRT)
            {
                result = type != ShaderType1.NightVision ? null : NightVision;
            }
            else
            {
                result = CRT;
            }
            return(result);
#endif
            switch (type)
            {
            case ShaderType1.CRT: return(CRT);

            case ShaderType1.NightVision: return(NightVision);

            default: return(null);
            }
        }
示例#4
0
        /// <summary>
        /// drawing method, third layer, interface
        /// </summary>
        protected virtual void ExtendedDrawWindowL3()
        {
            if (!ThisPart.vessel.Equals(FlightGlobals.ActiveVessel))
            {
                GUI.Label(new Rect(8, 34, 222, 20), "Broadcast from: " + ThisPart.vessel.vesselName, Styles.GreenLabel11);
            }

            if (IsAuxiliaryWindowOpen)
            {
                GUI.DrawTexture(new Rect(TexturePosition.width + 8, 34, GameSettings.UI_SCALE * 1, TexturePosition.height), _textureSeparator); //Separator
            }
            if (HighLogic.CurrentGame.Parameters.CustomParams <KURSSettings>().useKSPskin)
            {
                if (GUI.Button(new Rect(WindowPosition.width - 20, 3, GameSettings.UI_SCALE * 15, GameSettings.UI_SCALE * 15), "x"))
                {
                    IsButtonOff = true;
                }
            }
            else
            {
                if (GUI.Button(new Rect(WindowPosition.width - 20, 3, GameSettings.UI_SCALE * 15 + 4, GameSettings.UI_SCALE * 15), "x"))
                {
                    IsButtonOff = true;
                }
            }
            if (AuxWindowAllowed)
            {
                if (GUI.Button(new Rect(WindowPosition.width - 29, 20, GameSettings.UI_SCALE * 24, GameSettings.UI_SCALE * 15), IsAuxiliaryWindowOpen ? "◄" : "►")) //extend window
                {
                    IsAuxiliaryWindowOpen       = !IsAuxiliaryWindowOpen;
                    IsAuxiliaryWindowButtonPres = true;
                }
            }

            var tooltip = new GUIContent("☼", _currentShaderName);

            GUI.Box(new Rect(8, TexturePosition.yMax - 22, GameSettings.UI_SCALE * 20, GameSettings.UI_SCALE * 20), tooltip);
            GUI.Label(new Rect(64, 128, GameSettings.UI_SCALE * 200, GameSettings.UI_SCALE * 40), GUI.tooltip, Styles.GreenLabel15B);
            if (GUI.Button(new Rect(8, TexturePosition.yMax - 22, 20, 20), "☼"))
            {
#if false
                switch (ShadersToUse)
                {
                case 0:
                    _shaderType++;
                    if (!Enum.IsDefined(typeof(ShaderType), _shaderType))
                    {
                        _shaderType = ShaderType.None;
                    }
                    break;

                case 1:
                    _shaderType1++;
                    if (!Enum.IsDefined(typeof(ShaderType1), _shaderType1))
                    {
                        _shaderType1 = ShaderType1.CRT;
                    }
                    break;

                case 2:
                    _shaderType2++;
                    if (!Enum.IsDefined(typeof(ShaderType2), _shaderType2))
                    {
                        _shaderType2 = ShaderType2.None;
                    }
                    break;
                }
#else
                _shaderType++;
                if (!Enum.IsDefined(typeof(ShaderType), _shaderType))
                {
                    _shaderType = ShaderType.None;
                }
#endif
            }
            //if (GUI.RepeatButton(new Rect(TexturePosition.xMax - 22, TexturePosition.yMax - 22, 20, 20), "±") &&
            if (GUI.RepeatButton(new Rect(TexturePosition.xMax - 42, TexturePosition.yMax - 22, 20, 20), "-") &&
                UnityEngine.Camera.allCameras.FirstOrDefault(x => x.name == "Camera 00") != null) //Size of main window
            {
                //WindowSizeCoef = ((WindowSizeCoef - 1)%(MaxWindowSizeCoef-1))+2;
                WindowSizeCoef--;
                if (WindowSizeCoef < 2)
                {
                    WindowSizeCoef = MaxWindowSizeCoef;
                }

                Deactivate();
                InitWindow();
                InitTextures();
                Activate();
                //IsAuxiliaryWindowOpen = false;

                IsAuxiliaryWindowButtonPres = IsAuxiliaryWindowOpen;
            }
            if (GUI.RepeatButton(new Rect(TexturePosition.xMax - 22, TexturePosition.yMax - 22, 20, 20), "+") &&
                UnityEngine.Camera.allCameras.FirstOrDefault(x => x.name == "Camera 00") != null) //Size of main window
            {
                WindowSizeCoef = ((WindowSizeCoef - 1) % (MaxWindowSizeCoef - 1)) + 2;

                Deactivate();
                InitWindow();
                InitTextures();
                Activate();
                //IsAuxiliaryWindowOpen = false;

                IsAuxiliaryWindowButtonPres = IsAuxiliaryWindowOpen;
            }
            if (IsZoomAllowed)
            {
                CurrentZoom = GUI.HorizontalSlider(new Rect(TexturePosition.width / 2 - 80, GUI.skin.font.lineHeight + 10, 160, 10), CurrentZoom, MaxZoom, MinZoom);
            }
        }
示例#5
0
        /// <summary>
        /// drawing method, third layer, interface
        /// </summary>
        protected virtual void ExtendedDrawWindowL3()
        {
            if (!ThisPart.vessel.Equals(FlightGlobals.ActiveVessel))
            {
                GUI.Label(new Rect(8, 34, 222, 20), "Broadcast from: " + ThisPart.vessel.vesselName, Styles.GreenLabel11);
            }

            if (IsAuxiliaryWindowOpen)
            {
                GUI.DrawTexture(new Rect(TexturePosition.width + 8, 34, 1, TexturePosition.height), _textureSeparator); //Separator
            }
            if (GUI.Button(new Rect(WindowPosition.width - 20, 3, 15, 15), " "))
            {
                IsButtonOff = true;
            }

            if (GUI.Button(new Rect(WindowPosition.width - 29, 18, 24, 15), IsAuxiliaryWindowOpen ? "◄" : "►")) //extend window
            {
                IsAuxiliaryWindowOpen       = !IsAuxiliaryWindowOpen;
                IsAuxiliaryWindowButtonPres = true;
            }

            var tooltip = new GUIContent("☼", _currentShaderName);

            GUI.Box(new Rect(8, TexturePosition.yMax - 22, 20, 20), tooltip);
            GUI.Label(new Rect(64, 128, 200, 40), GUI.tooltip, Styles.GreenLabel15B);
            if (GUI.Button(new Rect(8, TexturePosition.yMax - 22, 20, 20), "☼"))
            {
                switch (ShadersToUse)
                {
                case 0:
                    _shaderType++;
                    if (!Enum.IsDefined(typeof(ShaderType), _shaderType))
                    {
                        _shaderType = ShaderType.OldTV;
                    }
                    break;

                case 1:
                    _shaderType1++;
                    if (!Enum.IsDefined(typeof(ShaderType1), _shaderType1))
                    {
                        _shaderType1 = ShaderType1.OldTV;
                    }
                    break;

                case 2:
                    _shaderType2++;
                    if (!Enum.IsDefined(typeof(ShaderType2), _shaderType2))
                    {
                        _shaderType2 = ShaderType2.None;
                    }
                    break;
                }
            }

            if (GUI.RepeatButton(new Rect(TexturePosition.xMax - 22, TexturePosition.yMax - 22, 20, 20), "±") &&
                UnityEngine.Camera.allCameras.FirstOrDefault(x => x.name == "Camera 00") != null) //Size of main window
            {
                switch (WindowSizeCoef)
                {
                case 2:
                    WindowSizeCoef = 3;
                    break;

                case 3:
                    WindowSizeCoef = 2;
                    break;
                }
                Deactivate();
                InitWindow();
                InitTextures();
                Activate();
                IsAuxiliaryWindowOpen = false;
            }

            CurrentZoom = GUI.HorizontalSlider(new Rect(TexturePosition.width / 2 - 80, 20, 160, 10), CurrentZoom, MaxZoom, MinZoom);
        }
示例#6
0
        /// <summary>
        /// drawing method, third layer, interface
        /// </summary>
        protected virtual void ExtendedDrawWindowL3()
        {
            if (!part.vessel.Equals(FlightGlobals.ActiveVessel))
            {
                GUI.Label(new Rect(22, 30, 222, 22), "Broadcast from: " + part.vessel.vesselName, guiStyleGreenLabelStandart);
            }
            if (IsAuxiliaryWindowOpen)
                GUI.DrawTexture(new Rect(texturePosition.width+8, 34, 1, texturePosition.height), textureSeparator);  //vert line, textureSeparator

            if (GUI.Button(new Rect(windowPosition.width - 20, 3, 15, 15), " ")) // destroy cam window
            {
                IsButtonOff = true;
            }
            if (GUI.Button(new Rect(windowPosition.width - 29, 18, 24, 15), IsAuxiliaryWindowOpen ? "◄" : "►")) //extend window
            {
                IsAuxiliaryWindowOpen = !IsAuxiliaryWindowOpen;
                IsAuxiliaryWindowButtonPres = true;
            }

            var tooltip = new GUIContent("☼", CurrentShaderName);
            GUI.Box(new Rect(8, texturePosition.yMax - 22, 20, 20), tooltip);
            GUI.Label(new Rect(64, 128, 200, 40), GUI.tooltip, guiStyleGreenLabelBold);
            if (GUI.Button(new Rect(8, texturePosition.yMax - 22, 20, 20), "☼"))
            {
                switch (shadersToUse)
                {
                    case 0:
                        shaderType++;
                        if (!Enum.IsDefined(typeof (ShaderType), shaderType))
                            shaderType = ShaderType.OldTV;
                        break;
                    case 1:
                        shaderType1++;
                        if (!Enum.IsDefined(typeof(ShaderType1), shaderType1))
                            shaderType1 = ShaderType1.OldTV;
                        break;
                    case 2:
                        shaderType2++;
                        if (!Enum.IsDefined(typeof (ShaderType2), shaderType2))
                            shaderType2 = ShaderType2.None;
                        break;
                }
            }

            if (GUI.RepeatButton(new Rect(texturePosition.xMax - 22, texturePosition.yMax - 22, 20, 20), "±") &&
                UnityEngine.Camera.allCameras.FirstOrDefault(x => x.name == "Camera 00") != null) //Size of main window
            {
                switch (windowSizeCoef)
                {
                    case 2:
                        windowSizeCoef = 3;
                        break;
                    case 3:
                        windowSizeCoef = 2;
                        break;
                }
                Deactivate();
                InitWindow();
                InitTextures();
                Activate();
                IsAuxiliaryWindowOpen = false;
            }

            currentZoom = GUI.HorizontalSlider(new Rect(texturePosition.width / 2 - 80, 20, 160, 10), currentZoom, maxZoom, minZoom);
        }
示例#7
0
        /// <summary>
        /// drawing method, third layer, interface
        /// </summary>
        protected virtual void ExtendedDrawWindowL3()
        {
            if (!part.vessel.Equals(FlightGlobals.ActiveVessel))
            {
                GUI.Label(new Rect(8f, 34f, 222f, 20f), "Broadcast from: " + part.vessel.vesselName, Styles.guiStyleGreenLabelSmall);
            }

            if (IsAuxiliaryWindowOpen)
            {
                GUI.DrawTexture(new Rect(texturePosition.width + 8f, 34f, 1f, texturePosition.height), textureSeparator);
            }
            if (GUI.Button(new Rect(windowPosition.width - 20f, 3f, 15f, 15f), " "))
            {
                IsButtonOff = true;
            }
            if (GUI.Button(new Rect(windowPosition.width - 29f, 18f, 24f, 15f), IsAuxiliaryWindowOpen ? "◄" : "►"))
            {
                IsAuxiliaryWindowOpen       = !IsAuxiliaryWindowOpen;
                IsAuxiliaryWindowButtonPres = true;
            }
            GUIContent gUIContent = new GUIContent("☼", BaseKspCamera.currentShaderName);

            GUI.Box(new Rect(8f, texturePosition.yMax - 22f, 20f, 20f), gUIContent);
            GUI.Label(new Rect(64f, 128f, 200f, 40f), GUI.tooltip, Styles.guiStyleGreenLabelBold);
            if (GUI.Button(new Rect(8f, texturePosition.yMax - 22f, 20f, 20f), "☼"))
            {
                switch (BaseKspCamera.ShadersToUse)
                {
                case 0:
                {
                    shaderType++;
                    if (!Enum.IsDefined(typeof(ShaderType), shaderType))
                    {
                        shaderType = ShaderType.OldTV;
                    }
                    break;
                }

                case 1:
                {
                    shaderType1++;
                    if (!Enum.IsDefined(typeof(ShaderType1), shaderType1))
                    {
                        shaderType1 = ShaderType1.OldTV;
                    }
                    break;
                }

                case 2:
                {
                    shaderType2++;
                    if (!Enum.IsDefined(typeof(ShaderType2), shaderType2))
                    {
                        shaderType2 = ShaderType2.None;
                    }
                    break;
                }
                }
            }

            if (GUI.RepeatButton(new Rect(texturePosition.xMax - 22f, texturePosition.yMax - 22f, 20f, 20f), "±") &&
                UnityEngine.Camera.allCameras.FirstOrDefault(x => x.name == "Camera 00") != null) //Size of main window
            {
                int windowSizeCoef = WindowSizeCoef;
                if (windowSizeCoef != 2)
                {
                    if (windowSizeCoef == 3)
                    {
                        WindowSizeCoef = 2;
                    }
                }
                else
                {
                    WindowSizeCoef = 3;
                }
                Deactivate();
                InitWindow();
                InitTextures();
                Activate();
                IsAuxiliaryWindowOpen = false;
            }
            CurrentZoom = GUI.HorizontalSlider(new Rect(texturePosition.width / 2f - 80f, 20f, 160f, 10f), CurrentZoom, MaxZoom, MinZoom);
        }