Inventory

Hook Documentation for Inventory Module.

Functions

MODULE:CanItemBeTransfered(item, currentInv, oldInv)

Determines whether an item can be transferred between inventories.

Parameters

  • item

    The item being transferred

  • currentInv

    The current inventory from which the item is beintransferred

  • oldInv

    The old inventory to which the item belonged

Returns

  • bool or string

    Whether the item can be transferred, or fal and a reason if not

MODULE:CanPlayerViewInventory()

Determines whether a player is allowed to view their inventory.

Returns

  • bool

    Whether the player is allowed to view their inventory

MODULE:CanRunItemAction(itemTable, action)

Determines whether a specific action can be run on an item.

Parameters

  • itemTable Table

    The table representing the item

  • action String

    The action of the action being checked

Returns

  • bool

    Whether the action can be run on the item

MODULE:InterceptClickItemIcon(self, itemIcon, keyCode)

Called when a player clicks on an item icon.

Parameters

  • self Panel

    The panel that received the click

  • itemIcon Panel

    The item icon that was clicked

  • keyCode Integer

    The key code associated with the click

MODULE:ItemDraggedOutOfInventory(client, item)

Called when an item is dragged out of an inventory.

Parameters

  • client Player

    The client dragging the item

  • item

    The item being dragged

MODULE:ItemPaintOver(self, itemTable, w, h)

Called when an item is being painted over.

Parameters

  • self Panel

    The panel being painted

  • itemTable Table

    The table representing the item being painted

  • w Integer

    The width of the panel

  • h Integer

    The height of the panel

MODULE:ItemTransfered(context)

Called when an item is transferred between inventories.

Parameters

  • context Table

    The context of the item transfer

MODULE:OnCreateItemInteractionMenu(self, menu, itemTable)

Called when an item interaction menu is being created.

Parameters

  • self Panel

    The panel on which the menu is being created

  • menu Panel

    The menu being created

  • itemTable Table

    The table representing the item for which the menu is being created

MODULE:OnPlayerLostStackItem(itemTypeOrItem)

Called when a player drops a stackable item.

Parameters

  • itemTypeOrItem

    The type or instance of the item being lost

MODULE:OnRequestItemTransfer(self, itemID, inventoryID, x, y)

Called when an item transfer is requested.

Parameters

  • self Panel

    The panel from which the transfer is requested

  • itemID Integer

    The ID of the item being transferred

  • inventoryID Integer

    The ID of the inventory from which the item is being transferred

  • x Integer

    The x-coordinate of the transfer request

  • y Integer

    The y-coordinate of the transfer request

MODULE:PostDrawInventory(panel)

Called after the player's inventory is drawn.

Parameters

  • panel Panel

    The panel containing the inventory