public InventoryViewer(InventoryComponent assignedCompo, IUserInterfaceManager userInterfaceManager, IResourceManager resourceManager) { _userInterfaceManager = userInterfaceManager; _resourceManager = resourceManager; _inventoryContainer = new ScrollableContainer(assignedCompo.Owner.Uid + "InvViewer", new Vector2i(270, 125), _resourceManager); _inventoryComponent = assignedCompo; _inventoryComponent.Changed += ComponentChanged; RebuildInventoryView(_inventoryComponent.MaxSlots, _inventoryComponent.ContainedEntities); }
private void ComponentChanged(InventoryComponent sender, int maxSlots, List<Entity> entities) { RebuildInventoryView(maxSlots, entities); }