public override void Initialize()
        {
            if (CheckedTexture == null)
            {
                throw new ArgumentNullException(nameof(CheckedTexture));
            }

            if (UncheckedTexture == null)
            {
                throw new ArgumentNullException(nameof(UncheckedTexture));
            }

            UpdateIdleTexture();

            if (HoverSoundEffect == null)
            {
                HoverSoundEffect = new EnhancedSoundEffect("button.wav");
            }

            base.Initialize();

            _toolTip = new ToolTip(WindowManager, this);
            SetToolTipText(_toolTipText);

            if (Width == 0)
            {
                Width = IdleTexture.Width;
            }
        }
예제 #2
0
        public override void Initialize()
        {
            int width = Width;

            if (IdleTexture == null)
            {
                IdleTexture = AssetLoader.LoadTexture(width + "pxbtn.png");
            }

            if (HoverTexture == null)
            {
                HoverTexture = AssetLoader.LoadTexture(width + "pxbtn_c.png");
            }

            if (HoverSoundEffect == null)
            {
                HoverSoundEffect = new EnhancedSoundEffect("button.wav");
            }

            base.Initialize();

            if (Width == 0)
            {
                Width = IdleTexture.Width;
            }
        }
예제 #3
0
        public override void Initialize()
        {
            EnableStartLocationSelection = true;

#if !WINDOWSGL
            disposeTextures = !UserINISettings.Instance.PreloadMapPreviews;
#endif
            startingLocationIndicators = new PlayerLocationIndicator[MAX_STARTING_LOCATIONS];

            Color nameBackgroundColor = AssetLoader.GetRGBAColorFromString(
                ClientConfiguration.Instance.MapPreviewNameBackgroundColor);

            Color nameBorderColor = AssetLoader.GetRGBAColorFromString(
                ClientConfiguration.Instance.MapPreviewNameBorderColor);

            contextMenu     = new XNAContextMenu(WindowManager);
            contextMenu.Tag = -1;

            double angularVelocity         = gameOptionsIni.GetDoubleValue("General", "StartingLocationAngularVelocity", 0.015);
            double reservedAngularVelocity = gameOptionsIni.GetDoubleValue("General", "ReservedStartingLocationAngularVelocity", -0.0075);

            Color hoverRemapColor = AssetLoader.GetRGBAColorFromString(ClientConfiguration.Instance.MapPreviewStartingLocationHoverRemapColor);

            // Init starting location indicators
            for (int i = 0; i < MAX_STARTING_LOCATIONS; i++)
            {
                PlayerLocationIndicator indicator = new PlayerLocationIndicator(WindowManager, mpColors,
                                                                                nameBackgroundColor, nameBorderColor, contextMenu);
                indicator.FontIndex               = FontIndex;
                indicator.Visible                 = false;
                indicator.Enabled                 = false;
                indicator.AngularVelocity         = angularVelocity;
                indicator.HoverRemapColor         = hoverRemapColor;
                indicator.ReversedAngularVelocity = reservedAngularVelocity;
                indicator.WaypointTexture         = AssetLoader.LoadTexture(string.Format("slocindicator{0}.png", i + 1));
                indicator.Tag         = i;
                indicator.LeftClick  += Indicator_LeftClick;
                indicator.RightClick += Indicator_RightClick;

                startingLocationIndicators[i] = indicator;

                AddChild(indicator);
            }

            contextMenu.ClientRectangle = new Rectangle(0, 0, 150, 2);
            AddChild(contextMenu);
            contextMenu.Disable();

            briefingBox = new CoopBriefingBox(WindowManager);
            AddChild(briefingBox);
            briefingBox.Disable();

            sndClickSound = new EnhancedSoundEffect("button.wav");

            sndDropdownSound = new EnhancedSoundEffect("dropdown.wav");

            base.Initialize();

            ClientRectangleUpdated += (s, e) => UpdateMap();
        }
예제 #4
0
        public override void Initialize()
        {
            int width = Width;

            if (IdleTexture == null)
            {
                IdleTexture = AssetLoader.LoadTexture(width + "pxbtn.png");
            }

            if (HoverTexture == null)
            {
                HoverTexture = AssetLoader.LoadTexture(width + "pxbtn_c.png");
            }

            if (HoverSoundEffect == null)
            {
                HoverSoundEffect = new EnhancedSoundEffect("button.wav");
            }

            base.Initialize();

            if (Width == 0)
            {
                Width = IdleTexture.Width;
            }

            _toolTip = new ToolTip(WindowManager, this);
            SetToolTipText(_toolTipText);
        }
        public override void Initialize()
        {
            CheckSoundEffect = new EnhancedSoundEffect("checkbox.wav");

            base.Initialize();

            toolTip = new ToolTip(WindowManager, this);
        }
예제 #6
0
        public override void Initialize()
        {
            CheckSoundEffect = new EnhancedSoundEffect("checkbox.wav");

            base.Initialize();

            CreateToolTip();
        }
예제 #7
0
        public override void Initialize()
        {
            ClickSoundEffect = new EnhancedSoundEffect("dropdown.wav");

            base.Initialize();

            ToolTip = new ToolTip(WindowManager, this);
        }
        public override void Initialize()
        {
            ClickSoundEffect = new EnhancedSoundEffect("dropdown.wav");

            CreateToolTip();

            base.Initialize();
        }
예제 #9
0
        public override void Initialize()
        {
            if (ClickSound == null)
            {
                ClickSound = new EnhancedSoundEffect("button.wav");
            }


            base.Initialize();
        }
예제 #10
0
        public override void ParseAttributeFromINI(IniFile iniFile, string key, string value)
        {
            switch (key)
            {
            case "OpenUp":
                OpenUp = Conversions.BooleanFromString(value, OpenUp);
                return;

            case "DropDownTexture":
                DropDownTexture = AssetLoader.LoadTextureUncached(value);
                return;

            case "DropDownOpenTexture":
                DropDownOpenTexture = AssetLoader.LoadTextureUncached(value);
                return;

            case "ItemHeight":
                ItemHeight = Conversions.IntFromString(value, ItemHeight);
                return;

            case "ClickSoundEffect":
                ClickSoundEffect = new EnhancedSoundEffect(value);
                return;

            case "FontIndex":
                FontIndex = Conversions.IntFromString(value, FontIndex);
                return;

            case "BorderColor":
                BorderColor = AssetLoader.GetRGBAColorFromString(value);
                return;

            case "FocusColor":
                FocusColor = AssetLoader.GetRGBAColorFromString(value);
                return;

            case "BackColor":
                BackColor = AssetLoader.GetRGBAColorFromString(value);
                return;

            case "DisabledItemColor":
                DisabledItemColor = AssetLoader.GetColorFromString(value);
                return;
            }

            if (key.StartsWith("Option"))
            {
                AddItem(value);
                return;
            }

            base.ParseAttributeFromINI(iniFile, key, value);
        }
예제 #11
0
        public override void Initialize()
        {
            EnableStartLocationSelection = true;

            BackgroundTexture = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);

#if !WINDOWSGL
            disposeTextures = !UserINISettings.Instance.PreloadMapPreviews;
#endif

            contextMenu                 = new XNAContextMenu(WindowManager);
            contextMenu.Tag             = -1;
            contextMenu.ClientRectangle = new Rectangle(0, 0, 150, 2);
            AddChild(contextMenu);
            contextMenu.Disable();

            sndClickSound = new EnhancedSoundEffect("button.wav");

            sndDropdownSound = new EnhancedSoundEffect("dropdown.wav");

            base.Initialize();
        }
예제 #12
0
        public override void ParseAttributeFromINI(IniFile iniFile, string key, string value)
        {
            switch (key)
            {
            case "MinValue":
                MinValue = iniFile.GetIntValue(Name, "MinValue", 0);
                return;

            case "MaxValue":
                MaxValue = iniFile.GetIntValue(Name, "MaxValue", 10);
                return;

            case "Value":
                Value = iniFile.GetIntValue(Name, "Value", 0);
                return;

            case "ClickSound":
                ClickSound = new EnhancedSoundEffect(value);
                return;
            }

            base.ParseAttributeFromINI(iniFile, key, value);
        }
예제 #13
0
        public override void Initialize()
        {
            Name = "LANLobby";
            BackgroundTexture = AssetLoader.LoadTexture("cncnetlobbybg.png");
            ClientRectangle   = new Rectangle(0, 0, WindowManager.RenderResolutionX - 64,
                                              WindowManager.RenderResolutionY - 64);

            localGame      = ClientConfiguration.Instance.LocalGame;
            localGameIndex = gameCollection.GameList.FindIndex(
                g => g.InternalName.ToUpper() == localGame.ToUpper());

            btnNewGame                 = new XNAClientButton(WindowManager);
            btnNewGame.Name            = "btnNewGame";
            btnNewGame.ClientRectangle = new Rectangle(12, Height - 35, UIDesignConstants.BUTTON_WIDTH_133, UIDesignConstants.BUTTON_HEIGHT);
            btnNewGame.Text            = "Create Game";
            btnNewGame.LeftClick      += BtnNewGame_LeftClick;

            btnJoinGame                 = new XNAClientButton(WindowManager);
            btnJoinGame.Name            = "btnJoinGame";
            btnJoinGame.ClientRectangle = new Rectangle(btnNewGame.Right + 12,
                                                        btnNewGame.Y, UIDesignConstants.BUTTON_WIDTH_133, UIDesignConstants.BUTTON_HEIGHT);
            btnJoinGame.Text       = "Join Game";
            btnJoinGame.LeftClick += BtnJoinGame_LeftClick;

            btnMainMenu                 = new XNAClientButton(WindowManager);
            btnMainMenu.Name            = "btnMainMenu";
            btnMainMenu.ClientRectangle = new Rectangle(Width - 145,
                                                        btnNewGame.Y, UIDesignConstants.BUTTON_WIDTH_133, UIDesignConstants.BUTTON_HEIGHT);
            btnMainMenu.Text       = "Main Menu";
            btnMainMenu.LeftClick += BtnMainMenu_LeftClick;

            lbGameList                 = new GameListBox(WindowManager, localGame, null);
            lbGameList.Name            = "lbGameList";
            lbGameList.ClientRectangle = new Rectangle(btnNewGame.X,
                                                       41, btnJoinGame.Right - btnNewGame.X,
                                                       btnNewGame.Y - 53);
            lbGameList.GameLifetime            = 15.0; // Smaller lifetime in LAN
            lbGameList.PanelBackgroundDrawMode = PanelBackgroundImageDrawMode.STRETCHED;
            lbGameList.BackgroundTexture       = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);
            lbGameList.DoubleLeftClick        += LbGameList_DoubleLeftClick;
            lbGameList.AllowMultiLineItems     = false;

            lbPlayerList                 = new XNAListBox(WindowManager);
            lbPlayerList.Name            = "lbPlayerList";
            lbPlayerList.ClientRectangle = new Rectangle(Width - 202,
                                                         lbGameList.Y, 190,
                                                         lbGameList.Height);
            lbPlayerList.PanelBackgroundDrawMode = PanelBackgroundImageDrawMode.STRETCHED;
            lbPlayerList.BackgroundTexture       = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);
            lbPlayerList.LineHeight = 16;

            lbChatMessages                 = new ChatListBox(WindowManager);
            lbChatMessages.Name            = "lbChatMessages";
            lbChatMessages.ClientRectangle = new Rectangle(lbGameList.Right + 12,
                                                           lbGameList.Y,
                                                           lbPlayerList.X - lbGameList.Right - 24,
                                                           lbGameList.Height);
            lbChatMessages.PanelBackgroundDrawMode = PanelBackgroundImageDrawMode.STRETCHED;
            lbChatMessages.BackgroundTexture       = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);
            lbChatMessages.LineHeight = 16;

            tbChatInput                 = new XNAChatTextBox(WindowManager);
            tbChatInput.Name            = "tbChatInput";
            tbChatInput.ClientRectangle = new Rectangle(lbChatMessages.X,
                                                        btnNewGame.Y, lbChatMessages.Width,
                                                        btnNewGame.Height);
            tbChatInput.Suggestion        = "Type here to chat...";
            tbChatInput.MaximumTextLength = 200;
            tbChatInput.EnterPressed     += TbChatInput_EnterPressed;

            lblColor                 = new XNALabel(WindowManager);
            lblColor.Name            = "lblColor";
            lblColor.ClientRectangle = new Rectangle(lbChatMessages.X, 14, 0, 0);
            lblColor.FontIndex       = 1;
            lblColor.Text            = "YOUR COLOR:";

            ddColor                 = new XNAClientDropDown(WindowManager);
            ddColor.Name            = "ddColor";
            ddColor.ClientRectangle = new Rectangle(lblColor.X + 95, 12,
                                                    150, 21);

            chatColors = new LANColor[]
            {
                new LANColor("Gray", Color.Gray),
                new LANColor("Metalic", Color.LightGray),
                new LANColor("Green", Color.Green),
                new LANColor("Lime Green", Color.LimeGreen),
                new LANColor("Green Yellow", Color.GreenYellow),
                new LANColor("Goldenrod", Color.Goldenrod),
                new LANColor("Yellow", Color.Yellow),
                new LANColor("Orange", Color.Orange),
                new LANColor("Red", Color.Red),
                new LANColor("Pink", Color.DeepPink),
                new LANColor("Purple", Color.MediumPurple),
                new LANColor("Sky Blue", Color.SkyBlue),
                new LANColor("Blue", Color.Blue),
                new LANColor("Brown", Color.SaddleBrown),
                new LANColor("Teal", Color.Teal)
            };

            foreach (LANColor color in chatColors)
            {
                ddColor.AddItem(color.Name, color.XNAColor);
            }

            AddChild(btnNewGame);
            AddChild(btnJoinGame);
            AddChild(btnMainMenu);

            AddChild(lbPlayerList);
            AddChild(lbChatMessages);
            AddChild(lbGameList);
            AddChild(tbChatInput);
            AddChild(lblColor);
            AddChild(ddColor);

            gameCreationWindow = new LANGameCreationWindow(WindowManager);
            var gameCreationPanel = new DarkeningPanel(WindowManager);

            AddChild(gameCreationPanel);
            gameCreationPanel.AddChild(gameCreationWindow);
            gameCreationWindow.Disable();

            gameCreationWindow.NewGame  += GameCreationWindow_NewGame;
            gameCreationWindow.LoadGame += GameCreationWindow_LoadGame;

            unknownGameIcon = AssetLoader.TextureFromImage(ClientCore.Properties.Resources.unknownicon);

            sndGameCreated = new EnhancedSoundEffect("gamecreated.wav");

            encoding = Encoding.UTF8;

            base.Initialize();

            CenterOnParent();
            gameCreationPanel.SetPositionAndSize();

            lanGameLobby = new LANGameLobby(WindowManager, "MultiplayerGameLobby",
                                            null, gameModes, chatColors, mapLoader, discordHandler);
            DarkeningPanel.AddAndInitializeWithControl(WindowManager, lanGameLobby);
            lanGameLobby.Disable();

            lanGameLoadingLobby = new LANGameLoadingLobby(WindowManager,
                                                          gameModes, chatColors, discordHandler);
            DarkeningPanel.AddAndInitializeWithControl(WindowManager, lanGameLoadingLobby);
            lanGameLoadingLobby.Disable();

            int selectedColor = UserINISettings.Instance.LANChatColor;

            ddColor.SelectedIndex = selectedColor >= ddColor.Items.Count || selectedColor < 0
                ? 0 : selectedColor;

            SetChatColor();
            ddColor.SelectedIndexChanged += DdColor_SelectedIndexChanged;

            lanGameLobby.GameLeft      += LanGameLobby_GameLeft;
            lanGameLobby.GameBroadcast += LanGameLobby_GameBroadcast;

            lanGameLoadingLobby.GameBroadcast += LanGameLoadingLobby_GameBroadcast;
            lanGameLoadingLobby.GameLeft      += LanGameLoadingLobby_GameLeft;

            WindowManager.GameClosing += WindowManager_GameClosing;
        }
        public override void Initialize()
        {
            Name              = "PrivateMessagingWindow";
            ClientRectangle   = new Rectangle(0, 0, 600, 600);
            BackgroundTexture = AssetLoader.LoadTextureUncached("privatemessagebg.png");

            unknownGameIcon = AssetLoader.TextureFromImage(ClientCore.Properties.Resources.unknownicon);
            adminGameIcon   = AssetLoader.TextureFromImage(ClientCore.Properties.Resources.cncneticon);

            personalMessageColor  = AssetLoader.GetColorFromString(ClientConfiguration.Instance.SentPMColor);
            otherUserMessageColor = AssetLoader.GetColorFromString(ClientConfiguration.Instance.ReceivedPMColor);

            lblPrivateMessaging           = new XNALabel(WindowManager);
            lblPrivateMessaging.Name      = "lblPrivateMessaging";
            lblPrivateMessaging.FontIndex = 1;
            lblPrivateMessaging.Text      = "PRIVATE MESSAGING";

            AddChild(lblPrivateMessaging);
            lblPrivateMessaging.CenterOnParent();
            lblPrivateMessaging.ClientRectangle = new Rectangle(
                lblPrivateMessaging.ClientRectangle.X, 12,
                lblPrivateMessaging.ClientRectangle.Width,
                lblPrivateMessaging.ClientRectangle.Height);

            tabControl                 = new XNAClientTabControl(WindowManager);
            tabControl.Name            = "tabControl";
            tabControl.ClientRectangle = new Rectangle(60, 50, 0, 0);
            tabControl.SoundOnClick    = AssetLoader.LoadSound("button.wav");
            tabControl.FontIndex       = 1;
            tabControl.AddTab("Messages", 160);
            tabControl.AddTab("Friend List", 160);
            tabControl.AddTab("All Players", 160);
            tabControl.SelectedIndexChanged += TabControl_SelectedIndexChanged;

            lblPlayers                 = new XNALabel(WindowManager);
            lblPlayers.Name            = "lblPlayers";
            lblPlayers.ClientRectangle = new Rectangle(12, tabControl.ClientRectangle.Bottom + 24, 0, 0);
            lblPlayers.FontIndex       = 1;
            lblPlayers.Text            = "PLAYERS:";

            lbUserList                 = new XNAListBox(WindowManager);
            lbUserList.Name            = "lbUserList";
            lbUserList.ClientRectangle = new Rectangle(lblPlayers.ClientRectangle.X,
                                                       lblPlayers.ClientRectangle.Bottom + 6,
                                                       150, ClientRectangle.Height - lblPlayers.ClientRectangle.Bottom - 18);
            lbUserList.RightClick           += LbUserList_RightClick;
            lbUserList.SelectedIndexChanged += LbUserList_SelectedIndexChanged;
            lbUserList.BackgroundTexture     = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);
            lbUserList.DrawMode              = PanelBackgroundImageDrawMode.STRETCHED;

            lblMessages                 = new XNALabel(WindowManager);
            lblMessages.Name            = "lblMessages";
            lblMessages.ClientRectangle = new Rectangle(lbUserList.ClientRectangle.Right + 12,
                                                        lblPlayers.ClientRectangle.Y, 0, 0);
            lblMessages.FontIndex = 1;
            lblMessages.Text      = "MESSAGES:";

            lbMessages                 = new ChatListBox(WindowManager);
            lbMessages.Name            = "lbMessages";
            lbMessages.ClientRectangle = new Rectangle(lblMessages.ClientRectangle.X,
                                                       lbUserList.ClientRectangle.Y,
                                                       ClientRectangle.Width - lblMessages.ClientRectangle.X - 12,
                                                       lbUserList.ClientRectangle.Height - 25);
            lbMessages.BackgroundTexture = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);
            lbMessages.DrawMode          = PanelBackgroundImageDrawMode.STRETCHED;

            tbMessageInput                 = new XNATextBox(WindowManager);
            tbMessageInput.Name            = "tbMessageInput";
            tbMessageInput.ClientRectangle = new Rectangle(lbMessages.ClientRectangle.X,
                                                           lbMessages.ClientRectangle.Bottom + 6, lbMessages.ClientRectangle.Width, 19);
            tbMessageInput.EnterPressed     += TbMessageInput_EnterPressed;
            tbMessageInput.MaximumTextLength = 200;
            tbMessageInput.Enabled           = false;

            playerContextMenu                 = new PlayerContextMenu(WindowManager);
            playerContextMenu.Name            = "playerContextMenu";
            playerContextMenu.ClientRectangle = new Rectangle(0, 0, 150, 2);
            playerContextMenu.Enabled         = false;
            playerContextMenu.Visible         = false;
            playerContextMenu.AddItem("Add Friend");
            playerContextMenu.OptionSelected += PlayerContextMenu_OptionSelected;

            notificationBox         = new PrivateMessageNotificationBox(WindowManager);
            notificationBox.Enabled = false;
            notificationBox.Visible = false;

            AddChild(tabControl);
            AddChild(lblPlayers);
            AddChild(lbUserList);
            AddChild(lblMessages);
            AddChild(lbMessages);
            AddChild(tbMessageInput);
            AddChild(playerContextMenu);
            WindowManager.AddAndInitializeControl(notificationBox);

            base.Initialize();

            CenterOnParent();

            try
            {
                friendList = File.ReadAllLines(ProgramConstants.GamePath + FRIEND_LIST_PATH).ToList();
            }
            catch
            {
                Logger.Log("Loading friend list failed!");
                friendList = new List <string>();
            }

            tabControl.SelectedTab = 0;

            connectionManager.PrivateMessageReceived += ConnectionManager_PrivateMessageReceived;

            sndMessageSound = new EnhancedSoundEffect("message.wav");

            sndPrivateMessageSound = new EnhancedSoundEffect("pm.wav");

            sndMessageSound.Enabled = UserINISettings.Instance.MessageSound;

            GameProcessLogic.GameProcessExited += SharedUILogic_GameProcessExited;
        }
예제 #15
0
        public override void Initialize()
        {
            Name              = "GameLoadingLobby";
            ClientRectangle   = new Rectangle(0, 0, 590, 510);
            BackgroundTexture = AssetLoader.LoadTexture("loadmpsavebg.png");

            lblDescription                 = new XNALabel(WindowManager);
            lblDescription.Name            = "lblDescription";
            lblDescription.ClientRectangle = new Rectangle(12, 12, 0, 0);
            lblDescription.Text            = "Wait for all players to join and get ready, then click Load Game to load the saved multiplayer game.";

            panelPlayers = new XNAPanel(WindowManager);
            panelPlayers.ClientRectangle   = new Rectangle(12, 32, 373, 125);
            panelPlayers.BackgroundTexture = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);
            panelPlayers.DrawMode          = PanelBackgroundImageDrawMode.STRETCHED;

            AddChild(lblDescription);
            AddChild(panelPlayers);

            lblPlayerNames = new XNALabel[8];
            for (int i = 0; i < 4; i++)
            {
                XNALabel lblPlayerName = new XNALabel(WindowManager);
                lblPlayerName.Name            = "lblPlayerName" + i;
                lblPlayerName.ClientRectangle = new Rectangle(9, 9 + 30 * i, 0, 0);
                lblPlayerName.Text            = "Player " + i;
                panelPlayers.AddChild(lblPlayerName);
                lblPlayerNames[i] = lblPlayerName;
            }

            for (int i = 4; i < 8; i++)
            {
                XNALabel lblPlayerName = new XNALabel(WindowManager);
                lblPlayerName.Name            = "lblPlayerName" + i;
                lblPlayerName.ClientRectangle = new Rectangle(190, 9 + 30 * (i - 4), 0, 0);
                lblPlayerName.Text            = "Player " + i;
                panelPlayers.AddChild(lblPlayerName);
                lblPlayerNames[i] = lblPlayerName;
            }

            lblMapName                 = new XNALabel(WindowManager);
            lblMapName.Name            = "lblMapName";
            lblMapName.FontIndex       = 1;
            lblMapName.ClientRectangle = new Rectangle(panelPlayers.Right + 12,
                                                       panelPlayers.Y, 0, 0);
            lblMapName.Text = "MAP:";

            lblMapNameValue                 = new XNALabel(WindowManager);
            lblMapNameValue.Name            = "lblMapNameValue";
            lblMapNameValue.ClientRectangle = new Rectangle(lblMapName.X,
                                                            lblMapName.Y + 18, 0, 0);
            lblMapNameValue.Text = "Map name";

            lblGameMode                 = new XNALabel(WindowManager);
            lblGameMode.Name            = "lblGameMode";
            lblGameMode.ClientRectangle = new Rectangle(lblMapName.X,
                                                        panelPlayers.Y + 40, 0, 0);
            lblGameMode.FontIndex = 1;
            lblGameMode.Text      = "GAME MODE:";

            lblGameModeValue                 = new XNALabel(WindowManager);
            lblGameModeValue.Name            = "lblGameModeValue";
            lblGameModeValue.ClientRectangle = new Rectangle(lblGameMode.X,
                                                             lblGameMode.Y + 18, 0, 0);
            lblGameModeValue.Text = "Game mode";

            lblSavedGameTime                 = new XNALabel(WindowManager);
            lblSavedGameTime.Name            = "lblSavedGameTime";
            lblSavedGameTime.ClientRectangle = new Rectangle(lblMapName.X,
                                                             panelPlayers.Bottom - 40, 0, 0);
            lblSavedGameTime.FontIndex = 1;
            lblSavedGameTime.Text      = "SAVED GAME:";

            ddSavedGame                 = new XNAClientDropDown(WindowManager);
            ddSavedGame.Name            = "ddSavedGame";
            ddSavedGame.ClientRectangle = new Rectangle(lblSavedGameTime.X,
                                                        panelPlayers.Bottom - 21,
                                                        Width - lblSavedGameTime.X - 12, 21);
            ddSavedGame.SelectedIndexChanged += DdSavedGame_SelectedIndexChanged;

            lbChatMessages      = new ChatListBox(WindowManager);
            lbChatMessages.Name = "lbChatMessages";
            lbChatMessages.BackgroundTexture = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);
            lbChatMessages.DrawMode          = PanelBackgroundImageDrawMode.STRETCHED;
            lbChatMessages.ClientRectangle   = new Rectangle(12, panelPlayers.Bottom + 12,
                                                             Width - 24,
                                                             Height - panelPlayers.Bottom - 12 - 29 - 34);

            tbChatInput                 = new XNATextBox(WindowManager);
            tbChatInput.Name            = "tbChatInput";
            tbChatInput.ClientRectangle = new Rectangle(lbChatMessages.X,
                                                        lbChatMessages.Bottom + 3, lbChatMessages.Width, 19);
            tbChatInput.MaximumTextLength = 200;
            tbChatInput.EnterPressed     += TbChatInput_EnterPressed;

            btnLoadGame                 = new XNAClientButton(WindowManager);
            btnLoadGame.Name            = "btnLoadGame";
            btnLoadGame.ClientRectangle = new Rectangle(lbChatMessages.X,
                                                        tbChatInput.Bottom + 6, 133, 23);
            btnLoadGame.Text       = "Load Game";
            btnLoadGame.LeftClick += BtnLoadGame_LeftClick;

            btnLeaveGame                 = new XNAClientButton(WindowManager);
            btnLeaveGame.Name            = "btnLeaveGame";
            btnLeaveGame.ClientRectangle = new Rectangle(Width - 145,
                                                         btnLoadGame.Y, 133, 23);
            btnLeaveGame.Text       = "Leave Game";
            btnLeaveGame.LeftClick += BtnLeaveGame_LeftClick;

            AddChild(lblMapName);
            AddChild(lblMapNameValue);
            AddChild(lblGameMode);
            AddChild(lblGameModeValue);
            AddChild(lblSavedGameTime);
            AddChild(lbChatMessages);
            AddChild(tbChatInput);
            AddChild(btnLoadGame);
            AddChild(btnLeaveGame);
            AddChild(ddSavedGame);

            base.Initialize();

            sndGetReady     = new EnhancedSoundEffect("getready.wav");
            sndJoinSound    = new EnhancedSoundEffect("joingame.wav");
            sndLeaveSound   = new EnhancedSoundEffect("leavegame.wav");
            sndMessageSound = new EnhancedSoundEffect("message.wav");

            MPColors = MultiplayerColor.LoadColors();

            WindowManager.CenterControlOnScreen(this);

            if (SavedGameManager.AreSavedGamesAvailable())
            {
                fsw = new FileSystemWatcher(ProgramConstants.GamePath + "Saved Games", "*.NET");
                fsw.EnableRaisingEvents = false;
                fsw.Created            += fsw_Created;
                fsw.Changed            += fsw_Created;
            }
        }
예제 #16
0
        private void PostUIInit()
        {
            sndGameCreated = new EnhancedSoundEffect("gamecreated.wav");

            cAdminNameColor = AssetLoader.GetColorFromString(ClientConfiguration.Instance.AdminNameColor);
            unknownGameIcon = AssetLoader.TextureFromImage(ClientCore.Properties.Resources.unknownicon);
            adminGameIcon   = AssetLoader.TextureFromImage(ClientCore.Properties.Resources.cncneticon);

            connectionManager.WelcomeMessageReceived += ConnectionManager_WelcomeMessageReceived;
            connectionManager.Disconnected           += ConnectionManager_Disconnected;

            gameCreationPanel = new DarkeningPanel(WindowManager);
            AddChild(gameCreationPanel);

            GameCreationWindow gcw = new GameCreationWindow(WindowManager, tunnelHandler);

            gameCreationPanel.AddChild(gcw);
            gameCreationPanel.Tag  = gcw;
            gcw.Cancelled         += Gcw_Cancelled;
            gcw.GameCreated       += Gcw_GameCreated;
            gcw.LoadedGameCreated += Gcw_LoadedGameCreated;

            gameCreationPanel.Hide();

            connectionManager.MainChannel.AddMessage(new ChatMessage(null, Color.White, DateTime.Now,
                                                                     Renderer.GetSafeString(
                                                                         "*** DTA CnCNet Client version " +
                                                                         System.Windows.Forms.Application.ProductVersion + " ***", lbChatMessages.FontIndex)));

            connectionManager.BannedFromChannel += ConnectionManager_BannedFromChannel;

            loginWindow            = new CnCNetLoginWindow(WindowManager);
            loginWindow.Connect   += LoginWindow_Connect;
            loginWindow.Cancelled += LoginWindow_Cancelled;

            var loginWindowPanel = new DarkeningPanel(WindowManager);

            loginWindowPanel.Alpha = 0.0f;

            AddChild(loginWindowPanel);
            loginWindowPanel.AddChild(loginWindow);
            loginWindow.Disable();

            passwordRequestWindow = new PasswordRequestWindow(WindowManager);
            passwordRequestWindow.PasswordEntered += PasswordRequestWindow_PasswordEntered;

            var passwordRequestWindowPanel = new DarkeningPanel(WindowManager);

            passwordRequestWindowPanel.Alpha = 0.0f;
            AddChild(passwordRequestWindowPanel);
            passwordRequestWindowPanel.AddChild(passwordRequestWindow);
            passwordRequestWindow.Disable();

            gameLobby.GameLeft        += GameLobby_GameLeft;
            gameLoadingLobby.GameLeft += GameLoadingLobby_GameLeft;

            UserINISettings.Instance.SettingsSaved += Instance_SettingsSaved;

            GameProcessLogic.GameProcessStarted += SharedUILogic_GameProcessStarted;
            GameProcessLogic.GameProcessExited  += SharedUILogic_GameProcessExited;
        }
예제 #17
0
        public override void Initialize()
        {
            Name              = nameof(PrivateMessagingWindow);
            ClientRectangle   = new Rectangle(0, 0, 600, 600);
            BackgroundTexture = AssetLoader.LoadTextureUncached("privatemessagebg.png");

            unknownGameIcon = AssetLoader.TextureFromImage(ClientCore.Properties.Resources.unknownicon);
            adminGameIcon   = AssetLoader.TextureFromImage(ClientCore.Properties.Resources.cncneticon);

            personalMessageColor  = AssetLoader.GetColorFromString(ClientConfiguration.Instance.SentPMColor);
            otherUserMessageColor = AssetLoader.GetColorFromString(ClientConfiguration.Instance.ReceivedPMColor);

            lblPrivateMessaging           = new XNALabel(WindowManager);
            lblPrivateMessaging.Name      = nameof(lblPrivateMessaging);
            lblPrivateMessaging.FontIndex = 1;
            lblPrivateMessaging.Text      = "PRIVATE MESSAGING";

            AddChild(lblPrivateMessaging);
            lblPrivateMessaging.CenterOnParent();
            lblPrivateMessaging.ClientRectangle = new Rectangle(
                lblPrivateMessaging.X, 12,
                lblPrivateMessaging.Width,
                lblPrivateMessaging.Height);

            tabControl                 = new XNAClientTabControl(WindowManager);
            tabControl.Name            = nameof(tabControl);
            tabControl.ClientRectangle = new Rectangle(60, 50, 0, 0);
            tabControl.ClickSound      = new EnhancedSoundEffect("button.wav");
            tabControl.FontIndex       = 1;
            tabControl.AddTab("Messages", 160);
            tabControl.AddTab("Friend List", 160);
            tabControl.AddTab("All Players", 160);
            tabControl.SelectedIndexChanged += TabControl_SelectedIndexChanged;

            lblPlayers                 = new XNALabel(WindowManager);
            lblPlayers.Name            = nameof(lblPlayers);
            lblPlayers.ClientRectangle = new Rectangle(12, tabControl.Bottom + 24, 0, 0);
            lblPlayers.FontIndex       = 1;
            lblPlayers.Text            = "PLAYERS:";

            lbUserList                 = new XNAListBox(WindowManager);
            lbUserList.Name            = nameof(lbUserList);
            lbUserList.ClientRectangle = new Rectangle(lblPlayers.X,
                                                       lblPlayers.Bottom + 6,
                                                       150, Height - lblPlayers.Bottom - 18);
            lbUserList.RightClick             += LbUserList_RightClick;
            lbUserList.SelectedIndexChanged   += LbUserList_SelectedIndexChanged;
            lbUserList.BackgroundTexture       = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);
            lbUserList.PanelBackgroundDrawMode = PanelBackgroundImageDrawMode.STRETCHED;

            lblMessages                 = new XNALabel(WindowManager);
            lblMessages.Name            = nameof(lblMessages);
            lblMessages.ClientRectangle = new Rectangle(lbUserList.Right + 12,
                                                        lblPlayers.Y, 0, 0);
            lblMessages.FontIndex = 1;
            lblMessages.Text      = "MESSAGES:";

            lbMessages                 = new ChatListBox(WindowManager);
            lbMessages.Name            = nameof(lbMessages);
            lbMessages.ClientRectangle = new Rectangle(lblMessages.X,
                                                       lbUserList.Y,
                                                       Width - lblMessages.X - 12,
                                                       lbUserList.Height - 25);
            lbMessages.BackgroundTexture       = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);
            lbMessages.PanelBackgroundDrawMode = PanelBackgroundImageDrawMode.STRETCHED;

            tbMessageInput                 = new XNATextBox(WindowManager);
            tbMessageInput.Name            = nameof(tbMessageInput);
            tbMessageInput.ClientRectangle = new Rectangle(lbMessages.X,
                                                           lbMessages.Bottom + 6, lbMessages.Width, 19);
            tbMessageInput.EnterPressed     += TbMessageInput_EnterPressed;
            tbMessageInput.MaximumTextLength = 200;
            tbMessageInput.Enabled           = false;

            playerContextMenu                 = new XNAContextMenu(WindowManager);
            playerContextMenu.Name            = nameof(playerContextMenu);
            playerContextMenu.ClientRectangle = new Rectangle(0, 0, 150, 2);
            playerContextMenu.Disable();
            playerContextMenu.AddItem("Add Friend", PlayerContextMenu_ToggleFriend);
            playerContextMenu.AddItem("Toggle Block", PlayerContextMenu_ToggleIgnore, null, () => (bool)lbUserList.SelectedItem.Tag, null);
            playerContextMenu.AddItem("Invite", PlayerContextMenu_Invite, null, () => !string.IsNullOrEmpty(inviteChannelName));

            notificationBox            = new PrivateMessageNotificationBox(WindowManager);
            notificationBox.Enabled    = false;
            notificationBox.Visible    = false;
            notificationBox.LeftClick += NotificationBox_LeftClick;

            AddChild(tabControl);
            AddChild(lblPlayers);
            AddChild(lbUserList);
            AddChild(lblMessages);
            AddChild(lbMessages);
            AddChild(tbMessageInput);
            AddChild(playerContextMenu);
            WindowManager.AddAndInitializeControl(notificationBox);

            base.Initialize();

            CenterOnParent();

            tabControl.SelectedTab = 0;

            connectionManager.PrivateMessageReceived += ConnectionManager_PrivateMessageReceived;
            connectionManager.UserAdded            += ConnectionManager_UserAdded;
            connectionManager.UserRemoved          += ConnectionManager_UserRemoved;
            connectionManager.UserGameIndexUpdated += ConnectionManager_UserGameIndexUpdated;

            sndMessageSound = new EnhancedSoundEffect("message.wav", 0.0, 0.0, ClientConfiguration.Instance.SoundMessageCooldown);

            sndPrivateMessageSound = new EnhancedSoundEffect("pm.wav", 0.0, 0.0, ClientConfiguration.Instance.SoundPrivateMessageCooldown);

            sndMessageSound.Enabled = UserINISettings.Instance.MessageSound;

            GameProcessLogic.GameProcessExited += SharedUILogic_GameProcessExited;
        }
예제 #18
0
        public override void Initialize()
        {
            Name              = nameof(PrivateMessagingWindow);
            ClientRectangle   = new Rectangle(0, 0, 600, 600);
            BackgroundTexture = AssetLoader.LoadTextureUncached("privatemessagebg.png");

            unknownGameIcon = AssetLoader.TextureFromImage(ClientCore.Properties.Resources.unknownicon);
            adminGameIcon   = AssetLoader.TextureFromImage(ClientCore.Properties.Resources.cncneticon);

            personalMessageColor  = AssetLoader.GetColorFromString(ClientConfiguration.Instance.SentPMColor);
            otherUserMessageColor = AssetLoader.GetColorFromString(ClientConfiguration.Instance.ReceivedPMColor);

            lblPrivateMessaging           = new XNALabel(WindowManager);
            lblPrivateMessaging.Name      = nameof(lblPrivateMessaging);
            lblPrivateMessaging.FontIndex = 1;
            lblPrivateMessaging.Text      = "PRIVATE MESSAGING";

            AddChild(lblPrivateMessaging);
            lblPrivateMessaging.CenterOnParent();
            lblPrivateMessaging.ClientRectangle = new Rectangle(
                lblPrivateMessaging.X, 12,
                lblPrivateMessaging.Width,
                lblPrivateMessaging.Height);

            tabControl                 = new XNAClientTabControl(WindowManager);
            tabControl.Name            = nameof(tabControl);
            tabControl.ClientRectangle = new Rectangle(34, 50, 0, 0);
            tabControl.ClickSound      = new EnhancedSoundEffect("button.wav");
            tabControl.FontIndex       = 1;
            tabControl.AddTab("Messages", UIDesignConstants.BUTTON_WIDTH_133);
            tabControl.AddTab("Friend List", UIDesignConstants.BUTTON_WIDTH_133);
            tabControl.AddTab("All Players", UIDesignConstants.BUTTON_WIDTH_133);
            tabControl.AddTab("Recent Players", UIDesignConstants.BUTTON_WIDTH_133);
            tabControl.SelectedIndexChanged += TabControl_SelectedIndexChanged;

            lblPlayers                 = new XNALabel(WindowManager);
            lblPlayers.Name            = nameof(lblPlayers);
            lblPlayers.ClientRectangle = new Rectangle(12, tabControl.Bottom + 24, 0, 0);
            lblPlayers.FontIndex       = 1;
            lblPlayers.Text            = DEFAULT_PLAYERS_TEXT;

            lbUserList                 = new XNAListBox(WindowManager);
            lbUserList.Name            = nameof(lbUserList);
            lbUserList.ClientRectangle = new Rectangle(lblPlayers.X,
                                                       lblPlayers.Bottom + 6,
                                                       LB_USERS_WIDTH, Height - lblPlayers.Bottom - 18);
            lbUserList.RightClick             += LbUserList_RightClick;
            lbUserList.SelectedIndexChanged   += LbUserList_SelectedIndexChanged;
            lbUserList.BackgroundTexture       = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);
            lbUserList.PanelBackgroundDrawMode = PanelBackgroundImageDrawMode.STRETCHED;
            lbUserList.DoubleLeftClick        += UserList_LeftDoubleClick;

            lblMessages                 = new XNALabel(WindowManager);
            lblMessages.Name            = nameof(lblMessages);
            lblMessages.ClientRectangle = new Rectangle(lbUserList.Right + 12,
                                                        lblPlayers.Y, 0, 0);
            lblMessages.FontIndex = 1;
            lblMessages.Text      = "MESSAGES:";

            lbMessages                 = new ChatListBox(WindowManager);
            lbMessages.Name            = nameof(lbMessages);
            lbMessages.ClientRectangle = new Rectangle(lblMessages.X,
                                                       lbUserList.Y,
                                                       Width - lblMessages.X - 12,
                                                       lbUserList.Height - 25);
            lbMessages.BackgroundTexture       = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);
            lbMessages.PanelBackgroundDrawMode = PanelBackgroundImageDrawMode.STRETCHED;
            lbMessages.RightClick += ChatListBox_RightClick;

            tbMessageInput                 = new XNATextBox(WindowManager);
            tbMessageInput.Name            = nameof(tbMessageInput);
            tbMessageInput.ClientRectangle = new Rectangle(lbMessages.X,
                                                           lbMessages.Bottom + 6, lbMessages.Width, 19);
            tbMessageInput.EnterPressed     += TbMessageInput_EnterPressed;
            tbMessageInput.MaximumTextLength = 200;
            tbMessageInput.Enabled           = false;

            mclbRecentPlayerList = new RecentPlayerTable(WindowManager, connectionManager);
            mclbRecentPlayerList.ClientRectangle   = new Rectangle(lbUserList.X, lbUserList.Y, lbMessages.Right - lbUserList.X, lbUserList.Height);
            mclbRecentPlayerList.PlayerRightClick += RecentPlayersList_RightClick;
            mclbRecentPlayerList.Disable();

            globalContextMenu            = new GlobalContextMenu(WindowManager, connectionManager, cncnetUserData, this);
            globalContextMenu.JoinEvent += PlayerContextMenu_JoinUser;

            notificationBox            = new PrivateMessageNotificationBox(WindowManager);
            notificationBox.Enabled    = false;
            notificationBox.Visible    = false;
            notificationBox.LeftClick += NotificationBox_LeftClick;

            AddChild(tabControl);
            AddChild(lblPlayers);
            AddChild(lbUserList);
            AddChild(lblMessages);
            AddChild(lbMessages);
            AddChild(tbMessageInput);
            AddChild(mclbRecentPlayerList);
            AddChild(globalContextMenu);
            WindowManager.AddAndInitializeControl(notificationBox);

            base.Initialize();

            CenterOnParent();

            tabControl.SelectedTab = MESSAGES_INDEX;

            privateMessageHandler.PrivateMessageReceived += PrivateMessageHandler_PrivateMessageReceived;
            connectionManager.UserAdded            += ConnectionManager_UserAdded;
            connectionManager.UserRemoved          += ConnectionManager_UserRemoved;
            connectionManager.UserGameIndexUpdated += ConnectionManager_UserGameIndexUpdated;

            sndMessageSound = new EnhancedSoundEffect("message.wav", 0.0, 0.0, ClientConfiguration.Instance.SoundMessageCooldown);

            sndPrivateMessageSound = new EnhancedSoundEffect("pm.wav", 0.0, 0.0, ClientConfiguration.Instance.SoundPrivateMessageCooldown);

            sndMessageSound.Enabled = UserINISettings.Instance.MessageSound;

            GameProcessLogic.GameProcessExited += SharedUILogic_GameProcessExited;
        }
        public override void Initialize()
        {
            Name = "MultiplayerGameLobby";

            base.Initialize();

            InitPlayerOptionDropdowns();

            ReadyBoxes = new XNACheckBox[MAX_PLAYER_COUNT];

            int readyBoxX = GameOptionsIni.GetIntValue(Name, "PlayerReadyBoxX", 7);
            int readyBoxY = GameOptionsIni.GetIntValue(Name, "PlayerReadyBoxY", 4);

            for (int i = 0; i < MAX_PLAYER_COUNT; i++)
            {
                XNACheckBox chkPlayerReady = new XNACheckBox(WindowManager);
                chkPlayerReady.Name            = "chkPlayerReady" + i;
                chkPlayerReady.Checked         = false;
                chkPlayerReady.AllowChecking   = false;
                chkPlayerReady.ClientRectangle = new Rectangle(readyBoxX, ddPlayerTeams[i].Y + readyBoxY,
                                                               0, 0);

                PlayerOptionsPanel.AddChild(chkPlayerReady);

                chkPlayerReady.DisabledClearTexture   = chkPlayerReady.ClearTexture;
                chkPlayerReady.DisabledCheckedTexture = chkPlayerReady.CheckedTexture;

                ReadyBoxes[i] = chkPlayerReady;
                ddPlayerSides[i].AddItem("Spectator", AssetLoader.LoadTexture("spectatoricon.png"));
            }

            ddGameMode.ClientRectangle = new Rectangle(
                MapPreviewBox.X - 12 - ddGameMode.Width,
                MapPreviewBox.Y, ddGameMode.Width,
                ddGameMode.Height);

            lblGameModeSelect.ClientRectangle = new Rectangle(
                btnLaunchGame.X, ddGameMode.Y + 1,
                lblGameModeSelect.Width, lblGameModeSelect.Height);

            lbMapList.ClientRectangle = new Rectangle(btnLaunchGame.X,
                                                      MapPreviewBox.Y + 23,
                                                      MapPreviewBox.X - btnLaunchGame.X - 12,
                                                      MapPreviewBox.Height - 23);

            lbChatMessages                 = new ChatListBox(WindowManager);
            lbChatMessages.Name            = "lbChatMessages";
            lbChatMessages.ClientRectangle = new Rectangle(lbMapList.X,
                                                           GameOptionsPanel.Y,
                                                           lbMapList.Width, GameOptionsPanel.Height - 24);
            lbChatMessages.DrawMode          = PanelBackgroundImageDrawMode.STRETCHED;
            lbChatMessages.BackgroundTexture = AssetLoader.CreateTexture(new Color(0, 0, 0, 128), 1, 1);
            lbChatMessages.LineHeight        = 16;
            lbChatMessages.DrawOrder         = -1;
            lbChatMessages.UpdateOrder       = -1;

            tbChatInput                 = new XNASuggestionTextBox(WindowManager);
            tbChatInput.Name            = "tbChatInput";
            tbChatInput.Suggestion      = "Type here to chat..";
            tbChatInput.ClientRectangle = new Rectangle(lbChatMessages.X,
                                                        lbChatMessages.Bottom + 3,
                                                        lbChatMessages.Width, 21);
            tbChatInput.MaximumTextLength = 150;
            tbChatInput.EnterPressed     += TbChatInput_EnterPressed;
            tbChatInput.DrawOrder         = 1;
            tbChatInput.UpdateOrder       = 1;

            btnLockGame                 = new XNAClientButton(WindowManager);
            btnLockGame.Name            = "btnLockGame";
            btnLockGame.ClientRectangle = new Rectangle(btnLaunchGame.Right + 12,
                                                        btnLaunchGame.Y, 133, 23);
            btnLockGame.Text       = "Lock Game";
            btnLockGame.LeftClick += BtnLockGame_LeftClick;

            AddChild(lbChatMessages);
            AddChild(tbChatInput);
            AddChild(btnLockGame);

            MapPreviewBox.LocalStartingLocationSelected += MapPreviewBox_LocalStartingLocationSelected;
            MapPreviewBox.StartingLocationApplied       += MapPreviewBox_StartingLocationApplied;

            InitializeWindow();

            DisplayRandomMapButton = btnPickRandomMap.Enabled && btnPickRandomMap.Visible;

            sndJoinSound     = new EnhancedSoundEffect("joingame.wav");
            sndLeaveSound    = new EnhancedSoundEffect("leavegame.wav");
            sndMessageSound  = new EnhancedSoundEffect("message.wav");
            sndGetReadySound = new EnhancedSoundEffect("getready.wav", 0.0, 0.0, 5.0f);

            if (SavedGameManager.AreSavedGamesAvailable())
            {
                fsw                     = new FileSystemWatcher(ProgramConstants.GamePath + "Saved Games", "*.NET");
                fsw.Created            += fsw_Created;
                fsw.Changed            += fsw_Created;
                fsw.EnableRaisingEvents = false;
            }
            else
            {
                Logger.Log("MultiplayerGameLobby: Saved games are not available!");
            }

            CenterOnParent();

            // To move the lblMapAuthor label into its correct position
            // if it was moved in the theme description INI file
            LoadDefaultMap();
        }