private void saveGuids(Stream output) { for (int i = 0; i < guidsTable.Count; i++) { GuidEntry entry = guidsTable[i]; output.WriteFromBuffer(entry.guid); output.WriteInt32(entry.index); } }
private void loadGuids(Stream input) { guidsTable = new List <GuidEntry>(); input.JumpTo(guidsOffset); for (int i = 0; i < guidsCount; i++) { GuidEntry entry = new GuidEntry(); entry.guid = input.ReadToBuffer(16); entry.index = input.ReadInt32(); guidsTable.Add(entry); } }
private void listBox1_MouseDoubleClick(object sender, MouseEventArgs e) { int n = listBox1.SelectedIndex; if (n == -1) { return; } GuidEntry g = GUIDs[n]; string s = g.NameIdx + ","; foreach (byte b in g.GUID) { s += b.ToString("X2"); } string result = Microsoft.VisualBasic.Interaction.InputBox("Please enter new values", "ME3Explorer", s, 0, 0); if (result == "") { return; } string[] tmp = result.Split(','); if (tmp.Length != 2 || tmp[1].Trim().Length != 32) { return; } int i = -1; if (Int32.TryParse(tmp[0], out i) && pcc.isName(i)) { g.NameIdx = i; g.Name = pcc.getNameEntry(i); } else { return; } g.GUID = StringToByteArray(tmp[1]); if (g.GUID[0] == 0x00) { return; } GUIDs[n] = g; RefreshLists(); listBox1.SelectedIndex = n; }
public void ReadGUIDs(byte[] buff) { props = PropertyReader.getPropList(pcc, buff); int pos = props[props.Count - 1].offend; int count = BitConverter.ToInt32(buff, pos); pos += 4; GUIDs = new List<GuidEntry>(); for (int i = 0; i < count; i++) { GuidEntry g = new GuidEntry(); g.NameIdx = BitConverter.ToInt32(buff, pos); g.Name = pcc.getNameEntry(g.NameIdx); g.GUID = new byte[16]; for (int j = 0; j < 16; j++) g.GUID[j] = buff[pos + j + 8]; GUIDs.Add(g); pos += 24; } }
private void cloneToolStripMenuItem_Click(object sender, EventArgs e) { int n = listBox1.SelectedIndex; if (n == -1) { return; } GuidEntry g = GUIDs[n]; GuidEntry g2 = new GuidEntry(); g2.NameIdx = g.NameIdx; g2.Name = g.Name; g2.GUID = new byte[16]; for (int i = 0; i < 16; i++) { g2.GUID[i] = g.GUID[i]; } GUIDs.Add(g2); RefreshLists(); }
public void ReadGUIDs(byte[] buff) { props = PropertyReader.getPropList(pcc, buff); int pos = props[props.Count - 1].offend; int count = BitConverter.ToInt32(buff, pos); pos += 4; GUIDs = new List <GuidEntry>(); for (int i = 0; i < count; i++) { GuidEntry g = new GuidEntry(); g.NameIdx = BitConverter.ToInt32(buff, pos); g.Name = pcc.getNameEntry(g.NameIdx); g.GUID = new byte[16]; for (int j = 0; j < 16; j++) { g.GUID[j] = buff[pos + j + 8]; } GUIDs.Add(g); pos += 24; } }
private void cloneToolStripMenuItem_Click(object sender, EventArgs e) { int n = listBox1.SelectedIndex; if (n == -1) return; GuidEntry g = GUIDs[n]; GuidEntry g2 = new GuidEntry(); g2.NameIdx = g.NameIdx; g2.Name = g.Name; g2.GUID = new byte[16]; for (int i = 0; i < 16; i++) g2.GUID[i] = g.GUID[i]; GUIDs.Add(g2); RefreshLists(); }
private void RemoveRow(GuidEntry data) { Data.Remove(data); }