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(":", "."); } } }
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; } }
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; } } }