mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-16 21:17:39 +03:00
Clothing/item ECS & cleanup (#9706)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Content.Server.Clothing.Components;
|
||||
using Content.Server.Light.Components;
|
||||
using Content.Shared.Clothing.EntitySystems;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Item;
|
||||
using Content.Shared.Light.Component;
|
||||
@@ -14,6 +15,9 @@ namespace Content.Server.Light.EntitySystems
|
||||
[UsedImplicitly]
|
||||
public sealed class ExpendableLightSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedItemSystem _item = default!;
|
||||
[Dependency] private readonly ClothingSystem _clothing = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -59,9 +63,9 @@ namespace Content.Server.Light.EntitySystems
|
||||
UpdateSpriteAndSounds(component);
|
||||
UpdateVisualizer(component);
|
||||
|
||||
if (TryComp<SharedItemComponent>(component.Owner, out var item))
|
||||
if (TryComp<ItemComponent>(component.Owner, out var item))
|
||||
{
|
||||
item.EquippedPrefix = "unlit";
|
||||
_item.SetHeldPrefix(component.Owner, "unlit", item);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -76,9 +80,9 @@ namespace Content.Server.Light.EntitySystems
|
||||
{
|
||||
if (!component.Activated && component.CurrentState == ExpendableLightState.BrandNew)
|
||||
{
|
||||
if (TryComp<SharedItemComponent>(component.Owner, out var item))
|
||||
if (TryComp<ItemComponent>(component.Owner, out var item))
|
||||
{
|
||||
item.EquippedPrefix = "lit";
|
||||
_item.SetHeldPrefix(component.Owner, "lit", item);
|
||||
}
|
||||
|
||||
component.CurrentState = ExpendableLightState.Lit;
|
||||
@@ -154,15 +158,15 @@ namespace Content.Server.Light.EntitySystems
|
||||
|
||||
if (TryComp<ClothingComponent>(component.Owner, out var clothing))
|
||||
{
|
||||
clothing.EquippedPrefix = component.Activated ? "Activated" : string.Empty;
|
||||
_clothing.SetEquippedPrefix(component.Owner, component.Activated ? "Activated" : string.Empty, clothing);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnExpLightInit(EntityUid uid, ExpendableLightComponent component, ComponentInit args)
|
||||
{
|
||||
if (TryComp<SharedItemComponent?>(uid, out var item))
|
||||
if (TryComp<ItemComponent?>(uid, out var item))
|
||||
{
|
||||
item.EquippedPrefix = "unlit";
|
||||
_item.SetHeldPrefix(uid, "unlit", item);
|
||||
}
|
||||
|
||||
component.CurrentState = ExpendableLightState.BrandNew;
|
||||
|
||||
Reference in New Issue
Block a user