summaryrefslogtreecommitdiffstats
path: root/source/UI/Window.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-30 21:34:09 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-30 21:34:09 +0200
commit9684f90f8361fb314a60a387dc9ecf9bc4c3062a (patch)
tree37e595d7f4b6fdd51b18943db2be6b538ea1caea /source/UI/Window.h
parentProtoProxy: Added a note in the documentation about the need to switch off username verification (diff)
downloadcuberite-9684f90f8361fb314a60a387dc9ecf9bc4c3062a.tar
cuberite-9684f90f8361fb314a60a387dc9ecf9bc4c3062a.tar.gz
cuberite-9684f90f8361fb314a60a387dc9ecf9bc4c3062a.tar.bz2
cuberite-9684f90f8361fb314a60a387dc9ecf9bc4c3062a.tar.lz
cuberite-9684f90f8361fb314a60a387dc9ecf9bc4c3062a.tar.xz
cuberite-9684f90f8361fb314a60a387dc9ecf9bc4c3062a.tar.zst
cuberite-9684f90f8361fb314a60a387dc9ecf9bc4c3062a.zip
Diffstat (limited to '')
-rw-r--r--source/UI/Window.h37
1 files changed, 13 insertions, 24 deletions
diff --git a/source/UI/Window.h b/source/UI/Window.h
index c31ed8a4d..1f2495a46 100644
--- a/source/UI/Window.h
+++ b/source/UI/Window.h
@@ -68,7 +68,7 @@ public:
cWindow(WindowType a_WindowType, const AString & a_WindowTitle);
virtual ~cWindow();
- char GetWindowID(void) const { return m_WindowID; }
+ char GetWindowID(void) const { return m_WindowID; } // tolua_export
int GetWindowType(void) const { return m_WindowType; } // tolua_export
cWindowOwner * GetOwner(void) { return m_Owner; }
@@ -84,6 +84,15 @@ public:
/// Sets the item to the specified slot for the specified player
void SetSlot(cPlayer & a_Player, int a_SlotNum, const cItem & a_Item);
+ /// Returns true if the specified slot is in the Player Main Inventory slotarea
+ bool IsSlotInPlayerMainInventory(int a_SlotNum) const;
+
+ /// Returns true if the specified slot is in the Player Hotbar slotarea
+ bool IsSlotInPlayerHotbar(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 IsSlotInPlayerInventory(int a_SlotNum) const;
+
// tolua_end
/// Fills a_Slots with the slots read from m_SlotAreas[], for the specified player
@@ -144,7 +153,8 @@ protected:
static char m_WindowIDCounter;
- void Destroy(void);
+ /// Sets the internal flag as "destroyed"; notifies the owner that the window is destroying
+ virtual void Destroy(void);
/** Returns the correct slot area for the specified window-global SlotNum
Also returns the area-local SlotNum corresponding to the GlobalSlotNum
@@ -173,7 +183,7 @@ protected:
/// Distributes a_NumToEachSlot items into the slots specified in a_SlotNums; returns the total number of items distributed
int DistributeItemToSlots(cPlayer & a_Player, const cItem & a_Item, int a_NumToEachSlot, const cSlotNums & a_SlotNums);
-} ;
+} ; // tolua_export
@@ -244,24 +254,3 @@ protected:
-
-// tolua_begin
-
-/// A window that has been created by a Lua plugin and is handled entirely by that plugin
-class cLuaWindow :
- public cWindow
-{
-public:
- /// Create a window of the specified type, with a slot grid of a_SlotsX * a_SlotsY size
- cLuaWindow(cWindow::WindowType a_WindowType, int a_SlotsX, int a_SlotsY, const AString & a_Title);
-
- // tolua_end
-
-protected:
- /// Contents of the non-inventory part
- cItemGrid m_Contents;
-} ;
-
-
-
-