Remove server/client clothing components. (#11981)

This commit is contained in:
Leon Friedrich
2022-10-23 11:30:37 +13:00
committed by GitHub
parent 4a3df4f85a
commit 7d276d1101
29 changed files with 110 additions and 131 deletions

View File

@@ -4,11 +4,11 @@ using System.Linq;
using Content.Client.Inventory;
using Content.Shared.Clothing;
using Content.Shared.Clothing.Components;
using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Humanoid;
using Content.Shared.Inventory;
using Content.Shared.Inventory.Events;
using Content.Shared.Item;
using Content.Shared.Tag;
using Robust.Client.GameObjects;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
@@ -17,7 +17,7 @@ using static Robust.Shared.GameObjects.SharedSpriteComponent;
namespace Content.Client.Clothing;
public sealed class ClothingVisualsSystem : EntitySystem
public sealed class ClientClothingSystem : ClothingSystem
{
/// <summary>
/// This is a shitty hotfix written by me (Paul) to save me from renaming all files.
@@ -44,15 +44,11 @@ public sealed class ClothingVisualsSystem : EntitySystem
[Dependency] private IResourceCache _cache = default!;
[Dependency] private InventorySystem _inventorySystem = default!;
[Dependency] private TagSystem _tagSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ClothingComponent, GotEquippedEvent>(OnGotEquipped);
SubscribeLocalEvent<ClothingComponent, GotUnequippedEvent>(OnGotUnequipped);
SubscribeLocalEvent<ClothingComponent, GetEquipmentVisualsEvent>(OnGetVisuals);
SubscribeLocalEvent<ClientInventoryComponent, VisualsChangedEvent>(OnVisualsChanged);
@@ -148,11 +144,6 @@ public sealed class ClothingVisualsSystem : EntitySystem
RenderEquipment(uid, args.Item, clothing.InSlot, component, null, clothing);
}
private void OnGotUnequipped(EntityUid uid, ClothingComponent component, GotUnequippedEvent args)
{
component.InSlot = null;
}
private void OnDidUnequip(EntityUid uid, SpriteComponent component, DidUnequipEvent args)
{
if (!TryComp(uid, out ClientInventoryComponent? inventory) || !TryComp(uid, out SpriteComponent? sprite))
@@ -184,9 +175,9 @@ public sealed class ClothingVisualsSystem : EntitySystem
}
}
private void OnGotEquipped(EntityUid uid, ClothingComponent component, GotEquippedEvent args)
protected override void OnGotEquipped(EntityUid uid, ClothingComponent component, GotEquippedEvent args)
{
component.InSlot = args.Slot;
base.OnGotEquipped(uid, component, args);
RenderEquipment(args.Equipee, uid, args.Slot, clothingComponent: component);
}

View File

@@ -1,12 +0,0 @@
using Content.Shared.Clothing.Components;
using Robust.Shared.GameStates;
namespace Content.Client.Clothing
{
[RegisterComponent]
[ComponentReference(typeof(SharedClothingComponent))]
public sealed class ClothingComponent : SharedClothingComponent
{
public string? InSlot;
}
}

View File

@@ -3,6 +3,7 @@ using Content.Client.Examine;
using Content.Client.Storage;
using Content.Client.UserInterface.Controls;
using Content.Client.Verbs;
using Content.Shared.Clothing.Components;
using Content.Shared.Hands.Components;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
@@ -23,7 +24,7 @@ namespace Content.Client.Inventory
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly ClothingVisualsSystem _clothingVisualsSystem = default!;
[Dependency] private readonly ClientClothingSystem _clothingVisualsSystem = default!;
[Dependency] private readonly ExamineSystem _examine = default!;
[Dependency] private readonly VerbSystem _verbs = default!;

View File

@@ -1,11 +1,8 @@
using Content.Client.Clothing;
using Content.Shared.Clothing.Components;
using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
using Content.Shared.Weapons.Ranged.Systems;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Physics.Components;
using Robust.Shared.Timing;

View File

@@ -18,7 +18,7 @@ public sealed class ToggleableLightVisualsSystem : VisualizerSystem<ToggleableLi
{
base.Initialize();
SubscribeLocalEvent<ToggleableLightVisualsComponent, GetInhandVisualsEvent>(OnGetHeldVisuals, after: new[] { typeof(ItemSystem) });
SubscribeLocalEvent<ToggleableLightVisualsComponent, GetEquipmentVisualsEvent>(OnGetEquipmentVisuals, after: new[] { typeof(ClothingVisualsSystem) });
SubscribeLocalEvent<ToggleableLightVisualsComponent, GetEquipmentVisualsEvent>(OnGetEquipmentVisuals, after: new[] { typeof(ClientClothingSystem) });
}
protected override void OnAppearanceChange(EntityUid uid, ToggleableLightVisualsComponent component, ref AppearanceChangeEvent args)

View File

@@ -1,14 +1,13 @@
using System.Threading.Tasks;
using Content.Server.Clothing.Components;
using Content.Server.Inventory;
using Content.Shared.Clothing.Components;
using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Inventory;
using Content.Shared.Item;
using NUnit.Framework;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using System.Threading.Tasks;
namespace Content.IntegrationTests.Tests
{

View File

@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using System.Threading;
using Content.Server.Administration.Commands;
using Content.Server.Administration.Components;
@@ -28,6 +28,7 @@ using Content.Server.Tools.Systems;
using Content.Shared.Administration;
using Content.Shared.Body.Components;
using Content.Shared.Body.Part;
using Content.Shared.Clothing.Components;
using Content.Shared.Damage;
using Content.Shared.Database;
using Content.Shared.Disease;

View File

@@ -1,24 +1,22 @@
using Content.Server.Humanoid;
using Content.Shared.Clothing.Components;
using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Humanoid;
using Content.Shared.Inventory.Events;
using Content.Shared.Tag;
namespace Content.Server.Clothing;
public sealed class ServerClothingSystem : EntitySystem
public sealed class ServerClothingSystem : ClothingSystem
{
[Dependency] private readonly HumanoidSystem _humanoidSystem = default!;
[Dependency] private readonly TagSystem _tagSystem = default!;
public override void Initialize()
protected override void OnGotEquipped(EntityUid uid, ClothingComponent component, GotEquippedEvent args)
{
SubscribeLocalEvent<SharedClothingComponent, GotEquippedEvent>(OnGotEquipped);
SubscribeLocalEvent<SharedClothingComponent, GotUnequippedEvent>(OnGotUnequipped);
}
base.OnGotEquipped(uid, component, args);
// why the fuck is humanoid visuals server-only???
private void OnGotEquipped(EntityUid uid, SharedClothingComponent component, GotEquippedEvent args)
{
if (args.Slot == "head"
&& _tagSystem.HasTag(args.Equipment, "HidesHair"))
{
@@ -27,8 +25,12 @@ public sealed class ServerClothingSystem : EntitySystem
}
}
private void OnGotUnequipped(EntityUid uid, SharedClothingComponent component, GotUnequippedEvent args)
protected override void OnGotUnequipped(EntityUid uid, ClothingComponent component, GotUnequippedEvent args)
{
base.OnGotUnequipped(uid, component, args);
// why the fuck is humanoid visuals server-only???
if (args.Slot == "head"
&& _tagSystem.HasTag(args.Equipment, "HidesHair"))
{

View File

@@ -1,13 +0,0 @@
using Content.Shared.Clothing.Components;
using Content.Shared.Item;
using Robust.Shared.GameStates;
namespace Content.Server.Clothing.Components
{
// Needed for client-side clothing component.
[RegisterComponent]
[ComponentReference(typeof(SharedClothingComponent))]
public sealed class ClothingComponent : SharedClothingComponent
{
}
}

View File

@@ -1,8 +1,3 @@
using Content.Shared.Actions;
using Content.Shared.Toggleable;
using Content.Shared.Inventory;
using Content.Shared.Inventory.Events;
using Content.Shared.Item;
using Content.Server.Actions;
using Content.Server.Atmos.Components;
using Content.Server.Atmos.EntitySystems;
@@ -14,8 +9,12 @@ using Content.Server.IdentityManagement;
using Content.Server.Nutrition.EntitySystems;
using Content.Server.Popups;
using Content.Server.VoiceMask;
using Content.Shared.Actions;
using Content.Shared.Clothing.Components;
using Content.Shared.Clothing.EntitySystems;
using Content.Shared.IdentityManagement.Components;
using Content.Shared.Inventory;
using Content.Shared.Inventory.Events;
using Robust.Shared.Player;
namespace Content.Server.Clothing

View File

@@ -1,27 +1,27 @@
using System.Threading;
using Content.Shared.Disease;
using Content.Shared.Disease.Components;
using Content.Server.Disease.Components;
using Content.Server.Clothing.Components;
using Content.Server.Body.Systems;
using Content.Server.Chat.Systems;
using Content.Shared.MobState.Components;
using Content.Shared.Examine;
using Content.Shared.Inventory;
using Content.Shared.Interaction;
using Content.Server.Popups;
using Content.Server.Disease.Components;
using Content.Server.DoAfter;
using Content.Server.MobState;
using Content.Server.Nutrition.EntitySystems;
using Content.Server.Popups;
using Content.Shared.Clothing.Components;
using Content.Shared.Disease;
using Content.Shared.Disease.Components;
using Content.Shared.Examine;
using Content.Shared.IdentityManagement;
using Content.Shared.Interaction;
using Content.Shared.Inventory;
using Content.Shared.Inventory.Events;
using Content.Shared.Item;
using Content.Shared.MobState.Components;
using Content.Shared.Rejuvenate;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager;
using Content.Shared.Inventory.Events;
using Content.Server.Nutrition.EntitySystems;
using Robust.Shared.Utility;
using Content.Shared.IdentityManagement;
using Content.Shared.Item;
using Content.Server.MobState;
using Content.Shared.Rejuvenate;
using System.Threading;
namespace Content.Server.Disease
{

View File

@@ -50,7 +50,7 @@ namespace Content.Server.Eye.Blinding.EyeProtection
private void OnEquipped(EntityUid uid, EyeProtectionComponent component, GotEquippedEvent args)
{
if (!TryComp<SharedClothingComponent>(uid, out var clothing) || clothing.Slots == SlotFlags.PREVENTEQUIP)
if (!TryComp<ClothingComponent>(uid, out var clothing) || clothing.Slots == SlotFlags.PREVENTEQUIP)
return;
if (!clothing.Slots.HasFlag(args.SlotFlags))

View File

@@ -1,15 +1,11 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
using Content.Server.Administration.Logs;
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Clothing.Components;
using Content.Server.DoAfter;
using Content.Server.Fluids.Components;
using Content.Server.Nutrition.Components;
using Content.Server.Nutrition.EntitySystems;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Clothing.Components;
using Content.Shared.Database;
using Content.Shared.FixedPoint;
using Content.Shared.Inventory.Events;
@@ -18,6 +14,9 @@ using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Threading;
namespace Content.Server.Fluids.EntitySystems;

View File

@@ -1,7 +1,7 @@
using Content.Server.Clothing.Components;
using Content.Server.Storage.Components;
using Content.Server.Storage.EntitySystems;
using Content.Server.Temperature.Systems;
using Content.Shared.Clothing.Components;
using Content.Shared.Interaction.Events;
using Content.Shared.Inventory;
using Content.Shared.Inventory.Events;

View File

@@ -1,5 +1,5 @@
using Content.Server.Clothing.Components;
using Content.Server.Light.Components;
using Content.Shared.Clothing.Components;
using Content.Shared.Clothing.EntitySystems;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;

View File

@@ -1,17 +1,16 @@
using System.Threading;
using Content.Shared.Verbs;
using Content.Shared.Inventory.Events;
using Content.Shared.MobState.Components;
using Content.Shared.FixedPoint;
using Content.Shared.Damage;
using Content.Shared.Actions;
using Content.Server.Clothing.Components;
using Content.Server.Medical.Components;
using Content.Server.Popups;
using Content.Server.Body.Components;
using Content.Server.DoAfter;
using Content.Server.Medical.Components;
using Content.Server.Popups;
using Content.Shared.Actions;
using Content.Shared.Clothing.Components;
using Content.Shared.Damage;
using Content.Shared.FixedPoint;
using Content.Shared.Inventory.Events;
using Content.Shared.MobState.Components;
using Content.Shared.Verbs;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using System.Threading;
namespace Content.Server.Medical
{

View File

@@ -1,12 +1,11 @@
using System.Linq;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Server.Chemistry.EntitySystems;
using Content.Server.Clothing.Components;
using Content.Server.Nutrition.Components;
using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.Clothing.Components;
using Content.Shared.Clothing.EntitySystems;
using Content.Shared.FixedPoint;
using Content.Shared.Inventory;
@@ -15,6 +14,7 @@ using Content.Shared.Smoking;
using Content.Shared.Temperature;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
using System.Linq;
namespace Content.Server.Nutrition.EntitySystems
{

View File

@@ -1,5 +1,5 @@
using Content.Server.Clothing.Components;
using Content.Server.Speech.Components;
using Content.Shared.Clothing.Components;
using Content.Shared.Inventory.Events;
namespace Content.Server.Speech.EntitySystems;

View File

@@ -10,8 +10,9 @@ namespace Content.Shared.Clothing.Components;
/// This handles entities which can be equipped.
/// </summary>
[NetworkedComponent]
[RegisterComponent]
[Access(typeof(ClothingSystem), typeof(InventorySystem))]
public abstract class SharedClothingComponent : Component
public sealed class ClothingComponent : Component
{
[DataField("clothingVisuals")]
[Access(typeof(ClothingSystem), typeof(InventorySystem), Other = AccessPermissions.ReadExecute)] // TODO remove execute permissions.
@@ -46,6 +47,8 @@ public abstract class SharedClothingComponent : Component
[ViewVariables(VVAccess.ReadWrite)]
[DataField("femaleMask")]
public FemaleClothingMask FemaleMask = FemaleClothingMask.UniformFull;
public string? InSlot;
}
[Serializable, NetSerializable]

View File

@@ -1,11 +1,12 @@
using Content.Shared.Clothing.Components;
using Content.Shared.Inventory;
using Content.Shared.Inventory.Events;
using Content.Shared.Item;
using Robust.Shared.GameStates;
namespace Content.Shared.Clothing.EntitySystems;
public sealed class ClothingSystem : EntitySystem
public abstract class ClothingSystem : EntitySystem
{
[Dependency] private readonly SharedItemSystem _itemSys = default!;
@@ -13,16 +14,28 @@ public sealed class ClothingSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<SharedClothingComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<SharedClothingComponent, ComponentHandleState>(OnHandleState);
SubscribeLocalEvent<ClothingComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<ClothingComponent, ComponentHandleState>(OnHandleState);
SubscribeLocalEvent<ClothingComponent, GotEquippedEvent>(OnGotEquipped);
SubscribeLocalEvent<ClothingComponent, GotUnequippedEvent>(OnGotUnequipped);
}
private void OnGetState(EntityUid uid, SharedClothingComponent component, ref ComponentGetState args)
protected virtual void OnGotEquipped(EntityUid uid, ClothingComponent component, GotEquippedEvent args)
{
component.InSlot = args.Slot;
}
protected virtual void OnGotUnequipped(EntityUid uid, ClothingComponent component, GotUnequippedEvent args)
{
component.InSlot = null;
}
private void OnGetState(EntityUid uid, ClothingComponent component, ref ComponentGetState args)
{
args.State = new ClothingComponentState(component.EquippedPrefix);
}
private void OnHandleState(EntityUid uid, SharedClothingComponent component, ref ComponentHandleState args)
private void OnHandleState(EntityUid uid, ClothingComponent component, ref ComponentHandleState args)
{
if (args.Current is ClothingComponentState state)
SetEquippedPrefix(uid, state.EquippedPrefix, component);
@@ -30,7 +43,7 @@ public sealed class ClothingSystem : EntitySystem
#region Public API
public void SetEquippedPrefix(EntityUid uid, string? prefix, SharedClothingComponent? clothing = null)
public void SetEquippedPrefix(EntityUid uid, string? prefix, ClothingComponent? clothing = null)
{
if (!Resolve(uid, ref clothing, false))
return;
@@ -43,7 +56,7 @@ public sealed class ClothingSystem : EntitySystem
Dirty(clothing);
}
public void SetSlots(EntityUid uid, SlotFlags slots, SharedClothingComponent? clothing = null)
public void SetSlots(EntityUid uid, SlotFlags slots, ClothingComponent? clothing = null)
{
if (!Resolve(uid, ref clothing))
return;
@@ -55,7 +68,7 @@ public sealed class ClothingSystem : EntitySystem
/// <summary>
/// Copy all clothing specific visuals from another item.
/// </summary>
public void CopyVisuals(EntityUid uid, SharedClothingComponent otherClothing, SharedClothingComponent? clothing = null)
public void CopyVisuals(EntityUid uid, ClothingComponent otherClothing, ClothingComponent? clothing = null)
{
if (!Resolve(uid, ref clothing))
return;

View File

@@ -39,8 +39,8 @@ public abstract class SharedChameleonClothingSystem : EntitySystem
}
// clothing sprite logic
if (TryComp(uid, out SharedClothingComponent? clothing) &&
proto.TryGetComponent("Clothing", out SharedClothingComponent? otherClothing))
if (TryComp(uid, out ClothingComponent? clothing) &&
proto.TryGetComponent("Clothing", out ClothingComponent? otherClothing))
{
_clothingSystem.CopyVisuals(uid, otherClothing, clothing);
}
@@ -62,7 +62,7 @@ public abstract class SharedChameleonClothingSystem : EntitySystem
return false;
// check if it's valid clothing
if (!proto.TryGetComponent("Clothing", out SharedClothingComponent? clothing))
if (!proto.TryGetComponent("Clothing", out ClothingComponent? clothing))
return false;
if (!clothing.Slots.HasFlag(chameleonSlot))
return false;

View File

@@ -27,7 +27,7 @@ namespace Content.Shared.Eye.Blinding
private void OnEquipped(EntityUid uid, BlindfoldComponent component, GotEquippedEvent args)
{
if (!TryComp<SharedClothingComponent>(uid, out var clothing) || clothing.Slots == SlotFlags.PREVENTEQUIP) // we live in a society
if (!TryComp<ClothingComponent>(uid, out var clothing) || clothing.Slots == SlotFlags.PREVENTEQUIP) // we live in a society
return;
// Is the clothing in its actual slot?
if (!clothing.Slots.HasFlag(args.SlotFlags))
@@ -51,7 +51,7 @@ namespace Content.Shared.Eye.Blinding
private void OnGlassesEquipped(EntityUid uid, VisionCorrectionComponent component, GotEquippedEvent args)
{
if (!TryComp<SharedClothingComponent>(uid, out var clothing) || clothing.Slots == SlotFlags.PREVENTEQUIP) // we live in a society
if (!TryComp<ClothingComponent>(uid, out var clothing) || clothing.Slots == SlotFlags.PREVENTEQUIP) // we live in a society
return;
// Is the clothing in its actual slot?
if (!clothing.Slots.HasFlag(args.SlotFlags))

View File

@@ -38,7 +38,7 @@ public abstract partial class InventorySystem
SubscribeAllEvent<UseSlotNetworkMessage>(OnUseSlot);
}
protected void QuickEquip(EntityUid uid, SharedClothingComponent component, UseInHandEvent args)
protected void QuickEquip(EntityUid uid, ClothingComponent component, UseInHandEvent args)
{
if (!TryComp(args.User, out InventoryComponent? inv)
|| !TryComp(args.User, out SharedHandsComponent? hands)
@@ -53,7 +53,7 @@ public abstract partial class InventorySystem
if (TryGetSlotEntity(args.User, slotDef.Name, out var slotEntity, inv))
{
// Item in slot has to be quick equipable as well
if (TryComp(slotEntity, out SharedClothingComponent? item) && !item.QuickEquip)
if (TryComp(slotEntity, out ClothingComponent? item) && !item.QuickEquip)
continue;
if (!TryUnequip(args.User, slotDef.Name, true, inventory: inv))
@@ -157,11 +157,11 @@ public abstract partial class InventorySystem
}
public bool TryEquip(EntityUid uid, EntityUid itemUid, string slot, bool silent = false, bool force = false, bool predicted = false,
InventoryComponent? inventory = null, SharedClothingComponent? clothing = null) =>
InventoryComponent? inventory = null, ClothingComponent? clothing = null) =>
TryEquip(uid, uid, itemUid, slot, silent, force, predicted, inventory, clothing);
public bool TryEquip(EntityUid actor, EntityUid target, EntityUid itemUid, string slot, bool silent = false, bool force = false, bool predicted = false,
InventoryComponent? inventory = null, SharedClothingComponent? clothing = null)
InventoryComponent? inventory = null, ClothingComponent? clothing = null)
{
if (!Resolve(target, ref inventory, false))
{
@@ -250,11 +250,11 @@ public abstract partial class InventorySystem
public bool CanEquip(EntityUid uid, EntityUid itemUid, string slot, [NotNullWhen(false)] out string? reason,
SlotDefinition? slotDefinition = null, InventoryComponent? inventory = null,
SharedClothingComponent? clothing = null, ItemComponent? item = null) =>
ClothingComponent? clothing = null, ItemComponent? item = null) =>
CanEquip(uid, uid, itemUid, slot, out reason, slotDefinition, inventory, clothing, item);
public bool CanEquip(EntityUid actor, EntityUid target, EntityUid itemUid, string slot, [NotNullWhen(false)] out string? reason, SlotDefinition? slotDefinition = null,
InventoryComponent? inventory = null, SharedClothingComponent? clothing = null, ItemComponent? item = null)
InventoryComponent? inventory = null, ClothingComponent? clothing = null, ItemComponent? item = null)
{
reason = "inventory-component-can-equip-cannot";
if (!Resolve(target, ref inventory, false))
@@ -326,17 +326,17 @@ public abstract partial class InventorySystem
}
public bool TryUnequip(EntityUid uid, string slot, bool silent = false, bool force = false, bool predicted = false,
InventoryComponent? inventory = null, SharedClothingComponent? clothing = null) => TryUnequip(uid, uid, slot, silent, force, predicted, inventory, clothing);
InventoryComponent? inventory = null, ClothingComponent? clothing = null) => TryUnequip(uid, uid, slot, silent, force, predicted, inventory, clothing);
public bool TryUnequip(EntityUid actor, EntityUid target, string slot, bool silent = false,
bool force = false, bool predicted = false, InventoryComponent? inventory = null, SharedClothingComponent? clothing = null) =>
bool force = false, bool predicted = false, InventoryComponent? inventory = null, ClothingComponent? clothing = null) =>
TryUnequip(actor, target, slot, out _, silent, force, predicted, inventory, clothing);
public bool TryUnequip(EntityUid uid, string slot, [NotNullWhen(true)] out EntityUid? removedItem, bool silent = false, bool force = false, bool predicted = false,
InventoryComponent? inventory = null, SharedClothingComponent? clothing = null) => TryUnequip(uid, uid, slot, out removedItem, silent, force, predicted, inventory, clothing);
InventoryComponent? inventory = null, ClothingComponent? clothing = null) => TryUnequip(uid, uid, slot, out removedItem, silent, force, predicted, inventory, clothing);
public bool TryUnequip(EntityUid actor, EntityUid target, string slot, [NotNullWhen(true)] out EntityUid? removedItem, bool silent = false,
bool force = false, bool predicted = false, InventoryComponent? inventory = null, SharedClothingComponent? clothing = null)
bool force = false, bool predicted = false, InventoryComponent? inventory = null, ClothingComponent? clothing = null)
{
removedItem = null;
if (!Resolve(target, ref inventory, false))

View File

@@ -8,9 +8,10 @@
sprite: Clothing/OuterClothing/WinterCoats/coat.rsi
- type: Clothing
sprite: Clothing/OuterClothing/WinterCoats/coat.rsi
size: 10
- type: TemperatureProtection
coefficient: 0.1
- type: Item
size: 10
- type: Armor
modifiers:
coefficients:

View File

@@ -156,9 +156,9 @@
state: bearpelt
- type: Item
sprite: Clothing/Head/Misc/hides.rsi
heldPrefix: bear
- type: Clothing
sprite: Clothing/Head/Misc/hides.rsi
heldPrefix: bear
slots:
- HEAD

View File

@@ -45,8 +45,7 @@
type: GasTankBoundUserInterface
- type: Clothing
sprite: Objects/Tanks/Jetpacks/blue.rsi
QuickEquip: false
size: 100
quickEquip: false
slots:
- Back
- type: GasTank

View File

@@ -308,11 +308,12 @@
- state: mag-unshaded-0
map: ["enum.GunVisualLayers.MagUnshaded"]
shader: unshaded
- type: Item
heldPrefix: taser4
- type: Clothing
quickEquip: false
slots:
- Belt
heldPrefix: taser4
- type: Gun
soundGunshot:
path: /Audio/Weapons/Guns/Gunshots/taser.ogg

View File

@@ -74,7 +74,7 @@
- type: Sprite
sprite: Objects/Weapons/Guns/Snipers/musket.rsi
- type: Clothing
icon: Objects/Weapons/Guns/Snipers/musket.rsi
sprite: Objects/Weapons/Guns/Snipers/musket.rsi
- type: Gun
selectedMode: SemiAuto
availableModes:
@@ -95,7 +95,7 @@
- type: Sprite
sprite: Objects/Weapons/Guns/Snipers/flintlock.rsi
- type: Clothing
icon: Objects/Weapons/Guns/Snipers/flintlock.rsi
sprite: Objects/Weapons/Guns/Snipers/flintlock.rsi
- type: BallisticAmmoProvider
whitelist:
tags:

View File

@@ -30,7 +30,6 @@
size: 20
- type: Clothing
sprite: Objects/Weapons/Melee/stunbaton.rsi
heldPrefix: off
quickEquip: false
slots:
- Belt