summaryrefslogtreecommitdiffstats
path: root/source/UI/SlotArea.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-10 21:42:56 +0100
committermadmaxoft <github@xoft.cz>2013-11-10 21:42:56 +0100
commitdde491ee0e3663440f05165f140e9086f68c69bf (patch)
tree4bec6ba6a6a60ff53fe3f2c7c9990fd4059cde5e /source/UI/SlotArea.h
parentRenamed variables in cWolf. (diff)
parentImplemented inventory dblclick. (diff)
downloadcuberite-dde491ee0e3663440f05165f140e9086f68c69bf.tar
cuberite-dde491ee0e3663440f05165f140e9086f68c69bf.tar.gz
cuberite-dde491ee0e3663440f05165f140e9086f68c69bf.tar.bz2
cuberite-dde491ee0e3663440f05165f140e9086f68c69bf.tar.lz
cuberite-dde491ee0e3663440f05165f140e9086f68c69bf.tar.xz
cuberite-dde491ee0e3663440f05165f140e9086f68c69bf.tar.zst
cuberite-dde491ee0e3663440f05165f140e9086f68c69bf.zip
Diffstat (limited to 'source/UI/SlotArea.h')
-rw-r--r--source/UI/SlotArea.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/source/UI/SlotArea.h b/source/UI/SlotArea.h
index 943452feb..4964e9986 100644
--- a/source/UI/SlotArea.h
+++ b/source/UI/SlotArea.h
@@ -40,9 +40,12 @@ public:
/// Called when a player clicks in the window. Parameters taken from the click packet.
virtual void Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem);
- /// Called from Clicked if it is a valid shiftclick
+ /// Called from Clicked when the action is a shiftclick (left or right)
virtual void ShiftClicked(cPlayer & a_Player, int a_SlotNum, const cItem & a_ClickedItem);
+ /// Called from Clicked when the action is a caDblClick
+ virtual void DblClicked(cPlayer & a_Player, int a_SlotNum);
+
/// Called when a new player opens the same parent window. The window already tracks the player. CS-locked.
virtual void OnPlayerAdded(cPlayer & a_Player) {} ;
@@ -57,6 +60,12 @@ public:
*/
virtual void DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_ShouldApply, bool a_KeepEmptySlots);
+ /// Called on DblClicking to collect all stackable items into hand.
+ /// The items are accumulated in a_Dragging and removed from the slots immediately.
+ /// If a_CollectFullStacks is false, slots with full stacks are skipped while collecting.
+ /// Returns true if full stack has been collected in a_Dragging, false if there's space remaining to fill.
+ virtual bool CollectItemsToHand(cItem & a_Dragging, cPlayer & a_Player, bool a_CollectFullStacks);
+
protected:
int m_NumSlots;
cWindow & m_ParentWindow;