Content update for NetEntities (#18935)
This commit is contained in:
@@ -56,13 +56,13 @@ public sealed partial class BinComponent : Component
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class BinComponentState : ComponentState
|
||||
{
|
||||
public List<EntityUid> Items;
|
||||
public List<NetEntity> Items;
|
||||
|
||||
public EntityWhitelist? Whitelist;
|
||||
|
||||
public int MaxItems;
|
||||
|
||||
public BinComponentState(List<EntityUid> items, EntityWhitelist? whitelist, int maxItems)
|
||||
public BinComponentState(List<NetEntity> items, EntityWhitelist? whitelist, int maxItems)
|
||||
{
|
||||
Items = items;
|
||||
Whitelist = whitelist;
|
||||
|
||||
@@ -38,7 +38,7 @@ public sealed class BinSystem : EntitySystem
|
||||
|
||||
private void OnGetState(EntityUid uid, BinComponent component, ref ComponentGetState args)
|
||||
{
|
||||
args.State = new BinComponentState(component.Items, component.Whitelist, component.MaxItems);
|
||||
args.State = new BinComponentState(GetNetEntityList(component.Items), component.Whitelist, component.MaxItems);
|
||||
}
|
||||
|
||||
private void OnHandleState(EntityUid uid, BinComponent component, ref ComponentHandleState args)
|
||||
@@ -46,7 +46,7 @@ public sealed class BinSystem : EntitySystem
|
||||
if (args.Current is not BinComponentState state)
|
||||
return;
|
||||
|
||||
component.Items = new List<EntityUid>(state.Items);
|
||||
component.Items = EnsureEntityList<BinComponent>(state.Items, uid);
|
||||
component.Whitelist = state.Whitelist;
|
||||
component.MaxItems = state.MaxItems;
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public sealed class DumpableSystem : EntitySystem
|
||||
StartDoAfter(uid, args.Target, args.User, dumpable);
|
||||
},
|
||||
Text = Loc.GetString("dump-disposal-verb-name", ("unit", args.Target)),
|
||||
IconEntity = uid
|
||||
IconEntity = GetNetEntity(uid)
|
||||
};
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
@@ -95,7 +95,7 @@ public sealed class DumpableSystem : EntitySystem
|
||||
StartDoAfter(uid, args.Target, args.User, dumpable);
|
||||
},
|
||||
Text = Loc.GetString("dump-placeable-verb-name", ("surface", args.Target)),
|
||||
IconEntity = uid
|
||||
IconEntity = GetNetEntity(uid)
|
||||
};
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
@@ -108,7 +108,7 @@ public sealed class DumpableSystem : EntitySystem
|
||||
|
||||
float delay = storage.StoredEntities.Count * (float) dumpable.DelayPerItem.TotalSeconds * dumpable.Multiplier;
|
||||
|
||||
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(userUid, delay, new DumpableDoAfterEvent(), storageUid, target: targetUid, used: storageUid)
|
||||
_doAfterSystem.TryStartDoAfter(new DoAfterArgs(EntityManager, userUid, delay, new DumpableDoAfterEvent(), storageUid, target: targetUid, used: storageUid)
|
||||
{
|
||||
BreakOnTargetMove = true,
|
||||
BreakOnUserMove = true,
|
||||
|
||||
@@ -7,13 +7,13 @@ namespace Content.Shared.Storage;
|
||||
public sealed partial class AreaPickupDoAfterEvent : DoAfterEvent
|
||||
{
|
||||
[DataField("entities", required: true)]
|
||||
public IReadOnlyList<EntityUid> Entities = default!;
|
||||
public IReadOnlyList<NetEntity> Entities = default!;
|
||||
|
||||
private AreaPickupDoAfterEvent()
|
||||
{
|
||||
}
|
||||
|
||||
public AreaPickupDoAfterEvent(List<EntityUid> entities)
|
||||
public AreaPickupDoAfterEvent(List<NetEntity> entities)
|
||||
{
|
||||
Entities = entities;
|
||||
}
|
||||
|
||||
@@ -10,11 +10,11 @@ namespace Content.Shared.Storage
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class StorageBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public readonly List<EntityUid> StoredEntities;
|
||||
public readonly List<NetEntity> StoredEntities;
|
||||
public readonly int StorageSizeUsed;
|
||||
public readonly int StorageCapacityMax;
|
||||
|
||||
public StorageBoundUserInterfaceState(List<EntityUid> storedEntities, int storageSizeUsed, int storageCapacityMax)
|
||||
public StorageBoundUserInterfaceState(List<NetEntity> storedEntities, int storageSizeUsed, int storageCapacityMax)
|
||||
{
|
||||
StoredEntities = storedEntities;
|
||||
StorageSizeUsed = storageSizeUsed;
|
||||
@@ -30,8 +30,8 @@ namespace Content.Shared.Storage
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class StorageInteractWithItemEvent : BoundUserInterfaceMessage
|
||||
{
|
||||
public readonly EntityUid InteractedItemUID;
|
||||
public StorageInteractWithItemEvent(EntityUid interactedItemUID)
|
||||
public readonly NetEntity InteractedItemUID;
|
||||
public StorageInteractWithItemEvent(NetEntity interactedItemUID)
|
||||
{
|
||||
InteractedItemUID = interactedItemUID;
|
||||
}
|
||||
@@ -59,12 +59,12 @@ namespace Content.Shared.Storage
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class AnimateInsertingEntitiesEvent : EntityEventArgs
|
||||
{
|
||||
public readonly EntityUid Storage;
|
||||
public readonly List<EntityUid> StoredEntities;
|
||||
public readonly List<EntityCoordinates> EntityPositions;
|
||||
public readonly NetEntity Storage;
|
||||
public readonly List<NetEntity> StoredEntities;
|
||||
public readonly List<NetCoordinates> EntityPositions;
|
||||
public readonly List<Angle> EntityAngles;
|
||||
|
||||
public AnimateInsertingEntitiesEvent(EntityUid storage, List<EntityUid> storedEntities, List<EntityCoordinates> entityPositions, List<Angle> entityAngles)
|
||||
public AnimateInsertingEntitiesEvent(NetEntity storage, List<NetEntity> storedEntities, List<NetCoordinates> entityPositions, List<Angle> entityAngles)
|
||||
{
|
||||
Storage = storage;
|
||||
StoredEntities = storedEntities;
|
||||
|
||||
Reference in New Issue
Block a user