/// <summary> /// Initializes a new instance of the <see cref="SpielerDialogScreen"/> class. /// </summary> /// <param name="graphicsManager">The GraphicsManager</param> /// <param name="screenManager">The screen manager.</param> /// <param name="spielerNr">The spieler nr.</param> /// <param name="playerSettings">The player settings.</param> public SpielerDialogScreen(IBallerburgGraphicsManager graphicsManager, IScreenManager screenManager, int spielerNr, PlayerSettings playerSettings) : base(graphicsManager, screenManager, "Spieler" + spielerNr.ToString() + " Dialog") { this.playerSettings = playerSettings; // Zurück button zurueckMenuEntry = new MenuEntry(this, ResourceLoader.GetString("BackText"), 0) { Position = new Vector2(500, 450) }; zurueckMenuEntry.Selected += ZurueckMenuEntrySelected; castleType = screenManager.PlayerSettings[spielerNr - 1].Castle.CastleType; var selectedEntry = 0; if (screenManager.PlayerSettings[spielerNr - 1].PlayerType == PlayerType.Computer) { selectedEntry = 1; } var entries = new List<string> { "Aus", "An" }; computerMenuEntry = new ComboToggleButton(this, "Computer", new Collection<string>(entries), selectedEntry, 0) { Position = new Vector2(10, 100) }; computerMenuEntry.Selected += ComputerMenuEntrySelected; txtCastleName = new TextBox(this, false) { Position = new Vector2(260, 270), ShowCursor = false }; nameLabel = new MenuEntry(this, "Name", 0) { Position = new Vector2(10, 200) }; nameLabel.Selected += NameMenuEntrySelected; ControlsContainer.Add(zurueckMenuEntry); ControlsContainer.Add(computerMenuEntry); ControlsContainer.Add(nameLabel); ControlsContainer.Add(txtCastleName); var pp = GraphicsManager.GraphicsDevice.PresentationParameters; renderTarget = new RenderTarget2D(GraphicsManager.GraphicsDevice, pp.BackBufferWidth, pp.BackBufferHeight, false, SurfaceFormat.Color, DepthFormat.Depth24Stencil8); }
public EnterNameDialogScreen(IBallerburgGraphicsManager graphicManager, string boxTitle, PlayerSettings playerSettings) : base(graphicManager) { this.playerSettings = playerSettings; zurueckMenuEntry = new MenuEntry(this, ResourceLoader.GetString("BackText"), 1) { Position = new Vector2(360, 360) }; zurueckMenuEntry.Selected += ZurueckExitMessageBoxAccepted; textBox = new TextBox(this, true) { Position = new Vector2(200, 250), Text = playerSettings.PlayerName, ShowCursor = true }; textBox.SetFocus(); ControlsContainer.Add(zurueckMenuEntry); ControlsContainer.Add(textBox); this.boxTitle = boxTitle; IsPopup = true; TransitionOffTime = TimeSpan.FromSeconds(0.2); }