예제 #1
0
    public override void Draw()
    {
        miniMap.Draw();
        gameSpeedButton.Draw();
        combatTimer.Draw();

        if (screenState == ScreenState.setup)
        {
            DrawSetup();
        }
        else if (screenState == ScreenState.play)
        {
            shipInfoPanel.Draw(mousePosition);
            if (shipDragSelectionBox.isActive())
            {
                shipDragSelectionBox.Draw();
            }
        }
        else if (screenState == ScreenState.Summary)
        {
            SummaryScrollList.Draw();
        }
        else
        {
            DrawPauseMenu();
        }
    }
    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();
        }
    }