Example #1
0
 public override void OnDeactivate()
 {
     base.OnDeactivate();
     pentagram     = null;
     unspentPoints = null;
     Constitution  = null;
     Strength      = null;
     Intelligence  = null;
     Charisma      = null;
     Dexterity     = null;
     Mobility      = null;
     Excavation    = null;
     Animalia      = null;
     Luck          = null;
     Mysticism     = null;
 }
Example #2
0
        public override void OnInitialize()
        {
            base.OnInitialize();
            Width.Set(diameter, 0f);
            Height.Set(diameter, 0f);

            Vector2 center = new Vector2(diameter / 2f, diameter / 2f);

            pentagram = new UITexture("levelplus/Textures/UI/ComboCircle", true);
            pentagram.Width.Set(diameter, 0f);
            pentagram.Height.Set(diameter, 0f);
            pentagram.Left.Set(0f, 0f);
            pentagram.Top.Set(0f, 0f);

            unspentPoints = new UIText("-1");
            unspentPoints.Width.Set(20f, 0f);
            unspentPoints.Height.Set(20f, 0f);
            unspentPoints.Top.Set(center.Y - unspentPoints.Height.Pixels / 2f, 0f);
            unspentPoints.Left.Set(center.X - unspentPoints.Width.Pixels / 2f, 0f);
            unspentPoints.OnClick += new MouseEvent(CloseMenu);

            pentagram.Append(unspentPoints);
            Append(pentagram);
            //big radius
            float BR = R1 * diameter;
            //little radius
            float LR = R2 * diameter;
            //big button radius
            float BBR = B1 * diameter;
            //little button radius
            float LBR = B2 * diameter;


            //bottom
            Animalia = new StatButton(Stat.ANIMALIA, LBR * 2);
            Animalia.Left.Set(center.X - LBR, 0f);
            Animalia.Top.Set(center.Y + LR - LBR, 0f);
            Append(Animalia);

            //bottom right
            Luck = new StatButton(Stat.LUCK, LBR * 2);
            Luck.Left.Set(center.X + S1 * LR - LBR, 0f);
            Luck.Top.Set(center.Y + C1 * LR - LBR, 0f);
            Append(Luck);

            //top right
            Mobility = new StatButton(Stat.MOBILITY, LBR * 2);
            Mobility.Left.Set(center.X + S2 * LR - LBR, 0f);
            Mobility.Top.Set(center.Y - C2 * LR - LBR, 0f);
            Append(Mobility);

            //top left
            Excavation = new StatButton(Stat.EXCAVATION, LBR * 2);
            Excavation.Left.Set(center.X - S2 * LR - LBR, 0f);
            Excavation.Top.Set(center.Y - C2 * LR - LBR, 0f);
            Append(Excavation);

            //bottom left
            Mysticism = new StatButton(Stat.MYSTICISM, LBR * 2);
            Mysticism.Left.Set(center.X - S1 * LR - LBR, 0f);
            Mysticism.Top.Set(center.Y + C1 * LR - LBR, 0f);
            Append(Mysticism);


            //top
            Constitution = new StatButton(Stat.CONSTITUTION, BBR * 2);
            Constitution.Left.Set(center.X - BBR, 0f);
            Constitution.Top.Set(center.Y - BR - BBR, 0f);
            Append(Constitution);

            //top left
            Strength = new StatButton(Stat.STRENGTH, BBR * 2);
            Strength.Left.Set(center.X - S1 * BR - BBR, 0f);
            Strength.Top.Set(center.Y - C1 * BR - BBR, 0f);
            Append(Strength);

            //bottom left
            Intelligence = new StatButton(Stat.INTELLIGENCE, BBR * 2);
            Intelligence.Left.Set(center.X - S2 * BR - BBR, 0f);
            Intelligence.Top.Set(center.Y + C2 * BR - BBR, 0f);
            Append(Intelligence);

            //bottom right
            Charisma = new StatButton(Stat.CHARISMA, BBR * 2);
            Charisma.Left.Set(center.X + S2 * BR - BBR, 0f);
            Charisma.Top.Set(center.Y + C2 * BR - BBR, 0f);
            Append(Charisma);

            //top right
            Dexterity = new StatButton(Stat.DEXTERITY, BBR * 2);
            Dexterity.Left.Set(center.X + S1 * BR - BBR, 0f);
            Dexterity.Top.Set(center.Y - C1 * BR - BBR, 0f);
            Append(Dexterity);
        }