コード例 #1
0
        protected override void LoadPanels()
        {
            #region Load from xml

            string fileName = Ap.FileDock(base.Game.GameMode);
            if (LoadFromFile(fileName))
            {
                return;
            }

            string defaultFileName = Ap.FileDockDefault(base.Game.GameMode);
            LoadFromFile(defaultFileName);

            #endregion

            #region Load Manually

            ChessBoard.Show(dp, DockState.Document);

            if (Config.IsDev)
            {
                DevUc.Show(ChessBoard.Pane, null);
            }
            ClockUc.Show(dp, DockState.DockRight);

            NotationUc.Show(ClockUc.Pane, DockAlignment.Bottom, 0.85);

            GameInfoUc.Visible     = Ap.Options.ShowGameInfo;
            CapturePieceUc.Visible = Ap.Options.ShowCapturedPieces;

            ChessBoard.TabText     = "Board";
            ChessBoard.HideOnClose = true;

            if (Config.IsDev)
            {
                DevUc.TabText     = "DevUc";
                DevUc.HideOnClose = true;
            }

            DockContent chatParent = NotationUc;

            switch (base.Game.GameMode)
            {
            case GameMode.None:
                break;

            case GameMode.Kibitzer:
                NotationUc.Show(ClockUc.Pane, DockAlignment.Bottom, 0.85);
                ScoringUc.Show(NotationUc.Pane, null);
                BookUc.Show(NotationUc.Pane, null);

                chatParent = NotationUc;
                break;

            case GameMode.OnlineHumanVsHuman:
                NotationUc.Show(ClockUc.Pane, DockAlignment.Bottom, 0.85);
                chatParent = NotationUc;
                break;

            case GameMode.OnlineHumanVsEngine:
            case GameMode.OnlineEngineVsEngine:
                NotationUc.Show(ClockUc.Pane, DockAlignment.Bottom, 0.85);
                AnalysisUc1.Show(NotationUc.Pane, DockAlignment.Bottom, 0.60);

                chatParent = AnalysisUc1;
                break;
            }

            ChatUc.Show(chatParent.Pane, DockAlignment.Bottom, 0.50);
            AudienceUc.Show(ChatUc.Pane, null);

            #endregion
        }
コード例 #2
0
        protected override void LoadPanels()
        {
            #region Load from xml

            string fileName = Ap.FileDock(base.Game.GameMode);
            if (LoadFromFile(fileName))
            {
                return;
            }

            string defaultFileName = Ap.FileDockDefault(base.Game.GameMode);
            if (LoadFromFile(defaultFileName) && base.Game.GameMode == GameMode.EngineVsEngine)
            {
                return;
            }
            #endregion

            #region Load Manually

            ChessBoard.Show(dp, DockState.Document);

            if (Config.IsDev)
            {
                DevUc.Show(ChessBoard.Pane, null);
            }

            ClockUc.Show(dp, DockState.DockRight);

            GameInfoUc.Visible                    = Ap.Options.ShowGameInfo;
            CapturePieceUc.Visible                = Ap.Options.ShowCapturedPieces;
            gameInfoToolStripMenuItem.Checked     = Ap.Options.ShowGameInfo;
            capturePieceToolStripMenuItem.Checked = Ap.Options.ShowCapturedPieces;

            if (base.Game.GameMode == GameMode.EngineVsEngine)
            {
                //NotationUc.Show(ChessBoard.Pane, DockAlignment.Bottom, 0.70);
                NotationUc.Show(dp, DockState.DockBottom);
            }
            else
            {
                NotationUc.Show(ClockUc.Pane, DockAlignment.Bottom, 0.85);
                ScoringUc.Show(NotationUc.Pane, null);
                BookUc.Show(NotationUc.Pane, null);
            }

            switch (base.Game.GameMode)
            {
            case GameMode.None:
                break;

            case GameMode.HumanVsHuman:
                break;

            case GameMode.HumanVsEngine:
                AnalysisUc.Show(NotationUc.Pane, DockAlignment.Bottom, 0.40);
                break;

            case GameMode.EngineVsEngine:
                base.AnalysisUc1.SetEngine(base.Game.Player1.Engine);
                AnalysisUc1.Show(ClockUc.Pane, DockAlignment.Bottom, 0.40);

                base.AnalysisUc2.SetEngine(base.Game.Player2.Engine);
                AnalysisUc2.Show(AnalysisUc1.Pane, DockAlignment.Bottom, 0.45);
                break;
            }

            #endregion
        }