API
Functions and classes available in the Lua API
|
#include <002c.h>
Public Types | |
enum | WindowType { Inventory = -1, Chest = 0, Workbench = 1, Furnace = 2, DropSpenser = 3, Enchantment = 4, Brewery = 5, NPCTrade = 6, Beacon = 7, Anvil = 8, Hopper = 9 } |
Public Member Functions | |
const cItem * | GetSlot (cPlayer &a_Player, int a_SlotNum) const |
Returns the item at the specified slot for the specified player. Returns NULL if invalid SlotNum requested. | |
char | GetWindowID (void) const |
const AString & | GetWindowTitle () const |
int | GetWindowType (void) const |
bool | IsSlotInPlayerHotbar (int a_SlotNum) const |
Returns true if the specified slot is in the Player Hotbar slotarea. | |
bool | IsSlotInPlayerInventory (int a_SlotNum) const |
Returns true if the specified slot is in the Player Main Inventory or Hotbar slotareas. Note that returns false for Armor. | |
bool | IsSlotInPlayerMainInventory (int a_SlotNum) const |
Returns true if the specified slot is in the Player Main Inventory slotarea. | |
void | SetSlot (cPlayer &a_Player, int a_SlotNum, const cItem &a_Item) |
Sets the item to the specified slot for the specified player. | |
void | SetWindowTitle (const AString &a_WindowTitle) |
Represents a UI window.
Each window has a list of players that are currently using it When there's no player using a window, it is destroyed. A window consists of several areas of slots with similar functionality - for example the crafting grid area, or the inventory area. Each area knows what its slots are (GetSlot() function) and can handle mouse clicks. The window acts only as a top-level container for those areas, redirecting the click events to the correct areas. Inventory painting, introduced in 1.5, is handled by the window, too
enum cWindow::WindowType |
Returns the item at the specified slot for the specified player. Returns NULL if invalid SlotNum requested.
|
inline |
|
inline |
|
inline |
bool cWindow::IsSlotInPlayerHotbar | ( | int | a_SlotNum | ) | const |
Returns true if the specified slot is in the Player Hotbar slotarea.
bool cWindow::IsSlotInPlayerInventory | ( | int | a_SlotNum | ) | const |
Returns true if the specified slot is in the Player Main Inventory or Hotbar slotareas. Note that returns false for Armor.
bool cWindow::IsSlotInPlayerMainInventory | ( | int | a_SlotNum | ) | const |
Returns true if the specified slot is in the Player Main Inventory slotarea.
Sets the item to the specified slot for the specified player.
|
inline |