Skip to main content

InGameInspector.CommandRunner

A private class in Root.Township, the global namespace. Reach it through att-stubs' publicized assemblies or Harmony's AccessTools.

Debug inspector tool that runs console commands listed in DebugToolCommandRunner.txt in the mods folder, one line per command. On a client it sends the chosen command to the server to run.

Constructors​

MemberWhat it is
CommandRunner(InGameInspector inspector)Creates an InGameInspector.CommandRunner from inspector.

Fields​

3 private and internal fields
MemberWhat it is
private string[] commandsLines read from the command file.
private int currentCommandIndex of the selected command.
private bool hasCommandsWhether the file had at least one line.

Properties​

MemberWhat it is
override string Name { get; }Shown on the inspector as "Console Command Runner".
1 private and internal property
MemberWhat it is
private string Path { get; }Full path of DebugToolCommandRunner.txt inside the configured mods directory.

Methods​

MemberWhat it is
override void Disable()Does nothing for this tool.
override void Enable(Interactable pickup, Interactor interactor)Reads the command file into commands, if it exists.
override async void PressClearAsync()Runs the selected command through CommandService.Handle on the server, or sends it to the server from a client.
override void PressDown()Selects the previous command, wrapping round.
override void PressUp()Selects the next command, wrapping round.
override void ReceiveAngle(float angle)Does nothing for this tool.
override void ReceiveInput(PlayerInput controller)Does nothing for this tool.
override async void Serialize(Stream stream)Writes the selected command into the sync message. When the server reads one, it runs it through CommandService.Handle.
override void Update()Shows the selected command, or says none are available.