Barotrauma Client Doc
|
Public Types | |
enum class | Layout { Default , Left , Right , Center } |
Public Member Functions | |
CharacterInventory (ContentXElement element, Character character, bool spawnInitialItems) | |
Item | FindEquippedItemByTag (Identifier tag) |
int | FindLimbSlot (InvSlotType limbSlot) |
Item | GetItemInLimbSlot (InvSlotType limbSlot) |
bool | IsInLimbSlot (Item item, InvSlotType limbSlot) |
override bool | CanBePutInSlot (Item item, int i, bool ignoreCondition=false) |
Can the item be put in the specified slot. More... | |
override bool | CanBePutInSlot (ItemPrefab itemPrefab, int i, float? condition, int? quality=null) |
override void | RemoveItem (Item item) |
void | RemoveItem (Item item, bool tryEquipFromSameStack) |
bool | TryPutItemWithAutoEquipCheck (Item item, Character user, IEnumerable< InvSlotType > allowedSlots=null, bool createNetworkEvent=true) |
If there is no room in the generic inventory (InvSlotType.Any), check if the item can be auto-equipped into its respective limbslot More... | |
override bool | TryPutItem (Item item, Character user, IEnumerable< InvSlotType > allowedSlots=null, bool createNetworkEvent=true, bool ignoreCondition=false) |
If there is room, puts the item in the inventory and returns true, otherwise returns false More... | |
bool | IsAnySlotAvailable (Item item) |
override bool | TryPutItem (Item item, int index, bool allowSwapping, bool allowCombine, Character user, bool createNetworkEvent=true, bool ignoreCondition=false) |
override void | CreateSlots () |
override bool | HideSlot (int i) |
void | RefreshSlotPositions () |
override void | Update (float deltaTime, Camera cam, bool isSubInventory=false) |
void | UpdateSlotInput () |
void | AssignQuickUseNumKeys () |
bool | CanBeAutoMovedToCorrectSlots (Item item) |
void | FlashAllowedSlots (Item item, Color color) |
Flash the slots the item is allowed to go in (not taking into account whether there's already something in those slots) More... | |
void | DrawOwn (SpriteBatch spriteBatch) |
void | ClientEventWrite (IWriteMessage msg, Character.InventoryStateEventData extraData) |
Public Member Functions inherited from Barotrauma.Inventory | |
Inventory (Entity owner, int capacity, int slotsPerRow=5) | |
bool | Contains (Item item) |
Is the item contained in this inventory. Does not recursively check items inside items. More... | |
Item | FirstOrDefault () |
Return the first item in the inventory, or null if the inventory is empty. More... | |
Item | LastOrDefault () |
Return the last item in the inventory, or null if the inventory is empty. More... | |
Item | GetItemAt (int index) |
Get the item stored in the specified inventory slot. If the slot contains a stack of items, returns the first item in the stack. More... | |
IEnumerable< Item > | GetItemsAt (int index) |
Get all the item stored in the specified inventory slot. Can return more than one item if the slot contains a stack of items. More... | |
int | GetItemStackSlotIndex (Item item, int index) |
int | FindIndex (Item item) |
Find the index of the first slot the item is contained in. More... | |
List< int > | FindIndices (Item item) |
Find the indices of all the slots the item is contained in (two-hand items for example can be in multiple slots). Note that this method instantiates a new list. More... | |
virtual bool | ItemOwnsSelf (Item item) |
Returns true if the item owns any of the parent inventories. More... | |
virtual int | FindAllowedSlot (Item item, bool ignoreCondition=false) |
bool | CanBePut (Item item) |
Can the item be put in the inventory (i.e. is there a suitable free slot or a stack the item can be put in). More... | |
bool | CanBePut (ItemPrefab itemPrefab, float? condition=null, int? quality=null) |
int | HowManyCanBePut (ItemPrefab itemPrefab, float? condition=null) |
virtual int | HowManyCanBePut (ItemPrefab itemPrefab, int i, float? condition, bool ignoreItemsInSlot=false) |
bool | IsEmpty () |
virtual bool | IsFull (bool takeStacksIntoAccount=false) |
Is there room to put more items in the inventory. Doesn't take stacking into account by default. More... | |
void | CreateNetworkEvent () |
Item | FindItem (Func< Item, bool > predicate, bool recursive) |
List< Item > | FindAllItems (Func< Item, bool > predicate=null, bool recursive=false, List< Item > list=null) |
Item | FindItemByTag (Identifier tag, bool recursive=false) |
Item | FindItemByIdentifier (Identifier identifier, bool recursive=false) |
void | ForceToSlot (Item item, int index) |
Forces an item to a specific slot. Doesn't remove the item from existing slots/inventories or do any other sanity checks, use with caution! More... | |
void | ForceRemoveFromSlot (Item item, int index) |
Removes an item from a specific slot. Doesn't do any sanity checks, use with caution! More... | |
bool | IsInSlot (Item item, int index) |
void | SharedRead (IReadMessage msg, List< ushort >[] receivedItemIds, out bool readyToApply) |
void | SharedWrite (IWriteMessage msg, Range slotRange) |
void | DeleteAllItems () |
Deletes all items inside the inventory (and also recursively all items inside the items) More... | |
Inventory | GetReplacementOrThiS () |
bool | Movable () |
bool | IsInventoryHoverAvailable (Character owner, ItemContainer container) |
void | UpdateSubInventory (float deltaTime, int slotIndex, Camera cam) |
void | ClearSubInventories () |
virtual void | Draw (SpriteBatch spriteBatch, bool subInventory=false) |
void | DrawSubInventory (SpriteBatch spriteBatch, int slotIndex) |
void | ClientEventRead (IReadMessage msg) |
void | ApplyReceivedState () |
Static Public Member Functions | |
static bool | IsHandSlotType (InvSlotType s) |
Static Public Member Functions inherited from Barotrauma.Inventory | |
static bool | IsMouseOnSlot (VisualSlot slot) |
Check if the mouse is hovering on top of the slot More... | |
static void | RefreshMouseOnInventory () |
Refresh the value of IsMouseOnInventory More... | |
static CursorState | GetInventoryMouseCursor () |
static void | UpdateDragging () |
static void | DrawFront (SpriteBatch spriteBatch) |
static void | DrawSlot (SpriteBatch spriteBatch, Inventory inventory, VisualSlot slot, Item item, int slotIndex, bool drawItem=true, InvSlotType type=InvSlotType.Any) |
Public Attributes | |
Vector2[] | SlotPositions |
Public Attributes inherited from Barotrauma.Inventory | |
readonly Entity | Owner |
bool | Locked |
bool | AllowSwappingContainedItems = true |
Inventory | ReplacedBy |
float | HideTimer |
VisualSlot[] | visualSlots |
RectTransform | RectTransform |
If set, the inventory is automatically positioned inside the rect More... | |
bool | DrawWhenEquipped |
Normally false - we don't draw the UI because it's drawn when the player hovers the cursor over the item in their inventory. Enabled in special cases like equippable fabricators where the inventory is a part of the fabricator UI. More... | |
float | OpenState |
Static Public Attributes | |
static readonly List< InvSlotType > | AnySlot = new List<InvSlotType>() { InvSlotType.Any } |
const InvSlotType | PersonalSlots = InvSlotType.Card | InvSlotType.Bag | InvSlotType.Headset | InvSlotType.InnerClothes | InvSlotType.OuterClothes | InvSlotType.Head |
static Point | SlotSize |
Static Public Attributes inherited from Barotrauma.Inventory | |
const int | MaxPossibleStackSize = (1 << 6) - 1 |
const int | MaxItemsPerNetworkEvent = 128 |
static Sprite | DraggableIndicator |
static Sprite | UnequippedIndicator |
static Inventory | DraggingInventory |
static VisualSlot | DraggingSlot |
static readonly List< Item > | DraggingItems = new List<Item>() |
static readonly List< Item > | doubleClickedItems = new List<Item>() |
Protected Member Functions | |
override void | PutItem (Item item, int i, Character user, bool removeItem=true, bool createNetworkEvent=true) |
override void | CreateNetworkEvent (Range slotRange) |
override ItemInventory | GetActiveEquippedSubInventory (int slotIndex) |
override void | CalculateBackgroundFrame () |
override void | ControlInput (Camera cam) |
Protected Member Functions inherited from Barotrauma.Inventory | |
IEnumerable< Item > | GetAllItems (bool checkForDuplicates) |
bool | TrySwapping (int index, Item item, Character user, bool createNetworkEvent, bool swapWholeStack) |
void | UpdateSlot (VisualSlot slot, int slotIndex, Item item, bool isSubSlot) |
Inventory | GetSubInventory (int slotIndex) |
Protected Attributes | |
bool[] | IsEquipped |
Protected Attributes inherited from Barotrauma.Inventory | |
readonly int | capacity |
readonly ItemSlot[] | slots |
float | syncItemsDelay |
float | prevUIScale = UIScale |
float | prevHUDScale = GUI.Scale |
Point | prevScreenResolution |
Vector4 | padding |
Properties | |
InvSlotType[] | SlotTypes [get] |
bool | AccessibleWhenAlive [get] |
Can the inventory be accessed when the character is still alive More... | |
bool | AccessibleByOwner [get] |
Can the inventory be accessed by the character itself when the character is still alive (only has an effect if AccessibleWhenAlive false) More... | |
static Dictionary< InvSlotType, Sprite >? | LimbSlotIcons [get] |
Layout | CurrentLayout [get, set] |
Properties inherited from Barotrauma.Inventory | |
int | ExtraStackSize [get, set] |
virtual IEnumerable< Item > | AllItems [get] |
All items contained in the inventory. Stacked items are returned as individual instances. DO NOT modify the contents of the inventory while enumerating this list. More... | |
IEnumerable< Item > | AllItemsMod [get] |
All items contained in the inventory. Allows modifying the contents of the inventory while being enumerated. More... | |
int | Capacity [get] |
int | EmptySlotCount [get] |
static float | UIScale [get] |
static int | ContainedIndicatorHeight [get] |
static Sprite | SlotSpriteSmall [get] |
Rectangle | BackgroundFrame [get, protected set] |
static bool | DraggingItemToWorld [get] |
int | SlotsPerRow [set] |
static SlotReference?? | SelectedSlot [get] |
static bool | IsMouseOnInventory [get] |
Additional Inherited Members | |
Static Protected Member Functions inherited from Barotrauma.Inventory | |
static void | DrawToolTip (SpriteBatch spriteBatch, RichString toolTip, Rectangle highlightedSlot) |
static Rectangle | GetSubInventoryHoverArea (SlotReference subSlot) |
Static Protected Attributes inherited from Barotrauma.Inventory | |
static Sprite | slotHotkeySprite |
static HashSet< SlotReference > | highlightedSubInventorySlots = new HashSet<SlotReference>() |
static SlotReference | selectedSlot |
Definition at line 16 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
|
strong |
Enumerator | |
---|---|
Default | |
Left | |
Right | |
Center |
Definition at line 16 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
Barotrauma.CharacterInventory.CharacterInventory | ( | ContentXElement | element, |
Character | character, | ||
bool | spawnInitialItems | ||
) |
Definition at line 57 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
void Barotrauma.CharacterInventory.AssignQuickUseNumKeys | ( | ) |
Definition at line 747 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
|
protectedvirtual |
Reimplemented from Barotrauma.Inventory.
Definition at line 178 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
bool Barotrauma.CharacterInventory.CanBeAutoMovedToCorrectSlots | ( | Item | item | ) |
Definition at line 1084 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
|
virtual |
Can the item be put in the specified slot.
Reimplemented from Barotrauma.Inventory.
Definition at line 206 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
|
virtual |
Reimplemented from Barotrauma.Inventory.
Definition at line 213 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
void Barotrauma.CharacterInventory.ClientEventWrite | ( | IWriteMessage | msg, |
Character.InventoryStateEventData | extraData | ||
) |
Definition at line 1247 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
|
protectedvirtual |
Reimplemented from Barotrauma.Inventory.
Definition at line 451 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
|
protectedvirtual |
Reimplemented from Barotrauma.Inventory.
Definition at line 551 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
|
virtual |
Reimplemented from Barotrauma.Inventory.
Definition at line 115 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
void Barotrauma.CharacterInventory.DrawOwn | ( | SpriteBatch | spriteBatch | ) |
Definition at line 1124 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
Item Barotrauma.CharacterInventory.FindEquippedItemByTag | ( | Identifier | tag | ) |
Definition at line 154 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
int Barotrauma.CharacterInventory.FindLimbSlot | ( | InvSlotType | limbSlot | ) |
Definition at line 167 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
void Barotrauma.CharacterInventory.FlashAllowedSlots | ( | Item | item, |
Color | color | ||
) |
Flash the slots the item is allowed to go in (not taking into account whether there's already something in those slots)
Definition at line 1102 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
|
protectedvirtual |
Reimplemented from Barotrauma.Inventory.
Definition at line 102 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
Item Barotrauma.CharacterInventory.GetItemInLimbSlot | ( | InvSlotType | limbSlot | ) |
Definition at line 176 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
|
virtual |
Reimplemented from Barotrauma.Inventory.
Definition at line 196 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
bool Barotrauma.CharacterInventory.IsAnySlotAvailable | ( | Item | item | ) |
|
static |
bool Barotrauma.CharacterInventory.IsInLimbSlot | ( | Item | item, |
InvSlotType | limbSlot | ||
) |
Definition at line 186 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
|
protectedvirtual |
Reimplemented from Barotrauma.Inventory.
Definition at line 533 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
void Barotrauma.CharacterInventory.RefreshSlotPositions | ( | ) |
Definition at line 252 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
|
virtual |
Reimplemented from Barotrauma.Inventory.
Definition at line 220 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
void Barotrauma.CharacterInventory.RemoveItem | ( | Item | item, |
bool | tryEquipFromSameStack | ||
) |
Definition at line 225 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
|
virtual |
If there is room, puts the item in the inventory and returns true, otherwise returns false
Reimplemented from Barotrauma.Inventory.
Definition at line 325 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
|
virtual |
Reimplemented from Barotrauma.Inventory.
Definition at line 485 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
bool Barotrauma.CharacterInventory.TryPutItemWithAutoEquipCheck | ( | Item | item, |
Character | user, | ||
IEnumerable< InvSlotType > | allowedSlots = null , |
||
bool | createNetworkEvent = true |
||
) |
If there is no room in the generic inventory (InvSlotType.Any), check if the item can be auto-equipped into its respective limbslot
Definition at line 266 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
|
virtual |
Reimplemented from Barotrauma.Inventory.
Definition at line 464 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
void Barotrauma.CharacterInventory.UpdateSlotInput | ( | ) |
Definition at line 654 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
|
static |
Definition at line 27 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
|
protected |
Definition at line 31 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
|
static |
Definition at line 74 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
Vector2 [] Barotrauma.CharacterInventory.SlotPositions |
Definition at line 78 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
|
static |
Definition at line 79 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
|
get |
Can the inventory be accessed by the character itself when the character is still alive (only has an effect if AccessibleWhenAlive false)
Definition at line 45 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
|
get |
Can the inventory be accessed when the character is still alive
Definition at line 36 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.
|
getset |
Definition at line 82 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
|
staticget |
Definition at line 39 of file BarotraumaClient/ClientSource/Items/CharacterInventory.cs.
|
get |
Definition at line 20 of file BarotraumaShared/SharedSource/Items/CharacterInventory.cs.