From 8947147c25e2640519897bfdc8807e97ee291d70 Mon Sep 17 00:00:00 2001 From: KingCol13 <48412633+KingCol13@users.noreply.github.com> Date: Fri, 2 Oct 2020 00:33:32 +0300 Subject: Enchanting table shows detail on hover. Enchanting is deterministic. (#4937) * Use lapis for enchanting, subtract correct number of levels, ClientHandle now selects from pregenerated list. Co-authored-by: Tiger Wang --- src/UI/EnchantingWindow.h | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/UI/EnchantingWindow.h') diff --git a/src/UI/EnchantingWindow.h b/src/UI/EnchantingWindow.h index 4de5ed00c..2b32f078a 100644 --- a/src/UI/EnchantingWindow.h +++ b/src/UI/EnchantingWindow.h @@ -15,6 +15,12 @@ +class cSlotAreaEnchanting; + + + + + class cEnchantingWindow: public cWindow { @@ -24,22 +30,23 @@ public: cEnchantingWindow(Vector3i a_BlockPos, const AString & a_Title); + /** Sends enchantment properties to the client. + If the property represents a level requirement, stores it for later GetProperty retrieval. */ virtual void SetProperty(short a_Property, short a_Value, cPlayer & a_Player) override; + /** Sends enchantment properties to the client. + If the property represents a level requirement, stores it for later GetProperty retrieval. */ virtual void SetProperty(short a_Property, short a_Value) override; - /** Return the value of a property */ - short GetPropertyValue(short a_Property); + /** Return the level requirement of the given enchantment slot. */ + short GetProperty(short a_Property); virtual void DistributeStack(cItem & a_ItemStack, int a_Slot, cPlayer & a_Player, cSlotArea * a_ClickedArea, bool a_ShouldApply) override; - cSlotArea * m_SlotArea; + cSlotAreaEnchanting * m_SlotArea; protected: - short m_PropertyValue[3]; + + std::array m_PropertyValue; Vector3i m_BlockPos; }; - - - - -- cgit v1.2.3