private void addToolStripMenuItem_Click(object sender, EventArgs e) { msgData[] expand = new msgData[file.data.Length + 1]; Array.Copy(file.data, expand, file.data.Length); string nameid = file.data[file.data.Length - 1].NameID; int endid = int.Parse(nameid.Substring(nameid.Length - 3, 3)); expand[expand.Length - 1].ID = file.data.Length; expand[expand.Length - 1].Lines = new string[] {"New Entry" }; expand[expand.Length - 1].NameID = nameid.Substring(0, nameid.Length - 3) + (endid + 1).ToString("000"); file.data = expand; slctBox.Items.Clear(); for (int i = 0; i < file.data.Length; i++) slctBox.Items.Add(file.data[i].ID.ToString() + "-" + file.data[i].NameID); }
private void removeToolStripMenuItem_Click(object sender, EventArgs e) { msgData[] reduce = new msgData[file.data.Length - 1]; Array.Copy(file.data, reduce, file.data.Length - 1); file.data = reduce; }
private void nameToolStripMenuItem_Click(object sender, EventArgs e) { //add msg name if (NamesLoaded) { msgData[] Expand = new msgData[Names.data.Length + 1]; Array.Copy(Names.data, Expand, Names.data.Length); Expand[Expand.Length - 1].NameID = "talisman_" + Names.data.Length.ToString("000"); Expand[Expand.Length - 1].ID = Names.data.Length; Expand[Expand.Length - 1].Lines = new string[] { "New Name Entry" }; Names.data = Expand; DialogResult msgbox = MessageBox.Show("Do you want to set current Z-soul to use this Name", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (msgbox == DialogResult.Yes) txtNameID.Text = Names.data[Names.data.Length - 1].ID.ToString(); } }
private void nameToolStripMenuItem1_Click(object sender, EventArgs e) { //add msg desc if (DescsLoaded) { msgData[] Expand = new msgData[Descs.data.Length + 1]; Array.Copy(Descs.data, Expand, Descs.data.Length); Expand[Expand.Length - 1].NameID = "talisman_eff_" + Descs.data.Length.ToString("000"); Expand[Expand.Length - 1].ID = Descs.data.Length; Expand[Expand.Length - 1].Lines = new string[] { "New Description Entry" }; Descs.data = Expand; DialogResult msgbox = MessageBox.Show("Do you want to set current Z-soul to use this Description", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (msgbox == DialogResult.Yes) txtDescID.Text = Descs.data[Descs.data.Length - 1].ID.ToString(); } }
private void descriptionToolStripMenuItem_Click(object sender, EventArgs e) { //remove msg name if (Items.Length > 211 && NamesLoaded) { msgData[] reduce = new msgData[Names.data.Length - 1]; Array.Copy(Names.data, reduce, Names.data.Length - 1); Names.data = reduce; } }
private void descriptionToolStripMenuItem1_Click(object sender, EventArgs e) { //remove msg desc if (Items.Length > 211 && DescsLoaded) { msgData[] reduce = new msgData[Descs.data.Length - 1]; Array.Copy(Descs.data, reduce, Descs.data.Length - 1); Descs.data = reduce; } }
private void addToolStripMenuItem_Click(object sender, EventArgs e) { //add/import Z -soul //load zss file OpenFileDialog browseFile = new OpenFileDialog(); browseFile.Filter = "Z Soul Share File (*.zss)|*.zss"; browseFile.Title = "Select the Z-Soul you want to use as a template for the new Z-soul"; if (browseFile.ShowDialog() == DialogResult.Cancel) return; byte[] zssfile = File.ReadAllBytes(browseFile.FileName); int nameCount = BitConverter.ToInt32(zssfile, 4); int DescCount = BitConverter.ToInt32(zssfile, 8); //expand the item array idbItem[] Expand = new idbItem[Items.Length + 1]; Array.Copy(Items, Expand, Items.Length); Expand[Expand.Length - 1].Data = new byte[640]; Items = Expand; short ID = BitConverter.ToInt16(Items[Items.Length - 2].Data, 0); ID++; Array.Copy(BitConverter.GetBytes(ID),Items[Items.Length - 1].Data,2); //apply Zss data to added z-soul Array.Copy(zssfile, 12 + (nameCount * 2) + (DescCount * 2), Items[Items.Length - 1].Data, 2, 638); //expand Names msg byte[] pass; if (NamesLoaded) { msgData[] Expand2 = new msgData[Names.data.Length + 1]; Array.Copy(Names.data, Expand2, Names.data.Length); Expand2[Expand2.Length - 1].NameID = "talisman_" + Names.data.Length.ToString("000"); Expand2[Expand2.Length - 1].ID = Names.data.Length; if (nameCount > 0) { pass = new byte[nameCount * 2]; Array.Copy(zssfile, 12, pass, 0, nameCount * 2); Expand2[Expand2.Length - 1].Lines = new string[] { BytetoString(pass) }; } else Expand2[Expand2.Length - 1].Lines = new string[] { "New Name Entry" }; Array.Copy(BitConverter.GetBytes((short)Expand2[Expand2.Length - 1].ID), 0, Items[Items.Length - 1].Data, 4, 2); Names.data = Expand2; Items[Items.Length - 1].msgIndexName = FindmsgIndex(ref Names, Names.data[Names.data.Length - 1].ID); } //expand description msg if (DescsLoaded) { msgData[] Expand3 = new msgData[Descs.data.Length + 1]; Array.Copy(Descs.data, Expand3, Descs.data.Length); Expand3[Expand3.Length - 1].NameID = "talisman_eff_" + Descs.data.Length.ToString("000"); Expand3[Expand3.Length - 1].ID = Descs.data.Length; if (DescCount > 0) { pass = new byte[DescCount * 2]; Array.Copy(zssfile, 12 + (nameCount * 2), pass, 0, DescCount * 2); Expand3[Expand3.Length - 1].Lines = new string[] { BytetoString(pass) }; } else Expand3[Expand3.Length - 1].Lines = new string[] { "New Description Entry" }; Array.Copy(BitConverter.GetBytes((short)Expand3[Expand3.Length - 1].ID), 0, Items[Items.Length - 1].Data, 6, 2); Descs.data = Expand3; Items[Items.Length - 1].msgIndexDesc = FindmsgIndex(ref Descs, Descs.data[Descs.data.Length - 1].ID); } //loadzss(browseFile.FileName, Items.Length - 1); //itemList.SelectedIndex = itemList.Items.Count - 1; itemList.Items.Clear(); for (int i = 0; i < Items.Length; i++) { if (NamesLoaded) itemList.Items.Add(BitConverter.ToInt16(Items[i].Data, 0).ToString() + " / " + String.Format("{0:X}", BitConverter.ToInt16(Items[i].Data, 0)) + "-" + Names.data[Items[i].msgIndexName].Lines[0]); else itemList.Items.Add(BitConverter.ToInt16(Items[i].Data, 0).ToString() + " / " + String.Format("{0:X}", BitConverter.ToInt16(Items[i].Data, 0))); } }