private void IndependenceButton_Click(object sender, EventArgs e) { if (this.ItemListBox.SelectedIndex < 0) { return; } uint itemid = (uint)U.atoh(this.ItemListBox.Text); uint itemaddr = ItemForm.GetItemAddr(itemid); string name = U.ToHexString(itemid) + " " + ClassForm.GetClassNameLow(itemaddr); uint pointer; uint currentP = ItemForm.GetEFFECTIVENESSPointerWhereID(itemid, out pointer); if (!U.isSafetyOffset(currentP)) { return; } Undo.UndoData undodata = Program.Undo.NewUndoData(this, this.Name + " Independence"); uint dataSize = (InputFormRef.DataCount + 1) * InputFormRef.BlockSize; PatchUtil.WriteIndependence(currentP, dataSize, pointer, name, undodata); Program.Undo.Push(undodata); InputFormRef.ShowWriteNotifyAnimation(this, currentP); ReselectItem(itemid); }