2021-06-09 22:19:39 +02:00
|
|
|
using Content.Client.AI;
|
2020-06-18 22:52:44 +10:00
|
|
|
using JetBrains.Annotations;
|
2021-02-01 16:49:43 -08:00
|
|
|
using Robust.Shared.Console;
|
2021-02-11 01:13:03 -08:00
|
|
|
using Robust.Shared.GameObjects;
|
2020-06-18 22:52:44 +10:00
|
|
|
|
|
|
|
|
namespace Content.Client.Commands
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This is used to handle the tooltips above AI mobs
|
|
|
|
|
/// </summary>
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
|
internal sealed class DebugAiCommand : IConsoleCommand
|
|
|
|
|
{
|
|
|
|
|
// ReSharper disable once StringLiteralTypo
|
|
|
|
|
public string Command => "debugai";
|
|
|
|
|
public string Description => "Handles all tooltip debugging above AI mobs";
|
|
|
|
|
public string Help => "debugai [hide/paths/thonk]";
|
|
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
2020-06-18 22:52:44 +10:00
|
|
|
{
|
|
|
|
|
#if DEBUG
|
|
|
|
|
if (args.Length < 1)
|
|
|
|
|
{
|
2021-02-01 16:49:43 -08:00
|
|
|
shell.RemoteExecuteCommand(argStr);
|
|
|
|
|
return;
|
2020-06-18 22:52:44 +10:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var anyAction = false;
|
|
|
|
|
var debugSystem = EntitySystem.Get<ClientAiDebugSystem>();
|
|
|
|
|
|
|
|
|
|
foreach (var arg in args)
|
|
|
|
|
{
|
|
|
|
|
switch (arg)
|
|
|
|
|
{
|
|
|
|
|
case "hide":
|
|
|
|
|
debugSystem.Disable();
|
|
|
|
|
anyAction = true;
|
|
|
|
|
break;
|
|
|
|
|
// This will show the pathfinding numbers above the mob's head
|
|
|
|
|
case "paths":
|
|
|
|
|
debugSystem.ToggleTooltip(AiDebugMode.Paths);
|
|
|
|
|
anyAction = true;
|
|
|
|
|
break;
|
|
|
|
|
// Shows stats on what the AI was thinking.
|
|
|
|
|
case "thonk":
|
|
|
|
|
debugSystem.ToggleTooltip(AiDebugMode.Thonk);
|
|
|
|
|
anyAction = true;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
if(!anyAction)
|
|
|
|
|
shell.RemoteExecuteCommand(argStr);
|
2020-06-22 22:43:46 +03:00
|
|
|
#else
|
2021-02-01 16:49:43 -08:00
|
|
|
shell.RemoteExecuteCommand(argStr);
|
2020-06-22 22:43:46 +03:00
|
|
|
#endif
|
2020-06-18 22:52:44 +10:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|