Changed "Run" to "Walk" in code (#1154)

* Changed "Run" to "Walk" in code

Fixes #844

* Revert "Changed "Run" to "Walk" in code"

This reverts commit bf70dc7214d08c208823bccd5d3f36854d6b80de.

* Changed "Run" to "Walk" in code

Fixes #844
This commit is contained in:
Vince
2020-06-19 15:15:25 +02:00
committed by GitHub
parent 1331bda3b0
commit cda8f8b2bc
3 changed files with 8 additions and 8 deletions

View File

@@ -39,7 +39,7 @@ namespace Content.Client.Input
ghost.AddFunction(EngineKeyFunctions.MoveDown); ghost.AddFunction(EngineKeyFunctions.MoveDown);
ghost.AddFunction(EngineKeyFunctions.MoveLeft); ghost.AddFunction(EngineKeyFunctions.MoveLeft);
ghost.AddFunction(EngineKeyFunctions.MoveRight); ghost.AddFunction(EngineKeyFunctions.MoveRight);
ghost.AddFunction(EngineKeyFunctions.Run); ghost.AddFunction(EngineKeyFunctions.Walk);
ghost.AddFunction(ContentKeyFunctions.OpenContextMenu); ghost.AddFunction(ContentKeyFunctions.OpenContextMenu);
common.AddFunction(ContentKeyFunctions.OpenEntitySpawnWindow); common.AddFunction(ContentKeyFunctions.OpenEntitySpawnWindow);

View File

@@ -73,9 +73,9 @@ namespace Content.Server.GameObjects.EntitySystems
var moveDownCmdHandler = InputCmdHandler.FromDelegate( var moveDownCmdHandler = InputCmdHandler.FromDelegate(
session => HandleDirChange(session, Direction.South, true), session => HandleDirChange(session, Direction.South, true),
session => HandleDirChange(session, Direction.South, false)); session => HandleDirChange(session, Direction.South, false));
var runCmdHandler = InputCmdHandler.FromDelegate( var walkCmdHandler = InputCmdHandler.FromDelegate(
session => HandleRunChange(session, false), session => HandleRunChange(session, true),
session => HandleRunChange(session, true)); session => HandleRunChange(session, false));
var input = EntitySystemManager.GetEntitySystem<InputSystem>(); var input = EntitySystemManager.GetEntitySystem<InputSystem>();
@@ -84,7 +84,7 @@ namespace Content.Server.GameObjects.EntitySystems
.Bind(EngineKeyFunctions.MoveLeft, moveLeftCmdHandler) .Bind(EngineKeyFunctions.MoveLeft, moveLeftCmdHandler)
.Bind(EngineKeyFunctions.MoveRight, moveRightCmdHandler) .Bind(EngineKeyFunctions.MoveRight, moveRightCmdHandler)
.Bind(EngineKeyFunctions.MoveDown, moveDownCmdHandler) .Bind(EngineKeyFunctions.MoveDown, moveDownCmdHandler)
.Bind(EngineKeyFunctions.Run, runCmdHandler) .Bind(EngineKeyFunctions.Walk, walkCmdHandler)
.Register<MoverSystem>(); .Register<MoverSystem>();
SubscribeLocalEvent<PlayerAttachSystemMessage>(PlayerAttached); SubscribeLocalEvent<PlayerAttachSystemMessage>(PlayerAttached);
@@ -265,12 +265,12 @@ namespace Content.Server.GameObjects.EntitySystems
moverComp.SetVelocityDirection(dir, state); moverComp.SetVelocityDirection(dir, state);
} }
private static void HandleRunChange(ICommonSession session, bool running) private static void HandleRunChange(ICommonSession session, bool walking)
{ {
if (!TryGetAttachedComponent(session as IPlayerSession, out PlayerInputMoverComponent moverComp)) if (!TryGetAttachedComponent(session as IPlayerSession, out PlayerInputMoverComponent moverComp))
return; return;
moverComp.Sprinting = running; moverComp.Sprinting = !walking;
} }
private static bool TryGetAttachedComponent<T>(IPlayerSession session, out T component) private static bool TryGetAttachedComponent<T>(IPlayerSession session, out T component)

View File

@@ -34,7 +34,7 @@ binds:
- function: MoveDown - function: MoveDown
type: State type: State
key: S key: S
- function: Run - function: Walk
type: State type: State
key: Shift key: Shift
- function: ShowEscapeMenu - function: ShowEscapeMenu