void ClearData(ListBoxEx listbox) { uint destAddr = InputFormRef.SelectToAddr(listbox); if (destAddr == U.NOT_FOUND) { return; } DialogResult dr = R.ShowYesNo("このユニットを消去して、データの終端にしてもよろしいですか?"); if (dr != System.Windows.Forms.DialogResult.Yes) { return; } uint blockSize = Program.ROM.RomInfo.eventunit_data_size; Undo.UndoData undodata = Program.Undo.NewUndoData(this); Program.ROM.write_fill(destAddr, blockSize, 0, undodata); Program.Undo.Push(undodata); //再描画と再選択. //listbox.Invalidate(); U.ReSelectList(listbox); InputFormRef.ShowWriteNotifyAnimation(this, destAddr); }
public static void UpdateRelatedLine(ListBoxEx addressList, List <EventScript.OneCode> eventAsm) { addressList.ClearAllSetRelatedLine(); int index = addressList.SelectedIndex; if (index < 0) { return; } if (index >= eventAsm.Count) { return; } EventScript.OneCode current = eventAsm[index]; uint needLabelID = GetScriptSomeLabel(current); if (needLabelID == U.NOT_FOUND) { return; } for (int i = 0; i < eventAsm.Count; i++) { if (i == index) {//自分自身を調べても意味がない continue; } EventScript.OneCode code = eventAsm[i]; uint labelID = GetScriptSomeLabel(code); if (labelID == needLabelID) { addressList.SetRelatedLine(i); } } }