The fl_inventory_item panel is a single slot of an fl_inventory panel.
It displays the item or the stack of items in the slot as a model or an icon, can be
dragged onto other slots and opens the menu of the item when it is clicked. An item
can draw on its slot with its paint_slot and paint_over_slot callbacks and adjust
the model view with adjust_model_panel.
Summary
Methods
Methods
Moves the items from the stack of another slot to this one, as many as the stack can fit.
Parameters
- panel2 Panel the fl_inventory_item panel to take the items from
Returns the id of the inventory that the slot belongs to.
Returns
- Number
Returns the position of the slot in the inventory.
Returns
- Number x
- Number y
Returns the size of the item in a number of slots, considering its rotation.
Returns
- Number width
- Number height; 1, 1 if the slot is empty
Checks if the inventory that the slot belongs to is multislot.
Returns
- Boolean
Checks if the item in the slot is displayed rotated.
Returns
- Boolean
Remembers the slot as the one that the item is being dragged from.
Parameters
- ... Vararg arguments passed on to the base panel
Opens the menu of the item if the slot was clicked rather than dragged.
Parameters
- ... Vararg arguments passed on to the base panel
Draws the slot: its rounded background, the drag and drop highlight, the outline of a hovered or special item and the slot icon. Calls the paint_slot callback of the item afterward.
Parameters
- w Number
- h Number
Draws the amount of items in the stack and the number of the slot. Calls the paint_over_slot callback of the item afterward.
Parameters
- w Number
- h Number
Recreates the icon or the model of the item along with its tooltip. Makes the slot draggable only if it has an item.
Empties the slot and makes it undraggable.
Sets the item that the slot displays.
Parameters
- instance_id Number/List<Number> instance id, or instance ids of a stack of items
Sets the stack of items that the slot displays. Does nothing if the first item is unknown or the items are not stackable.
Parameters
- ids List<Number> instance ids of the items in the stack
Rotates the item in the slot, swapping the width and the height of the panel.
Checks if the item has been rotated in the panel since it was placed in the inventory.
Returns
- Boolean