Merge pull request #184 from frosty-dev/FoldedClothingHonkSpecialEdition
Очень важный момент для курток
This commit is contained in:
@@ -4,6 +4,7 @@ using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Reflection;
|
||||
using Content.Shared.Foldable;
|
||||
|
||||
namespace Content.Client._Amour.Hole;
|
||||
|
||||
@@ -17,6 +18,18 @@ public sealed class HoleSystem : SharedHoleSystem
|
||||
SubscribeLocalEvent<HoleContainerComponent, EntRemovedFromContainerMessage>(OnRemoved);
|
||||
|
||||
SubscribeLocalEvent<HoleComponent, ComponentHandleState>(OnHandleState);
|
||||
|
||||
SubscribeLocalEvent<HoleBlockerComponent, FoldedEvent>(OnFolded);
|
||||
}
|
||||
|
||||
private void OnFolded(Entity<HoleBlockerComponent> ent, ref FoldedEvent args)
|
||||
{
|
||||
if (ent.Comp.Equipee == NetEntity.Invalid)
|
||||
return;
|
||||
var equipee = GetEntity(ent.Comp.Equipee);
|
||||
if (!HasComp<HoleContainerComponent>(equipee))
|
||||
return;
|
||||
UpdateVisuals(equipee);
|
||||
}
|
||||
|
||||
private void OnHandleState(EntityUid uid, HoleComponent component, ref ComponentHandleState args)
|
||||
|
||||
10
Content.Shared/_Amour/Hole/HoleBlockerComponent.cs
Normal file
10
Content.Shared/_Amour/Hole/HoleBlockerComponent.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using Robust.Shared.GameStates;
|
||||
|
||||
namespace Content.Shared._Amour.Hole;
|
||||
|
||||
[RegisterComponent, AutoGenerateComponentState, NetworkedComponent]
|
||||
public sealed partial class HoleBlockerComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadOnly), AutoNetworkedField]
|
||||
public NetEntity Equipee = NetEntity.Invalid;
|
||||
}
|
||||
23
Content.Shared/_Amour/Hole/HoleBlockerSystem.cs
Normal file
23
Content.Shared/_Amour/Hole/HoleBlockerSystem.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using Content.Shared.Inventory.Events;
|
||||
|
||||
namespace Content.Shared._Amour.Hole;
|
||||
|
||||
public sealed class HoleBlockerSystem : EntitySystem
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<HoleBlockerComponent, GotEquippedEvent>(OnHoleBlockerEquipped);
|
||||
SubscribeLocalEvent<HoleBlockerComponent, GotUnequippedEvent>(OnHoleBlockerUnequipped);
|
||||
}
|
||||
|
||||
private void OnHoleBlockerEquipped(Entity<HoleBlockerComponent> ent, ref GotEquippedEvent args)
|
||||
{
|
||||
ent.Comp.Equipee = GetNetEntity(args.Equipee);
|
||||
}
|
||||
|
||||
private void OnHoleBlockerUnequipped(Entity<HoleBlockerComponent> ent, ref GotUnequippedEvent args)
|
||||
{
|
||||
ent.Comp.Equipee = NetEntity.Invalid;
|
||||
}
|
||||
}
|
||||
@@ -29,6 +29,7 @@ public sealed partial class HoleComponent : Component
|
||||
[ViewVariables(VVAccess.ReadWrite)] public bool IsExcited = false;
|
||||
[DataField] public bool IsMainHole = false;
|
||||
[DataField] public bool IsVisibleInSkirt = true;
|
||||
[DataField] public bool IsVisibleInFoldedJumpsuit = false;
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable, DataDefinition]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Foldable;
|
||||
|
||||
namespace Content.Shared._Amour.Hole;
|
||||
|
||||
@@ -22,9 +23,14 @@ public partial class SharedHoleSystem
|
||||
|
||||
foreach (var slot in hole.Comp.HoleNotVisibleIn)
|
||||
{
|
||||
if (slot == "jumpsuit" && _inventory.TryGetSlotEntity(entity, "jumpsuit", out var jumpsuit, entity) && TryComp<FoldableComponent>(jumpsuit, out var foldedItem) && foldedItem.IsFolded && hole.Comp.IsVisibleInFoldedJumpsuit)
|
||||
continue;
|
||||
|
||||
if (_inventory.TryGetSlotEntity(entity, slot, out var item, entity) && !(HasComp<VisibleHoleComponent>(item) && hole.Comp.IsVisibleInSkirt))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -95,4 +95,5 @@
|
||||
- state: icon_folded
|
||||
map: ["foldedLayer"]
|
||||
visible: false
|
||||
- type: HoleBlocker # AMOUR EDIT
|
||||
# WD End
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
prefix: "_0_FRONT"
|
||||
excitedPrefix: "_1_FRONT"
|
||||
isVisibleInSkirt: false
|
||||
isVisibleInFoldedJumpsuit: true
|
||||
- type: HoleSolution
|
||||
- type: HoleInventory
|
||||
|
||||
|
||||
Reference in New Issue
Block a user