Пример #1
0
        public FilterOverlay()
        {
            // loading styles
            mTextures.CreateTextures();
            Button       = GUITextureButtonFactory.CreateFromFilename("texButton");
            ButtonGray   = GUITextureButtonFactory.CreateFromFilename("texButtonGray");
            ButtonGreen  = GUITextureButtonFactory.CreateFromFilename("texButtonGreen");
            ButtonRed    = GUITextureButtonFactory.CreateFromFilename("texButtonRed");
            ButtonYellow = GUITextureButtonFactory.CreateFromFilename("texButtonYellow");

            GameEvents.onPlanetariumTargetChanged.Add(OnChangeTarget);
            GameEvents.onHideUI.Add(OnHideUI);
            GameEvents.onShowUI.Add(OnShowUI);
            MapView.OnEnterMapView += OnEnterMapView;
            MapView.OnExitMapView  += OnExitMapView;
            // Add the on mouse over event
            mAntennaFragment.onMouseOverListEntry += showTargetInfo;

            WindowAlign targetInfoAlign = WindowAlign.TopLeft;

            if (this.onTrackingStation)
            {
                // switch to the other side if we are at the trackingStation
                targetInfoAlign = WindowAlign.TopRight;
            }

            // Create a new Targetinfo window with a fixed position to the antenna fragment
            mTargetInfos = new TargetInfoWindow(PositionAntenna, targetInfoAlign);
        }
Пример #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");
        }
Пример #3
0
 static Style()
 {
     Button       = GUITextureButtonFactory.CreateFromFilename("texButton.png");
     ButtonGray   = GUITextureButtonFactory.CreateFromFilename("texButtonGray.png");
     ButtonGreen  = GUITextureButtonFactory.CreateFromFilename("texButtonGreen.png");
     ButtonRed    = GUITextureButtonFactory.CreateFromFilename("texButtonRed.png");
     ButtonYellow = GUITextureButtonFactory.CreateFromFilename("texButtonYellow.png");
 }
Пример #4
0
        public FocusOverlay()
        {
            Button = GUITextureButtonFactory.CreateFromFilename("texKnowledgeNormal.png", "texKnowledgeHover.png", "texKnowledgeActive.png", "texKnowledgeHover.png");

            MapView.OnEnterMapView += OnEnterMapView;
            MapView.OnExitMapView  += OnExitMapView;
            GameEvents.onHideUI.Add(OnHideUI);
            GameEvents.onShowUI.Add(OnShowUI);
        }
Пример #5
0
        public ManeuverNodeOverlay()
        {
            mManeuverNodeButtonAdd               = GUITextureButtonFactory.CreateFromFilename("buttons_fc_add", "buttons_fc_add_hover", "buttons_fc_add_hover", "buttons_fc_add_hover");
            mManeuverNodeButtonAdd.fixedHeight   = mManeuverNodeButtonAdd.fixedWidth = 0;
            mManeuverNodeButtonAdd.stretchHeight = mManeuverNodeButtonAdd.stretchWidth = true;

            mManeuverNodeButtonDelete               = GUITextureButtonFactory.CreateFromFilename("buttons_fc_del", "buttons_fc_del_hover", "buttons_fc_del", "buttons_fc_del");
            mManeuverNodeButtonDelete.fixedHeight   = mManeuverNodeButtonDelete.fixedWidth = 0;
            mManeuverNodeButtonDelete.stretchHeight = mManeuverNodeButtonDelete.stretchWidth = true;

            MapView.OnEnterMapView += OnEnterMapView;
            MapView.OnExitMapView  += OnExitMapView;

            GameEvents.onHideUI.Add(OnHideUI);
            GameEvents.onShowUI.Add(OnShowUI);
        }
Пример #6
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;
        }
Пример #7
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)
            {
                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);
            }
        }
Пример #8
0
 static Style()
 {
     Button = GUITextureButtonFactory.CreateFromFilename("texKnowledgeNormal.png", "texKnowledgeHover.png", "texKnowledgeActive.png", "texKnowledgeHover.png");
 }