diff options
author | madmaxoft <github@xoft.cz> | 2013-10-28 13:30:24 +0100 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2013-10-28 13:30:24 +0100 |
commit | df20c19986805380cfd728d63f2e3003331b1665 (patch) | |
tree | 6f2d00c4b23f46af9a6d39550186815a95905dcb /source | |
parent | APIDump: Documented HTTPFormData and HTTPRequest. (diff) | |
download | cuberite-df20c19986805380cfd728d63f2e3003331b1665.tar cuberite-df20c19986805380cfd728d63f2e3003331b1665.tar.gz cuberite-df20c19986805380cfd728d63f2e3003331b1665.tar.bz2 cuberite-df20c19986805380cfd728d63f2e3003331b1665.tar.lz cuberite-df20c19986805380cfd728d63f2e3003331b1665.tar.xz cuberite-df20c19986805380cfd728d63f2e3003331b1665.tar.zst cuberite-df20c19986805380cfd728d63f2e3003331b1665.zip |
Diffstat (limited to 'source')
-rw-r--r-- | source/Bindings.cpp | 24 | ||||
-rw-r--r-- | source/Bindings.h | 2 | ||||
-rw-r--r-- | source/ClientHandle.cpp | 4 | ||||
-rw-r--r-- | source/LuaWindow.cpp | 4 | ||||
-rw-r--r-- | source/Protocol/Protocol125.cpp | 2 | ||||
-rw-r--r-- | source/UI/SlotArea.cpp | 2 | ||||
-rw-r--r-- | source/UI/Window.cpp | 20 | ||||
-rw-r--r-- | source/UI/Window.h | 22 |
8 files changed, 40 insertions, 40 deletions
diff --git a/source/Bindings.cpp b/source/Bindings.cpp index 5de3a3b38..8259eda81 100644 --- a/source/Bindings.cpp +++ b/source/Bindings.cpp @@ -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); diff --git a/source/Bindings.h b/source/Bindings.h index edcdfd12f..411e608d9 100644 --- a/source/Bindings.h +++ b/source/Bindings.h @@ -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 */
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp index f67a546fd..90802aa71 100644 --- a/source/ClientHandle.cpp +++ b/source/ClientHandle.cpp @@ -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; diff --git a/source/LuaWindow.cpp b/source/LuaWindow.cpp index a0609f746..9011d668c 100644 --- a/source/LuaWindow.cpp +++ b/source/LuaWindow.cpp @@ -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; diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp index fb7315468..ef40f265a 100644 --- a/source/Protocol/Protocol125.cpp +++ b/source/Protocol/Protocol125.cpp @@ -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; diff --git a/source/UI/SlotArea.cpp b/source/UI/SlotArea.cpp index 463e56bce..82e87e126 100644 --- a/source/UI/SlotArea.cpp +++ b/source/UI/SlotArea.cpp @@ -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); diff --git a/source/UI/Window.cpp b/source/UI/Window.cpp index 2794abe22..1318cbca8 100644 --- a/source/UI/Window.cpp +++ b/source/UI/Window.cpp @@ -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)); diff --git a/source/UI/Window.h b/source/UI/Window.h index aa7e9d0d0..2d5e81e9e 100644 --- a/source/UI/Window.h +++ b/source/UI/Window.h @@ -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 |