Пример #1
0
        public Give(Mod game, Rectangle rect)
            : base(rect, "Give")
        {
            Game = game;

            // Add controls to the tab page
            onclick = new XG_ButtonLabelBool(new Rectangle(10, -10, 100, 60), "on Click", null, true);
            Children.Add(onclick);
            onPlayer = new XG_Button(new Rectangle(10, 50, 60, 20), "on Player", this.Onplayer_Clicked );
            Children.Add(onPlayer);

            string text = "Stack";
            STACK = new XG_PlusMinus(new Rectangle(10, 70, 100, 60), text, this.Cuantity_Clicked,1f,true,true,1f,250f,1f,"F1",true);
            Children.Add(STACK);

            Tree = new XGTree(new Rectangle(110, 0, 300, 115), TreeItemClicked);
            Children.Add(Tree);

            XGTreeItem Tools = new XGTreeItem(Mod.ItemD.Tools.Cathegory, Main.inventoryBackTexture);
            Tree.Items.Add(Tools);
            for (int i = 0; i < Mod.ItemD.Tools.Sections.Length; i++) // add sections
            {
                XGTreeItem Tools_Sections = new XGTreeItem(Mod.ItemD.Tools.Sections[i], Main.inventoryBackTexture);
                Tools.Items.Add(Tools_Sections);
                for (int n = 0; n < Mod.ItemD.Tools.SectionNpcItems[i].Length; n++) // add section items
                {
                    Item item = new Item();
                    item.SetDefaults(Mod.ItemD.Tools.SectionNpcItems[i][n]);
                    XGTreeItem Tools_Section_items = new XGTreeItem(Mod.ItemD.Tools.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                    Tools_Sections.Items.Add(Tools_Section_items);

                }
            }

            XGTreeItem Weapons = new XGTreeItem(Mod.ItemD.Weapons.Cathegory, Main.inventoryBackTexture);
            Tree.Items.Add(Weapons);
            for (int i = 0; i < Mod.ItemD.Weapons.Sections.Length; i++) // add sections
            {
                XGTreeItem Weapons_Sections = new XGTreeItem(Mod.ItemD.Weapons.Sections[i], Main.inventoryBackTexture);
                Weapons.Items.Add(Weapons_Sections);
                for (int n = 0; n < Mod.ItemD.Weapons.SectionNpcItems[i].Length; n++) // add section items
                {

                    Item item = new Item();
                    item.SetDefaults(Mod.ItemD.Weapons.SectionNpcItems[i][n]);
                    XGTreeItem Weapons_Section_items = new XGTreeItem(Mod.ItemD.Weapons.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                    Weapons_Sections.Items.Add(Weapons_Section_items);

              }
            }

            XGTreeItem Furniture = new XGTreeItem(Mod.ItemD.Furniture.Cathegory, Main.inventoryBackTexture);
            Tree.Items.Add(Furniture);
            for (int i = 0; i < Mod.ItemD.Furniture.Sections.Length; i++) // add sections
            {
                XGTreeItem Furniture_Sections = new XGTreeItem(Mod.ItemD.Furniture.Sections[i], Main.inventoryBackTexture);
                Furniture.Items.Add(Furniture_Sections);
                for (int n = 0; n < Mod.ItemD.Furniture.SectionNpcItems[i].Length; n++) // add section items
                {
                    Item item = new Item();
                    item.SetDefaults(Mod.ItemD.Furniture.SectionNpcItems[i][n]);
                    XGTreeItem Furniture_Section_items = new XGTreeItem(Mod.ItemD.Furniture.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                    Furniture_Sections.Items.Add(Furniture_Section_items);

                }
            }

            XGTreeItem Miscellaneous = new XGTreeItem(Mod.ItemD.Miscellaneous.Cathegory, Main.inventoryBackTexture);
            Tree.Items.Add(Miscellaneous);
            for (int i = 0; i < Mod.ItemD.Miscellaneous.Sections.Length; i++) // add sections
            {
                XGTreeItem Miscellaneous_Sections = new XGTreeItem(Mod.ItemD.Miscellaneous.Sections[i], Main.inventoryBackTexture);
                Miscellaneous.Items.Add(Miscellaneous_Sections);
                for (int n = 0; n < Mod.ItemD.Miscellaneous.SectionNpcItems[i].Length; n++) // add section items
                {

                    Item item = new Item();
                    item.SetDefaults(Mod.ItemD.Miscellaneous.SectionNpcItems[i][n]);
                    XGTreeItem Miscellaneous_Section_items = new XGTreeItem(Mod.ItemD.Miscellaneous.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                    Miscellaneous_Sections.Items.Add(Miscellaneous_Section_items);

                       }
            }

            XGTreeItem Accessories = new XGTreeItem(Mod.ItemD.Accessories.Cathegory, Main.inventoryBackTexture);
            Tree.Items.Add(Accessories);
            for (int i = 0; i < Mod.ItemD.Accessories.Sections.Length; i++) // add sections
            {

                XGTreeItem Accessories_Sections = new XGTreeItem(Mod.ItemD.Accessories.Sections[i], Main.inventoryBackTexture);
                Accessories.Items.Add(Accessories_Sections);
                for (int n = 0; n < Mod.ItemD.Accessories.SectionNpcItems[i].Length; n++) // add section items
                {

                    Item item = new Item();
                    item.SetDefaults(Mod.ItemD.Accessories.SectionNpcItems[i][n]);
                    XGTreeItem Accessories_Section_items = new XGTreeItem(Mod.ItemD.Accessories.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                    Accessories_Sections.Items.Add(Accessories_Section_items);

             }
            }

            XGTreeItem Blocks = new XGTreeItem(Mod.ItemD.Blocks.Cathegory, Main.inventoryBackTexture);
            Tree.Items.Add(Blocks);
            for (int i = 0; i < Mod.ItemD.Blocks.Sections.Length; i++) // add sections
            {
                XGTreeItem Blocks_Sections = new XGTreeItem(Mod.ItemD.Blocks.Sections[i], Main.inventoryBackTexture);
                Blocks.Items.Add(Blocks_Sections);
                for (int n = 0; n < Mod.ItemD.Blocks.SectionNpcItems[i].Length; n++) // add section items
                {

                    Item item = new Item();
                    item.SetDefaults(Mod.ItemD.Blocks.SectionNpcItems[i][n]);
                    XGTreeItem Blocks_Section_items = new XGTreeItem(Mod.ItemD.Blocks.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                    Blocks_Sections.Items.Add(Blocks_Section_items);

                }
            }

            XGTreeItem Potions = new XGTreeItem(Mod.ItemD.Potions.Cathegory, Main.inventoryBackTexture);
            Tree.Items.Add(Potions);
            for (int i = 0; i < Mod.ItemD.Potions.Sections.Length; i++) // add sections
            {
                XGTreeItem Potions_Sections = new XGTreeItem(Mod.ItemD.Potions.Sections[i], Main.inventoryBackTexture);
                Potions.Items.Add(Potions_Sections);
                for (int n = 0; n < Mod.ItemD.Potions.SectionNpcItems[i].Length; n++) // add section items
                {
                    Item item = new Item();
                    item.SetDefaults(Mod.ItemD.Potions.SectionNpcItems[i][n]);
                    XGTreeItem Potions_Section_items = new XGTreeItem(Mod.ItemD.Potions.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                    Potions_Sections.Items.Add(Potions_Section_items);

                    }
            }

            XGTreeItem Defenseitems = new XGTreeItem(Mod.ItemD.Defenseitems.Cathegory, Main.inventoryBackTexture);
            Tree.Items.Add(Defenseitems);
            for (int i = 0; i < Mod.ItemD.Defenseitems.Sections.Length; i++) // add sections
            {
                if (Mod.ItemD.Defenseitems.Sections[i] != "Armor Sets")
                {
                    XGTreeItem Defenseitems_Sections = new XGTreeItem(Mod.ItemD.Defenseitems.Sections[i], Main.inventoryBackTexture);
                    Defenseitems.Items.Add(Defenseitems_Sections);
                    for (int n = 0; n < Mod.ItemD.Defenseitems.SectionNpcItems[i].Length; n++) // add section items
                    {
                        Item item = new Item();
                        item.SetDefaults(Mod.ItemD.Defenseitems.SectionNpcItems[i][n]);
                        XGTreeItem Defenseitems_Section_items = new XGTreeItem(Mod.ItemD.Defenseitems.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                        Defenseitems_Sections.Items.Add(Defenseitems_Section_items);

                    }

                }
                else
                {

                    XGTreeItem ArmorSets = new XGTreeItem(Mod.ItemD.ArmorSets.Cathegory, Main.inventoryBackTexture);
                    Defenseitems.Items.Add(ArmorSets);
                    for (int t = 0; t < Mod.ItemD.ArmorSets.Sections.Length; t++) // add sections
                    {
                        XGTreeItem ArmorSets_Sections = new XGTreeItem(Mod.ItemD.ArmorSets.Sections[t], Main.inventoryBackTexture);
                        ArmorSets.Items.Add(ArmorSets_Sections);
                        for (int n = 0; n < Mod.ItemD.ArmorSets.SectionNpcItems[t].Length; n++) // add section items
                        {

                            Item item = new Item();
                            item.SetDefaults(Mod.ItemD.ArmorSets.SectionNpcItems[t][n]);
                            XGTreeItem ArmorSets_Section_items = new XGTreeItem(Mod.ItemD.ArmorSets.SectionNpcItems[t][n], Main.itemTexture[item.type]);
                            ArmorSets_Sections.Items.Add(ArmorSets_Section_items);

                       }
                    }
                }
            }

            XGTreeItem VanityItems = new XGTreeItem(Mod.ItemD.VanityItems.Cathegory, Main.inventoryBackTexture);
            Tree.Items.Add(VanityItems);
            for (int i = 0; i < Mod.ItemD.VanityItems.Sections.Length; i++) // add sections
            {
                if (Mod.ItemD.VanityItems.Sections[i] != "Vanity Sets")
                {
                    XGTreeItem VanityItems_Sections = new XGTreeItem(Mod.ItemD.VanityItems.Sections[i], Main.inventoryBackTexture);
                    VanityItems.Items.Add(VanityItems_Sections);
                    for (int n = 0; n < Mod.ItemD.VanityItems.SectionNpcItems[i].Length; n++) // add section items
                    {

                        Item item = new Item();
                        item.SetDefaults(Mod.ItemD.VanityItems.SectionNpcItems[i][n]);
                        XGTreeItem VanityItems_Section_items = new XGTreeItem(Mod.ItemD.VanityItems.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                        VanityItems_Sections.Items.Add(VanityItems_Section_items);

             }

                }
                else
                {

                    XGTreeItem VanitySets = new XGTreeItem(Mod.ItemD.VanitySets.Cathegory, Main.inventoryBackTexture);
                    VanityItems.Items.Add(VanitySets);
                    for (int t = 0; t < Mod.ItemD.VanitySets.Sections.Length; t++) // add sections
                    {
                        XGTreeItem VanitySets_Sections = new XGTreeItem(Mod.ItemD.VanitySets.Sections[t], Main.inventoryBackTexture);
                        VanitySets.Items.Add(VanitySets_Sections);
                        for (int n = 0; n < Mod.ItemD.VanitySets.SectionNpcItems[t].Length; n++) // add section items
                        {

                            Item item = new Item();
                            item.SetDefaults(Mod.ItemD.VanitySets.SectionNpcItems[t][n]);
                            XGTreeItem VanitySets_Section_items = new XGTreeItem(Mod.ItemD.VanitySets.SectionNpcItems[t][n], Main.itemTexture[item.type]);
                            VanitySets_Sections.Items.Add(VanitySets_Section_items);

                        }
                    }
                }
            }

            XGTreeItem All = new XGTreeItem("All", Main.inventoryBackTexture);
            Tree.Items.Add(All);
            for (int i = 0; i < Main.itemName.Length; i++) // add sections
            {

                    Item item = new Item();
                    item.SetDefaults(Main.itemName[i]);
                    XGTreeItem All_items = new XGTreeItem(item.name, Main.itemTexture[item.type]);
                    All.Items.Add(All_items);

            }

            //Tree.ExpandAll();
        }
Пример #2
0
        public WallSel(Mod game, Rectangle rect)
            : base(rect, "Wall Selection")
        {
            Game = game;

            WallTree = new XGTree(new Rectangle(10, 5, 230, 135), TreeItemClicked);
            Children.Add(WallTree);
            for (int i = 0; i < Mod.ItemD.Blocks.Sections.Length; i++) // add sections
            {
                if (Mod.ItemD.Blocks.Sections[i] == "Walls")
                {
                    XGTreeItem Walls_Sections = new XGTreeItem(Mod.ItemD.Blocks.Sections[i], Main.inventoryBackTexture);
                    WallTree.Items.Add(Walls_Sections);
                    for (int n = 0; n < Mod.ItemD.Blocks.SectionNpcItems[i].Length; n++) // add section items
                    {
                        Item item = new Item();
                        item.SetDefaults(Mod.ItemD.Blocks.SectionNpcItems[i][n]);
                        XGTreeItem Walls_Section_items = new XGTreeItem(Mod.ItemD.Blocks.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                        Walls_Sections.Items.Add(Walls_Section_items);
                    }
                }
            }
        }
Пример #3
0
        public TileSel(Mod game, Rectangle rect)
            : base(rect, "Tile Selection")
        {
            Game = game;

            TileTree = new XGTree(new Rectangle(10, 5, 230, 135), TreeItemClicked);
            Children.Add(TileTree);

            XGTreeItem Furniture = new XGTreeItem(Mod.ItemD.Furniture.Cathegory, Main.inventoryBackTexture);
            TileTree.Items.Add(Furniture);
            for (int i = 0; i < Mod.ItemD.Furniture.Sections.Length; i++) // add sections
            {
                XGTreeItem Furniture_Sections = new XGTreeItem(Mod.ItemD.Furniture.Sections[i], Main.inventoryBackTexture);
                Furniture.Items.Add(Furniture_Sections);
                for (int n = 0; n < Mod.ItemD.Furniture.SectionNpcItems[i].Length; n++) // add section items
                {

                    Item item = new Item();
                    item.SetDefaults(Mod.ItemD.Furniture.SectionNpcItems[i][n]);
                    XGTreeItem Furniture_Section_items = new XGTreeItem(Mod.ItemD.Furniture.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                    Furniture_Sections.Items.Add(Furniture_Section_items);

                }
            }

            XGTreeItem Blocks = new XGTreeItem("Blocks", Main.inventoryBackTexture);
            TileTree.Items.Add(Blocks);
            for (int i = 0; i < Mod.ItemD.Blocks.Sections.Length; i++) // add sections
            {

                if (Mod.ItemD.Blocks.Sections[i] != "Walls")
                {
                    XGTreeItem Blocks_Sections = new XGTreeItem(Mod.ItemD.Blocks.Sections[i], Main.inventoryBackTexture);
                    Blocks.Items.Add(Blocks_Sections);

                    for (int n = 0; n < Mod.ItemD.Blocks.SectionNpcItems[i].Length; n++) // add section items
                    {

                        Item item = new Item();
                        item.SetDefaults(Mod.ItemD.Blocks.SectionNpcItems[i][n]);
                        if (item.createTile >= 0)
                        {

                            XGTreeItem Blocks_Section_items = new XGTreeItem(Mod.ItemD.Blocks.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                            Blocks_Sections.Items.Add(Blocks_Section_items);

                        }
                    }
                }
            }

            XGTreeItem Miscellaneous = new XGTreeItem(Mod.ItemD.Miscellaneous.Cathegory, Main.inventoryBackTexture);
            TileTree.Items.Add(Miscellaneous);
            for (int i = 0; i < Mod.ItemD.Miscellaneous.Sections.Length; i++) // add sections
            {
                XGTreeItem Miscellaneous_Sections = new XGTreeItem(Mod.ItemD.Miscellaneous.Sections[i], Main.inventoryBackTexture);
                Miscellaneous.Items.Add(Miscellaneous_Sections);
                for (int n = 0; n < Mod.ItemD.Miscellaneous.SectionNpcItems[i].Length; n++) // add section items
                {
                    Item item = new Item();
                    item.SetDefaults(Mod.ItemD.Miscellaneous.SectionNpcItems[i][n]);

                    if (item.createTile >= 0)
                    {

                        XGTreeItem Miscellaneous_Section_items = new XGTreeItem(Mod.ItemD.Miscellaneous.SectionNpcItems[i][n], Main.itemTexture[item.type]);
                        Miscellaneous_Sections.Items.Add(Miscellaneous_Section_items);
                    }
                }
            }
        }
Пример #4
0
        public Npcs(Mod game, Rectangle rect)
            : base(rect, "Npcs")
        {
            Game = game;

            // Add controls to the tab page

            Rectangle pageRect = this.Rectangle; // tab pages are the size of the tab control
            pageRect.X = pageRect.Y = 0;
            pageRect.Height = 148;
            pageRect.Width = (pageRect.Width / 2) - 1;
            XGTabControl tab = new XGTabControl(pageRect);
            Children.Add(tab); // add the tab control to our child control list

            onclick = new Npconclick(game, pageRect);
            tab.Children.Add(onclick);

            spawn = new Npcspawn(game, pageRect);
            tab.Children.Add(spawn);

            Tree = new XGTree(new Rectangle(210, 5, 205, 135), TreeItemClicked);
            Children.Add(Tree);

            XGTreeItem MobsFamilies = new XGTreeItem(Mod.NpcD.MobsFamilies.Cathegory, Main.inventoryBackTexture);
            Tree.Items.Add(MobsFamilies);
            for (int i = 0; i < Mod.NpcD.MobsFamilies.Sections.Length; i++) // add sections
            {
                XGTreeItem MobsFamilies_Sections = new XGTreeItem(Mod.NpcD.MobsFamilies.Sections[i], Main.inventoryBackTexture);
                MobsFamilies.Items.Add(MobsFamilies_Sections);
                for (int n = 0; n < Mod.NpcD.MobsFamilies.SectionNpcItems[i].Length; n++) // add section items
                {
                    NPC npc = new NPC();
                    npc.SetDefaults(Mod.NpcD.MobsFamilies.SectionNpcItems[i][n]);
                    XGTreeItem MobsFamilies_Section_items = new XGTreeItem(Mod.NpcD.MobsFamilies.SectionNpcItems[i][n], Main.npcTexture[npc.type]);
                    MobsFamilies_Sections.Items.Add(MobsFamilies_Section_items);
                }
            }

            XGTreeItem AtoZ = new XGTreeItem(Mod.NpcD.AtoZ.Cathegory, Main.inventoryBackTexture);
            Tree.Items.Add(AtoZ);
            for (int i = 0; i < Mod.NpcD.AtoZ.Sections.Length; i++) // add sections
            {
                XGTreeItem AtoZ_Sections = new XGTreeItem(Mod.NpcD.AtoZ.Sections[i], Main.inventoryBackTexture);
                AtoZ.Items.Add(AtoZ_Sections);
                for (int n = 0; n < Mod.NpcD.AtoZ.SectionNpcItems[i].Length; n++) // add section items
                {
                    NPC npc = new NPC();
                    npc.SetDefaults(Mod.NpcD.AtoZ.SectionNpcItems[i][n]);
                    XGTreeItem MobsFamilies_Section_items = new XGTreeItem(Mod.NpcD.AtoZ.SectionNpcItems[i][n], Main.npcTexture[npc.type]);
                    AtoZ_Sections.Items.Add(MobsFamilies_Section_items);
                }
            }

            XGTreeItem ALL = new XGTreeItem("ALL", Main.inventoryBackTexture);
            Tree.Items.Add(ALL);
            for (int i = 0; i <Main.npcName.Length; i++) // add sections
            {

                    NPC npc = new NPC();
                    npc.SetDefaults(Main.npcName[i]);
                    XGTreeItem alll = new XGTreeItem(npc.name, Main.npcTexture[npc.type]);
                    ALL.Items.Add(alll);

            }

            //Tree.ExpandAll();
        }
Пример #5
0
        public Item_PP(Mod game, Rectangle rect)
            : base(rect, "P.P.")
        {
            Game = game;
            Children.Add(new XG_Label(new Rectangle(10, 0, 200, 20), "projectile properties"));

            // string text = "";
            //text = "Shoot";
            //Shoot = new XG_PlusMinus(new Rectangle(10, 10, 100, 60), text, this.Shoot_Clicked);
            //Children.Add(Shoot);

            Tree = new XGTree(new Rectangle(250, 0, 170, 115), TreeItemClicked);
            Children.Add(Tree);

            XGTreeItem Shoot = new XGTreeItem("Shoot", Main.inventoryBackTexture);
            Tree.Items.Add(Shoot);
            for (int n = 0; n < Main.maxProjectileTypes; n++) // add section items
            {
                if (n != 0)
                {
                    Projectile projectile = new Projectile();
                    projectile.SetDefaults(n);
                    XGTreeItem Shoot_Section_items = new XGTreeItem(projectile.name, Main.projectileTexture[projectile.type]);
                    Tree.Items.Add(Shoot_Section_items);
                }
            }

            string text = "";
            text = "ammo";
            ammo = new XG_PlusMinus(new Rectangle(10, 60, 100, 60), text, this.ammo_Clicked, 1f, false, false, 0, 50, 0, "F0");
            Children.Add(ammo);

            text = "useammo";
            useAmmo = new XG_PlusMinus(new Rectangle(10, 10, 100, 60), text, this.useAmmo_Clicked, 1f, false, false, 0, 50, 0, "F0");
            Children.Add(useAmmo);

            text = "shootspeed";
            shootSpeed = new XG_PlusMinus(new Rectangle(100, 60, 100, 60), text, this.shootSpeed_Clicked, 0.1f, true, false, 0, 100f, 0, "F1");
            Children.Add(shootSpeed);

            text = "knockBack";
            knockBack = new XG_PlusMinus(new Rectangle(100, 10, 100, 60), text, this.knockBack_Clicked, 1f, false, false, 0, 500, 0, "F0");
            Children.Add(knockBack);

            text = "channel";
            channel = new XG_ButtonLabelBool(new Rectangle(200, 10, 100, 60), text, this.channel_Clicked);
            Children.Add(channel);
        }
Пример #6
0
        public Buffsel(Mod game, Rectangle rect)
            : base(rect, "Buffs")
        {
            Game = game;

            string text = "";
            text = "minutes";
            inmiliseconds = new XG_PlusMinus(new Rectangle(10, 10, 100, 60), text, this.Time_Clicked, 1f, true, true, 0, 1000);
            Children.Add(inmiliseconds);

            bufftree = new XGTree(new Rectangle(100, 10, 300, 90), TreeItemClicked);
            Children.Add(bufftree);

            for (int i = 0; i < Main.buffName.Length; i++) // add sections
            {

                if (Main.buffName[i] != null)
                {
                    bufftree.Items.Add(new XGTreeItem(@Main.buffName[i], Main.buffTexture[i]));
                }

            }
        }