Exemple #1
0
        public override void Initialize()
        {
            base.Initialize();

            int top = padding;
            const int buttonWidth = 200;
            const int buttonHeight = 50;

            playerObjectEditors = new ObjectEditor<Player>[maxPlayers];

            tabs = new TabControl(ControlManager.Manager);
            tabs.Init();

            tabs.SetPosition(300, 50);

            int width = (int)(ScreenWidth * 0.75f);
            int height = (int)(ScreenHeight * 0.75f);

            tabs.MinimumHeight = height;
            tabs.MinimumWidth = width;

            var playGame = new Button(ControlManager.Manager) { Text = "Play Game", Left = padding, Top = padding, Width = buttonWidth, Height = buttonHeight};
            playGame.Init();
            playGame.Click += (sender, args) => StartGame();

            top += playGame.Height + padding;

            var addPlayer = new Button(ControlManager.Manager) { Text = "Add Player", Left = padding, Top = top, Width = buttonWidth, Height = buttonHeight };
            addPlayer.Init();
            addPlayer.Click += (sender, args) => AddPlayer();

            top += addPlayer.Height+padding;

            var removePlayer = new Button(ControlManager.Manager) { Text = "Remove Player", Left = padding, Top = top, Width = buttonWidth, Height = buttonHeight };
            removePlayer.Init();
            removePlayer.Click += (sender, args) => RemovePlayer();

            top += addPlayer.Height + padding;

            var backButton = new Button(ControlManager.Manager) { Text = "Main Menu", Left = padding, Top = top, Width = buttonWidth, Height = buttonHeight };
            backButton.Init();
            backButton.Click += (sender, args) => ScreenManager.SwapScreens(this, Constants.ScreenNames.MainMenu);

            ControlManager.Add(tabs);
            ControlManager.Add(addPlayer);
            ControlManager.Add(removePlayer);
            ControlManager.Add(playGame);
            ControlManager.Add(backButton);

            gameInfoTab = tabs.AddPage();
            PopulateGameInfo(gameInfoTab);

            for (var i = 0; i < minPlayers; i++) {
                AddPlayer();
            }
            SwitchToTab(0);
        }
Exemple #2
0
        public virtual TabControl GetTabbedControl(TabControl tabControl, Manager manager, Player[] playerList)
        {
            _playerList = playerList;
            tabControl.Left = 10;
            tabControl.Top = 10;

            foreach (var player in playerList) {
                var newTab = tabControl.AddPage(player.Name);
                var componentHeight = PopulateTab(manager, player, newTab);
                tabControl.Height = Math.Max(tabControl.Height, componentHeight + 50);
                createdPages[newTab] = componentHeight;
            }

            tabControl.PageChanged += (sender, args) => RecalculateHeight(tabControl);
            tabControl.PageChanged += (sender, args) => RecalculateHeight(tabControl);
            tabControl.PageChanged += (sender, args) => RecalculateHeight(tabControl);
            tabControl.PageChanged += (sender, args) => RecalculateHeight(tabControl);

            return tabControl;
        }
 public override TabControl GetTabbedControl(TabControl tabControl, Manager manager, Player[] playerList)
 {
     var firstPage = tabControl.AddPage("Leader Board");
     CreateFirstPage(manager, playerList, firstPage);
     return base.GetTabbedControl(tabControl, manager, playerList);
 }
		////////////////////////////////////////////////////////////////////////////    

		////////////////////////////////////////////////////////////////////////////
		private void InitConsole()
		{
			TabControl tbc = new TabControl(Manager);
			Console con1 = new Console(Manager);
			Console con2 = new Console(Manager);

			// Setup of TabControl, which will be holding both consoles
			tbc.Init();
			tbc.AddPage("Global");
			tbc.AddPage("Private");

			tbc.Alpha = 220;
			tbc.Left = 220;
			tbc.Height = 220;
			tbc.Width = 400;
			tbc.Top = Manager.TargetHeight - tbc.Height - 32;

			tbc.Movable = true;
			tbc.Resizable = true;
			tbc.MinimumHeight = 96;
			tbc.MinimumWidth = 160;

			tbc.TabPages[0].Add(con1);
			tbc.TabPages[1].Add(con2);

			con1.Init();
			con2.Init();

			con2.Width = con1.Width = tbc.TabPages[0].ClientWidth;
			con2.Height = con1.Height = tbc.TabPages[0].ClientHeight;
			con2.Anchor = con1.Anchor = Anchors.All;

			con1.Channels.Add(new ConsoleChannel(0, "General", Color.Orange));
			con1.Channels.Add(new ConsoleChannel(1, "Private", Color.White));
			con1.Channels.Add(new ConsoleChannel(2, "System", Color.Yellow));

			// We want to share channels and message buffer in both consoles
			con2.Channels = con1.Channels;
			con2.MessageBuffer = con1.MessageBuffer;

			// In the second console we display only "Private" messages
			con2.ChannelFilter.Add(1);

			// Select default channels for each tab
			con1.SelectedChannel = 0;
			con2.SelectedChannel = 1;

			// Do we want to add timestamp or channel name at the start of every message?
			con1.MessageFormat = ConsoleMessageFormats.All;
			con2.MessageFormat = ConsoleMessageFormats.TimeStamp;

			// Handler for altering incoming message
			con1.MessageSent += new ConsoleMessageEventHandler(con1_MessageSent);

			// We send initial welcome message to System channel
			con1.MessageBuffer.Add(new ConsoleMessage("Welcome to Neoforce!", 2));

			Manager.Add(tbc);
		}
        public void Initialize()
        {
            manager.Initialize();

            #region /// Master ///
            master = new SideBar(manager);
            master.Init();
            master.Name = "Sidebar";
            master.Width = Width;
            master.Height = OrbIt.game.MainWindow.ClientArea.Height;
            master.Visible = true;
            master.Anchor = Anchors.Top | Anchors.Left | Anchors.Bottom;

            ui.game.MainWindow.Add(master);
            #endregion

            #region  /// tabcontrol ///
            tbcMain = new TabControl(manager);
            tbcMain.Init();
            //tbcMain.BackColor = Color.Transparent;
            //tbcMain.Color = Color.Transparent;
            tbcMain.Parent = master;
            tbcMain.Left = 0;
            tbcMain.Top = 0;
            tbcMain.Width = master.Width - 5;
            tbcMain.Height = master.Height - 40;
            tbcMain.Anchor = Anchors.All;
            activeTabControl = tbcMain;
            #endregion

            #region  /// Page1 ///

            tbcMain.AddPage();
            tbcMain.TabPages[0].Text = "First";
            TabPage first = tbcMain.TabPages[0];
            tbcMain.SelectedIndex = 0;

            #region  /// Title ///
            title1 = new Label(manager);
            title1.Init();
            title1.Parent = first;

            title1.Top = HeightCounter;
            title1.Text = "Node List";
            title1.Width = 130;
            title1.Left = first.Width / 2 - title1.Width / 2; //TODO : Center auto
            HeightCounter += VertPadding + title1.Height;
            title1.Anchor = Anchors.Left;
            #endregion

            #region  /// List Main ///
            lstMain = new ListBox(manager);
            lstMain.Init();
            lstMain.Parent = first;

            lstMain.Top = HeightCounter;
            lstMain.Left = LeftPadding;
            lstMain.Width = first.Width - LeftPadding * 2;
            lstMain.Height = first.Height / 5; HeightCounter += VertPadding + lstMain.Height;
            lstMain.Anchor = Anchors.Top | Anchors.Left | Anchors.Bottom;

            lstMain.HideSelection = false;
            lstMain.ItemIndexChanged += lstMain_ItemIndexChanged;
            lstMain.Click += lstMain_Click;
            lstMain.Refresh();
            //room.nodes.CollectionChanged += nodes_Sync;

            mainNodeContextMenu = new ContextMenu(manager);
            ConvertIntoList = new MenuItem("Make Default of new Group.");
            ConvertIntoList.Click += ConvertIntoList_Click;
            PromoteToDefault = new MenuItem("Make Default of current Group");
            PromoteToDefault.Click += PromoteToDefault_Click;
            mainNodeContextMenu.Items.Add(ConvertIntoList);
            lstMain.ContextMenu = mainNodeContextMenu;

            ui.SetScrollableControl(lstMain, lstMain_ChangeScrollPosition);
            #endregion

            #region  /// List Picker ///

            cbListPicker = new ComboBox(manager);
            cbListPicker.Init();
            cbListPicker.Parent = first;
            cbListPicker.MaxItems = 20;

            cbListPicker.Width = first.Width - LeftPadding * 6;
            cbListPicker.Left = LeftPadding;
            cbListPicker.Top = HeightCounter;
            cbListPicker.Items.Add("Other Objects");
            cbListPicker.ItemIndex = 0;
            //cbListPicker.
            cbListPicker.Click += cbListPicker_Click;
            cbListPicker.ItemIndexChanged += cbListPicker_ItemIndexChanged;

            #endregion

            #region /// Delete Group Button ///

            btnDeleteGroup = new Button(manager);
            btnDeleteGroup.Init();
            btnDeleteGroup.Parent = first;
            btnDeleteGroup.Left = LeftPadding + cbListPicker.Width + 5;
            btnDeleteGroup.Width = 15;
            btnDeleteGroup.Height = cbListPicker.Height;
            btnDeleteGroup.Top = HeightCounter; HeightCounter += VertPadding + cbListPicker.Height;
            btnDeleteGroup.Text = "X";
            btnDeleteGroup.Click += btnDeleteGroup_Click;

            #endregion

            #region  /// Remove Node Button ///
            btnRemoveNode = new Button(manager);
            btnRemoveNode.Init();
            btnRemoveNode.Parent = first;

            btnRemoveNode.Top = HeightCounter;
            btnRemoveNode.Width = first.Width / 2 - LeftPadding;
            btnRemoveNode.Height = 24;
            btnRemoveNode.Left = LeftPadding;

            btnRemoveNode.Text = "Remove Node";
            btnRemoveNode.Click += btnRemoveNode_Click;
            #endregion

            #region  /// Remove All Nodes Button ///
            btnRemoveAllNodes = new Button(manager);
            btnRemoveAllNodes.Init();
            btnRemoveAllNodes.Parent = first;

            btnRemoveAllNodes.Top = HeightCounter;
            //btnRemoveAllNodes.Width = first.Width / 2 - LeftPadding;
            btnRemoveAllNodes.Width = first.Width / 2 - LeftPadding;
            btnRemoveAllNodes.Height = 24; HeightCounter += VertPadding + btnRemoveAllNodes.Height;
            btnRemoveAllNodes.Left = LeftPadding + btnRemoveNode.Width;

            btnRemoveAllNodes.Text = "Remove All";
            btnRemoveAllNodes.Click += btnRemoveAllNodes_Click;
            #endregion

            #region  /// Add Componenet ///
            btnAddComponent = new Button(manager);
            btnAddComponent.Init();
            btnAddComponent.Parent = first;

            btnAddComponent.Top = HeightCounter;
            btnAddComponent.Width = first.Width / 2 - LeftPadding;
            btnAddComponent.Height = 20;
            btnAddComponent.Left = LeftPadding;

            btnAddComponent.Text = "Add Component";
            btnAddComponent.Click += btnAddComponent_Click;
            #endregion

            #region  /// Default Node ///
            btnDefaultNode = new Button(manager);
            btnDefaultNode.Init();
            btnDefaultNode.Parent = first;

            btnDefaultNode.Top = HeightCounter;
            btnDefaultNode.Width = first.Width / 2 - LeftPadding;
            btnDefaultNode.Height = 20; HeightCounter += VertPadding + btnDefaultNode.Height;
            btnDefaultNode.Left = LeftPadding + btnRemoveNode.Width;

            btnDefaultNode.Text = "Default Node";
            btnDefaultNode.Click += btnDefaultNode_Click;
            #endregion

            #region  /// Presets Dropdown ///
            cbPresets = new ComboBox(manager);
            cbPresets.Init();
            cbPresets.Parent = first;
            cbPresets.MaxItems = 20;
            cbPresets.Width = 160;
            cbPresets.Left = LeftPadding;
            cbPresets.Top = HeightCounter; HeightCounter += cbPresets.Height;
            Assets.NodePresets.CollectionChanged += NodePresets_Sync;
            cbPresets.ItemIndexChanged += cbPresets_ItemIndexChanged;
            cbPresets.Click += cmbPresets_Click;
            #endregion

            inspectorArea = new InspectorArea(this, first, LeftPadding, HeightCounter);

            HeightCounter += inspectorArea.Height;

            #region  /// Apply to Group ///
            btnApplyToAll = new Button(manager);
            btnApplyToAll.Init();
            btnApplyToAll.Parent = first;

            btnApplyToAll.Text = "Apply To Group";
            btnApplyToAll.Top = HeightCounter;
            btnApplyToAll.Width = first.Width / 2 - LeftPadding;
            btnApplyToAll.Height = 20; //HeightCounter += VertPadding + btnApplyToAll.Height;
            btnApplyToAll.Left = LeftPadding;
            btnApplyToAll.Click += applyToAllNodesMenuItem_Click;
            #endregion

            #region  /// Save as Preset ///
            btnSaveNode = new Button(manager);
            btnSaveNode.Init();
            btnSaveNode.Text = "Save Node";
            btnSaveNode.Top = HeightCounter;
            btnSaveNode.Width = first.Width / 2 - LeftPadding;
            btnSaveNode.Height = 20; HeightCounter += VertPadding + btnSaveNode.Height;
            btnSaveNode.Left = LeftPadding + btnApplyToAll.Width;
            btnSaveNode.Parent = first;
            btnSaveNode.Click += btnSaveNode_Click;
            #endregion

            #endregion

            #region  /// Page 2 ///
            tbcMain.AddPage();
            tbcMain.TabPages[1].Text = "Second";
            TabPage second = tbcMain.TabPages[1];
            HeightCounter = 0;

            #endregion

            inspectorArea.ResetInspectorBox(ActiveDefaultNode);

            InitializeSecondPage();
            InitializeThirdPage();
        }
		////////////////////////////////////////////////////////////////////////////


		#endregion

		#region //// Constructors //////

		////////////////////////////////////////////////////////////////////////////   
		public TaskDialog(Manager manager)
			: base(manager)
		{
			//Alpha = 200;      
			Height = 520;
			MinimumWidth = 254;
			MinimumHeight = 160;
			Center();

			TopPanel.Height = 80;
			TopPanel.BevelStyle = BevelStyle.None;
			TopPanel.BevelBorder = BevelBorder.None;
			Caption.Visible = false;
			Description.Visible = false;
			Text = "Dialog Template";

			imgTop = new ImageBox(manager);
			imgTop.Init();
			imgTop.Parent = TopPanel;
			imgTop.Top = 0;
			imgTop.Left = 0;
			imgTop.Width = TopPanel.ClientWidth;
			imgTop.Height = TopPanel.ClientHeight;
			imgTop.Anchor = Anchors.Left | Anchors.Top | Anchors.Right | Anchors.Bottom;
			imgTop.SizeMode = SizeMode.Normal;
			imgTop.Image = Manager.Content.Load<Texture2D>("Content\\Images\\Caption");

			tbcMain = new TabControl(manager);
			tbcMain.Init();
			tbcMain.Parent = this;
			tbcMain.Left = 4;
			tbcMain.Top = TopPanel.Height + 4;
			tbcMain.Width = ClientArea.Width - 8;
			tbcMain.Height = ClientArea.Height - 8 - TopPanel.Height - BottomPanel.Height;
			tbcMain.Anchor = Anchors.All;
			tbcMain.AddPage();
			tbcMain.TabPages[0].Text = "First";
			tbcMain.AddPage();
			tbcMain.TabPages[1].Text = "Second";
			tbcMain.AddPage();
			tbcMain.TabPages[2].Text = "Third";

			btnFirst = new Button(manager);
			btnFirst.Init();
			btnFirst.Parent = tbcMain.TabPages[0];
			btnFirst.Anchor = Anchors.Left | Anchors.Top | Anchors.Right;
			btnFirst.Top = 8;
			btnFirst.Left = 8;
			btnFirst.Width = btnFirst.Parent.ClientWidth - 16;
			btnFirst.Text = ">>> First Page Button <<<";

			grpFirst = new GroupPanel(manager);
			grpFirst.Init();
			grpFirst.Parent = tbcMain.TabPages[0];
			grpFirst.Anchor = Anchors.All;
			//grpFirst.Type = GroupBoxType.Flat;
			grpFirst.Left = 8;
			grpFirst.Top = btnFirst.Top + btnFirst.Height + 4;
			grpFirst.Width = btnFirst.Parent.ClientWidth - 16;
			grpFirst.Height = btnFirst.Parent.ClientHeight - grpFirst.Top - 8;

			btnSecond = new Button(manager);
			btnSecond.Init();
			btnSecond.Parent = tbcMain.TabPages[1];
			btnSecond.Anchor = Anchors.Left | Anchors.Top | Anchors.Right;
			btnSecond.Top = 8;
			btnSecond.Left = 8;
			btnSecond.Width = btnSecond.Parent.ClientWidth - 16;
			btnSecond.Text = ">>> Second Page Button <<<";

			btnThird = new Button(manager);
			btnThird.Init();
			btnThird.Parent = tbcMain.TabPages[2];
			btnThird.Anchor = Anchors.Left | Anchors.Top | Anchors.Right;
			btnThird.Top = 8;
			btnThird.Left = 8;
			btnThird.Width = btnThird.Parent.ClientWidth - 16;
			btnThird.Text = ">>> Third Page Button <<<";

			btnOk = new Button(manager);
			btnOk.Init();
			btnOk.Parent = BottomPanel;
			btnOk.Anchor = Anchors.Top | Anchors.Right;
			btnOk.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8;
			btnOk.Left = btnOk.Parent.ClientWidth - 8 - btnOk.Width * 3 - 8;
			btnOk.Text = "OK";
			btnOk.ModalResult = ModalResult.Ok;

			btnApply = new Button(manager);
			btnApply.Init();
			btnApply.Parent = BottomPanel;
			btnApply.Anchor = Anchors.Top | Anchors.Right;
			btnApply.Top = btnOk.Parent.ClientHeight - btnOk.Height - 8;
			btnApply.Left = btnOk.Parent.ClientWidth - 4 - btnOk.Width * 2 - 8;
			btnApply.Text = "Apply";

			btnClose = new Button(manager);
			btnClose.Init();
			btnClose.Parent = BottomPanel;
			btnClose.Anchor = Anchors.Top | Anchors.Right;
			btnClose.Top = btnOk.Parent.ClientHeight - btnClose.Height - 8;
			btnClose.Left = btnOk.Parent.ClientWidth - btnClose.Width - 8;
			btnClose.Text = "Close";
			btnClose.ModalResult = ModalResult.Cancel;

			btnFirst.Focused = true;
		}
Exemple #7
0
        private void InitializeControls()
        {
            _manager.Initialize();
            _manager.AutoCreateRenderTarget = true;

            _tabControl = new TabControl(_manager);
            _tabControl.Init();
            _tabControl.Left   = 600;
            _tabControl.Top    = 0;
            _tabControl.Width  = Width;
            _tabControl.Height = Height;
            _tabControl.Show();
            #region WavePage
            _wavePage      = _tabControl.AddPage();
            _wavePage.Text = "Waves";

            #region Constructors
            _health = new Label(_manager);
            _health.Init();
            _texture = new Label(_manager);
            _texture.Init();
            _speed = new Label(_manager);
            _speed.Init();
            _number = new Label(_manager);
            _number.Init();

            _waves = new ListBox(_manager);
            _waves.Init();
            _deleteWaveButton = new Button(_manager);
            _deleteWaveButton.Init();
            _addWaveButton = new Button(_manager);
            _addWaveButton.Init();
            _currentWave = new ListBox(_manager);
            _currentWave.Init();
            _addCreepsButton = new Button(_manager);
            _addCreepsButton.Init();
            _numberOfCreeps = new TextBox(_manager);
            _numberOfCreeps.Init();
            _speedOfCreeps = new TextBox(_manager);
            _speedOfCreeps.Init();
            _healthOfCreeps = new TextBox(_manager);
            _healthOfCreeps.Init();
            _creepTexture = new ComboBox(_manager);
            _creepTexture.Init();
            #endregion

            #region Properties
            _texture.Text   = "Textur";
            _texture.Top    = 2;
            _texture.Left   = 2;
            _texture.Parent = _wavePage;
            _wavePage.Add(_texture);

            _creepTexture.Items.AddRange(new[] { "Slyder", "Drone", "Ape", "Paw" });
            _creepTexture.Text      = "Slyder";
            _creepTexture.Width     = 80;
            _creepTexture.Left      = 2;
            _creepTexture.Top       = _texture.Top + _texture.Height + 2;
            _creepTexture.TextColor = Color.LightGray;
            _creepTexture.Parent    = _wavePage;

            _health.Text   = "Gesundheit";
            _health.Top    = 2;
            _health.Left   = _creepTexture.Left + _creepTexture.Width + 5;
            _health.Parent = _wavePage;

            _healthOfCreeps.Left      = _health.Left;
            _healthOfCreeps.Top       = _health.Top + _health.Height + 2;
            _healthOfCreeps.Width     = _health.Width;
            _healthOfCreeps.TextColor = Color.LightGray;
            _healthOfCreeps.Parent    = _wavePage;

            _speed.Text   = "Geschwindigkeit";
            _speed.Left   = _health.Left + _health.Width + 5;
            _speed.Top    = 2;
            _speed.Width  = 93;
            _speed.Parent = _wavePage;

            _speedOfCreeps.Left      = _speed.Left;
            _speedOfCreeps.Top       = _speed.Top + _speed.Height + 2;
            _speedOfCreeps.Width     = _speed.Width;
            _speedOfCreeps.TextColor = Color.LightGray;
            _speedOfCreeps.Parent    = _wavePage;

            _number.Text   = "Anzahl";
            _number.Top    = 2;
            _number.Left   = _speed.Left + _speed.Width + 5;
            _number.Width  = 40;
            _number.Parent = _wavePage;

            _numberOfCreeps.Left      = _number.Left;
            _numberOfCreeps.Top       = _number.Top + _number.Height + 2;
            _numberOfCreeps.Width     = _number.Width;
            _numberOfCreeps.TextColor = Color.LightGray;
            _numberOfCreeps.Parent    = _wavePage;

            _addCreepsButton.Text   = "Creeps hinzufügen";
            _addCreepsButton.Top    = _numberOfCreeps.Top + _numberOfCreeps.Height - _addCreepsButton.Height;
            _addCreepsButton.Left   = _numberOfCreeps.Left + _numberOfCreeps.Width + 5;
            _addCreepsButton.Width  = 120;
            _addCreepsButton.Parent = _wavePage;

            _currentWave.Left      = 2;
            _currentWave.Top       = _creepTexture.Top + _creepTexture.Height + 5;
            _currentWave.Width     = _addCreepsButton.Left + _addCreepsButton.Width;
            _currentWave.Height    = 150;
            _currentWave.TextColor = Color.LightGray;
            _currentWave.Parent    = _wavePage;

            _addWaveButton.Text   = "Wave hinzufügen";
            _addWaveButton.Left   = 2;
            _addWaveButton.Top    = _currentWave.Top + _currentWave.Height + 5;
            _addWaveButton.Width  = 150;
            _addWaveButton.Parent = _wavePage;

            _deleteWaveButton.Text   = "Wave löschen";
            _deleteWaveButton.Left   = _addWaveButton.Left + _addWaveButton.Width + 5;
            _deleteWaveButton.Top    = _currentWave.Top + _currentWave.Height + 5;
            _deleteWaveButton.Width  = _addWaveButton.Width;
            _deleteWaveButton.Parent = _wavePage;

            _waves.Left              = 2;
            _waves.Top               = _addWaveButton.Top + _addWaveButton.Height + 5;
            _waves.Width             = _currentWave.Width;
            _waves.Height            = 150;
            _waves.TextColor         = Color.LightGray;
            _waves.Parent            = _wavePage;
            _waves.ItemIndexChanged += _waves_ItemIndexChanged;
            #endregion

            #region Events
            _addCreepsButton.Click  += AddCreepsButton_Click;
            _addWaveButton.Click    += AddWaveButton_Click;
            _deleteWaveButton.Click += DeleteWaveButton_Click;
            #endregion
            #endregion

            #region SavePage
            _savePage      = _tabControl.AddPage();
            _savePage.Text = "Speichern & Laden";
            _path          = new TextBox(_manager);
            _path.Init();
            _path.Top      = 2;
            _path.Left     = 2;
            _path.Width    = 200;
            _path.Parent   = _savePage;
            _path.ReadOnly = true;

            _fileNameButton = new Button(_manager);
            _fileNameButton.Init();
            _fileNameButton.Text   = "...";
            _fileNameButton.Width  = 17;
            _fileNameButton.Height = _fileNameButton.Width;
            _fileNameButton.Top    = _path.Top + _path.Height / 2 - _fileNameButton.Height / 2;
            _fileNameButton.Left   = _path.Left + _path.Width + 2;
            _fileNameButton.Parent = _savePage;
            _fileNameButton.Click += delegate {
                var dlg = new SaveFileDialog {
                    Filter           = "Level-Dateien|*.xml",
                    InitialDirectory =
                        Path.GetFullPath(
                            Path.GetDirectoryName(
                                Assembly.GetExecutingAssembly().Location) +
                            @"\..\Content\Map")
                };
                dlg.ShowDialog();
                _path.Text = dlg.FileName;
            };

            _saveButton = new Button(_manager);
            _saveButton.Init();
            _saveButton.Top    = _path.Top + _path.Height + 2;
            _saveButton.Left   = 2;
            _saveButton.Text   = "Speichern";
            _saveButton.Width  = 120;
            _saveButton.Parent = _savePage;
            _saveButton.Click += delegate {
                if (_path.Text.Length > 0)
                {
                    string fileName = _path.Text;
                    Save(fileName);
                }
            };

            LoadButton = new Button(_manager);
            LoadButton.Init();
            LoadButton.Left   = 2;
            LoadButton.Top    = 50;
            LoadButton.Text   = "Laden";
            LoadButton.Width  = 120;
            LoadButton.Parent = _savePage;
            LoadButton.Click += LoadButton_Click;
            #endregion
            _manager.Add(_tabControl);
        }
        public void InitializeGroupsPage()
        {
            tbcMain.Visible = false;

            tbcViews = new TabControl(manager);
            tbcViews.Init();
            master.Add(tbcViews);
            tbcViews.Left = 0;
            tbcViews.Top = 0;
            tbcViews.Width = master.Width - 5;
            tbcViews.Height = master.Height - 60;
            tbcViews.Anchor = Anchors.All;
            tbcViews.Color = UserInterface.TomLight;

            tbcViews.AddPage();

            TabPage groupsTab = tbcViews.TabPages[0];
            //tbcViews.Color = Color.Transparent;
            groupsTab.Text = "Groups";
            tbcViews.SelectedIndex = 0;
            activeTabControl = tbcViews;

            TitlePanel titlePanelGroups = new TitlePanel(this, groupsTab, "Groups", false);

            tbcGroups = new TabControl(manager);
            tbcGroups.Init();
            tbcGroups.Parent = groupsTab;
            tbcGroups.Top = titlePanelGroups.Height * 2;
            tbcGroups.Height = 460;
            tbcGroups.Width = groupsTab.Width;

            tbcGroups.AddPage("Custom");
            TabPage customPage = tbcGroups.TabPages[0];
            groupsView = new GroupsView(this, customPage, 0, -20, room.groups.general);
            groupsView.btnCreateGroup.Text = "     Create \nCustom  Group";
            groupsView.lblGroupLabel.Text = "Custom Groups";
            groupsView.UpdateGroups();

            tbcGroups.AddPage("Presets");
            tbcGroups.SelectedIndex = 1;
            TabPage presetsPage = tbcGroups.TabPages[1];
            presetsView = new GroupsView(this, presetsPage, 0, -20, room.groups.preset);
            presetsView.btnCreateGroup.Text = "     Create \nPreset  Group";
            presetsView.lblGroupLabel.Text = "Preset Groups";
            presetsView.UpdateGroups();
            tbcGroups.SelectedIndex = 0;

            tbcViews.SelectedIndex = 0;

            toolWindow = new ToolWindow(this);
            gamemodeWindow = new GamemodeWindow(this);
            gamemodeWindow.window.Visible = false;

            Button btnGameMode = new Button(manager);
            btnGameMode.Init();
            btnGameMode.Top = tbcViews.Top + tbcViews.Height;
            btnGameMode.Left = 15;
            btnGameMode.Text = "Mode";
            btnGameMode.Width = (int)manager.Skin.Fonts[0].Resource.MeasureString(btnGameMode.Text).X+10;
            btnGameMode.ClientMargins = new Margins(0, btnGameMode.ClientMargins.Top, 0, btnGameMode.ClientMargins.Bottom);
            btnGameMode.Anchor = Anchors.Bottom;
            master.Add(btnGameMode);
            btnGameMode.Click += (s, e) =>
            {
                gamemodeWindow.window.Visible = !gamemodeWindow.window.Visible;
            };

            btnOptions = new Button(manager);
            btnOptions.Init();
            master.Add(btnOptions);
            btnOptions.Left = btnGameMode.Left+btnGameMode.Width;
            btnOptions.Top = tbcViews.Top + tbcViews.Height;
            btnOptions.Text = "Options";
            btnOptions.Width = (int)manager.Skin.Fonts[0].Resource.MeasureString(btnOptions.Text).X + 10;
            btnOptions.ClientMargins = new Margins(0, btnOptions.ClientMargins.Top, 0, btnOptions.ClientMargins.Bottom);
            btnOptions.Anchor = Anchors.Bottom;

            btnOptions.Click += (s, e) =>
            {
                new OptionsWindow(this);
            };

            btnFullScreen = new Button(manager);
            btnFullScreen.Init();
            master.Add(btnFullScreen);
            btnFullScreen.Left = btnOptions.Left + btnOptions.Width;
            btnFullScreen.Top = tbcViews.Top + tbcViews.Height;
            btnFullScreen.Text = "FullScreen";
            btnFullScreen.Width = (int)manager.Skin.Fonts[0].Resource.MeasureString(btnFullScreen.Text).X + 10;
            btnFullScreen.ClientMargins = new Margins(0, btnFullScreen.ClientMargins.Top, 0, btnFullScreen.ClientMargins.Bottom);
            btnFullScreen.Anchor = Anchors.Bottom;

            btnFullScreen.Click += (s, e) =>
            {
                if (btnFullScreen.Text == "FullScreen")
                {
                    btnFullScreen.Text = "Windowed";
                    game.setResolution(game.prefFullScreenResolution ?? resolutions.AutoFullScreen, true);
                }
                else
                {
                    game.setResolution(game.prefFullScreenResolution ?? resolutions.WSXGA_1680x1050, false);
                    btnFullScreen.Text = "FullScreen";
                }
            };

            btnPause = new Button(manager);
            btnPause.Init();
            master.Add(btnPause);
            btnPause.Left = btnFullScreen.Left + btnFullScreen.Width;
            btnPause.Top = tbcViews.Top + tbcViews.Height;
            btnPause.Text = "Pause";
            btnPause.Width = (int)manager.Skin.Fonts[0].Resource.MeasureString("Resume").X + 10;
            btnPause.ClientMargins = new Margins(0, btnPause.ClientMargins.Top, 0, btnPause.ClientMargins.Bottom);
            btnPause.Anchor = Anchors.Bottom;

            btnPause.Click += (s, e) =>
            {
                ui.IsPaused = !ui.IsPaused;
                btnPause.Text = ui.IsPaused ? "Resume" : "Pause";
            };

            btnLoadLevel = new Button(manager);
            btnLoadLevel.Init();
            master.Add(btnLoadLevel);
            btnLoadLevel.Left = btnGameMode.Left;
            btnLoadLevel.Top = btnGameMode.Top + btnGameMode.Height;
            btnLoadLevel.Text = "Load Level";
            btnLoadLevel.Width = (int)manager.Skin.Fonts[0].Resource.MeasureString(btnLoadLevel.Text).X + 10;
            btnLoadLevel.ClientMargins = new Margins(0, btnLoadLevel.ClientMargins.Top, 0, btnLoadLevel.ClientMargins.Bottom);
            btnLoadLevel.Anchor = Anchors.Bottom;

            btnLoadLevel.Click += btnLoadLevel_Click;

            btnSaveLevel = new Button(manager);
            btnSaveLevel.Init();
            master.Add(btnSaveLevel);
            btnSaveLevel.Left = btnLoadLevel.Left + btnLoadLevel.Width;
            btnSaveLevel.Top = btnGameMode.Top + btnGameMode.Height;
            btnSaveLevel.Text = "Save Level";
            btnSaveLevel.Width = (int)manager.Skin.Fonts[0].Resource.MeasureString(btnSaveLevel.Text).X + 10;
            btnSaveLevel.ClientMargins = new Margins(0, btnSaveLevel.ClientMargins.Top, 0, btnSaveLevel.ClientMargins.Bottom);
            btnSaveLevel.Anchor = Anchors.Bottom;

            btnSaveLevel.Click += btnSaveLevel_Click;
        }
Exemple #9
0
        private void RecalculateHeight(TabControl tabControl)
        {
            var size = Math.Max(createdPages[tabControl.TabPages[tabControl.SelectedIndex]] + 50, 400);
            Resize(tabControl, size);

            Control parent = tabControl;
            do {
                parent.Refresh();
                parent.Invalidate();
            } while ((parent = parent.Parent) != null);
        }
Exemple #10
0
        private void CreateTabs()
        {
            _tabs = new TabControl(ControlManager.Manager);
            _tabs.Init();
            _tabs.SetPosition(300, 50);

            _tabs.MinimumHeight = 467;
            _tabs.MinimumWidth = 856;

            ControlManager.Add(_tabs);
        }
Exemple #11
0
		private void InitializeControls() {
			_manager.Initialize();
			_manager.AutoCreateRenderTarget = true;

			_tabControl = new TabControl(_manager);
			_tabControl.Init();
			_tabControl.Left = 600;
			_tabControl.Top = 0;
			_tabControl.Width = Width;
			_tabControl.Height = Height;
			_tabControl.Show();
			#region WavePage
			_wavePage = _tabControl.AddPage();
			_wavePage.Text = "Waves";

			#region Constructors
			_health = new Label(_manager);
			_health.Init();
			_texture = new Label(_manager);
			_texture.Init();
			_speed = new Label(_manager);
			_speed.Init();
			_number = new Label(_manager);
			_number.Init();

			_waves = new ListBox(_manager);
			_waves.Init();
			_deleteWaveButton = new Button(_manager);
			_deleteWaveButton.Init();
			_addWaveButton = new Button(_manager);
			_addWaveButton.Init();
			_currentWave = new ListBox(_manager);
			_currentWave.Init();
			_addCreepsButton = new Button(_manager);
			_addCreepsButton.Init();
			_numberOfCreeps = new TextBox(_manager);
			_numberOfCreeps.Init();
			_speedOfCreeps = new TextBox(_manager);
			_speedOfCreeps.Init();
			_healthOfCreeps = new TextBox(_manager);
			_healthOfCreeps.Init();
			_creepTexture = new ComboBox(_manager);
			_creepTexture.Init();
			#endregion

			#region Properties
			_texture.Text = "Textur";
			_texture.Top = 2;
			_texture.Left = 2;
			_texture.Parent = _wavePage;
			_wavePage.Add(_texture);

			_creepTexture.Items.AddRange(new[] { "Slyder", "Drone", "Ape", "Paw" });
			_creepTexture.Text = "Slyder";
			_creepTexture.Width = 80;
			_creepTexture.Left = 2;
			_creepTexture.Top = _texture.Top + _texture.Height + 2;
			_creepTexture.TextColor = Color.LightGray;
			_creepTexture.Parent = _wavePage;

			_health.Text = "Gesundheit";
			_health.Top = 2;
			_health.Left = _creepTexture.Left + _creepTexture.Width + 5;
			_health.Parent = _wavePage;

			_healthOfCreeps.Left = _health.Left;
			_healthOfCreeps.Top = _health.Top + _health.Height + 2;
			_healthOfCreeps.Width = _health.Width;
			_healthOfCreeps.TextColor = Color.LightGray;
			_healthOfCreeps.Parent = _wavePage;

			_speed.Text = "Geschwindigkeit";
			_speed.Left = _health.Left + _health.Width + 5;
			_speed.Top = 2;
			_speed.Width = 93;
			_speed.Parent = _wavePage;

			_speedOfCreeps.Left = _speed.Left;
			_speedOfCreeps.Top = _speed.Top + _speed.Height + 2;
			_speedOfCreeps.Width = _speed.Width;
			_speedOfCreeps.TextColor = Color.LightGray;
			_speedOfCreeps.Parent = _wavePage;

			_number.Text = "Anzahl";
			_number.Top = 2;
			_number.Left = _speed.Left + _speed.Width + 5;
			_number.Width = 40;
			_number.Parent = _wavePage;

			_numberOfCreeps.Left = _number.Left;
			_numberOfCreeps.Top = _number.Top + _number.Height + 2;
			_numberOfCreeps.Width = _number.Width;
			_numberOfCreeps.TextColor = Color.LightGray;
			_numberOfCreeps.Parent = _wavePage;

			_addCreepsButton.Text = "Creeps hinzufügen";
			_addCreepsButton.Top = _numberOfCreeps.Top + _numberOfCreeps.Height - _addCreepsButton.Height;
			_addCreepsButton.Left = _numberOfCreeps.Left + _numberOfCreeps.Width + 5;
			_addCreepsButton.Width = 120;
			_addCreepsButton.Parent = _wavePage;

			_currentWave.Left = 2;
			_currentWave.Top = _creepTexture.Top + _creepTexture.Height + 5;
			_currentWave.Width = _addCreepsButton.Left + _addCreepsButton.Width;
			_currentWave.Height = 150;
			_currentWave.TextColor = Color.LightGray;
			_currentWave.Parent = _wavePage;

			_addWaveButton.Text = "Wave hinzufügen";
			_addWaveButton.Left = 2;
			_addWaveButton.Top = _currentWave.Top + _currentWave.Height + 5;
			_addWaveButton.Width = 150;
			_addWaveButton.Parent = _wavePage;

			_deleteWaveButton.Text = "Wave löschen";
			_deleteWaveButton.Left = _addWaveButton.Left + _addWaveButton.Width + 5;
			_deleteWaveButton.Top = _currentWave.Top + _currentWave.Height + 5;
			_deleteWaveButton.Width = _addWaveButton.Width;
			_deleteWaveButton.Parent = _wavePage;

			_waves.Left = 2;
			_waves.Top = _addWaveButton.Top + _addWaveButton.Height + 5;
			_waves.Width = _currentWave.Width;
			_waves.Height = 150;
			_waves.TextColor = Color.LightGray;
			_waves.Parent = _wavePage;
			_waves.ItemIndexChanged += _waves_ItemIndexChanged;
			#endregion

			#region Events
			_addCreepsButton.Click += AddCreepsButton_Click;
			_addWaveButton.Click += AddWaveButton_Click;
			_deleteWaveButton.Click += DeleteWaveButton_Click;
			#endregion
			#endregion

			#region SavePage
			_savePage = _tabControl.AddPage();
			_savePage.Text = "Speichern & Laden";
			_path = new TextBox(_manager);
			_path.Init();
			_path.Top = 2;
			_path.Left = 2;
			_path.Width = 200;
			_path.Parent = _savePage;
			_path.ReadOnly = true;

			_fileNameButton = new Button(_manager);
			_fileNameButton.Init();
			_fileNameButton.Text = "...";
			_fileNameButton.Width = 17;
			_fileNameButton.Height = _fileNameButton.Width;
			_fileNameButton.Top = _path.Top + _path.Height / 2 - _fileNameButton.Height / 2;
			_fileNameButton.Left = _path.Left + _path.Width + 2;
			_fileNameButton.Parent = _savePage;
			_fileNameButton.Click += delegate {
											var dlg = new SaveFileDialog {
												Filter = "Level-Dateien|*.xml",
												InitialDirectory =
													Path.GetFullPath(
													Path.GetDirectoryName(
														Assembly.GetExecutingAssembly().Location) +
													@"\..\Content\Map")
											};
											dlg.ShowDialog();
											_path.Text = dlg.FileName;
										};

			_saveButton = new Button(_manager);
			_saveButton.Init();
			_saveButton.Top = _path.Top + _path.Height + 2;
			_saveButton.Left = 2;
			_saveButton.Text = "Speichern";
			_saveButton.Width = 120;
			_saveButton.Parent = _savePage;
			_saveButton.Click += delegate {
										if (_path.Text.Length > 0) {
											string fileName = _path.Text;
											Save(fileName);
										}
									};

			LoadButton = new Button(_manager);
			LoadButton.Init();
			LoadButton.Left = 2;
			LoadButton.Top = 50;
			LoadButton.Text = "Laden";
			LoadButton.Width = 120;
			LoadButton.Parent = _savePage;
			LoadButton.Click += LoadButton_Click;
			#endregion
			_manager.Add(_tabControl);
		}
        public ComponentView(Sidebar sidebar, Control parent, int Left, int Top, ViewType viewType)
            : base(sidebar, parent, Left, Top, false)
        {
            this.parent = parent;
            lblComponents = new Label(manager);
            lblComponents.Init();
            lblComponents.Parent = parent;
            lblComponents.Text = "Components";
            lblComponents.Width = 150;
            lblComponents.Left = LeftPadding;
            lblComponents.TextColor = Color.Black;
            lblComponents.Top = HeightCounter;
            HeightCounter += lblComponents.Height + VertPadding;
            base.Initialize();

            btnAddComponent = new Button(manager);
            btnAddComponent.Init();
            btnAddComponent.Width = 150;
            btnAddComponent.Left = Left + LeftPadding + (Width - btnAddComponent.Width) / 2;
            btnAddComponent.Top = HeightCounter;

            btnAddComponent.Parent = parent;
            btnAddComponent.Text = "Add Component";
            btnAddComponent.Click += btnAddComponent_Click;
            HeightCounter += btnAddComponent.Height + VertPadding;

            bottomArea = new TabControl(manager);
            bottomArea.Init();
            bottomArea.Parent = parent;
            bottomArea.Left = 0;
            bottomArea.Top = HeightCounter;
            bottomArea.Width = sidebar.Width - 5;
            bottomArea.Height = 500;

            bottomArea.AddPage();
            bottomArea.TabPages[0].Text = "Edit";
            TabPage editTab = bottomArea.TabPages[0];
            editTab.Margins = new Margins(0, 0, 0, 0);

            lblCurrentComp = new Label(manager);
            lblCurrentComp.Init();
            lblCurrentComp.Parent = editTab;
            lblCurrentComp.Width = 150;
            lblCurrentComp.Top = 5;
            lblCurrentComp.Left = LeftPadding;
            lblCurrentComp.Text = "";
            lblCurrentComp.TextColor = Color.Black;

            insView = new InspectorView(sidebar, editTab, Left, lblComponents.Height + 10);
            insView.GroupSync = true;
            insView.Height = 140;
            OnItemEvent += OnEvent2;
            editTab.Margins = new Margins(0, 0, 0, 0);

            bottomArea.AddPage();
            bottomArea.TabPages[1].Text = "Preview";
            TabPage previewTab = bottomArea.TabPages[1];
            previewTab.Margins = new Margins(0, 0, 0, 0);
            bottomArea.Height = insView.Height + 140;

            this.viewType = viewType;
        }
Exemple #13
0
        private void InitializeControls()
        {
            manager = new Manager(CurrGame, CurrGame.Graphics, "Green") { SkinDirectory = CurrGame.ApplicationDirectory + @"\Content\GUI\Skin\" };
            try
            {
                manager.Initialize();
            }
            catch (Exception)
            {
                throw;
            }

            manager.AutoCreateRenderTarget = true;

            Console = new Console(manager);
            Console.Init();
            LoadConsoleCommands();
            manager.Add(Console);
            Console.ChannelsVisible = false;
            Console.MessageSent += Console_MessageSent;
            Console.MessageFormat = ConsoleMessageFormats.None;
            Console.Width = manager.ScreenWidth;
            Console.Channels.Add(new ConsoleChannel(0, "[System]", Color.Orange));
            Console.Channels.Add(new ConsoleChannel(1, "[User]", Color.White));
            Console.Channels.Add(new ConsoleChannel(2, "[Error]", Color.DarkRed));
            Console.SelectedChannel = 1;
            Console.Hide();

            tabControl = new TabControl(manager);
            tabControl.Init();
            tabControl.Left = CurrGame.CreepFieldWidth;
            tabControl.Top = 0;
            tabControl.Width = CurrGame.Width - CurrGame.CreepFieldWidth;
            tabControl.Height = CurrGame.Height;

            #region Gameplaypage

            GameplayPage = tabControl.AddPage();
            GameplayPage.Init();
            GameplayPage.Text = "Spiel";

            #region Turmauswahl

            var thumbnailBox = new GroupBox(manager);
            thumbnailBox.Init();
            thumbnailBox.Parent = GameplayPage;
            thumbnailBox.Left = 2;
            thumbnailBox.Top = 2;
            thumbnailBox.Width = thumbnailBox.Parent.Width - 4;
            thumbnailBox.Height = 100;

            int counter = 0;
            foreach (TowerClass towerClass in GamePlayScreen.TowerManager.TowerClassList)
            {
                var towerButton = new ImageButton(manager)
                                      {
                                          Image = GamePlayScreen.TowerManager.GetThumbnail(towerClass.TowerKey),
                                          SizeMode = SizeMode.Stretched,
                                          Top = 14,
                                          Tag = towerClass
                                      };
                towerButton.Width = towerButton.Height = 60;
                towerButton.Left = 6 + counter * (towerButton.Width + 5);
                towerButton.Click += towerButton_Click;
                towerButton.MouseOver += towerButton_MouseOver;
                towerButton.MouseOut += towerButton_MouseOut;
                towerButton.Init();
                thumbnailBox.Add(towerButton);
                BuyTowerButtons.Add(towerButton);
                counter++;
            }

            thumbnailBox.AutoScroll = true;

            var scrollBar = new ScrollBar(manager, Orientation.Horizontal);
            scrollBar.Init();
            thumbnailBox.Add(scrollBar);
            scrollBar.Visible = false;

            #endregion

            #region Informationen

            var infoBox = new GroupBox(manager);
            infoBox.Init();
            infoBox.Parent = GameplayPage;
            infoBox.Text = "Informationen";
            infoBox.Width = infoBox.Parent.Width - 4;
            infoBox.Height = 110;
            infoBox.Left = 2;
            infoBox.Top = thumbnailBox.Top + thumbnailBox.Height + 2;

            CreepNumber = new Label(manager);
            CreepNumber.Init();
            CreepNumber.Parent = infoBox;
            CreepNumber.Top = 14;
            CreepNumber.Left = 4;
            CreepNumber.Width = CreepNumber.Parent.Width - 4;
            CreepNumber.ToolTip = new ToolTip(manager) { Text = "So viele Creeps sind momentan\nauf dem Spielfeld" };
            CreepNumber.Passive = false;

            CreepHealth = new Label(manager);
            CreepHealth.Init();
            CreepHealth.Parent = infoBox;
            CreepHealth.Top = CreepNumber.Top + CreepNumber.Height + 2;
            CreepHealth.Left = CreepNumber.Left;
            CreepHealth.Width = CreepHealth.Parent.Width - 4;
            CreepHealth.ToolTip = new ToolTip(manager) { Text = "Die Gesamtenergie aller auf dem\nSpielfeld befindlicher Creeps" };
            CreepHealth.Passive = false;

            Money = new Label(manager);
            Money.Init();
            Money.Parent = infoBox;
            Money.Top = CreepHealth.Top + CreepHealth.Height + 2;
            Money.Left = CreepNumber.Left;
            Money.Width = Money.Parent.Width - 4;
            Money.ToolTip = new ToolTip(manager) { Text = "So viel Geld besitzt der Spieler" };
            Money.Passive = false;

            OwnHealth = new Label(manager);
            OwnHealth.Init();
            OwnHealth.Parent = infoBox;
            OwnHealth.Top = Money.Top + Money.Height + 2;
            OwnHealth.Left = CreepNumber.Left;
            OwnHealth.Width = OwnHealth.Parent.Width - 4;
            OwnHealth.ToolTip = new ToolTip(manager) { Text = "So viel Energie hat der Spieler noch" };
            OwnHealth.Passive = false;

            Points = new Label(manager);
            Points.Init();
            Points.Parent = infoBox;
            Points.Top = OwnHealth.Top + OwnHealth.Height + 2;
            Points.Left = CreepNumber.Left;
            Points.Width = Points.Parent.Width - 4;
            Points.ToolTip = new ToolTip(manager) { Text = "So viele Punkte hat der Spieler schon.\nDie Punkte setzen sich aus Energie\nund Geschwindigkeit der Creeps zusammen.\nJe näher ein Gegner am Ziel ist, desto mehr\nPunkte gibt er." };
            Points.Passive = false;

            #endregion

            #region Waves

            var waveBox = new GroupBox(manager);
            waveBox.Init();
            waveBox.Parent = GameplayPage;
            waveBox.Text = "Waves";
            waveBox.Left = 2;
            waveBox.Top = infoBox.Top + infoBox.Height + 2;
            waveBox.Width = waveBox.Parent.Width - 4;
            waveBox.Height = 137;

            WaveNumber = new Label(manager);
            WaveNumber.Init();
            WaveNumber.Parent = waveBox;
            WaveNumber.Top = 14;
            WaveNumber.Left = 4;
            WaveNumber.Width = WaveNumber.Parent.Width - 4;

            RealWaveNumber = new Label(manager);
            RealWaveNumber.Init();
            RealWaveNumber.Parent = waveBox;
            RealWaveNumber.Top = WaveNumber.Top + WaveNumber.Height + 2;
            RealWaveNumber.Left = WaveNumber.Left;
            RealWaveNumber.Width = RealWaveNumber.Parent.Width - 4;

            CreepsLeft = new Label(manager);
            CreepsLeft.Init();
            CreepsLeft.Parent = waveBox;
            CreepsLeft.Top = RealWaveNumber.Top + RealWaveNumber.Height + 2;
            CreepsLeft.Left = WaveNumber.Left;
            CreepsLeft.Width = CreepsLeft.Parent.Width - 4;
            CreepsLeft.Passive = false;
            CreepsLeft.ToolTip = new ToolTip(manager) { Text = "So viele Creeps werden noch im Level erscheinen,\nbevor die Aktuelle Welle vorbei ist." };

            CreepHealthLevel = new Label(manager);
            CreepHealthLevel.Init();
            CreepHealthLevel.Parent = waveBox;
            CreepHealthLevel.Top = CreepsLeft.Top + CreepsLeft.Height + 2;
            CreepHealthLevel.Left = WaveNumber.Left;
            CreepHealthLevel.Width = CreepHealthLevel.Parent.Width - 4;
            CreepHealthLevel.Passive = false;
            CreepHealthLevel.ToolTip = new ToolTip(manager) { Text = "Wenn alle Waves eines Levels fertig sind, werden die Waves von Anfang anwiederholt.\nAllerdings steigt die Energie der Creeps dabei.\nDas Gesundheitsniveau liegt dieser Energie zugrunde." };

            TimeLeftNextWave = new Label(manager);
            TimeLeftNextWave.Init();
            TimeLeftNextWave.Parent = waveBox;
            TimeLeftNextWave.Top = CreepHealthLevel.Top + CreepHealthLevel.Height + 2;
            TimeLeftNextWave.Left = WaveNumber.Left;
            TimeLeftNextWave.Width = TimeLeftNextWave.Parent.Width - 4;

            var nextWaveButton = new Button(manager);
            nextWaveButton.Init();
            nextWaveButton.Parent = waveBox;
            nextWaveButton.Text = "Nächste Welle";
            nextWaveButton.Left = 2;
            nextWaveButton.Top = TimeLeftNextWave.Top + TimeLeftNextWave.Height + 2;
            nextWaveButton.Width = nextWaveButton.Parent.Width - 4;
            nextWaveButton.Click += delegate { GamePlayScreen.StartNextWave(); };

            #endregion

            #region Spielsteuerung

            var gameBox = new GroupBox(manager);
            gameBox.Init();
            gameBox.Text = "Spielsteuerung";
            gameBox.Parent = GameplayPage;
            gameBox.Width = gameBox.Parent.Width - 4;
            gameBox.Height = 200;
            gameBox.Left = 2;
            gameBox.Top = waveBox.Top + waveBox.Height + 2;

            var playButton = new ImageButton(manager)
                                 {
                                     Image =
                                         CurrGame.Content.Load<Texture2D>(CurrGame.ApplicationDirectory + "\\Content\\GUI\\play"),
                                     SizeMode = SizeMode.Stretched,
                                     Top = 14,
                                     Left = 2,
                                     Width = 50
                                 };
            playButton.Height = playButton.Width;
            playButton.Click += ((sender, e) => GamePlayScreen.StartGame());
            playButton.Init();

            var pauseButton = new ImageButton(manager)
                                  {
                                      Image =
                                          CurrGame.Content.Load<Texture2D>(CurrGame.ApplicationDirectory +
                                                                           "\\Content\\GUI\\pause"),
                                      SizeMode = SizeMode.Stretched,
                                      Top = 14,
                                      Left = playButton.Left + playButton.Width + 4
                                  };
            pauseButton.Width = pauseButton.Height = playButton.Width;
            pauseButton.Click += ((sender, e) => GamePlayScreen.StopGame());
            pauseButton.Init();

            gameBox.Add(playButton);
            gameBox.Add(pauseButton);

            #endregion

            RefreshGameInformation();

            #endregion

            #region Optionspage

            OptionsPage = tabControl.AddPage();
            OptionsPage.Text = "Optionen";

            #endregion

            #region SaveLoadPage

            #endregion

            manager.Add(tabControl);
        }