public void LoadData(byte[] b, HSDStruct reference) { Data = b; Reference = reference; PointerBox.SelectedItem = AllActions.Find(e => e._struct == Reference); Bitreader r = new Bitreader(Data); var sa = SubactionManager.GetSubaction((byte)r.Read(6)); comboBox1.SelectedItem = sa.Name; for (int i = 0; i < sa.Parameters.Length; i++) { var p = sa.Parameters[i]; if (p.Name.Contains("None")) { continue; } var value = r.Read(p.BitCount); if (p.IsPointer) { continue; } (panel1.Controls[sa.Parameters.Length - 1 - i].Controls[0] as SubactionValueEditor).SetValue(value); } CenterToScreen(); }
public int[] GetParameters(byte[] data) { Bitreader r = new Bitreader(data); r.Read(6); List <int> param = new List <int>(); for (int i = 0; i < Parameters.Length; i++) { var p = Parameters[i]; if (p.Name.Contains("None")) { continue; } var value = r.Read(p.BitCount); if (p.IsPointer) { continue; } param.Add(value); } return(param.ToArray()); }
public int[] GetParameters(byte[] data, int offset = 0) { Bitreader r = new Bitreader(data); r.Skip(offset * 8); r.Read(CodeSize); List <int> param = new List <int>(); for (int i = 0; i < Parameters.Length; i++) { var p = Parameters[i]; if (p.Name.Contains("None")) { continue; } var value = p.Signed ? r.ReadSigned(p.BitCount) : r.Read(p.BitCount); if (p.IsPointer) { continue; } param.Add(value); } return(param.ToArray()); }