1
0

Renamed cWindow constants to include the "wt" prefix.

This commit is contained in:
madmaxoft 2013-10-28 13:30:24 +01:00
parent 1a29c19619
commit df20c19986
8 changed files with 40 additions and 40 deletions

View File

@ -1,6 +1,6 @@
/*
** Lua binding: AllToLua
** Generated automatically by tolua++-1.0.92 on 10/25/13 11:34:58.
** Generated automatically by tolua++-1.0.92 on 10/28/13 13:11:03.
*/
#ifndef __cplusplus
@ -31025,17 +31025,17 @@ TOLUA_API int tolua_AllToLua_open (lua_State* tolua_S)
tolua_endmodule(tolua_S);
tolua_cclass(tolua_S,"cWindow","cWindow","",NULL);
tolua_beginmodule(tolua_S,"cWindow");
tolua_constant(tolua_S,"Inventory",cWindow::Inventory);
tolua_constant(tolua_S,"Chest",cWindow::Chest);
tolua_constant(tolua_S,"Workbench",cWindow::Workbench);
tolua_constant(tolua_S,"Furnace",cWindow::Furnace);
tolua_constant(tolua_S,"DropSpenser",cWindow::DropSpenser);
tolua_constant(tolua_S,"Enchantment",cWindow::Enchantment);
tolua_constant(tolua_S,"Brewery",cWindow::Brewery);
tolua_constant(tolua_S,"NPCTrade",cWindow::NPCTrade);
tolua_constant(tolua_S,"Beacon",cWindow::Beacon);
tolua_constant(tolua_S,"Anvil",cWindow::Anvil);
tolua_constant(tolua_S,"Hopper",cWindow::Hopper);
tolua_constant(tolua_S,"wtInventory",cWindow::wtInventory);
tolua_constant(tolua_S,"wtChest",cWindow::wtChest);
tolua_constant(tolua_S,"wtWorkbench",cWindow::wtWorkbench);
tolua_constant(tolua_S,"wtFurnace",cWindow::wtFurnace);
tolua_constant(tolua_S,"wtDropSpenser",cWindow::wtDropSpenser);
tolua_constant(tolua_S,"wtEnchantment",cWindow::wtEnchantment);
tolua_constant(tolua_S,"wtBrewery",cWindow::wtBrewery);
tolua_constant(tolua_S,"wtNPCTrade",cWindow::wtNPCTrade);
tolua_constant(tolua_S,"wtBeacon",cWindow::wtBeacon);
tolua_constant(tolua_S,"wtAnvil",cWindow::wtAnvil);
tolua_constant(tolua_S,"wtHopper",cWindow::wtHopper);
tolua_function(tolua_S,"GetWindowID",tolua_AllToLua_cWindow_GetWindowID00);
tolua_function(tolua_S,"GetWindowType",tolua_AllToLua_cWindow_GetWindowType00);
tolua_function(tolua_S,"GetSlot",tolua_AllToLua_cWindow_GetSlot00);

View File

@ -1,6 +1,6 @@
/*
** Lua binding: AllToLua
** Generated automatically by tolua++-1.0.92 on 10/25/13 11:34:58.
** Generated automatically by tolua++-1.0.92 on 10/28/13 13:11:04.
*/
/* Exported function */

View File

@ -469,12 +469,12 @@ bool cClientHandle::HandleLogin(int a_ProtocolVersion, const AString & a_Usernam
void cClientHandle::HandleCreativeInventory(short a_SlotNum, const cItem & a_HeldItem)
{
// This is for creative Inventory changes
if (m_Player->GetGameMode() != eGameMode_Creative)
if (m_Player->IsGameModeCreative())
{
LOGWARNING("Got a CreativeInventoryAction packet from user \"%s\" while not in creative mode. Ignoring.", m_Username.c_str());
return;
}
if (m_Player->GetWindow()->GetWindowType() != cWindow::Inventory)
if (m_Player->GetWindow()->GetWindowType() != cWindow::wtInventory)
{
LOGWARNING("Got a CreativeInventoryAction packet from user \"%s\" while not in the inventory window. Ignoring.", m_Username.c_str());
return;

View File

@ -31,8 +31,8 @@ cLuaWindow::cLuaWindow(cWindow::WindowType a_WindowType, int a_SlotsX, int a_Slo
// If appropriate, add an Armor slot area:
switch (a_WindowType)
{
case cWindow::Inventory:
case cWindow::Workbench:
case cWindow::wtInventory:
case cWindow::wtWorkbench:
{
m_SlotAreas.push_back(new cSlotAreaArmor(*this));
break;

View File

@ -963,7 +963,7 @@ void cProtocol125::SendWholeInventory(const cWindow & a_Window)
void cProtocol125::SendWindowClose(const cWindow & a_Window)
{
if (a_Window.GetWindowType() == cWindow::Inventory)
if (a_Window.GetWindowType() == cWindow::wtInventory)
{
// Do not send inventory-window-close
return;

View File

@ -559,7 +559,7 @@ cSlotAreaInventoryBase::cSlotAreaInventoryBase(int a_NumSlots, int a_SlotOffset,
void cSlotAreaInventoryBase::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem)
{
if ((a_Player.GetGameMode() == eGameMode_Creative) && (m_ParentWindow.GetWindowType() == cWindow::Inventory))
if (a_Player.IsGameModeCreative() && (m_ParentWindow.GetWindowType() == cWindow::wtInventory))
{
// Creative inventory must treat a_ClickedItem as a DraggedItem instead, replacing the inventory slot with it
SetSlot(a_SlotNum, a_Player, a_ClickedItem);

View File

@ -23,7 +23,7 @@ char cWindow::m_WindowIDCounter = 1;
cWindow::cWindow(cWindow::WindowType a_WindowType, const AString & a_WindowTitle) :
cWindow::cWindow(WindowType a_WindowType, const AString & a_WindowTitle) :
m_WindowID((++m_WindowIDCounter) % 127),
m_WindowType(a_WindowType),
m_WindowTitle(a_WindowTitle),
@ -31,7 +31,7 @@ cWindow::cWindow(cWindow::WindowType a_WindowType, const AString & a_WindowTitle
m_IsDestroyed(false),
m_ShouldDistributeToHotbarFirst(true)
{
if (a_WindowType == Inventory)
if (a_WindowType == wtInventory)
{
m_WindowID = 0;
}
@ -277,7 +277,7 @@ bool cWindow::ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse)
m_OpenedBy.remove(&a_Player);
if ((m_WindowType != Inventory) && m_OpenedBy.empty())
if ((m_WindowType != wtInventory) && m_OpenedBy.empty())
{
Destroy();
}
@ -703,7 +703,7 @@ void cWindow::SetProperty(int a_Property, int a_Value, cPlayer & a_Player)
// cInventoryWindow:
cInventoryWindow::cInventoryWindow(cPlayer & a_Player) :
cWindow(cWindow::Inventory, "Inventory"),
cWindow(wtInventory, "Inventory"),
m_Player(a_Player)
{
m_SlotAreas.push_back(new cSlotAreaCrafting(2, *this)); // The creative inventory doesn't display it, but it's still counted into slot numbers
@ -720,7 +720,7 @@ cInventoryWindow::cInventoryWindow(cPlayer & a_Player) :
// cCraftingWindow:
cCraftingWindow::cCraftingWindow(int a_BlockX, int a_BlockY, int a_BlockZ) :
cWindow(cWindow::Workbench, "Crafting Table")
cWindow(wtWorkbench, "Crafting Table")
{
m_SlotAreas.push_back(new cSlotAreaCrafting(3, *this));
m_SlotAreas.push_back(new cSlotAreaInventory(*this));
@ -735,7 +735,7 @@ cCraftingWindow::cCraftingWindow(int a_BlockX, int a_BlockY, int a_BlockZ) :
// cChestWindow:
cChestWindow::cChestWindow(cChestEntity * a_Chest) :
cWindow(cWindow::Chest, "Chest"),
cWindow(wtChest, "Chest"),
m_World(a_Chest->GetWorld()),
m_BlockX(a_Chest->GetPosX()),
m_BlockY(a_Chest->GetPosY()),
@ -757,7 +757,7 @@ cChestWindow::cChestWindow(cChestEntity * a_Chest) :
cChestWindow::cChestWindow(cChestEntity * a_PrimaryChest, cChestEntity * a_SecondaryChest) :
cWindow(cWindow::Chest, "Double Chest"),
cWindow(wtChest, "Double Chest"),
m_World(a_PrimaryChest->GetWorld()),
m_BlockX(a_PrimaryChest->GetPosX()),
m_BlockY(a_PrimaryChest->GetPosY()),
@ -796,7 +796,7 @@ cChestWindow::~cChestWindow()
// cDropSpenserWindow:
cDropSpenserWindow::cDropSpenserWindow(int a_BlockX, int a_BlockY, int a_BlockZ, cDropSpenserEntity * a_DropSpenser) :
cWindow(cWindow::DropSpenser, "Dropspenser")
cWindow(wtDropSpenser, "Dropspenser")
{
m_ShouldDistributeToHotbarFirst = false;
m_SlotAreas.push_back(new cSlotAreaItemGrid(a_DropSpenser->GetContents(), *this));
@ -812,7 +812,7 @@ cDropSpenserWindow::cDropSpenserWindow(int a_BlockX, int a_BlockY, int a_BlockZ,
// cHopperWindow:
cHopperWindow::cHopperWindow(int a_BlockX, int a_BlockY, int a_BlockZ, cHopperEntity * a_Hopper) :
super(cWindow::Hopper, "Hopper")
super(wtHopper, "Hopper")
{
m_ShouldDistributeToHotbarFirst = false;
m_SlotAreas.push_back(new cSlotAreaItemGrid(a_Hopper->GetContents(), *this));
@ -828,7 +828,7 @@ cHopperWindow::cHopperWindow(int a_BlockX, int a_BlockY, int a_BlockZ, cHopperEn
// cFurnaceWindow:
cFurnaceWindow::cFurnaceWindow(int a_BlockX, int a_BlockY, int a_BlockZ, cFurnaceEntity * a_Furnace) :
cWindow(cWindow::Furnace, "Furnace")
cWindow(wtFurnace, "Furnace")
{
m_ShouldDistributeToHotbarFirst = false;
m_SlotAreas.push_back(new cSlotAreaFurnace(a_Furnace, *this));

View File

@ -49,17 +49,17 @@ class cWindow
public:
enum WindowType
{
Inventory = -1, // This value is never actually sent to a client
Chest = 0,
Workbench = 1,
Furnace = 2,
DropSpenser = 3, // Dropper or Dispenser
Enchantment = 4,
Brewery = 5,
NPCTrade = 6,
Beacon = 7,
Anvil = 8,
Hopper = 9,
wtInventory = -1, // This value is never actually sent to a client
wtChest = 0,
wtWorkbench = 1,
wtFurnace = 2,
wtDropSpenser = 3, // Dropper or Dispenser
wtEnchantment = 4,
wtBrewery = 5,
wtNPCTrade = 6,
wtBeacon = 7,
wtAnvil = 8,
wtHopper = 9,
};
// tolua_end