summaryrefslogtreecommitdiffstats
path: root/src/UI/Window.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-18 21:10:51 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-07-18 21:10:51 +0200
commit37140ae57835680d2c4fb3aa365082622d3a150e (patch)
tree89a636c74375b3c9f0fe77b20ecbadc693bd0989 /src/UI/Window.h
parentMerge branch 'master' of https://github.com/mc-server/MCServer into portals (diff)
parentMonster fixes (diff)
downloadcuberite-37140ae57835680d2c4fb3aa365082622d3a150e.tar
cuberite-37140ae57835680d2c4fb3aa365082622d3a150e.tar.gz
cuberite-37140ae57835680d2c4fb3aa365082622d3a150e.tar.bz2
cuberite-37140ae57835680d2c4fb3aa365082622d3a150e.tar.lz
cuberite-37140ae57835680d2c4fb3aa365082622d3a150e.tar.xz
cuberite-37140ae57835680d2c4fb3aa365082622d3a150e.tar.zst
cuberite-37140ae57835680d2c4fb3aa365082622d3a150e.zip
Diffstat (limited to 'src/UI/Window.h')
-rw-r--r--src/UI/Window.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/UI/Window.h b/src/UI/Window.h
index 542dccb88..1872b2c20 100644
--- a/src/UI/Window.h
+++ b/src/UI/Window.h
@@ -36,12 +36,12 @@ typedef std::vector<cSlotArea *> cSlotAreas;
// tolua_begin
-/**
+/**
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
+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
@@ -109,12 +109,12 @@ public:
/// Handles a click event from a player
void Clicked(
- cPlayer & a_Player, int a_WindowID,
+ cPlayer & a_Player, int a_WindowID,
short a_SlotNum, eClickAction a_ClickAction,
const cItem & a_ClickedItem
);
- void OpenedByPlayer(cPlayer & a_Player);
+ virtual void OpenedByPlayer(cPlayer & a_Player);
/// Called when a player closes this window; notifies all slot areas. Returns true if close accepted
virtual bool ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse);
@@ -327,10 +327,15 @@ public:
cChestWindow(cChestEntity * a_Chest);
cChestWindow(cChestEntity * a_PrimaryChest, cChestEntity * a_SecondaryChest);
~cChestWindow();
+
+ virtual bool ClosedByPlayer(cPlayer & a_Player, bool a_CanRefuse) override;
+ virtual void OpenedByPlayer(cPlayer & a_Player) override;
protected:
cWorld * m_World;
int m_BlockX, m_BlockY, m_BlockZ; // Position of the chest, for the window-close packet
+ cChestEntity * m_PrimaryChest;
+ cChestEntity * m_SecondaryChest;
} ;