Пример #1
0
        public static void Modify(object sender, EventArgs e)
        {
            Control      this_obj    = sender as Control;
            SoundPlayer  soundPlayer = new SoundPlayer(Application.StartupPath + "\\MainFormClickSounds\\button_click.wav");
            TreeView     Root        = Cbhk_form.register;
            Item_spawner Is          = new Item_spawner(null, soundPlayer, true);

            if (Is.ShowDialog() == DialogResult.OK)
            {
                NBT      = Is.ItemNBTs[0];
                ItemType = Is.ItemIds[0];
                if (NBT.Trim() != "")
                {
                    this_obj.Tag = NBT;
                }
                else
                {
                    this_obj.Tag = null;
                }
                if (ItemType.Trim() != "")
                {
                    this_obj.Name = ItemType.Replace(":", ".");
                }
            }
        }
Пример #2
0
        private void SetItemNBT(object sender, EventArgs e)
        {
            if (click != null)
            {
                click.Play();
            }
            Button       this_obj     = sender as Button;
            Item_spawner item_Spawner = new Item_spawner(null, click, true);

            if (item_Spawner.ShowDialog() == DialogResult.OK && item_Spawner.ItemNBTs[0].Trim() != "")
            {
                this_obj.Tag = item_Spawner.ItemNBTs[0];
            }
            else
            {
                this_obj.Tag = null;
            }
        }
Пример #3
0
        private void LoadItem(object sender, EventArgs e)
        {
            Button this_obj = sender as Button;

            if (this_obj.Tag == null)
            {
                Item_spawner itemspawner = new Item_spawner(null, soundPlayer, true);
                if (itemspawner.ShowDialog() == DialogResult.OK)
                {
                    this_obj.Name = itemspawner.ItemIds[0];
                    this_obj.Tag  = itemspawner.ItemNBTs[0];
                }
            }
            else
            {
                EntityNBTForm entityNBTForm = new EntityNBTForm(this_obj.Tag.ToString());
                if (entityNBTForm.ShowDialog() == DialogResult.OK)
                {
                    this_obj.Tag = entityNBTForm.nbt_result;
                }
            }
        }
Пример #4
0
        //物品生成器
        public void ItemSpawner(Form obj, SoundPlayer click_sound)
        {
            Item_spawner itemspawner = new Item_spawner(obj, click_sound);

            itemspawner.Show();
        }