API
Functions and classes available in the Lua API
Public Types | Public Member Functions | List of all members
cWindow Class Reference

#include <002c.h>

Inheritance diagram for cWindow:
Inheritance graph
[legend]

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 cItemGetSlot (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)

Detailed Description

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

Member Enumeration Documentation

Enumerator:
Inventory 
Chest 
Workbench 
Furnace 
DropSpenser 
Enchantment 
Brewery 
NPCTrade 
Beacon 
Anvil 
Hopper 

Member Function Documentation

const cItem* cWindow::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 cWindow::GetWindowID ( void  ) const
inline
const AString& cWindow::GetWindowTitle ( ) const
inline
int cWindow::GetWindowType ( void  ) const
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.

void cWindow::SetSlot ( cPlayer a_Player,
int  a_SlotNum,
const cItem a_Item 
)

Sets the item to the specified slot for the specified player.

void cWindow::SetWindowTitle ( const AString &  a_WindowTitle)
inline