From cda8f8b2bc7c31692144e5713220e727a8eaf754 Mon Sep 17 00:00:00 2001 From: Vince <39844191+Visne@users.noreply.github.com> Date: Fri, 19 Jun 2020 15:15:25 +0200 Subject: [PATCH] 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 --- Content.Client/Input/ContentContexts.cs | 2 +- .../GameObjects/EntitySystems/MoverSystem.cs | 12 ++++++------ Resources/keybinds.yml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Content.Client/Input/ContentContexts.cs b/Content.Client/Input/ContentContexts.cs index 279b238217..f9636dc01f 100644 --- a/Content.Client/Input/ContentContexts.cs +++ b/Content.Client/Input/ContentContexts.cs @@ -39,7 +39,7 @@ namespace Content.Client.Input ghost.AddFunction(EngineKeyFunctions.MoveDown); ghost.AddFunction(EngineKeyFunctions.MoveLeft); ghost.AddFunction(EngineKeyFunctions.MoveRight); - ghost.AddFunction(EngineKeyFunctions.Run); + ghost.AddFunction(EngineKeyFunctions.Walk); ghost.AddFunction(ContentKeyFunctions.OpenContextMenu); common.AddFunction(ContentKeyFunctions.OpenEntitySpawnWindow); diff --git a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs index 125bafc35d..7a22249763 100644 --- a/Content.Server/GameObjects/EntitySystems/MoverSystem.cs +++ b/Content.Server/GameObjects/EntitySystems/MoverSystem.cs @@ -73,9 +73,9 @@ namespace Content.Server.GameObjects.EntitySystems var moveDownCmdHandler = InputCmdHandler.FromDelegate( session => HandleDirChange(session, Direction.South, true), session => HandleDirChange(session, Direction.South, false)); - var runCmdHandler = InputCmdHandler.FromDelegate( - session => HandleRunChange(session, false), - session => HandleRunChange(session, true)); + var walkCmdHandler = InputCmdHandler.FromDelegate( + session => HandleRunChange(session, true), + session => HandleRunChange(session, false)); var input = EntitySystemManager.GetEntitySystem(); @@ -84,7 +84,7 @@ namespace Content.Server.GameObjects.EntitySystems .Bind(EngineKeyFunctions.MoveLeft, moveLeftCmdHandler) .Bind(EngineKeyFunctions.MoveRight, moveRightCmdHandler) .Bind(EngineKeyFunctions.MoveDown, moveDownCmdHandler) - .Bind(EngineKeyFunctions.Run, runCmdHandler) + .Bind(EngineKeyFunctions.Walk, walkCmdHandler) .Register(); SubscribeLocalEvent(PlayerAttached); @@ -265,12 +265,12 @@ namespace Content.Server.GameObjects.EntitySystems 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)) return; - moverComp.Sprinting = running; + moverComp.Sprinting = !walking; } private static bool TryGetAttachedComponent(IPlayerSession session, out T component) diff --git a/Resources/keybinds.yml b/Resources/keybinds.yml index 85aae27e3f..29388101ed 100644 --- a/Resources/keybinds.yml +++ b/Resources/keybinds.yml @@ -34,7 +34,7 @@ binds: - function: MoveDown type: State key: S -- function: Run +- function: Walk type: State key: Shift - function: ShowEscapeMenu