From 8591935a4b48c24a16e8c103d474ee6803ce56a0 Mon Sep 17 00:00:00 2001 From: Howaner Date: Sat, 13 Dec 2014 18:49:11 +0100 Subject: Implemented vanilla-like shift click. This fixes many visual bugs. --- src/UI/EnchantingWindow.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/UI/EnchantingWindow.h') diff --git a/src/UI/EnchantingWindow.h b/src/UI/EnchantingWindow.h index 9e42c1f4f..a6386ffe2 100644 --- a/src/UI/EnchantingWindow.h +++ b/src/UI/EnchantingWindow.h @@ -70,6 +70,25 @@ public: return m_PropertyValue[a_Property]; } + virtual void DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a_Player, cSlotArea * a_ClickedArea, bool a_ShouldApply) override + { + cSlotAreas AreasInOrder; + + if (a_ClickedArea == m_SlotAreas[0]) + { + // Enchanting Area + AreasInOrder.push_back(m_SlotAreas[2]); /* Hotbar */ + AreasInOrder.push_back(m_SlotAreas[1]); /* Inventory */ + super::DistributeStack(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, true); + } + else + { + // Inventory or Hotbar + AreasInOrder.push_back(m_SlotAreas[0]); /* Enchanting */ + super::DistributeStack(a_ItemStack, a_Player, AreasInOrder, a_ShouldApply, false); + } + } + cSlotArea * m_SlotArea; protected: -- cgit v1.2.3