diff options
author | Mattes D <github@xoft.cz> | 2014-05-10 21:27:57 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-05-10 21:27:57 +0200 |
commit | 28815252e6ff086c0fab7cf56be4839f3d8612a3 (patch) | |
tree | 4532e85cbcc873a2616147713e9f899ecf84d111 /src/UI/SlotArea.h | |
parent | Client cert is not requested. (diff) | |
parent | Merge pull request #993 from mc-server/GridStructGen (diff) | |
download | cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.gz cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.bz2 cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.lz cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.xz cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.tar.zst cuberite-28815252e6ff086c0fab7cf56be4839f3d8612a3.zip |
Diffstat (limited to 'src/UI/SlotArea.h')
-rw-r--r-- | src/UI/SlotArea.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/UI/SlotArea.h b/src/UI/SlotArea.h index 254722822..4da6a672f 100644 --- a/src/UI/SlotArea.h +++ b/src/UI/SlotArea.h @@ -9,6 +9,7 @@ #pragma once #include "../Inventory.h" +#include "Window.h" @@ -259,6 +260,43 @@ protected: +class cSlotAreaAnvil : + public cSlotAreaTemporary +{ + typedef cSlotAreaTemporary super; + +public: + cSlotAreaAnvil(cAnvilWindow & a_ParentWindow); + + // cSlotArea overrides: + virtual void Clicked(cPlayer & a_Player, int a_SlotNum, eClickAction a_ClickAction, const cItem & a_ClickedItem) override; + virtual void ShiftClicked(cPlayer & a_Player, int a_SlotNum, const cItem & a_ClickedItem) override; + virtual void DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, bool a_ShouldApply, bool a_KeepEmptySlots) override; + + // cSlotAreaTemporary overrides: + virtual void OnPlayerRemoved(cPlayer & a_Player) override; + + /** Can the player take the item from the slot? */ + bool CanTakeResultItem(cPlayer & a_Player); + + /** This function will call, when the player take the item from the slot. */ + void OnTakeResult(cPlayer & a_Player); + + /** Handles a click in the item slot. */ + void UpdateResult(cPlayer & a_Player); + +protected: + /** The maximum cost of repairing/renaming in the anvil. */ + int m_MaximumCost; + + /** The stack size of the second item where was used for repair */ + char m_StackSizeToBeUsedInRepair; +} ; + + + + + class cSlotAreaEnchanting : public cSlotAreaTemporary { |