From 03c6bb9f85b929a99df2c800b8ba7d8ef4a8ec43 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 13 Jun 2013 07:36:43 +0000 Subject: Added hopper entity, it can suck items out of chests, dispensers, droppers and other hopppers above it. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1587 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/UI/SlotArea.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'source/UI/SlotArea.cpp') diff --git a/source/UI/SlotArea.cpp b/source/UI/SlotArea.cpp index 3f480817c..feeeb4add 100644 --- a/source/UI/SlotArea.cpp +++ b/source/UI/SlotArea.cpp @@ -665,6 +665,16 @@ cSlotAreaItemGrid::cSlotAreaItemGrid(cItemGrid & a_ItemGrid, cWindow & a_ParentW super(a_ItemGrid.GetNumSlots(), a_ParentWindow), m_ItemGrid(a_ItemGrid) { + m_ItemGrid.AddListener(*this); +} + + + + + +cSlotAreaItemGrid::~cSlotAreaItemGrid() +{ + m_ItemGrid.RemoveListener(*this); } @@ -689,6 +699,16 @@ void cSlotAreaItemGrid::SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & +void cSlotAreaItemGrid::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) +{ + ASSERT(a_ItemGrid == &m_ItemGrid); + m_ParentWindow.BroadcastSlot(this, a_SlotNum); +} + + + + + /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // cSlotAreaTemporary: -- cgit v1.2.3