private void debugPokeValue()
{
reflexiveData rd = (reflexiveData)treeViewTagReflexives.SelectedNode.Tag;
// Idents must be poked individually with Tag Type, then Tag Name. It doesn't change if both
// are poked at once.
if (CurrentControl is Ident && CurrentControl.size == 8)
{
BR.BaseStream.Position = rd.baseOffset + CurrentControl.chunkOffset;
Byte[] bytes = BR.ReadBytes(CurrentControl.size);
HaloMap.RealTimeHalo.RTH_Imports.Poke(
(uint)(CurrentControl.offsetInMap + CurrentControl.meta.magic),
BitConverter.ToUInt32(bytes, 0),
4);
HaloMap.RealTimeHalo.RTH_Imports.Poke(
(uint)(CurrentControl.offsetInMap + CurrentControl.meta.magic + 4),
BitConverter.ToUInt32(bytes, 4),
4);
}
else
{
BR.BaseStream.Position = rd.baseOffset + CurrentControl.chunkOffset;
uint value = uint.MaxValue;
switch (CurrentControl.size)
{
case 1:
value = BR.ReadByte();
break;
case 2:
value = BitConverter.ToUInt16(BR.ReadBytes(CurrentControl.size), 0);
break;
case 4:
value = BitConverter.ToUInt32(BR.ReadBytes(CurrentControl.size), 0);
break;
default:
MessageBox.Show("Error: Cannot RTH " + CurrentControl.GetType() + " of size: " + CurrentControl.size);
return;
}
HaloMap.RealTimeHalo.RTH_Imports.Poke(
(uint)(CurrentControl.offsetInMap + CurrentControl.meta.magic),
value,
CurrentControl.size);
}
}