Add merge block support to sequencer.

This commit is contained in:
2025-02-21 16:52:01 -05:00
parent 2704207dc2
commit d7018f2c97
3 changed files with 67 additions and 0 deletions

View File

@ -1,4 +1,5 @@
using Sandbox.ModAPI.Ingame;
using SpaceEngineers.Game.ModAPI.Ingame;
using System;
using System.Collections.Generic;
using VRage.Game.ModAPI.Ingame.Utilities;
@ -169,6 +170,26 @@ namespace IngameScript
Ini.Get(key, "velocity").ToSingle(2f)
);
}
else if (block is IMyShipMergeBlock)
{
MergeAction action;
string config = Ini.Get(key, "action").ToString("merge").ToLower();
switch (config)
{
case "merge":
action = MergeAction.Merge;
break;
case "unmerge":
action = MergeAction.Unmerge;
break;
default:
Console.Print($"Unknown action '{config}. Defaulting to merge.");
action = MergeAction.Merge;
break;
}
return new BlockActionMerge(block as IMyShipMergeBlock, action);
}
// TODO: there are several block types added for other scripts that we should support here.
Console.Print($"Can't add unsupported block '{block.CustomName}'");
return null;