From a561886bf39ef49bcf6ea5488be833bd23e2edef Mon Sep 17 00:00:00 2001 From: Lane Kolbly Date: Thu, 6 Jul 2017 22:27:04 -0500 Subject: Implemented draggingitem API. --- src/Entities/Player.cpp | 13 +++++++++++++ src/Entities/Player.h | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 761337a30..e4192140a 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -1880,6 +1880,19 @@ AString cPlayer::GetPlayerListName(void) const +void cPlayer::SetDraggingItem(const cItem & a_Item) +{ + if (GetWindow() != nullptr) + { + m_DraggingItem = a_Item; + GetClientHandle()->SendInventorySlot(-1, -1, m_DraggingItem); + } +} + + + + + void cPlayer::TossEquippedItem(char a_Amount) { cItems Drops; diff --git a/src/Entities/Player.h b/src/Entities/Player.h index dc8f07823..95b21ec9a 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -404,7 +404,10 @@ public: void SendExperience(void); /** In UI windows, get the item that the player is dragging */ - cItem & GetDraggingItem(void) {return m_DraggingItem; } + cItem & GetDraggingItem(void) {return m_DraggingItem; } // tolua_export + + /** In UI windows, set the item that the player is dragging */ + void SetDraggingItem(const cItem & a_Item); // tolua_export // In UI windows, when inventory-painting: /** Clears the list of slots that are being inventory-painted. To be used by cWindow only */ -- cgit v1.2.3