Add merge block support to sequencer.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user