예제 #1
0
        /// <summary>
        /// Constructor of the class.
        /// </summary>
        /// <param name="command">The command of the unit.</param>
        /// <param name="type">The type of the action owner of the command.</param>
        public CommandMenu(Command command, ActionMenuType type)
            : base(command.Unit, command.Name, type)
        {
            this.CommandField = command;

            if (this.Unit.Player.PlayerIndex == PlayerIndex.One)
            {
                this.ItemTexture = TextureManager.Instance.Sprites.Menu.SubmenuItemPlayerOne;
            }
            else
            {
                this.ItemTexture = TextureManager.Instance.Sprites.Menu.SubmenuItemPlayerTwo;
            }

            this.SelectedItemTexture = TextureManager.Instance.Sprites.Menu.SubmenuSelectedItem;
            this.DisabledItemTexture = TextureManager.Instance.Sprites.Menu.SubmenuDisabledItem;

            this.TextSpriteFont      = FontManager.Instance.Chilopod14;
            this.AttributeSpriteFont = FontManager.Instance.Chilopod12;
        }
예제 #2
0
        /// <summary>
        /// Constructor of the class.
        /// </summary>
        /// <param name="unit">The unit owner of the action.</param>
        /// <param name="text">The text of the action.</param>
        /// <param name="type">The type of the action.</param>
        public ActionMenu(Unit unit, string text, ActionMenuType type)
        {
            // Set the properties.
            this.UnitField = unit;
            this.TextField = text;
            this.TypeField = type;

            if (this.Unit.Player.PlayerIndex == PlayerIndex.One)
            {
                this.ItemTexture = TextureManager.Instance.Sprites.Menu.ItemPlayerOne;
            }
            else
            {
                this.ItemTexture = TextureManager.Instance.Sprites.Menu.ItemPlayerTwo;
            }

            this.SelectedItemTexture = TextureManager.Instance.Sprites.Menu.SelectedItem;

            // Set the font to draw the text.
            this.TextSpriteFont = FontManager.Instance.Chilopod16;

            // Create the commands.
            this.CommandsField = new List <CommandMenu>();
        }