void WriteText(uint id, string text, Undo.UndoData undodata) { //無効なID if (id <= 0) { return; } //最後の改行の削除. if (text.Length < 2) { return; } string writetext = U.substr(text, 0, text.Length - 2); writetext = TextForm.ConvertFEditorToEscape(writetext); if (id < this.MaxTextCount) { TextForm.WriteText(this.TextBaseAddress , this.MaxTextCount , id , writetext , undodata); return; } if (!U.isSafetyPointer(id)) { Log.Error("不明な文字列", id.ToString(), text); return; } uint p_text_pointer = U.toOffset(id); uint text_pointer = Program.ROM.u32(p_text_pointer); if (!U.isSafetyPointer(text_pointer)) { Log.Error("ポインタではありません", id.ToString(), text); return; } uint new_textpointer = CStringForm.WriteCString(text_pointer, writetext, undodata); if (new_textpointer == U.NOT_FOUND) { return; } Program.ROM.write_p32(p_text_pointer, new_textpointer, undodata); }
private void ParamLabel_Clicked(object sender, EventArgs e) { EventScript.OneCode code; int selectID; int argindex; if (!Get_Select_ParamSrc_Object(sender, out code, out selectID, out argindex)) { return; } NumericUpDown src_object = ScriptEditSetTables[selectID].ParamSrc; EventScript.Arg arg = code.Script.Args[argindex]; uint value = EventScriptForm.GetValueOneScriptEditSetTables(ScriptEditSetTables[selectID], arg); if (arg.Type == EventScript.ArgType.POINTER_TEXT) { CStringForm f = (CStringForm)InputFormRef.JumpForm <CStringForm>(); f.Init(src_object); } else if (arg.Type == EventScript.ArgType.POINTER_PROCS) { ProcsScriptForm f = (ProcsScriptForm)InputFormRef.JumpForm <ProcsScriptForm>(U.NOT_FOUND); f.JumpTo(value); } else if (arg.Type == EventScript.ArgType.POINTER_ASM) { DisASMForm f = (DisASMForm)InputFormRef.JumpForm <DisASMForm>(U.NOT_FOUND); f.JumpTo(DisassemblerTrumb.ProgramAddrToPlain(value)); } else if (arg.Type == EventScript.ArgType.POINTER_AIUNIT) { AIUnitsForm f = (AIUnitsForm)InputFormRef.JumpFormLow <AIUnitsForm>(); f.JumpTo(value); f.ShowDialog(); U.SetActiveControl(src_object); U.ForceUpdate(src_object, f.GetBaseAddress()); } }