ShowEmergencyShuttleCommand and MeleeSpreadCommand LEC conversion. (#37993)
progress
This commit is contained in:
@@ -3,15 +3,15 @@ using Robust.Shared.Console;
|
|||||||
|
|
||||||
namespace Content.Client.Shuttles.Commands;
|
namespace Content.Client.Shuttles.Commands;
|
||||||
|
|
||||||
public sealed class ShowEmergencyShuttleCommand : IConsoleCommand
|
public sealed class ShowEmergencyShuttleCommand : LocalizedEntityCommands
|
||||||
{
|
{
|
||||||
public string Command => "showemergencyshuttle";
|
[Dependency] private readonly ShuttleSystem _shuttle = default!;
|
||||||
public string Description => "Shows the expected position of the emergency shuttle";
|
|
||||||
public string Help => $"{Command}";
|
public override string Command => "showemergencyshuttle";
|
||||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
|
||||||
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||||
{
|
{
|
||||||
var tstalker = IoCManager.Resolve<IEntitySystemManager>().GetEntitySystem<ShuttleSystem>();
|
_shuttle.EnableShuttlePosition ^= true;
|
||||||
tstalker.EnableShuttlePosition ^= true;
|
shell.WriteLine(Loc.GetString($"cmd-showemergencyshuttle-status", ("status", _shuttle.EnableShuttlePosition)));
|
||||||
shell.WriteLine($"Set emergency shuttle debug to {tstalker.EnableShuttlePosition}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,39 +3,33 @@ using Robust.Client.Graphics;
|
|||||||
using Robust.Client.Input;
|
using Robust.Client.Input;
|
||||||
using Robust.Client.Player;
|
using Robust.Client.Player;
|
||||||
using Robust.Shared.Console;
|
using Robust.Shared.Console;
|
||||||
using Robust.Shared.Map;
|
|
||||||
|
|
||||||
namespace Content.Client.Weapons.Melee;
|
namespace Content.Client.Weapons.Melee;
|
||||||
|
|
||||||
|
public sealed class MeleeSpreadCommand : LocalizedEntityCommands
|
||||||
public sealed class MeleeSpreadCommand : IConsoleCommand
|
|
||||||
{
|
{
|
||||||
public string Command => "showmeleespread";
|
[Dependency] private readonly IEyeManager _eyeManager = default!;
|
||||||
public string Description => "Shows the current weapon's range and arc for debugging";
|
[Dependency] private readonly IInputManager _inputManager = default!;
|
||||||
public string Help => $"{Command}";
|
[Dependency] private readonly IOverlayManager _overlay = default!;
|
||||||
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
|
[Dependency] private readonly MeleeWeaponSystem _meleeSystem = default!;
|
||||||
|
[Dependency] private readonly SharedCombatModeSystem _combatSystem = default!;
|
||||||
|
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
|
||||||
|
|
||||||
|
public override string Command => "showmeleespread";
|
||||||
|
|
||||||
|
public override void Execute(IConsoleShell shell, string argStr, string[] args)
|
||||||
{
|
{
|
||||||
var collection = IoCManager.Instance;
|
if (_overlay.RemoveOverlay<MeleeArcOverlay>())
|
||||||
|
|
||||||
if (collection == null)
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var overlayManager = collection.Resolve<IOverlayManager>();
|
_overlay.AddOverlay(new MeleeArcOverlay(
|
||||||
|
EntityManager,
|
||||||
if (overlayManager.RemoveOverlay<MeleeArcOverlay>())
|
_eyeManager,
|
||||||
{
|
_inputManager,
|
||||||
return;
|
_playerManager,
|
||||||
}
|
_meleeSystem,
|
||||||
|
_combatSystem,
|
||||||
var sysManager = collection.Resolve<IEntitySystemManager>();
|
_transformSystem));
|
||||||
|
|
||||||
overlayManager.AddOverlay(new MeleeArcOverlay(
|
|
||||||
collection.Resolve<IEntityManager>(),
|
|
||||||
collection.Resolve<IEyeManager>(),
|
|
||||||
collection.Resolve<IInputManager>(),
|
|
||||||
collection.Resolve<IPlayerManager>(),
|
|
||||||
sysManager.GetEntitySystem<MeleeWeaponSystem>(),
|
|
||||||
sysManager.GetEntitySystem<SharedCombatModeSystem>(),
|
|
||||||
sysManager.GetEntitySystem<SharedTransformSystem>()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
1
Resources/Locale/en-US/commands/melee-spread-command.ftl
Normal file
1
Resources/Locale/en-US/commands/melee-spread-command.ftl
Normal file
@@ -0,0 +1 @@
|
|||||||
|
cmd-showmeleespread-desc = Shows the current weapon's range and arc for debugging.
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
cmd-showemergencyshuttle-desc = Shows the expected position of the emergency shuttle.
|
||||||
|
cmd-showemergencyshuttle-status = Set emergency shuttle debug to {$status}.
|
||||||
Reference in New Issue
Block a user