public UIDefaultActionButton(GameBoard game, int hOra, LiveUnit unit, int xPos, int yPos, int width, int height) : base(game, xPos, yPos, width, height)
        {
            this.hOra = hOra;
            if (this.hOra == 0)
            {
                this.thisSprite = move;
            }
            else if (this.hOra == 1)
            {
                this.thisSprite = attack;
            }
            else if (this.hOra == 2)
            {
                this.thisSprite = passive1;
            }
            else if (this.hOra == 3)
            {
                this.thisSprite = passive2;
            }

            this.layer = 95;
            this.lrep  = unit;
            //Create a hover text box
            if (this.hOra == 0)
            {
                this.flavorText = new UITextBox(game, "Move Unit // This unit can move " + (this.lrep.speed - 1) + " this turn.", xPos, yPos, 89, 12);
            }
            else if (this.hOra == 1)
            {
                this.flavorText = new UITextBox(game, this.lrep.Abilities[0].Title + " // " + this.lrep.Abilities[0].Tooltip, xPos, yPos, 89, 12);
            }
            else if (this.hOra == 2)
            {
                if (this.lrep.Abilities.Count > 3)
                {
                    this.flavorText = new UITextBox(game, this.lrep.Abilities[3].Title + " // " + this.lrep.Abilities[3].Tooltip, xPos, yPos, 89, 12);
                }
            }
            else if (this.hOra == 3)
            {
                if (this.lrep.Abilities.Count > 4)
                {
                    this.flavorText = new UITextBox(game, this.lrep.Abilities[4].Title + " // " + this.lrep.Abilities[4].Tooltip, xPos, yPos, 89, 12);
                }
            }
        }
예제 #2
0
        public UISkillButton(GameBoard game, int skillNum, Ability ability, LiveUnit unit, int xPos, int yPos, int width, int height) : base(game, xPos, yPos, width, height)
        {
            this.skillNum = skillNum;
            if (this.skillNum == 1)
            {
                this.thisSprite = skill1;
            }
            else if (this.skillNum == 2)
            {
                this.thisSprite = skill2;
            }

            this.layer = 95;
            this.rep   = ability;
            this.lrep  = unit;
            //Create a hover text box
            this.flavorText = new UITextBox(game, this.rep.Title + " // " + this.rep.Tooltip, xPos, yPos, width, 12);
        }