private void RenumberToolbar(MyObjectBuilder_Toolbar toolbar, ref Dictionary<Int64, Int64> idReplacementTable)
{
if (toolbar == null)
return;
foreach (var item in toolbar.Slots)
{
var terminalGroup = item.Data as MyObjectBuilder_ToolbarItemTerminalGroup;
if (terminalGroup != null)
{
// GridEntityId does not require remapping. accoring to IL on ToolbarItemTerminalGroup.
//terminalGroup.GridEntityId = MergeId(terminalGroup.GridEntityId, ref idReplacementTable);
terminalGroup.BlockEntityId = MergeId(terminalGroup.BlockEntityId, ref idReplacementTable);
}
var terminalBlock = item.Data as MyObjectBuilder_ToolbarItemTerminalBlock;
if (terminalBlock != null)
{
terminalBlock.BlockEntityId = MergeId(terminalBlock.BlockEntityId, ref idReplacementTable);
}
}
}