diff --git a/Resources/Locale/en-US/toolshed-commands.ftl b/Resources/Locale/en-US/toolshed-commands.ftl index 1f3c5e46c..aa20a4f8b 100644 --- a/Resources/Locale/en-US/toolshed-commands.ftl +++ b/Resources/Locale/en-US/toolshed-commands.ftl @@ -161,3 +161,9 @@ command-description-EqualCommand = Performs an equality comparison, returning true if the inputs are equal. command-description-NotEqualCommand = Performs an equality comparison, returning true if the inputs are not equal. + +command-description-entitysystemupdateorder-tick = + Lists the tick update order of entity systems. + +command-description-entitysystemupdateorder-frame = + Lists the frame update order of entity systems. diff --git a/Robust.Shared/GameObjects/EntitySystemManager.cs b/Robust.Shared/GameObjects/EntitySystemManager.cs index b39d153d8..8bbfb9d08 100644 --- a/Robust.Shared/GameObjects/EntitySystemManager.cs +++ b/Robust.Shared/GameObjects/EntitySystemManager.cs @@ -393,6 +393,9 @@ namespace Robust.Shared.GameObjects return mFrameUpdate!.DeclaringType != typeof(EntitySystem); } + internal IEnumerable FrameUpdateOrder => _frameUpdateOrder.Select(c => c.GetType()); + internal IEnumerable TickUpdateOrder => _updateOrder.Select(c => c.System.GetType()); + private struct UpdateReg { [ViewVariables] public IEntitySystem System; diff --git a/Robust.Shared/GameObjects/EntitySystemUpdateOrderCommand.cs b/Robust.Shared/GameObjects/EntitySystemUpdateOrderCommand.cs new file mode 100644 index 000000000..ec75bb18a --- /dev/null +++ b/Robust.Shared/GameObjects/EntitySystemUpdateOrderCommand.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using Robust.Shared.IoC; +using Robust.Shared.Toolshed; + +namespace Robust.Shared.GameObjects; + +[ToolshedCommand] +internal sealed class EntitySystemUpdateOrderCommand : ToolshedCommand +{ + [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; + + [CommandImplementation("tick")] + public IEnumerable Tick() + { + var mgr = (EntitySystemManager)_entitySystemManager; + + return mgr.TickUpdateOrder; + } + + [CommandImplementation("frame")] + public IEnumerable Frame() + { + var mgr = (EntitySystemManager)_entitySystemManager; + + return mgr.FrameUpdateOrder; + } +}