CharacterInventory
Barotrauma.CharacterInventory
Functions
ApplyReceivedState()
ApplyReceivedState
AssignQuickUseNumKeys()
AssignQuickUseNumKeys
CanBeAutoMovedToCorrectSlots(item)
CanBeAutoMovedToCorrectSlots
Parameters
-
item
Item
Returns
-
bool
CanBePut(itemPrefab, condition, quality)
CanBePut
Parameters
-
itemPrefab
ItemPrefab
-
condition
optional Single
-
quality
optional Int32
Returns
-
bool
CanBePut(item)
CanBePut
Parameters
-
item
Item
Returns
-
bool
CanBePutInSlot(itemPrefab, i, condition, quality)
CanBePutInSlot
Parameters
-
itemPrefab
ItemPrefab
-
i
number
-
condition
optional Single
-
quality
optional Int32
Returns
-
bool
CanBePutInSlot(item, i, ignoreCondition)
CanBePutInSlot
Parameters
-
item
Item
-
i
number
-
ignoreCondition
bool
Returns
-
bool
CharacterInventory(element, character, spawnInitialItems)
CharacterInventory
Parameters
-
element
ContentXElement
-
character
Character
-
spawnInitialItems
bool
CharacterInventory.IsHandSlotType(s)
IsHandSlotType
Parameters
-
s
InvSlotType
Returns
-
bool
ClearSubInventories()
ClearSubInventories
ClientEventRead(msg)
ClientEventRead
Parameters
-
msg
Networking.IReadMessage
ClientEventWrite(msg, extraData)
ClientEventWrite
Parameters
-
msg
Networking.IWriteMessage
-
extraData
InventoryStateEventData
Contains(item)
Contains
Parameters
-
item
Item
Returns
-
bool
CreateNetworkEvent()
CreateNetworkEvent
CreateSlots()
CreateSlots
DeleteAllItems()
DeleteAllItems
Draw(spriteBatch, subInventory)
Draw
Parameters
-
spriteBatch
Microsoft.Xna.Framework.Graphics.SpriteBatch
-
subInventory
bool
DrawOwn(spriteBatch)
DrawOwn
Parameters
-
spriteBatch
Microsoft.Xna.Framework.Graphics.SpriteBatch
DrawSubInventory(spriteBatch, slotIndex)
DrawSubInventory
Parameters
-
spriteBatch
Microsoft.Xna.Framework.Graphics.SpriteBatch
-
slotIndex
number
Equals(obj)
Equals
Parameters
-
obj
Object
Returns
-
bool
FindAllItems(predicate, recursive, list)
FindAllItems
Parameters
-
predicate
function
-
recursive
bool
-
list
table
Returns
FindAllowedSlot(item, ignoreCondition)
FindAllowedSlot
Parameters
-
item
Item
-
ignoreCondition
bool
Returns
-
number
FindEquippedItemByTag(tag)
FindEquippedItemByTag
Parameters
-
tag
Identifier
Returns
-
Item
FindIndex(item)
FindIndex
Parameters
-
item
Item
Returns
-
number
FindIndices(item)
FindIndices
Parameters
-
item
Item
Returns
FindItem(predicate, recursive)
FindItem
Parameters
-
predicate
function
-
recursive
bool
Returns
-
Item
FindItemByIdentifier(identifier, recursive)
FindItemByIdentifier
Parameters
-
identifier
Identifier
-
recursive
bool
Returns
-
Item
FindItemByTag(tag, recursive)
FindItemByTag
Parameters
-
tag
Identifier
-
recursive
bool
Returns
-
Item
FindLimbSlot(limbSlot)
FindLimbSlot
Parameters
-
limbSlot
InvSlotType
Returns
-
number
FirstOrDefault()
FirstOrDefault
Returns
-
Item
FlashAllowedSlots(item, color)
FlashAllowedSlots
Parameters
-
item
Item
-
color
Microsoft.Xna.Framework.Color
ForceRemoveFromSlot(item, index)
ForceRemoveFromSlot
Parameters
-
item
Item
-
index
number
ForceToSlot(item, index)
ForceToSlot
Parameters
-
item
Item
-
index
number
GetAllItems(checkForDuplicates)
GetAllItems
Parameters
-
checkForDuplicates
bool
Returns
-
IEnumerable
GetHashCode()
GetHashCode
Returns
-
number
GetItemAt(index)
GetItemAt
Parameters
-
index
number
Returns
-
Item
GetItemInLimbSlot(limbSlot)
GetItemInLimbSlot
Parameters
-
limbSlot
InvSlotType
Returns
-
Item
GetItemStackSlotIndex(item, index)
GetItemStackSlotIndex
Parameters
-
item
Item
-
index
number
Returns
-
number
GetItemsAt(index)
GetItemsAt
Parameters
-
index
number
Returns
-
IEnumerable
GetReplacementOrThiS()
GetReplacementOrThiS
Returns
-
Inventory
GetType()
GetType
Returns
-
Type
HideSlot(i)
HideSlot
Parameters
-
i
number
Returns
-
bool
HowManyCanBePut(itemPrefab, i, condition, ignoreItemsInSlot)
HowManyCanBePut
Parameters
-
itemPrefab
ItemPrefab
-
i
number
-
condition
optional Single
-
ignoreItemsInSlot
bool
Returns
-
number
HowManyCanBePut(itemPrefab, condition)
HowManyCanBePut
Parameters
-
itemPrefab
ItemPrefab
-
condition
optional Single
Returns
-
number
IsAnySlotAvailable(item)
IsAnySlotAvailable
Parameters
-
item
Item
Returns
-
bool
IsEmpty()
IsEmpty
Returns
-
bool
IsFull(takeStacksIntoAccount)
IsFull
Parameters
-
takeStacksIntoAccount
bool
Returns
-
bool
IsInLimbSlot(item, limbSlot)
IsInLimbSlot
Parameters
-
item
Item
-
limbSlot
InvSlotType
Returns
-
bool
IsInSlot(item, index)
IsInSlot
Parameters
-
item
Item
-
index
number
Returns
-
bool
IsInventoryHoverAvailable(owner, container)
IsInventoryHoverAvailable
Parameters
-
owner
Character
-
container
Items.Components.ItemContainer
Returns
-
bool
ItemOwnsSelf(item)
ItemOwnsSelf
Parameters
-
item
Item
Returns
-
bool
LastOrDefault()
LastOrDefault
Returns
-
Item
Movable()
Movable
Returns
-
bool
RefreshSlotPositions()
RefreshSlotPositions
RemoveItem(item, tryEquipFromSameStack)
RemoveItem
Parameters
-
item
Item
-
tryEquipFromSameStack
bool
RemoveItem(item)
RemoveItem
Parameters
-
item
Item
ServerEventRead(msg, sender)
ServerEventRead
Parameters
-
msg
Networking.IReadMessage
-
sender
Networking.Client
ServerEventWrite(msg, c, inventoryData)
ServerEventWrite
Parameters
-
msg
Networking.IWriteMessage
-
c
Networking.Client
-
inventoryData
InventoryStateEventData
ToString()
ToString
Returns
TryPutItem(item, user, allowedSlots, createNetworkEvent, ignoreCondition)
TryPutItem
Parameters
-
item
Item
-
user
Character
-
allowedSlots
IEnumerable
-
createNetworkEvent
bool
-
ignoreCondition
bool
Returns
-
bool
TryPutItem(item, index, allowSwapping, allowCombine, user, createNetworkEvent, ignoreCondition)
TryPutItem
Parameters
-
item
Item
-
index
number
-
allowSwapping
bool
-
allowCombine
bool
-
user
Character
-
createNetworkEvent
bool
-
ignoreCondition
bool
Returns
-
bool
TryPutItemWithAutoEquipCheck(item, user, allowedSlots, createNetworkEvent)
TryPutItemWithAutoEquipCheck
Parameters
-
item
Item
-
user
Character
-
allowedSlots
IEnumerable
-
createNetworkEvent
bool
Returns
-
bool
Update(deltaTime, cam, isSubInventory)
Update
Parameters
-
deltaTime
number
-
cam
Camera
-
isSubInventory
bool
UpdateSlotInput()
UpdateSlotInput
UpdateSubInventory(deltaTime, slotIndex, cam)
UpdateSubInventory
Parameters
-
deltaTime
number
-
slotIndex
number
-
cam
Camera
Fields
AccessibleByOwner
AccessibleByOwner, field of type bool
-
AccessibleByOwner
AccessibleWhenAlive
AccessibleWhenAlive, field of type bool
-
AccessibleWhenAlive
AllItems
AllItems, field of type IEnumerable
-
AllItems
AllItemsMod
AllItemsMod, field of type IEnumerable
-
AllItemsMod
AllowSwappingContainedItems
AllowSwappingContainedItems, field of type bool
-
AllowSwappingContainedItems
BackgroundFrame
BackgroundFrame, field of type Microsoft.Xna.Framework.Rectangle
-
BackgroundFrame
Capacity
Capacity, field of type number
-
Capacity
CharacterInventory.AnySlot
CharacterInventory.AnySlot, field of type table
CharacterInventory.BagSlot
CharacterInventory.BagSlot, field of type table
CharacterInventory.LimbSlotIcons
CharacterInventory.LimbSlotIcons, field of type table
CharacterInventory.PersonalSlots
CharacterInventory.PersonalSlots, field of type InvSlotType
CharacterInventory.SlotSize
CharacterInventory.SlotSize, field of type Microsoft.Xna.Framework.Point
CurrentLayout
CurrentLayout, field of type Layout
-
CurrentLayout
DrawWhenEquipped
DrawWhenEquipped, field of type bool
-
DrawWhenEquipped
EmptySlotCount
EmptySlotCount, field of type number
-
EmptySlotCount
ExtraStackSize
ExtraStackSize, field of type number
-
ExtraStackSize
HideTimer
HideTimer, field of type number
-
HideTimer
Locked
Locked, field of type bool
-
Locked
OpenState
OpenState, field of type number
-
OpenState
Owner
Owner, field of type Entity
-
Owner
RectTransform
RectTransform, field of type RectTransform
-
RectTransform
ReplacedBy
ReplacedBy, field of type Inventory
-
ReplacedBy
SlotPositions
SlotPositions, field of type Microsoft.Xna.Framework.Vector2[]
-
SlotPositions
SlotTypes
SlotTypes, field of type InvSlotType[]
-
SlotTypes
SlotsPerRow
SlotsPerRow, field of type number
-
SlotsPerRow
visualSlots
visualSlots, field of type VisualSlot[]
-
visualSlots