Skip to content
This repository has been archived by the owner on Nov 1, 2024. It is now read-only.

Commit

Permalink
Merge pull request #335 from Corvax-Frontier/revert-325-lie-down-2
Browse files Browse the repository at this point in the history
Revert "Ляжания вторая попытка - ДОДЕЛАННОЕ, РАБОЧЕЕ ГАВНО"
  • Loading branch information
Vonsant authored Jun 23, 2024
2 parents 6be289a + 45472db commit 52d479a
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 313 deletions.
1 change: 0 additions & 1 deletion Content.Client/Input/ContentContexts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.Arcade1);
human.AddFunction(ContentKeyFunctions.Arcade2);
human.AddFunction(ContentKeyFunctions.Arcade3);
human.AddFunction(ContentKeyFunctions.LieDownStandUp);

// actions should be common (for ghosts, mobs, etc)
common.AddFunction(ContentKeyFunctions.OpenActionsMenu);
Expand Down
1 change: 0 additions & 1 deletion Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
AddButton(ContentKeyFunctions.Drop);
AddButton(ContentKeyFunctions.ExamineEntity);
AddButton(ContentKeyFunctions.SwapHands);
AddButton(ContentKeyFunctions.LieDownStandUp);
AddButton(ContentKeyFunctions.MoveStoredItem);
AddButton(ContentKeyFunctions.RotateStoredItem);
AddButton(ContentKeyFunctions.SaveItemLocation);
Expand Down
1 change: 0 additions & 1 deletion Content.Shared/Input/ContentKeyFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ public static class ContentKeyFunctions
public static readonly BoundKeyFunction ZoomOut = "ZoomOut";
public static readonly BoundKeyFunction ZoomIn = "ZoomIn";
public static readonly BoundKeyFunction ResetZoom = "ResetZoom";
public static readonly BoundKeyFunction LieDownStandUp = "LieDownStandUp";

public static readonly BoundKeyFunction ArcadeUp = "ArcadeUp";
public static readonly BoundKeyFunction ArcadeDown = "ArcadeDown";
Expand Down
25 changes: 0 additions & 25 deletions Content.Shared/LieDown/LyingDownComponent.cs

This file was deleted.

171 changes: 0 additions & 171 deletions Content.Shared/LieDown/SharedLieDownSystem.cs

This file was deleted.

59 changes: 19 additions & 40 deletions Content.Shared/Standing/StandingStateComponent.cs
Original file line number Diff line number Diff line change
@@ -1,45 +1,24 @@
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Content.Shared.Actions;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;

namespace Content.Shared.Standing;


[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(StandingStateSystem))]
public sealed partial class StandingStateComponent : Component
namespace Content.Shared.Standing
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public SoundSpecifier DownSound { get; private set; } = new SoundCollectionSpecifier("BodyFall");

[DataField, AutoNetworkedField]
public bool Standing = true;

/// <summary>
/// List of fixtures that had their collision mask changed when the entity was downed.
/// Required for re-adding the collision mask.
/// </summary>
[DataField, AutoNetworkedField]
public List<string> ChangedFixtures = new();

[DataField]
public EntProtoId LieDownAction = "ActionLieDown";

[DataField, AutoNetworkedField]
public EntityUid? LieDownActionEntity;

[DataField("stand-up-action")]
public EntProtoId StandUpAction = "ActionStandUp";

[DataField, AutoNetworkedField]
public EntityUid? StandUpActionEntity;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(StandingStateSystem))]
public sealed partial class StandingStateComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public SoundSpecifier DownSound { get; private set; } = new SoundCollectionSpecifier("BodyFall");

[DataField, AutoNetworkedField]
public bool Standing { get; set; } = true;

/// <summary>
/// List of fixtures that had their collision mask changed when the entity was downed.
/// Required for re-adding the collision mask.
/// </summary>
[DataField, AutoNetworkedField]
public List<string> ChangedFixtures = new();
}
}

public sealed partial class LieDownActionEvent : InstantActionEvent {}
public sealed partial class StandUpActionEvent : InstantActionEvent {}

46 changes: 1 addition & 45 deletions Content.Shared/Standing/StandingStateSystem.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using Content.Shared.Actions;
using Content.Shared.Hands.Components;
using Content.Shared.LieDown;
using Content.Shared.Movement.Systems;
using Content.Shared.Physics;
using Content.Shared.Rotation;
using Robust.Shared.Audio;
Expand All @@ -16,20 +13,10 @@ public sealed class StandingStateSystem : EntitySystem
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly SharedActionsSystem _actions = default!;
[Dependency] private readonly SharedLieDownSystem _lieDown = default!;
[Dependency] private readonly ActionContainerSystem _actionContainer = default!;

// If StandingCollisionLayer value is ever changed to more than one layer, the logic needs to be edited.
private const int StandingCollisionLayer = (int)CollisionGroup.MidImpassable;
private const int StandingCollisionLayer = (int) CollisionGroup.MidImpassable;

public override void Initialize()
{
SubscribeLocalEvent<StandingStateComponent, ComponentStartup>(OnComponentInit);
SubscribeLocalEvent<StandingStateComponent, LieDownActionEvent>(OnLieDownAction);
SubscribeLocalEvent<StandingStateComponent, StandUpActionEvent>(OnStandUpAction);
SubscribeLocalEvent<StandingStateComponent, MapInitEvent>(OnMapInit);
}
public bool IsDown(EntityUid uid, StandingStateComponent? standingState = null)
{
if (!Resolve(uid, ref standingState, false))
Expand All @@ -38,37 +25,6 @@ public bool IsDown(EntityUid uid, StandingStateComponent? standingState = null)
return !standingState.Standing;
}

private void OnMapInit(EntityUid uid, StandingStateComponent component, MapInitEvent args)
{
_actionContainer.EnsureAction(uid, ref component.LieDownActionEntity, component.LieDownAction);
_actionContainer.EnsureAction(uid, ref component.StandUpActionEntity, component.StandUpAction);
Dirty(uid, component);
}

/// <summary>
/// When component is added to player, add an action.
/// </summary>
private void OnComponentInit(EntityUid uid, StandingStateComponent component, ComponentStartup args)
{
_actions.AddAction(uid, ref component.LieDownActionEntity, component.LieDownAction);
}

/// <summary>
/// Event that being risen on lie down attempt.
/// </summary>
private void OnLieDownAction(EntityUid uid, StandingStateComponent component, LieDownActionEvent args)
{
_lieDown.TryLieDown(uid);
}

/// <summary>
/// Event that being risen on stand up attempt.
/// </summary>
private void OnStandUpAction(EntityUid uid, StandingStateComponent component, StandUpActionEvent args)
{
_lieDown.TryStandUp(uid);
}

public bool Down(EntityUid uid, bool playSound = true, bool dropHeldItems = true,
StandingStateComponent? standingState = null,
AppearanceComponent? appearance = null,
Expand Down
5 changes: 0 additions & 5 deletions Resources/Locale/en-US/actions/actions/lie-down.ftl

This file was deleted.

19 changes: 0 additions & 19 deletions Resources/Prototypes/Actions/liedown.yml

This file was deleted.

Binary file removed Resources/Textures/Interface/Actions/lie-down-state.png
Binary file not shown.
Binary file removed Resources/Textures/Interface/Actions/stand-up-state.png
Binary file not shown.
6 changes: 1 addition & 5 deletions Resources/keybinds.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: 1 # Not used right now, whatever.
version: 1 # Not used right now, whatever.
binds:
- function: UIClick
type: State
Expand Down Expand Up @@ -540,7 +540,3 @@ binds:
- function: Hotbar9
type: State
key: Num9
- function: LieDownStandUp
type: State
key: Z
mod1: Shift

0 comments on commit 52d479a

Please sign in to comment.