feat: add noclip console command

This commit is contained in:
2026-08-22 22:23:02 +02:00
parent 76694a40f6
commit eba1af5ff0
4 changed files with 26 additions and 1 deletions
@@ -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