Draw() public method

public Draw ( ) : void
return void
Esempio n. 1
0
        public override void Window(int uid)
        {
            if (mAntennaFragment.Antenna == null)
            {
                Hide(); return;
            }
            GUI.skin = HighLogic.Skin;

            // check the mouse position on every draw call
            mouseOverAntennaWindow();

            GUILayout.BeginVertical(GUILayout.Width(300), GUILayout.Height(500));
            {
                mAntennaFragment.Draw();
            }
            GUILayout.EndVertical();

            base.Window(uid);
        }
Esempio n. 2
0
        public void Draw()
        {
            if (!mShowOverlay)
            {
                return;
            }
            GUI.depth = 0;
            GUI.skin  = HighLogic.Skin;

            // Draw Satellite Selector
            if (mEnabled && mSatelliteFragment.Satellite != null)
            {
                GUILayout.BeginArea(PositionSatellite, AbstractWindow.Frame);
                {
                    mSatelliteFragment.Draw();
                }
                GUILayout.EndArea();
            }

            // Hide the targetInfoWindow if we don't have a selected antenna
            if (mAntennaFragment.Antenna == null)
            {
                mTargetInfos.Hide();
            }

            // Draw Antenna Selector
            mAntennaFragment.triggerMouseOverListEntry = PositionAntenna.Contains(Event.current.mousePosition) && mEnabled;

            if (mEnabled && mSatelliteFragment.Satellite != null && mAntennaFragment.Antenna != null)
            {
                GUILayout.BeginArea(PositionAntenna, AbstractWindow.Frame);
                {
                    mAntennaFragment.Draw();
                }
                GUILayout.EndArea();
            }


            // Switch the background from map view to tracking station
            Texture2D backgroundImage = mTextures.Background;

            if (this.onTrackingStation)
            {
                backgroundImage = mTextures.BackgroundLeft;
            }


            // TODO: Fix textures
            // Draw Toolbar
            GUI.DrawTexture(Position, backgroundImage);
            GUILayout.BeginArea(Position);
            {
                GUILayout.BeginHorizontal();
                {
                    if (this.onTrackingStation)
                    {
                        if (GUILayout.Button("", StyleStatusButton, GUILayout.Width(mTextures.SatButton.width * GameSettings.UI_SCALE), GUILayout.Height(mTextures.SatButton.height * GameSettings.UI_SCALE)))
                        {
                            OnClickStatus();
                        }
                        if (GUILayout.Button(TextureTypeButton, Button, GUILayout.Width(mTextures.OmniDish.width * GameSettings.UI_SCALE), GUILayout.Height(mTextures.OmniDish.height * GameSettings.UI_SCALE)))
                        {
                            OnClickType();
                        }
                        if (GUILayout.Button(TextureReachButton, Button, GUILayout.Width(mTextures.Cone.width * GameSettings.UI_SCALE), GUILayout.Height(mTextures.Cone.height * GameSettings.UI_SCALE)))
                        {
                            OnClickReach();
                        }
                        if (GUILayout.Button(TextureComButton, Button, GUILayout.Width(mTextures.Path.width * GameSettings.UI_SCALE), GUILayout.Height(mTextures.Path.height * GameSettings.UI_SCALE)))
                        {
                            OnClickCompath();
                        }
                    }
                    else
                    {
                        GUILayout.FlexibleSpace();
                        if (GUILayout.Button(TextureComButton, Button, GUILayout.Width(mTextures.Path.width * GameSettings.UI_SCALE), GUILayout.Height(mTextures.Path.height * GameSettings.UI_SCALE)))
                        {
                            OnClickCompath();
                        }
                        if (GUILayout.Button(TextureReachButton, Button, GUILayout.Width(mTextures.Cone.width * GameSettings.UI_SCALE), GUILayout.Height(mTextures.Cone.height * GameSettings.UI_SCALE)))
                        {
                            OnClickReach();
                        }
                        if (GUILayout.Button(TextureTypeButton, Button, GUILayout.Width(mTextures.OmniDish.width * GameSettings.UI_SCALE), GUILayout.Height(mTextures.OmniDish.height * GameSettings.UI_SCALE)))
                        {
                            OnClickType();
                        }
                        if (GUILayout.Button("", StyleStatusButton, GUILayout.Width(mTextures.SatButton.width * GameSettings.UI_SCALE), GUILayout.Height(mTextures.SatButton.height * GameSettings.UI_SCALE)))
                        {
                            OnClickStatus();
                        }
                    }
                }
                GUILayout.EndHorizontal();
            }
            GUILayout.EndArea();
        }