Beispiel #1
0
        public override void OnInitialize()
        {
            Vector2 inventory = new Vector2(30f, 32f);

            Inventory.Left.Set(statPoint.X - inventory.X * 0.5f, 0f);
            Inventory.Top.Set(statPoint.Y - inventory.Y * 0.5f, 0f);
            Inventory.Width.Set(inventory.X, 0f);
            Inventory.Height.Set(inventory.Y, 0f);
            Inventory.SetVisibility(1f, 0.5f);
            Append(Inventory);
            InventoryHighlight.Left.Set(0f, 0f);
            InventoryHighlight.Top.Set(0f, 0f);
            InventoryHighlight.Width.Set(inventory.X, 0f);
            InventoryHighlight.Height.Set(inventory.Y, 0f);
            InventoryHighlight.SetVisibility(1f, 0f);
            InventoryHighlight.OnClick += new MouseEvent(InventoryClicked);
            //InventoryHighlight.OnRightClick += new MouseEvent(InventoryRightClicked);
            Inventory.Append(InventoryHighlight);

            Vector2 grid = new Vector2(64f, 64f);

            for (int i = 0; i < 9; i++)
            {
                float posX = statPoint.X + 32f + inventory.X + grid.X * (-0.5f + (int)(i % 3)) + (int)(i % 3) * 10f;
                float posY = statPoint.Y + 18f + grid.Y * (-0.5f + (int)(i / 3)) + (int)(i / 3) * 10f;
                CardInventoryGridSlot Gri = new CardInventoryGridSlot(GetTexture("Entrogic/UI/Cards/InventoryGrid"), i);
                Gri.uiPosition = new Vector2(posX, posY);
                Gri.uiWidth    = Gri.uiHeight = 64f;
                Grid.Add(Gri);
            }
        }
Beispiel #2
0
        public override void OnInitialize()
        {
            Vector2 grave = new Vector2(48f, 30f);

            Graveyard.Left.Set(statPoint.X + 220f - grave.X * 0.5f, 0f);
            Graveyard.Top.Set(statPoint.Y - grave.Y * 0.5f, 0f);
            Graveyard.Width.Set(grave.X, 0f);
            Graveyard.Height.Set(grave.Y, 0f);
            Append(Graveyard);
            GraveyardHighlight.Left.Set(0f, 0f);
            GraveyardHighlight.Top.Set(0f, 0f);
            GraveyardHighlight.Width.Set(grave.X, 0f);
            GraveyardHighlight.Height.Set(grave.Y, 0f);
            GraveyardHighlight.SetVisibility(1f, 0f);
            GraveyardHighlight.OnClick += new MouseEvent(GraveyardClicked);
            Graveyard.Append(GraveyardHighlight);
            GraveyardDelay.Left.Set(statPoint.X + 220f - grave.X * 0.5f, 0f);
            GraveyardDelay.Top.Set(statPoint.Y - grave.Y * 0.5f, 0f);
            GraveyardDelay.Width.Set(grave.X, 0f);
            GraveyardDelay.Height.Set(grave.Y, 0f);
            Append(GraveyardDelay);

            Vector2 libraries = new Vector2(38f, 32f);

            Libraries.Left.Set(statPoint.X - 220f - libraries.X * 0.5f, 0f);
            Libraries.Top.Set(statPoint.Y - libraries.Y * 1.2f, 0f);
            Libraries.Width.Set(libraries.X, 0f);
            Libraries.Height.Set(libraries.Y, 0f);
            Append(Libraries);

            Vector2 pass = new Vector2(32f, 30f);

            Pass.Left.Set(statPoint.X - 220f - pass.X * 0.5f, 0f);
            Pass.Top.Set(statPoint.Y + pass.Y * 0.2f, 0f);
            Pass.Width.Set(pass.X, 0f);
            Pass.Height.Set(pass.Y, 0f);
            Append(Pass);
            PassHighlight.Left.Set(0f, 0f);
            PassHighlight.Top.Set(0f, 0f);
            PassHighlight.Width.Set(pass.X, 0f);
            PassHighlight.Height.Set(pass.Y, 0f);
            PassHighlight.SetVisibility(1f, 0f);
            PassHighlight.OnClick += new MouseEvent(PassClicked);
            Pass.Append(PassHighlight);
            PassDelay.Left.Set(statPoint.X - 220f - pass.X * 0.5f, 0f);
            PassDelay.Top.Set(statPoint.Y + pass.Y * 0.2f, 0f);
            PassDelay.Width.Set(pass.X, 0f);
            PassDelay.Height.Set(pass.Y, 0f);
            Append(PassDelay);

            Vector2 bar = new Vector2(346f, 22f);

            Bar.SetPadding(0);
            Bar.Left.Set(statPoint.X - bar.X / 2f, 0f);
            Bar.Top.Set(statPoint.Y - bar.Y / 2f - 50f, 0f);
            Bar.Width.Set(bar.X, 0f);
            Bar.Height.Set(bar.Y, 0f);
            Append(Bar);
            BarFull.SetPadding(0);
            BarFull.Left.Set(statPoint.X - bar.X / 2f, 0f);
            BarFull.Top.Set(statPoint.Y - bar.Y / 2f - 50f, 0f);
            BarFull.Width.Set(bar.X, 0f);
            BarFull.Height.Set(bar.Y, 0f);
            Append(BarFull);

            for (int i = 0; i >= -(ManaCrystal.Length - 1); i--)
            {
                Vector2 crystal = new Vector2(20f, 20f);
                float   posX    = statPoint.X + 150f + (crystal.X * 0.5f + 15) * i;
                float   posY    = statPoint.Y + 52f - crystal.Y * 0.5f;
                int     num     = Math.Abs(i);
                ManaCrystal[num] = new CardManaUI(GetTexture("Entrogic/UI/Cards/ManaCrystal"), num, new Vector2(posX, posY));
                ManaCrystal[num].SetPadding(0);
                ManaCrystal[num].Left.Set(posX, 0f);
                ManaCrystal[num].Top.Set(posY, 0f);
                ManaCrystal[num].Width.Set(crystal.X, 0f);
                ManaCrystal[num].Height.Set(crystal.Y, 0f);
                Append(ManaCrystal[num]);
            }
            Vector2 grid = new Vector2(66f, 66f);

            for (int i = 0; i < 6; i++)
            {
                float posX = statPoint.X - 200f + 2f + grid.X * i;
                float posY = statPoint.Y - grid.Y * 0.5f;
                UICardHandGridButton Gri = new UICardHandGridButton(GetTexture("Entrogic/UI/Cards/HelpGrid"), i, new Vector2(posX, posY));
                Gri.Left.Set(posX, 0f);
                Gri.Top.Set(posY, 0f);
                Gri.Width.Set(grid.X, 0f);
                Gri.Height.Set(grid.Y, 0f);
                Grid.Add(Gri);
                try
                {
                    Append(Grid[i]);
                }
                catch { }
            }
        }