void FixBattleAnimePointerOnAddressListExpandsEvent(object sender, EventArgs arg) { InputFormRef.ExpandsEventArgs eearg = (InputFormRef.ExpandsEventArgs)arg; uint addr = eearg.NewBaseAddress; int count = (int)eearg.NewDataCount; if (CLASS_LISTBOX.SelectedIndex < 0) { return; } uint cid = (uint)CLASS_LISTBOX.SelectedIndex; uint pointer; ClassForm.GetBattleAnimeAddrWhereID(cid, out pointer); if (!U.isSafetyOffset(pointer)) { return; } Undo.UndoData undodata = Program.Undo.NewUndoData(this, "FixBattleAnimeSetting"); //クラスの戦闘アニメポインタを更新する. Program.ROM.write_p32(pointer, addr, undodata); Program.Undo.Push(undodata); this.InputFormRef.ReInit(addr, (uint)count); }
private void IndependenceButton_Click(object sender, EventArgs e) { if (this.CLASS_LISTBOX.SelectedIndex < 0) { return; } uint classid = (uint)U.atoh(this.CLASS_LISTBOX.Text); uint classaddr = ClassForm.GetClassAddr(classid); string name = U.ToHexString(classid) + " " + ClassForm.GetClassNameLow(classaddr); uint pointer; uint currentP = ClassForm.GetBattleAnimeAddrWhereID(classid, 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); U.ReSelectList(this.CLASS_LISTBOX); }
//他のクラスでこのデータを参照しているか? bool UpdateIndependencePanel() { if (this.CLASS_LISTBOX.SelectedIndex < 0) { return(false); } uint classid = (uint)U.atoh(this.CLASS_LISTBOX.Text); uint currentP = ClassForm.GetBattleAnimeAddrWhereID(classid); if (!U.isSafetyOffset(currentP)) { return(false); } uint class_count = (uint)this.CLASS_LISTBOX.Items.Count; for (uint i = 0; i < class_count; i++) { if (i == classid) {//自分自身 continue; } uint p = ClassForm.GetBattleAnimeAddrWhereID(i); if (p == currentP) { return(true); } } return(false); }
private void CLASS_LISTBOX_SelectedIndexChanged(object sender, EventArgs e) { uint cid = (uint)CLASS_LISTBOX.SelectedIndex; uint addr = ClassForm.GetBattleAnimeAddrWhereID(cid); if (!U.isSafetyOffset(addr)) { this.InputFormRef.ClearSelect(true); return; } this.InputFormRef.ReInit(addr); //他のクラスでこのデータを参照しているならば、独立ボタンを出す. IndependencePanel.Visible = UpdateIndependencePanel(); }
public static string GetBattleAnimeHint(uint search_animeindex) { List <U.AddrResult> classlist = ClassForm.MakeClassList(); for (int cid = 0; cid < classlist.Count; cid++) { uint addr = ClassForm.GetBattleAnimeAddrWhereID((uint)cid); if (!U.isSafetyOffset(addr)) { continue; } for (uint i = 0; true; i += 4) { uint a = addr + i; if (!U.isSafetyOffset(a + 3)) { break; } uint item = Program.ROM.u8(a + 0); uint sp = Program.ROM.u8(a + 1); uint anime = Program.ROM.u16(a + 2); if (item == 0 && sp == 0 && anime == 0) { break; } if (anime != search_animeindex) { continue; } //発見! string name = U.skip(classlist[cid].name, " ").Trim(); return(name + " " + getSPTypeName(item, sp)); } } //ない return(""); }
//クラスのアニメを取得します。 とりあえず一番最初の奴を. public static uint GetAnimeIDByClassID(uint class_id) { uint battleanime = ClassForm.GetBattleAnimeAddrWhereID(class_id); return(GetAnimeIDByAnimeSettingPointer(battleanime)); }