From 23211e94362b200bda3896b7e73ee03697029e59 Mon Sep 17 00:00:00 2001 From: gluesniffler Date: Thu, 4 Jul 2024 19:42:16 -0400 Subject: [PATCH 1/8] Porting contents from the Wizden repo --- Content.Server/Alert/Click/ToggleWalking.cs | 22 ++++++++++ .../Components/InputMoverComponent.cs | 4 ++ .../Movement/Systems/SharedMoverController.cs | 39 +++++++++++++++++- Resources/Locale/en-US/alerts/alerts.ftl | 3 ++ Resources/Prototypes/Alerts/alerts.yml | 13 ++++++ .../Mobs/Cyborgs/base_borg_chassis.yml | 1 + .../Prototypes/Entities/Mobs/NPCs/animals.yml | 1 + .../Entities/Mobs/NPCs/regalrat.yml | 1 + .../Prototypes/Entities/Mobs/NPCs/slimes.yml | 1 + .../Prototypes/Entities/Mobs/Species/base.yml | 1 + Resources/Prototypes/tags.yml | 3 ++ .../Interface/Alerts/walking.rsi/meta.json | 17 ++++++++ .../Interface/Alerts/walking.rsi/walking0.png | Bin 0 -> 1639 bytes .../Interface/Alerts/walking.rsi/walking1.png | Bin 0 -> 1686 bytes 14 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 Content.Server/Alert/Click/ToggleWalking.cs create mode 100644 Resources/Textures/Interface/Alerts/walking.rsi/meta.json create mode 100644 Resources/Textures/Interface/Alerts/walking.rsi/walking0.png create mode 100644 Resources/Textures/Interface/Alerts/walking.rsi/walking1.png diff --git a/Content.Server/Alert/Click/ToggleWalking.cs b/Content.Server/Alert/Click/ToggleWalking.cs new file mode 100644 index 00000000000..45e46673e5a --- /dev/null +++ b/Content.Server/Alert/Click/ToggleWalking.cs @@ -0,0 +1,22 @@ +using Content.Shared.Movement.Systems; +using Content.Shared.Movement.Components; +using Content.Shared.Alert; +using JetBrains.Annotations; + +namespace Content.Server.Alert.Click; + +/// +/// Attempts to toggle the internals for a particular entity +/// +[UsedImplicitly] +[DataDefinition] +public sealed partial class ToggleWalking : IAlertClick +{ + public void AlertClicked(EntityUid player) + { + var movementSystem = IoCManager.Resolve().GetEntitySystem(); + var entManager = IoCManager.Resolve(); + entManager.TryGetComponent(player, out var mover); + movementSystem.ToggleWalking(player); + } +} diff --git a/Content.Shared/Movement/Components/InputMoverComponent.cs b/Content.Shared/Movement/Components/InputMoverComponent.cs index f1e34c90df4..f193ee389f0 100644 --- a/Content.Shared/Movement/Components/InputMoverComponent.cs +++ b/Content.Shared/Movement/Components/InputMoverComponent.cs @@ -1,4 +1,5 @@ using System.Numerics; +using Content.Shared.Alert; using Content.Shared.Movement.Systems; using Robust.Shared.GameStates; using Robust.Shared.Serialization; @@ -74,6 +75,9 @@ public sealed partial class InputMoverComponent : Component [ViewVariables(VVAccess.ReadWrite)] public bool CanMove = true; + + [DataField] + public ProtoId WalkingAlert = "Walking"; } [Serializable, NetSerializable] diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index 4d9eedbf7c4..acb9b7411d1 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -1,5 +1,6 @@ using System.Diagnostics.CodeAnalysis; using System.Numerics; +using Content.Shared.Alert; using Content.Shared.Bed.Sleep; using Content.Shared.CCVar; using Content.Shared.Friction; @@ -33,6 +34,7 @@ namespace Content.Shared.Movement.Systems /// public abstract partial class SharedMoverController : VirtualController { + [Dependency] private readonly AlertsSystem _alerts = default!; [Dependency] private readonly IConfigurationManager _configManager = default!; [Dependency] protected readonly IGameTiming Timing = default!; [Dependency] private readonly IMapManager _mapManager = default!; @@ -165,6 +167,17 @@ protected void HandleMobMovement( var (walkDir, sprintDir) = GetVelocityInput(mover); var touching = false; + if (_tags.HasTag(uid, "CanWalk")) + { + if (!mover.Sprinting) + { + _alerts.ShowAlert(uid, mover.WalkingAlert, 0); + } else + { + _alerts.ShowAlert(uid, mover.WalkingAlert, 1); + } + } + // Handle wall-pushes. if (weightless) { @@ -285,6 +298,30 @@ protected void HandleMobMovement( PhysicsSystem.SetAngularVelocity(physicsUid, 0, body: physicsComponent); } + public void ToggleWalking(EntityUid player) + { + + var mover = MoverQuery.GetComponent(player); + //var buttons = mover.HeldMoveButtons; + bool containsWalk = (mover.HeldMoveButtons & MoveButtons.Walk) == MoveButtons.Walk; + //var moveEvent = new MoveInputEvent(mover.Owner, mover, mover.HeldMoveButtons); + /*if (!containsWalk) + { + mover.HeldMoveButtons |= MoveButtons.Walk; + } + else + { + mover.HeldMoveButtons &= ~MoveButtons.Walk; + }*/ + + //RaiseLocalEvent(player, ref moveEvent); + //Dirty(mover.Owner, mover);*/ + HandleRunChange(player, Timing.TickFraction, !containsWalk); + //var funcId = InputManager.NetworkBindMap.KeyFunctionID(EngineKeyFunctions.Walk); + //var message = new IFullInputCmdMessage(Timing.CurTick, (containsWalk ? BoundKeyState.Up : BoundKeyState.Down), 145, Timing.TickFraction); + //await Client.WaitPost(() => InputSystem.HandleInputCommand(ClientSession, key, message)); + } + public void LerpRotation(EntityUid uid, InputMoverComponent mover, float frameTime) { var angleDiff = Angle.ShortestDistance(mover.RelativeRotation, mover.TargetRelativeRotation); @@ -440,7 +477,7 @@ private bool TryGetSound( sound = moverModifier.FootstepSoundCollection; return true; } - + // If got the component in yml and no shoes = no sound. Delta V if (_entities.TryGetComponent(uid, out NoShoesSilentFootstepsComponent? _) & !_inventory.TryGetSlotEntity(uid, "shoes", out var _)) diff --git a/Resources/Locale/en-US/alerts/alerts.ftl b/Resources/Locale/en-US/alerts/alerts.ftl index 795d740141b..20e9d311e2b 100644 --- a/Resources/Locale/en-US/alerts/alerts.ftl +++ b/Resources/Locale/en-US/alerts/alerts.ftl @@ -110,3 +110,6 @@ alerts-revenant-essence-desc = The power of souls. It sustains you and is used f alerts-revenant-corporeal-name = Corporeal alerts-revenant-corporeal-desc = You have manifested physically. People around you can see and hurt you. + +alerts-walking-name = Walking +alerts-walking-desc = Toggles your movement speed to be slower or faster. diff --git a/Resources/Prototypes/Alerts/alerts.yml b/Resources/Prototypes/Alerts/alerts.yml index 2d1c9062e61..f79649f6b93 100644 --- a/Resources/Prototypes/Alerts/alerts.yml +++ b/Resources/Prototypes/Alerts/alerts.yml @@ -419,6 +419,19 @@ name: alerts-pacified-name description: alerts-pacified-desc +- type: alert + id: Walking + onClick: !type:ToggleWalking { } + icons: + - sprite: /Textures/Interface/Alerts/walking.rsi + state: walking0 + - sprite: /Textures/Interface/Alerts/walking.rsi + state: walking1 + name: alerts-walking-name + description: alerts-walking-desc + minSeverity: 0 + maxSeverity: 1 + - type: alert id: Debug1 icons: diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index 0645e451af2..23eda535ee4 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -205,6 +205,7 @@ - ShoesRequiredStepTriggerImmune - DoorBumpOpener - CanPilot + - CanWalk - type: Emoting - type: GuideHelp guides: diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index e311681ce5f..43fa13f1112 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -1299,6 +1299,7 @@ tags: - VimPilot - DoorBumpOpener + - CanWalk - type: entity name: monkey diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml b/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml index 50fe3b6765e..662e90b8bf5 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml @@ -95,6 +95,7 @@ tags: - CannotSuicide - FootstepSound + - CanWalk - type: NoSlip - type: RatKing hungerPerArmyUse: 25 diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml index 901bf149cbc..e46347b79e5 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml @@ -43,6 +43,7 @@ - type: Tag tags: - FootstepSound + - CanWalk - type: Butcherable butcheringType: Knife spawned: diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml index 67212d416fe..42c73e4663a 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml @@ -229,6 +229,7 @@ - CanPilot - FootstepSound - DoorBumpOpener + - CanWalk - type: entity save: false diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index c6a0ab3f8fd..5237febc2b3 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -286,6 +286,9 @@ - type: Tag id: CanPilot +- type: Tag + id: CanWalk + - type: Tag id: CannonBall diff --git a/Resources/Textures/Interface/Alerts/walking.rsi/meta.json b/Resources/Textures/Interface/Alerts/walking.rsi/meta.json new file mode 100644 index 00000000000..fc1a55d48ea --- /dev/null +++ b/Resources/Textures/Interface/Alerts/walking.rsi/meta.json @@ -0,0 +1,17 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Walking icon by /tg/station (placeholder)", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "walking0" + }, + { + "name": "walking1" + } + ] +} diff --git a/Resources/Textures/Interface/Alerts/walking.rsi/walking0.png b/Resources/Textures/Interface/Alerts/walking.rsi/walking0.png new file mode 100644 index 0000000000000000000000000000000000000000..d1ab277a99fcc6cc1615ad6d2e065a8c9058b8fd GIT binary patch literal 1639 zcmV-t2AKJYP)7D}6~=#SpL2(EeH}L*uN^x>MN&Wtq99s12xtbiaa59Eh6iLv>H{x*;ZFfxqDlx= zN)6(nYSX4|XoX_~HEmQCAxfvfL%@#laPGBzr*qG=HxK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DJd=Ci{xE_4^>Em4a?Q=x)nv#_2I8a}jRi0gzQYevHg#*-N_%1rJLR66} zkyu_qyqX78Wgl%!{64IdYpY8$saD5#7pDR>Utc|-R@Z+U$k*DVs=S84y|#&g0U4N> gsLQr%$=7TD0X_RkyWv|f)&Kwi07*qoM6N<$f}A=sM*si- literal 0 HcmV?d00001 From 325de7fe05d591f368c660284afc6c797df53641 Mon Sep 17 00:00:00 2001 From: gluesniffler Date: Thu, 4 Jul 2024 21:02:12 -0400 Subject: [PATCH 2/8] Fixed some oopsies --- .vscode/settings.json | 2 +- Content.Shared/Alert/AlertType.cs | 1 + Content.Shared/Movement/Components/InputMoverComponent.cs | 1 + Content.Shared/Movement/Systems/SharedMoverController.cs | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 0e0d3ae890c..3386947c62b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { "omnisharp.analyzeOpenDocumentsOnly": true, - "dotnet.defaultSolution": "SpaceStation14.sln" + "dotnet.defaultSolution": "SpaceStation14.sln", } diff --git a/Content.Shared/Alert/AlertType.cs b/Content.Shared/Alert/AlertType.cs index b917dd692d7..a4423cad6c5 100644 --- a/Content.Shared/Alert/AlertType.cs +++ b/Content.Shared/Alert/AlertType.cs @@ -37,6 +37,7 @@ public enum AlertType : byte Internals, Toxins, Muted, + Walking, VowOfSilence, VowBroken, Essence, diff --git a/Content.Shared/Movement/Components/InputMoverComponent.cs b/Content.Shared/Movement/Components/InputMoverComponent.cs index f193ee389f0..263190d46fd 100644 --- a/Content.Shared/Movement/Components/InputMoverComponent.cs +++ b/Content.Shared/Movement/Components/InputMoverComponent.cs @@ -5,6 +5,7 @@ using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; using Robust.Shared.Timing; +using Robust.Shared.Prototypes; namespace Content.Shared.Movement.Components { diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index acb9b7411d1..067c0656faf 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -171,10 +171,10 @@ protected void HandleMobMovement( { if (!mover.Sprinting) { - _alerts.ShowAlert(uid, mover.WalkingAlert, 0); + _alerts.ShowAlert(uid, AlertType.Walking, 0); } else { - _alerts.ShowAlert(uid, mover.WalkingAlert, 1); + _alerts.ShowAlert(uid, AlertType.Walking, 1); } } From 9134379ca1c741297fb6786339f7495dd537f951 Mon Sep 17 00:00:00 2001 From: gluesniffler Date: Mon, 8 Jul 2024 03:07:07 -0400 Subject: [PATCH 3/8] Added new sprites, fixed interaction issues, gave up on the Alert Click event. --- .gitignore | 1 + Content.Server/Alert/Click/ToggleWalking.cs | 22 --------- .../Systems/SharedMoverController.Input.cs | 7 ++- .../Movement/Systems/SharedMoverController.cs | 44 ++++++------------ Resources/Locale/en-US/alerts/alerts.ftl | 2 +- Resources/Prototypes/Alerts/alerts.yml | 1 - .../Entities/Objects/Specific/Mech/mechs.yml | 1 + .../Interface/Alerts/walking.rsi/meta.json | 2 +- .../Interface/Alerts/walking.rsi/walking0.png | Bin 1639 -> 1376 bytes .../Interface/Alerts/walking.rsi/walking1.png | Bin 1686 -> 1048 bytes 10 files changed, 23 insertions(+), 57 deletions(-) delete mode 100644 Content.Server/Alert/Click/ToggleWalking.cs diff --git a/.gitignore b/.gitignore index 0cd376f5dcd..91a6317c1db 100644 --- a/.gitignore +++ b/.gitignore @@ -264,6 +264,7 @@ __pycache__/ # Visual Studio Code workspace settings. .vscode/* +.vscode !.vscode/extensions.json !.vscode/launch.json !.vscode/tasks.json diff --git a/Content.Server/Alert/Click/ToggleWalking.cs b/Content.Server/Alert/Click/ToggleWalking.cs deleted file mode 100644 index 45e46673e5a..00000000000 --- a/Content.Server/Alert/Click/ToggleWalking.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Content.Shared.Movement.Systems; -using Content.Shared.Movement.Components; -using Content.Shared.Alert; -using JetBrains.Annotations; - -namespace Content.Server.Alert.Click; - -/// -/// Attempts to toggle the internals for a particular entity -/// -[UsedImplicitly] -[DataDefinition] -public sealed partial class ToggleWalking : IAlertClick -{ - public void AlertClicked(EntityUid player) - { - var movementSystem = IoCManager.Resolve().GetEntitySystem(); - var entManager = IoCManager.Resolve(); - entManager.TryGetComponent(player, out var mover); - movementSystem.ToggleWalking(player); - } -} diff --git a/Content.Shared/Movement/Systems/SharedMoverController.Input.cs b/Content.Shared/Movement/Systems/SharedMoverController.Input.cs index bce3aeff527..d323125f1dc 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.Input.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.Input.cs @@ -1,4 +1,5 @@ using System.Numerics; +using Content.Shared.Alert; using Content.Shared.CCVar; using Content.Shared.Follower.Components; using Content.Shared.Input; @@ -333,6 +334,8 @@ private void OnInputInit(EntityUid uid, InputMoverComponent component, Component component.RelativeEntity = xform.GridUid ?? xform.MapUid; component.TargetRelativeRotation = Angle.Zero; + WalkingAlert(uid, !component.Sprinting); + } private void HandleRunChange(EntityUid uid, ushort subTick, bool walking) @@ -344,6 +347,7 @@ private void HandleRunChange(EntityUid uid, ushort subTick, bool walking) // if we swap to relay then stop our existing input if we ever change back. if (moverComp != null) { + WalkingAlert(uid, walking); SetMoveInput(moverComp, MoveButtons.None); } @@ -460,10 +464,11 @@ private void ResetSubtick(InputMoverComponent component) component.LastInputSubTick = 0; } + public void SetSprinting(EntityUid entity, InputMoverComponent component, ushort subTick, bool walking) { // Logger.Info($"[{_gameTiming.CurTick}/{subTick}] Sprint: {enabled}"); - + WalkingAlert(entity, walking); SetMoveInput(entity, component, subTick, walking, MoveButtons.Walk); } diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index 067c0656faf..785e6c33ae8 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -24,7 +24,8 @@ using Robust.Shared.Physics.Systems; using Robust.Shared.Timing; using Robust.Shared.Utility; -using Content.Shared.StepTrigger.Components; // Delta V-NoShoesSilentFootstepsComponent +using Content.Shared.StepTrigger.Components; +using System.Diagnostics; // Delta V-NoShoesSilentFootstepsComponent namespace Content.Shared.Movement.Systems { @@ -162,21 +163,13 @@ protected void HandleMobMovement( UsedMobMovement[uid] = true; + //Logger.Debug($"Beginning movement with {mover.Sprinting} owned by {mover.Owner}. Relative entity is {mover.RelativeEntity} Current UID is {uid}, Physics UID is {physicsUid}"); // Specifically don't use mover.Owner because that may be different to the actual physics body being moved. var weightless = _gravity.IsWeightless(physicsUid, physicsComponent, xform); var (walkDir, sprintDir) = GetVelocityInput(mover); var touching = false; - if (_tags.HasTag(uid, "CanWalk")) - { - if (!mover.Sprinting) - { - _alerts.ShowAlert(uid, AlertType.Walking, 0); - } else - { - _alerts.ShowAlert(uid, AlertType.Walking, 1); - } - } + // Handle wall-pushes. if (weightless) @@ -298,28 +291,17 @@ protected void HandleMobMovement( PhysicsSystem.SetAngularVelocity(physicsUid, 0, body: physicsComponent); } - public void ToggleWalking(EntityUid player) - { - - var mover = MoverQuery.GetComponent(player); - //var buttons = mover.HeldMoveButtons; - bool containsWalk = (mover.HeldMoveButtons & MoveButtons.Walk) == MoveButtons.Walk; - //var moveEvent = new MoveInputEvent(mover.Owner, mover, mover.HeldMoveButtons); - /*if (!containsWalk) + public void WalkingAlert(EntityUid player, bool walking) { + if (_tags.HasTag(player, "CanWalk")) { - mover.HeldMoveButtons |= MoveButtons.Walk; + if (walking) + { + _alerts.ShowAlert(player, AlertType.Walking, 0); + } else + { + _alerts.ShowAlert(player, AlertType.Walking, 1); + } } - else - { - mover.HeldMoveButtons &= ~MoveButtons.Walk; - }*/ - - //RaiseLocalEvent(player, ref moveEvent); - //Dirty(mover.Owner, mover);*/ - HandleRunChange(player, Timing.TickFraction, !containsWalk); - //var funcId = InputManager.NetworkBindMap.KeyFunctionID(EngineKeyFunctions.Walk); - //var message = new IFullInputCmdMessage(Timing.CurTick, (containsWalk ? BoundKeyState.Up : BoundKeyState.Down), 145, Timing.TickFraction); - //await Client.WaitPost(() => InputSystem.HandleInputCommand(ClientSession, key, message)); } public void LerpRotation(EntityUid uid, InputMoverComponent mover, float frameTime) diff --git a/Resources/Locale/en-US/alerts/alerts.ftl b/Resources/Locale/en-US/alerts/alerts.ftl index 20e9d311e2b..ac134ff7002 100644 --- a/Resources/Locale/en-US/alerts/alerts.ftl +++ b/Resources/Locale/en-US/alerts/alerts.ftl @@ -112,4 +112,4 @@ alerts-revenant-corporeal-name = Corporeal alerts-revenant-corporeal-desc = You have manifested physically. People around you can see and hurt you. alerts-walking-name = Walking -alerts-walking-desc = Toggles your movement speed to be slower or faster. +alerts-walking-desc = Indicates how fast you're moving. diff --git a/Resources/Prototypes/Alerts/alerts.yml b/Resources/Prototypes/Alerts/alerts.yml index f79649f6b93..7146f0589ca 100644 --- a/Resources/Prototypes/Alerts/alerts.yml +++ b/Resources/Prototypes/Alerts/alerts.yml @@ -421,7 +421,6 @@ - type: alert id: Walking - onClick: !type:ToggleWalking { } icons: - sprite: /Textures/Interface/Alerts/walking.rsi state: walking0 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml b/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml index 5a2587ff710..d985d5a7667 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml @@ -59,6 +59,7 @@ baseSprintSpeed: 2 - type: Tag tags: + - CanWalk - DoorBumpOpener - FootstepSound - type: Pullable diff --git a/Resources/Textures/Interface/Alerts/walking.rsi/meta.json b/Resources/Textures/Interface/Alerts/walking.rsi/meta.json index fc1a55d48ea..d328b01a45f 100644 --- a/Resources/Textures/Interface/Alerts/walking.rsi/meta.json +++ b/Resources/Textures/Interface/Alerts/walking.rsi/meta.json @@ -1,7 +1,7 @@ { "version": 1, "license": "CC-BY-SA-3.0", - "copyright": "Walking icon by /tg/station (placeholder)", + "copyright": "Walking/Running icons modified by Mocho, original taken from /tg/station https://github.com/tgstation/tgstation/pull/52691/commits/6a1261187c108c8f151c99ebfa567bd1ec34044c", "size": { "x": 32, "y": 32 diff --git a/Resources/Textures/Interface/Alerts/walking.rsi/walking0.png b/Resources/Textures/Interface/Alerts/walking.rsi/walking0.png index d1ab277a99fcc6cc1615ad6d2e065a8c9058b8fd..2547d35c8f1ba0d2ab2ddb48847bf5f303015282 100644 GIT binary patch delta 1358 zcmV-U1+n_)4B!foBYyx1a7bBm000XT000XT0n*)m`~Uz25=lfsR9HvFSIui&RTMw> z%}kQ9lcbYLCNCe-4>W#2!6H`FO`3%zrBDsUg)|{93et_Z68r-MSK>wjE(|5hQmlwY z7wxPB7lNRmEoduE(`G)C`OZwW$o|w_+{dA$P#-;NuWOM7D zdV)mL128@m9&}h4L;=H~pglmAQ6rlHV01tZk`a&; z8BaVrO;){5!2y0}Pfkuwsqx|;H$~*d1!1^MKouz~VD*h8gcmv@HW3F=2g~h-dJc4S!we@CI#({6Rb8-Mu=?W+ zdOwx&to}$Wic09v2L`Z!3G8-{cnE-PoPU4Qu^E~@Izz9%|6%7Y#3l@0(ky5GW+qKj zQKt;IcXGb@3JhQY6WFk!i-$ml-MP#CyhsH?zrS=a-C z3z)!$4P83U17Q(XhY8~SeD2K^Id^77ZSw0Md3QS311^b1n45%GKV4VtS_Pk20(kSWY)M;<9Dnc)yf*j~W7t9GV9V!HRXKgTp}P+#oV#8V0Kopg z*2oEv>P2EC9_hIcbesuwFn#%M=hKb%TRrCC)pqIY0sVtNwRYTV+wInl`}G3fdx3j? z*LN*6n|rCO%68rDdK2;shmPfUFX(BL_+yDRo delta 1623 zcmV-d2B`Vq3g--vBYy@iNkl7D}6~=#SpL2(EeH}L*uN^x>MN&Wtq99s1 z2xtbiaa59Eh6iLv>H{x*;ZFfxqDlx=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EiIDdYW zAPk7gA-Y^9+N^a|xru(A%Ngo81L@mGFNbIHRAL-NvGEm4a?Q=x)nv#_2I8a}jRi0gzQYevHg#*-N_%1rJLR66}kyu_qyqX78Wgl%!{64Id zYpY8$saD5#7pDR>Utc|-R@Z+U$k*DVs=S84y|#&g0U4N>sLQr%$=7TD0X_RkyWv|f Q)&Kwi07*qoM6N<$g5^LpDgXcg From 2bb2ae009b1dfdf83fbe5f7033bb30be6d812c5b Mon Sep 17 00:00:00 2001 From: gluesniffler Date: Mon, 8 Jul 2024 03:50:30 -0400 Subject: [PATCH 4/8] Tying up a few loose ends (why were these modified?) --- .gitignore | 1 - .vscode/settings.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 91a6317c1db..0cd376f5dcd 100644 --- a/.gitignore +++ b/.gitignore @@ -264,7 +264,6 @@ __pycache__/ # Visual Studio Code workspace settings. .vscode/* -.vscode !.vscode/extensions.json !.vscode/launch.json !.vscode/tasks.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 3386947c62b..0e0d3ae890c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,4 @@ { "omnisharp.analyzeOpenDocumentsOnly": true, - "dotnet.defaultSolution": "SpaceStation14.sln", + "dotnet.defaultSolution": "SpaceStation14.sln" } From d9e7eee3224d229da32a2314987db1c2a4b81da8 Mon Sep 17 00:00:00 2001 From: gluesniffler Date: Mon, 8 Jul 2024 08:56:21 -0400 Subject: [PATCH 5/8] minor kerning mistake :trollface: --- .../Interface/Alerts/walking.rsi/walking0.png | Bin 1376 -> 1335 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Resources/Textures/Interface/Alerts/walking.rsi/walking0.png b/Resources/Textures/Interface/Alerts/walking.rsi/walking0.png index 2547d35c8f1ba0d2ab2ddb48847bf5f303015282..1d1f048fb918d8c09a4d044f3850e16da939d583 100644 GIT binary patch delta 1296 zcmV+r1@HRc3bzW7IDZ7`NklM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sep 17 00:00:00 2001 From: gluesniffler <159397573+gluesniffler@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:43:24 -0400 Subject: [PATCH 6/8] Adding changes from the review Co-authored-by: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Signed-off-by: gluesniffler <159397573+gluesniffler@users.noreply.github.com> --- .../Movement/Systems/SharedMoverController.Input.cs | 1 - .../Movement/Systems/SharedMoverController.cs | 12 ++---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/Content.Shared/Movement/Systems/SharedMoverController.Input.cs b/Content.Shared/Movement/Systems/SharedMoverController.Input.cs index d323125f1dc..891bd518b1c 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.Input.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.Input.cs @@ -335,7 +335,6 @@ private void OnInputInit(EntityUid uid, InputMoverComponent component, Component component.RelativeEntity = xform.GridUid ?? xform.MapUid; component.TargetRelativeRotation = Angle.Zero; WalkingAlert(uid, !component.Sprinting); - } private void HandleRunChange(EntityUid uid, ushort subTick, bool walking) diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index 785e6c33ae8..09dd4f19b60 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -25,7 +25,7 @@ using Robust.Shared.Timing; using Robust.Shared.Utility; using Content.Shared.StepTrigger.Components; -using System.Diagnostics; // Delta V-NoShoesSilentFootstepsComponent +using System.Diagnostics; namespace Content.Shared.Movement.Systems { @@ -163,14 +163,12 @@ protected void HandleMobMovement( UsedMobMovement[uid] = true; - //Logger.Debug($"Beginning movement with {mover.Sprinting} owned by {mover.Owner}. Relative entity is {mover.RelativeEntity} Current UID is {uid}, Physics UID is {physicsUid}"); // Specifically don't use mover.Owner because that may be different to the actual physics body being moved. var weightless = _gravity.IsWeightless(physicsUid, physicsComponent, xform); var (walkDir, sprintDir) = GetVelocityInput(mover); var touching = false; - // Handle wall-pushes. if (weightless) { @@ -294,13 +292,7 @@ protected void HandleMobMovement( public void WalkingAlert(EntityUid player, bool walking) { if (_tags.HasTag(player, "CanWalk")) { - if (walking) - { - _alerts.ShowAlert(player, AlertType.Walking, 0); - } else - { - _alerts.ShowAlert(player, AlertType.Walking, 1); - } + _alerts.ShowAlert(player, AlertType.Walking, walking ? 0 : 1); } } From de080a80cd3770e0851834d066b8e00dfcf6bd57 Mon Sep 17 00:00:00 2001 From: gluesniffler Date: Thu, 11 Jul 2024 14:09:47 -0400 Subject: [PATCH 7/8] Apparently C# doesn't implicitly cast death's review suggestion into a Short, added this ugly cast on both sides --- Content.Shared/Movement/Systems/SharedMoverController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index 94c0ad8ce9b..03c0d800594 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -292,7 +292,7 @@ protected void HandleMobMovement( public void WalkingAlert(EntityUid player, bool walking) { if (_tags.HasTag(player, "CanWalk")) { - _alerts.ShowAlert(player, AlertType.Walking, walking ? 0 : 1); + _alerts.ShowAlert(player, AlertType.Walking, walking ? (short) 0 : (short) 1); } } From 3046cee34c23324166fd25e4c5c18fa90a4f08a8 Mon Sep 17 00:00:00 2001 From: gluesniffler Date: Tue, 16 Jul 2024 17:21:30 -0400 Subject: [PATCH 8/8] Turned CanWalk into a component, added it to the prev entities and the Reagent Slime --- .../Movement/Components/CanWalkComponent.cs | 11 +++++++++++ .../Movement/Systems/SharedMoverController.cs | 5 +++-- .../Entities/Mobs/Cyborgs/base_borg_chassis.yml | 2 +- Resources/Prototypes/Entities/Mobs/NPCs/animals.yml | 2 +- Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml | 1 + Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml | 2 +- Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml | 2 +- Resources/Prototypes/Entities/Mobs/Species/base.yml | 2 +- .../Entities/Objects/Specific/Mech/mechs.yml | 2 +- Resources/Prototypes/tags.yml | 3 --- 10 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 Content.Shared/Movement/Components/CanWalkComponent.cs diff --git a/Content.Shared/Movement/Components/CanWalkComponent.cs b/Content.Shared/Movement/Components/CanWalkComponent.cs new file mode 100644 index 00000000000..fab851595c7 --- /dev/null +++ b/Content.Shared/Movement/Components/CanWalkComponent.cs @@ -0,0 +1,11 @@ +using Robust.Shared.GameStates; + +namespace Content.Shared.Movement.Components; + +/// +/// Indicates if the entity can toggle walking or not. +/// +[NetworkedComponent, RegisterComponent] +public sealed partial class CanWalkComponent : Component +{ +} diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index 078beae17ed..4c2c91db6a1 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -289,8 +289,9 @@ protected void HandleMobMovement( PhysicsSystem.SetAngularVelocity(physicsUid, 0, body: physicsComponent); } - public void WalkingAlert(EntityUid player, bool walking) { - if (_tags.HasTag(player, "CanWalk")) + public void WalkingAlert(EntityUid player, bool walking) + { + if (HasComp(player)) { _alerts.ShowAlert(player, AlertType.Walking, walking ? (short) 0 : (short) 1); } diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index 86a2606c8a7..a75be106f3c 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -205,7 +205,6 @@ - ShoesRequiredStepTriggerImmune - DoorBumpOpener - CanPilot - - CanWalk - type: Emoting - type: GuideHelp guides: @@ -221,6 +220,7 @@ understands: - GalacticCommon - RobotTalk + - type: CanWalk - type: entity id: BaseBorgChassisNT diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index 80e29f6b82e..5d8753e669e 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -1309,7 +1309,7 @@ tags: - VimPilot - DoorBumpOpener - - CanWalk + - type: CanWalk - type: entity name: monkey diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml b/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml index 01fce382e37..f19879c9eaa 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/elemental.yml @@ -292,6 +292,7 @@ solution: bloodstream - type: DrainableSolution solution: bloodstream + - type: CanWalk - type: entity name: Reagent Slime Spawner diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml b/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml index 943b470b5be..db594873fe3 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/regalrat.yml @@ -95,7 +95,6 @@ tags: - CannotSuicide - FootstepSound - - CanWalk - type: NoSlip - type: RatKing hungerPerArmyUse: 25 @@ -127,6 +126,7 @@ understands: - GalacticCommon - Mouse + - type: CanWalk - type: entity id: MobRatKingBuff diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml index 1c79d83682f..690a4c5d291 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml @@ -44,7 +44,6 @@ - type: Tag tags: - FootstepSound - - CanWalk - type: Butcherable butcheringType: Knife spawned: @@ -129,6 +128,7 @@ speechSounds: Slime - type: TypingIndicator proto: slime + - type: CanWalk - type: entity name: blue slime diff --git a/Resources/Prototypes/Entities/Mobs/Species/base.yml b/Resources/Prototypes/Entities/Mobs/Species/base.yml index 8bdfa6715ab..9f3269abda6 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/base.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/base.yml @@ -229,7 +229,7 @@ - CanPilot - FootstepSound - DoorBumpOpener - - CanWalk + - type: CanWalk - type: entity save: false diff --git a/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml b/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml index d985d5a7667..ffa4e7ade7a 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Mech/mechs.yml @@ -59,7 +59,6 @@ baseSprintSpeed: 2 - type: Tag tags: - - CanWalk - DoorBumpOpener - FootstepSound - type: Pullable @@ -96,6 +95,7 @@ - type: GuideHelp guides: - Robotics + - type: CanWalk - type: entity id: MechRipley diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index 83a4de4033c..231326e5b11 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -301,9 +301,6 @@ - type: Tag id: CanPilot -- type: Tag - id: CanWalk - - type: Tag id: CannonBall