Beispiel #1
0
        /// <summary>
        /// Initializes the styles and assets
        /// </summary>
        private void initalAssets()
        {
            // initial styles
            this.mGuiHintText = new GUIStyle(HighLogic.Skin.label)
            {
                fontSize = 11,
                normal   = { textColor = XKCDColors.Grey }
            };

            this.mGuiRunningText = new GUIStyle(HighLogic.Skin.label)
            {
                fontSize = 13,
                normal   = { textColor = Color.white }
            };

            this.mGuiListText = new GUIStyle(HighLogic.Skin.label)
            {
                fontSize = 12,
            };

            this.mGuiListButton = new GUIStyle(HighLogic.Skin.button)
            {
                fontSize = 12,
                normal   = { textColor = Color.white }
            };

            // initial Textures
            mTexHeadline = RTUtil.LoadImage("headline");
            // Visual style colors
            this.loadColorTexture(out this.mVSColorDish, this.mSettings.DishConnectionColor);
            this.loadColorTexture(out this.mVSColorOmni, this.mSettings.OmniConnectionColor);
            this.loadColorTexture(out this.mVSColorActive, this.mSettings.ActiveConnectionColor);
            this.loadColorTexture(out this.mVSColorRemoteStation, this.mSettings.RemoteStationColorDot);
        }
Beispiel #2
0
        public TimeWarpDecorator()
        {
            mFlightButtonGreen  = GUITextureButtonFactory.CreateFromFilename("texFlightGreen.png", "texFlightGreenOver.png", "texFlightGreenDown.png", "texFlightGreenOver.png");
            mFlightButtonYellow = GUITextureButtonFactory.CreateFromFilename("texFlightYellow.png", "texFlightYellowOver.png", "texFlightYellowDown.png", "texFlightYellowOver.png");
            mFlightButtonRed    = GUITextureButtonFactory.CreateFromFilename("texFlightRed.png", "texFlightRed.png", "texFlightRed.png", "texFlightRed.png");

            mFlightButtonGreen.fixedHeight    = mFlightButtonGreen.fixedWidth = 0;
            mFlightButtonYellow.fixedHeight   = mFlightButtonYellow.fixedWidth = 0;
            mFlightButtonRed.fixedHeight      = mFlightButtonRed.fixedWidth = 0;
            mFlightButtonGreen.stretchHeight  = mFlightButtonGreen.stretchWidth = true;
            mFlightButtonYellow.stretchHeight = mFlightButtonYellow.stretchWidth = true;
            mFlightButtonRed.stretchHeight    = mFlightButtonRed.stretchWidth = true;

            // Crap timewarp object
            mTimewarpObject = TimeWarp.fetch;

            // objects on this scene?
            if (mTimewarpObject == null || mTimewarpObject.timeQuadrantTab == null)
            {
                // to skip the draw calls
                mTimewarpObject = null;
                return;
            }

            var text = mTimewarpObject.timeQuadrantTab.transform.FindChild("MET timer").GetComponent <ScreenSafeGUIText>();

            mTextStyle          = new GUIStyle(text.textStyle);
            mTextStyle.fontSize = (int)(text.textSize * ScreenSafeUI.PixelRatio);

            // Put the draw function to the DrawQueue
            RenderingManager.AddToPostDrawQueue(0, Draw);

            // create the Background
            RTUtil.LoadImage(out mTexBackground, "TimeQuadrantFcStatus.png");
        }
Beispiel #3
0
        public static GUIStyle CreateFromFilename(String normal)
        {
            Texture2D[] tex = new Texture2D[4];
            RTUtil.LoadImage(out tex[0], normal);
            RTUtil.LoadImage(out tex[1], normal);
            RTUtil.LoadImage(out tex[2], normal);
            RTUtil.LoadImage(out tex[3], normal);

            return(CreateFromTextures(tex[0], tex[1], tex[2], tex[3]));
        }
Beispiel #4
0
        public static GUIStyle CreateFromFilename(String normal, String hover, String active,
                                                  String focus)
        {
            Texture2D[] tex = new Texture2D[4];
            RTUtil.LoadImage(out tex[0], normal);
            RTUtil.LoadImage(out tex[1], hover);
            RTUtil.LoadImage(out tex[2], active);
            RTUtil.LoadImage(out tex[3], focus);

            return(CreateFromTextures(tex[0], tex[1], tex[2], tex[3]));
        }
 static Texture()
 {
     RTUtil.LoadImage(out Background, "texBackground.png");
     RTUtil.LoadImage(out BackgroundLeft, "texBackground_left.png");
     RTUtil.LoadImage(out NoPath, "texNoPath.png");
     RTUtil.LoadImage(out Path, "texPath.png");
     RTUtil.LoadImage(out NoOmniDish, "texNoOmniDish.png");
     RTUtil.LoadImage(out Dish, "texDish.png");
     RTUtil.LoadImage(out Omni, "texOmni.png");
     RTUtil.LoadImage(out OmniDish, "texOmniDish.png");
     RTUtil.LoadImage(out NoCone, "texNoCone.png");
     RTUtil.LoadImage(out Cone, "texCone.png");
 }
Beispiel #6
0
 public void CreateTextures()
 {
     RTUtil.LoadImage(out Background, "texBackground");
     RTUtil.LoadImage(out BackgroundLeft, "texBackground_left");
     RTUtil.LoadImage(out NoPath, "texNoPath");
     RTUtil.LoadImage(out Path, "texPath");
     RTUtil.LoadImage(out NoOmniDish, "texNoOmniDish");
     RTUtil.LoadImage(out Dish, "texDish");
     RTUtil.LoadImage(out Omni, "texOmni");
     RTUtil.LoadImage(out OmniDish, "texOmniDish");
     RTUtil.LoadImage(out NoCone, "texNoCone");
     RTUtil.LoadImage(out Cone, "texCone");
     RTUtil.LoadImage(out SatButton, "texButtonGray");
 }
Beispiel #7
0
        public FocusOverlay()
        {
            // Load texture on create, removal of the old Textures class
            satellite = RTUtil.LoadImage("texSatellite");

            // New AppLauncher Button instead of floating satellite button
            var actives = KSP.UI.Screens.ApplicationLauncher.AppScenes.TRACKSTATION | KSP.UI.Screens.ApplicationLauncher.AppScenes.MAPVIEW;

            mButton    = KSP.UI.Screens.ApplicationLauncher.Instance.AddModApplication(OnButtonDown, OnButtonUp, null, null, null, null, actives, satellite);
            mButtonImg = mButton.GetComponent <UnityEngine.UI.Image>();

            RebuildTrackingListeners();

            MapView.OnEnterMapView += OnEnterMapView;
            MapView.OnExitMapView  += OnExitMapView;
        }
Beispiel #8
0
        public TimeWarpDecorator()
        {
            mFlightButtonGreen  = GUITextureButtonFactory.CreateFromFilename("texFlightGreen", "texFlightGreenOver", "texFlightGreenDown", "texFlightGreenOver");
            mFlightButtonYellow = GUITextureButtonFactory.CreateFromFilename("texFlightYellow", "texFlightYellowOver", "texFlightYellowDown", "texFlightYellowOver");
            mFlightButtonRed    = GUITextureButtonFactory.CreateFromFilename("texFlightRed", "texFlightRed", "texFlightRed", "texFlightRed");

            mFlightButtonGreen.fixedHeight    = mFlightButtonGreen.fixedWidth = 0;
            mFlightButtonYellow.fixedHeight   = mFlightButtonYellow.fixedWidth = 0;
            mFlightButtonRed.fixedHeight      = mFlightButtonRed.fixedWidth = 0;
            mFlightButtonGreen.stretchHeight  = mFlightButtonGreen.stretchWidth = true;
            mFlightButtonYellow.stretchHeight = mFlightButtonYellow.stretchWidth = true;
            mFlightButtonRed.stretchHeight    = mFlightButtonRed.stretchWidth = true;

            // create the Background
            RTUtil.LoadImage(out mTexBackground, "TimeQuadrantFcStatus");

            // Get the image for positioning the decorator
            GameObject go = GameObject.Find("TimeQuadrant");

            if (go)
            {
                mTimewarpTransform = go.GetComponent <UnityEngine.RectTransform>();
            }

            // objects on this scene?
            if (mTimewarpTransform == null || TimeWarp.fetch == null)
            {
                return;
            }

            // create a style (for the connection / delay text) from the high logic skin label style.
            var skin = UnityEngine.Object.Instantiate(HighLogic.Skin);

            mTextStyle           = new GUIStyle(skin.label);
            mTextStyle.alignment = TextAnchor.MiddleLeft;
            mTextStyle.wordWrap  = false;
            mTextStyle.font      = skin.font;
        }
        public TimeWarpDecorator()
        {
            mFlightButtonGreen  = GUITextureButtonFactory.CreateFromFilename("texFlightGreen", "texFlightGreenOver", "texFlightGreenDown", "texFlightGreenOver");
            mFlightButtonYellow = GUITextureButtonFactory.CreateFromFilename("texFlightYellow", "texFlightYellowOver", "texFlightYellowDown", "texFlightYellowOver");
            mFlightButtonRed    = GUITextureButtonFactory.CreateFromFilename("texFlightRed", "texFlightRed", "texFlightRed", "texFlightRed");

            mFlightButtonGreen.fixedHeight    = mFlightButtonGreen.fixedWidth = 0;
            mFlightButtonYellow.fixedHeight   = mFlightButtonYellow.fixedWidth = 0;
            mFlightButtonRed.fixedHeight      = mFlightButtonRed.fixedWidth = 0;
            mFlightButtonGreen.stretchHeight  = mFlightButtonGreen.stretchWidth = true;
            mFlightButtonYellow.stretchHeight = mFlightButtonYellow.stretchWidth = true;
            mFlightButtonRed.stretchHeight    = mFlightButtonRed.stretchWidth = true;

            // create the Background
            RTUtil.LoadImage(out mTexBackground, "TimeQuadrantFcStatus");

            // Get the image for positioning the decorator
            GameObject go = GameObject.Find("TimeQuadrant");

            if (go)
            {
                mTimewarpImage = go.GetComponent <UnityEngine.UI.Image>();
            }

            // objects on this scene?
            if (mTimewarpImage == null)
            {
                return;
            }

            if (TimeWarp.fetch != null && TimeWarp.fetch.timeQuadrantTab != null)
            {
                var text = TimeWarp.fetch.timeQuadrantTab.transform.FindChild("MET timer").GetComponent <ScreenSafeGUIText>();
                mTextStyle          = new GUIStyle(text.textStyle);
                mTextStyle.fontSize = (int)(text.textSize * ScreenSafeUI.PixelRatio);
            }
        }
        // Replaced with new texture handling mechanics.
        public static GUIStyle CreateFromFilename(String normal)
        {
            Texture2D tex = RTUtil.LoadImage(normal);

            return(CreateFromTextures(tex, tex, tex, tex));
        }
 // Replaced with new texture handling mechanics.
 public static GUIStyle CreateFromFilename(String normal, String hover, String active, String focus)
 {
     return(CreateFromTextures(RTUtil.LoadImage(normal), RTUtil.LoadImage(hover),
                               RTUtil.LoadImage(active), RTUtil.LoadImage(focus)));
 }
Beispiel #12
0
 static Texture()
 {
     RTUtil.LoadImage(out Satellite, "texSatellite.png");
 }