public Editor(EditorBase editor) { this.editor = editor; InitializeComponent(); Text = editor.ToString(); this.editor.Update += euh = new EventHandler(editor_Update); }
public Selector(EditorBase editor) { this.editor = editor; InitializeComponent(); foreach (var i in editor.GetSelector()) { listBox1.Items.Add(i); } }
public override void Load() { SortedDictionary <ushort, Item> Item = new SortedDictionary <ushort, Item>(); #if AONOKISEKI ItemQuartz[] quartz = new ItemQuartz[120]; MasterQuartz[] master = new MasterQuartz[22]; QuartzLevel[][] mqattr = new QuartzLevel[22][]; for (int i = 0; i < mqattr.Length; i++) { mqattr[i] = new QuartzLevel[5]; } #else ItemQuartz[] quartz = new ItemQuartz[200]; #endif using (var stream = ReadFile("t_quartz._dt")) { int i = 0; #if AONOKISEKI var b1 = stream.ReadByte(); var b2 = stream.ReadByte(); var length = (ushort)b2 << 8 | b1; #else var length = stream.Length; #endif while (stream.Position < length) { quartz[i++] = ReadStrcuture <ItemQuartz>(stream); } #if AONOKISEKI i = 0; while (i < master.Length) { master[i++] = ReadStrcuture <MasterQuartz>(stream); } #endif } using (var stream = ReadFile("t_item._dt")) using (var reader = new BinaryReader(stream)) { ushort header = reader.ReadUInt16(); stream.Seek(header, SeekOrigin.Begin); //Skip Index Table; ushort end = reader.ReadUInt16(); ushort pos = end; List <ushort> lp = new List <ushort>(); do { lp.Add(pos); pos = reader.ReadUInt16(); } while (stream.Position < end); //lp.Add(pos); foreach (var p in lp) { Item item = new Item { Name = "", Description = "" }; stream.Seek(p, SeekOrigin.Begin); item.Field = ReadStrcuture <ItemField>(stream); if (item.Field.ID >= 100 && item.Field.ID < 100 + quartz.Length) { item.Quartz = quartz[item.Field.ID - 100]; #if AONOKISEKI } else if (item.Field.ID >= 220 && item.Field.ID < 242) { item.Quartz = master[item.Field.ID - 220]; #endif } Item[item.Field.ID] = item; } } using (var stream = ReadFile("t_item2._dt")) using (var reader = new BinaryReader(stream)) { ushort header = reader.ReadUInt16(); stream.Seek(header, SeekOrigin.Begin); //Skip Index Table; ushort end = reader.ReadUInt16(); ushort pos = end; List <ushort> lp = new List <ushort>(); do { lp.Add(pos); pos = reader.ReadUInt16(); } while (stream.Position < end); //lp.Add(pos); foreach (var p in lp) { Item item = new Item { Name = "", Description = "" }; stream.Seek(p, SeekOrigin.Begin); item.Field = ReadStrcuture <ItemField>(stream); Item[item.Field.ID] = item; } } using (var stream = ReadFile("t_ittxt._dt")) using (var reader = new BinaryReader(stream)) { ushort header = reader.ReadUInt16(); stream.Seek(header, SeekOrigin.Begin); //Skip Index Table; ushort end = reader.ReadUInt16(); ushort pos = end; List <ushort> lp = new List <ushort>(); do { lp.Add(pos); pos = reader.ReadUInt16(); } while (stream.Position < end); //lp.Add(pos); foreach (var p in lp) { stream.Seek(p, SeekOrigin.Begin); ushort id = reader.ReadUInt16(); reader.ReadUInt16(); //skip 0s ushort p1 = reader.ReadUInt16(); ushort p2 = reader.ReadUInt16(); stream.Seek(p1, SeekOrigin.Begin); Item[id].Name = EditorBase.ReadString(stream); stream.Seek(p2, SeekOrigin.Begin); Item[id].Description = EditorBase.ReadString(stream); } } using (var stream = ReadFile("t_ittxt2._dt")) using (var reader = new BinaryReader(stream)) { ushort header = reader.ReadUInt16(); stream.Seek(header, SeekOrigin.Begin); //Skip Index Table; ushort end = reader.ReadUInt16(); ushort pos = end; List <ushort> lp = new List <ushort>(); do { lp.Add(pos); pos = reader.ReadUInt16(); } while (stream.Position < end); //lp.Add(pos); foreach (var p in lp) { stream.Seek(p, SeekOrigin.Begin); ushort id = reader.ReadUInt16(); reader.ReadUInt16(); //skip 0s ushort p1 = reader.ReadUInt16(); ushort p2 = reader.ReadUInt16(); stream.Seek(p1, SeekOrigin.Begin); Item[id].Name = EditorBase.ReadString(stream); stream.Seek(p2, SeekOrigin.Begin); Item[id].Description = EditorBase.ReadString(stream); } Item.Remove(9999); } using (var stream = ReadFile("t_mstqrt._dt")) using (var reader = new BinaryReader(stream)) { for (int i = 0; i < mqattr.Length; i++) { for (int j = 0; j < 5; j++) { mqattr[i][j] = ReadStrcuture <QuartzLevel>(stream); } Item[(ushort)(220 + i)].Levels = mqattr[i]; } List <ushort> pos = new List <ushort>(); do { pos.Add(reader.ReadUInt16()); } while (stream.Position < pos[0]); string[] desc = new string[pos.Count]; for (int i = 0; i < desc.Length; i++) { stream.Position = pos[i]; desc[i] = ReadString(stream); } Helper.GetEditorByType <MasterEffectsEditor>().Load(desc); } items = Item; }