feat: add noclip console command
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System.Collections.Generic;
|
||||
using Game.Features.Console.Contracts;
|
||||
using Game.Features.Players.Contracts;
|
||||
|
||||
namespace Game.Features.Console.Application.Commands;
|
||||
|
||||
public sealed class NoclipCommand(IMovementModeSwitcher movementModeSwitcher) : ICommand
|
||||
{
|
||||
public string Name => "noclip";
|
||||
public string Description => "Toggles noclip movement mode.";
|
||||
public IReadOnlyList<CommandArgSpec> Args { get; } = [];
|
||||
|
||||
public CommandResult Execute(CommandArgValues args)
|
||||
{
|
||||
MovementMode next = movementModeSwitcher.ActiveMovementMode == MovementMode.Noclip ? MovementMode.Ground : MovementMode.Noclip;
|
||||
movementModeSwitcher.SetMovementMode(next);
|
||||
|
||||
return CommandResult.Ok(next == MovementMode.Noclip ? "Noclip enabled." : "Noclip disabled.");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
uid://de2nlceiv1per
|
||||
Reference in New Issue
Block a user