/* * GUIDialogScreen.cs * Authors: * Copyright (c) 2007-2008 Cornell University This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ using System; using System.Collections.Generic; using System.Text; using Microsoft.Xna.Framework.Graphics; namespace tAC_Engine.GUI { /// /// Enum representing all the possible end states of the dialog screen /// public enum DialogOptions { /// /// Represents that the user has accepted the current dialog /// OK, /// /// Represents that the user has canceled out of the current dialog /// CANCEL, /// /// Represents that the user agrees with the current dialog /// YES, /// /// Represents that the user disagrees with the current dialog /// NO } /// /// Defines how dialog works and is rendered within a game screen /// public class GUIDialogScreen : GUIScreen { #region Fields private string mMessage; private Texture2D mPixel; private DialogOptions mOptions; private List mButtons; #endregion #region Properties #endregion #region Creation /// /// Constructor /// /// Message that will be displayed in the dialog screen /// List of options that the player can choose from public GUIDialogScreen(string message, DialogOptions options) { mMessage = message; mOptions = options; mButtons = new List(); if ((options & DialogOptions.OK) == DialogOptions.OK) { GUIButton okButton = new GUIButton(); okButton.Text = "OK"; mButtons.Add(okButton); Add(okButton); } } #endregion #region Management /// /// Loads all needed information for content dependent variables. /// protected override void LoadContent() { mPixel = new Texture2D(GraphicsDevice, 1, 1, 1, TextureUsage.None, SurfaceFormat.Color); Color[] pixels = new Color[1]; pixels[0] = Color.White; mPixel.SetData(pixels); base.LoadContent(); } #endregion #region Modifiers /// /// Resizes the tip panel that the dialog resides in. /// Currently not implemented /// protected override void ResizeTipPanel() { throw new NotImplementedException(); } #endregion } }