Remove IContainer and move functions to the container system. (#19834)
This commit is contained in:
@@ -72,7 +72,7 @@ namespace Content.Client.Actions
|
||||
_actionHoldersQueue.Enqueue(uid);
|
||||
}
|
||||
|
||||
protected override void AddActionInternal(EntityUid holderId, EntityUid actionId, IContainer container, ActionsComponent holder)
|
||||
protected override void AddActionInternal(EntityUid holderId, EntityUid actionId, BaseContainer container, ActionsComponent holder)
|
||||
{
|
||||
// Sometimes the client receives actions from the server, before predicting that newly added components will add
|
||||
// their own shared actions. Just in case those systems ever decided to directly access action properties (e.g.,
|
||||
@@ -87,7 +87,7 @@ namespace Content.Client.Actions
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddAction(EntityUid holderId, EntityUid actionId, EntityUid? provider, ActionsComponent? holder = null, BaseActionComponent? action = null, bool dirty = true, IContainer? actionContainer = null)
|
||||
public override void AddAction(EntityUid holderId, EntityUid actionId, EntityUid? provider, ActionsComponent? holder = null, BaseActionComponent? action = null, bool dirty = true, BaseContainer? actionContainer = null)
|
||||
{
|
||||
if (!Resolve(holderId, ref holder, false))
|
||||
return;
|
||||
|
||||
@@ -27,6 +27,7 @@ public sealed class InventoryUIController : UIController, IOnStateEntered<Gamepl
|
||||
|
||||
[UISystemDependency] private readonly ClientInventorySystem _inventorySystem = default!;
|
||||
[UISystemDependency] private readonly HandsSystem _handsSystem = default!;
|
||||
[UISystemDependency] private readonly ContainerSystem _container = default!;
|
||||
|
||||
private EntityUid? _playerUid;
|
||||
private InventorySlotsComponent? _playerInventory;
|
||||
@@ -281,7 +282,7 @@ public sealed class InventoryUIController : UIController, IOnStateEntered<Gamepl
|
||||
var hoverEntity = _entities.SpawnEntity("hoverentity", MapCoordinates.Nullspace);
|
||||
var hoverSprite = _entities.GetComponent<SpriteComponent>(hoverEntity);
|
||||
var fits = _inventorySystem.CanEquip(player.Value, held, control.SlotName, out _, slotDef) &&
|
||||
container.CanInsert(held, _entities);
|
||||
_container.CanInsert(held, container);
|
||||
|
||||
hoverSprite.CopyFrom(sprite);
|
||||
hoverSprite.Color = fits ? new Color(0, 255, 0, 127) : new Color(255, 0, 0, 127);
|
||||
|
||||
Reference in New Issue
Block a user