예제 #1
0
        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);
        }
예제 #2
0
 private void ComponentChanged(InventoryComponent sender, int maxSlots, List<Entity> entities)
 {
     RebuildInventoryView(maxSlots, entities);
 }