示例#1
0
        public override void Draw(BMapControl c, Graphics g)
        {
            if (IsVisible)
            {
                this.map       = c;
                ScreenPosition = map.LatLngToPoint(Position);
                Point p    = ScreenPosition.GetOffSet(OffSet.X, OffSet.Y);
                var   rect = ScreenArea = new Rectangle(p, Size);
                if (IsMouseOver)
                {
                    g.FillEllipse(new SolidBrush(Color.FromArgb(0xaa, 0xff, 0xff, 0xff)), rect);

                    //if (ToolTip!=null)
                    //{
                    //    ToolTip.IsOpen=IsMouseOver;
                    //}
                }

                p.Offset(3, 3);
                var rect1 = new Rectangle(p.X, p.Y, Size.Width - 6, Size.Height - 6);
                g.FillEllipse(new SolidBrush(Color.FromArgb(0xFF, 0x11, 0x11, 0xff)), rect1);


                ToolTip.Draw(c, g);
            }
        }
        public override void Draw()
        {
            base.Draw();

            // Draw tooltip last
            if (defaultToolTip != null)
            {
                defaultToolTip.Draw();
            }
        }
示例#3
0
        public override bool HandleMouseMoveEvent(ZedGraphControl sender, MouseEventArgs e)
        {
            using (var g = sender.CreateGraphics())
            {
                if (FindNearestObject(e.Location, g, out var nearestObject, out var index) && nearestObject is BarItem)
                {
                    PopulateTooltip(index);
                    ToolTip?.Draw(index, e.Location);

                    sender.Cursor = Cursors.Hand;
                    return(true);
                }
    public override void Draw()
    {
        if (quitResumeSubScreen.isOpen())
        {
            quitResumeSubScreen.Draw();
        }
        else if (SummaryScrollList.isOpen())
        {
            SummaryScrollList.Draw();
        }
        else if (designDisplayWindow.isOpen())
        {
            designDisplayWindow.Draw();
        }
        else
        {
            miniMap.Draw();
            shipInfoPanel.Draw(mousePosition);
            fleetCombatInfoPanel.Draw();
            gameSpeedButton.Draw();
            combatTimer.Draw();

            if (SetupPhase)
            {
                GUI.Box(ShipSelectionRect, "", GameManager.instance.standardBackGround);

                if (GUI.Button(ShipsCategoryButtonRect, "Ships", GameManager.instance.standardButtonStyle))
                {
                    ChangeUnitCategory(UnitCategory.Ships);
                    PlayMainButtonClick();
                }
                if (GUI.Button(StationCategoryButtonRect, "Stations", GameManager.instance.standardButtonStyle))
                {
                    ChangeUnitCategory(UnitCategory.Stations);
                    PlayMainButtonClick();
                }
                if (GUI.Button(FightersCategoryButtonRect, "Fighters", GameManager.instance.standardButtonStyle))
                {
                    ChangeUnitCategory(UnitCategory.Fighters);
                    PlayMainButtonClick();
                }

                if (SelectedUnityCategory == UnitCategory.Ships)
                {
                    shipHullList.Draw();

                    DesignScrollPostion = GUI.BeginScrollView(DesignScrollWindowRect, DesignScrollPostion, DesignScrollViewRect);
                    foreach (DesignDataListEntry entry in DesignDataList)
                    {
                        entry.Draw(selectedDesign);
                    }
                    GUI.EndScrollView();
                }
                else if (SelectedUnityCategory == UnitCategory.Stations)
                {
                    stationHullList.Draw();

                    DesignScrollPostion = GUI.BeginScrollView(DesignScrollWindowRect, DesignScrollPostion, DesignScrollViewRect);
                    foreach (StationDesignDataListEntry entry in StationDesignDataList)
                    {
                        entry.Draw(selectedStationDesign);
                    }
                    GUI.EndScrollView();
                }
                else
                {
                    fighterList.Draw();
                }

                //Owner Toggles
                if (GUI.Toggle(OwnerPlayerButtonRect, PlayerSelected, "Player"))
                {
                    if (!PlayerSelected)
                    {
                        PlayerSelected  = true;
                        EnemySelected   = false;
                        AllySelected    = false;
                        NeutralSelected = false;
                        if (DummyUnit != null)
                        {
                            DummyUnit.transform.GetChild(0).gameObject.layer = 9;
                        }
                        PlayMainButtonClick();
                    }
                }
                if (GUI.Toggle(OwnerEnemyButtonRect, EnemySelected, "Enemy"))
                {
                    if (!EnemySelected)
                    {
                        PlayerSelected  = false;
                        EnemySelected   = true;
                        AllySelected    = false;
                        NeutralSelected = false;
                        if (DummyUnit != null)
                        {
                            DummyUnit.transform.GetChild(0).gameObject.layer = 10;
                        }
                        PlayMainButtonClick();
                    }
                }
                if (GUI.Toggle(OwnerAlliedButtonRect, AllySelected, "Ally"))
                {
                    if (!AllySelected)
                    {
                        PlayerSelected  = false;
                        EnemySelected   = false;
                        AllySelected    = true;
                        NeutralSelected = false;
                        if (DummyUnit != null)
                        {
                            DummyUnit.transform.GetChild(0).gameObject.layer = 11;
                        }
                        PlayMainButtonClick();
                    }
                }
                if (GUI.Toggle(OwnerNeutralButtonRect, NeutralSelected, "Neutral"))
                {
                    if (!NeutralSelected)
                    {
                        PlayerSelected  = false;
                        EnemySelected   = false;
                        AllySelected    = false;
                        NeutralSelected = true;
                        if (DummyUnit != null)
                        {
                            DummyUnit.transform.GetChild(0).gameObject.layer = 13;
                        }
                        PlayMainButtonClick();
                    }
                }

                //Button to start Combat
                if (GUI.Button(StartButtonRect, "Start", GameManager.instance.standardButtonStyle))
                {
                    DeselectDesignData();
                    SetPauseShipManagers(false);
                    SetupPhase = false;
                    PlayMainButtonClick();
                }

                if (GUI.Button(SummaryButtonRect, "Summary", GameManager.instance.standardButtonStyle))
                {
                    AddEntriesToSummaryList();
                    SummaryScrollList.SetOpen(true);
                }
            }
            else
            {
                storedUnitPanel.Draw();
                storedUnitPanel.CheckToolTip(mousePosition);
                if (shipDragSelectionBox.isActive())
                {
                    shipDragSelectionBox.Draw();
                }
            }

            if (combatTimer.CheckToolTip(mousePosition))
            {
            }
            else if (miniMap.CheckToolTip(mousePosition))
            {
            }
            else if (gameSpeedButton.ToolTipCheck(mousePosition))
            {
            }

            ToolTip.Draw();
        }
    }
示例#5
0
 public void DrawToolTip()
 {
     ToolTip.Draw();
 }