Пример #1
0
        // Opens up the gui
        public void open(ref Unit pmUnit)
        {
            unit=	pmUnit;

            // Unit's name
            name.text=	unit.name;

            // Unit's level
            level.text=	"Lv. "+unit.level;
            level.bounds.X=	game.Window.ClientBounds.Width-24-(int)(level.font.MeasureString(level.text).X);

            // HP
            statsLbl[0].text=	"HP:    "+spaceOutEvenly(unit.health)+"  +"+unit.getStatDifference("hp");
            stats[0].isEnabled=	(unit.statVariance.hp< 12);

            // Mana
            statsLbl[1].text=	"Mana:  "+spaceOutEvenly(unit.mana)+"  +"+unit.getStatDifference("mana");
            stats[1].isEnabled=	(unit.statVariance.mana< 12);

            // Attack
            statsLbl[2].text=	"Atk:   "+spaceOutEvenly(unit.attack)+"  +"+unit.getStatDifference("atk");
            stats[2].isEnabled=	(unit.statVariance.atk< 12);

            // Defense
            statsLbl[3].text=	"Def:   "+spaceOutEvenly(unit.defense)+"  +"+unit.getStatDifference("def");
            stats[3].isEnabled=	(unit.statVariance.def< 12);

            // Magic
            statsLbl[4].text=	"Mag:   "+spaceOutEvenly(unit.magic)+"  +"+unit.getStatDifference("mag");
            stats[4].isEnabled=	(unit.statVariance.mag< 12);

            // Resistance
            statsLbl[5].text=	"Res:   "+spaceOutEvenly(unit.resistance)+"  +"+unit.getStatDifference("res");
            stats[5].isEnabled=	(unit.statVariance.res< 12);

            // Speed
            statsLbl[6].text=	"Spd:   "+spaceOutEvenly(unit.speed)+"  +"+unit.getStatDifference("spd");
            stats[6].isEnabled=	(unit.statVariance.spd< 12);

            // Movement
            statsLbl[7].text=	"Move:  "+spaceOutEvenly(unit.move);
            stats[7].isEnabled=	(unit.statVariance.move< 6);

            game.gui.open("unit_level_up");
        }