示例#1
0
 /// <summary>
 /// Sets up the option, associates it with a menu and the IntLeafOption that needed it to get the input
 /// </summary>
 /// <param name="menu">The menu that this option is a part of</param>
 /// <param name="option">The option that needed the InputGetter to get some input for it</param>
 public InputGetterOption(Menu menu, IntLeafOption option)
     : base("OK", "Enter Value:", option.getDescription(), menu)
 {
     returnOption = option;
     input = "";
     drawer = new InputGetterDrawer(this);
 }
示例#2
0
        private List<MenuOption> options; //the list of options associated with this branch

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Sets up the branch options, sets the button text to "select"
        /// </summary>
        /// <param name="text">The text to display this option as if it is in a list of menu options</param>
        /// <param name="description">The description of this option that is displayed at the top of the screen under the title if it is the selected option</param>
        /// <param name="menu">The menu object associated with this menu option</param>
        public BranchOption(string text, string description, Menu menu)
            : base("Select", text, description, menu)
        {
            options = new List<MenuOption>();
            listTop = 0;
            listDispLength = 12;
            drawer = new MenuBranchDrawer(this);
        }
示例#3
0
 /// <summary>
 /// Initialises the menu option
 /// </summary>
 /// <param name="buttonText">The button text for the menu option. Should be a single word or value that is not too long</param>
 /// <param name="text">The text of the menu option, a sentence description of the option that will be used when it is displayed in a list and the title when it is selected</param>
 /// <param name="description">The description of the menu option, a more in depth description of the purpose of the menu option</param>
 /// <param name="menu">The menu that this option is a part of, used to update the current node of the menu etc.</param>
 public MenuOption(string buttonText, string text, string description, Menu menu)
 {
     this.description = description;
     this.buttonText = buttonText;
     this.location = new Vector2(0,0);
     this.text = text;
     this.menu = menu;
     button = new OptionButton(new Vector2(0,0), new Vector2(100, 35), TextureNames.EMPTYBTN, this);
     button.Text = buttonText;
     Vector2 bLoc = new Vector2(location.X + Display.measureString(text).X + 5, location.Y);
     button.setLocation(bLoc, new Vector2(button.getWidth(), button.getHeight()));
 }
示例#4
0
 /// <summary>
 /// Initialises the leaf option, maximum value is set to unbounded and minimum value is set to 0
 /// </summary>
 /// <param name="text">The text title of the leaf option, what is shown when it is in the list</param>
 /// <param name="description">The detailed description of the node, this is not displayed at the moment, but could be in a future version</param>
 /// <param name="menu">The menu the option is a part of</param>
 /// <param name="getMethod">The get method for the variable this option represents</param>
 /// <param name="setMethod">The set method for the variable this option represents</param>
 public IntLeafOption(string text, string description, Menu menu, Func<int> getMethod, Action<int> setMethod)
     : base(getMethod().ToString(), text, description, menu)
 {
     init(getMethod, setMethod, int.MaxValue, 0);
 }
示例#5
0
        private Action<bool> setMethod; //A method to set the associated variable's value

        #endregion Fields

        #region Constructors

        /// <summary>
        /// Sets up the button
        /// </summary>
        /// <param name="text">The button text</param>
        /// <param name="description">The description of this leaf</param>
        /// <param name="menu">The menu associated with this leaf</param>
        /// <param name="getMethod">The get method for the variable this leaf affects</param>
        /// <param name="setMethod">The set method for the variable this leaf affects</param>
        public BoolLeafOption(string text, string description, Menu menu, Func<bool> getMethod, Action<bool> setMethod)
            : base(getMethod().ToString(), text, description, menu)
        {
            this.getMethod = getMethod;
            this.setMethod = setMethod;
        }
示例#6
0
 /// <summary>
 /// Constructor for BackButton objects
 /// </summary>
 /// <param name="topLeft">The location of the top leftmost point of the button as a Vector2</param>
 /// <param name="size">The size of the button as a Vector2</param>
 /// <param name="texString">The TextureNames enum that corresponds to the texture to use for this button</param>
 /// <param name="menu">The menu this button is a part of</param>
 public BackButton(Vector2 topLeft,Menu menu)
     : base(topLeft, new Vector2(150, 50), TextureNames.BACK)
 {
     this.menu = menu;
 }
示例#7
0
 /// <summary>
 /// Initialises the menu option
 /// </summary>
 /// <param name="buttonText">The button text for the menu option</param>
 /// <param name="text">The text for the menu option, should be a sentence long description. This is what will be displayed in the branch list</param>
 /// <param name="description">The detailed description of the menu option</param>
 /// <param name="menu">The menu this object is associated with</param>
 protected LeafOption(string buttonText, string text, string description, Menu menu)
     : base(buttonText, text, description, menu)
 {
     //empty
 }