summaryrefslogtreecommitdiffstats
path: root/src/UI/Window.cpp
diff options
context:
space:
mode:
authordaniel0916 <theschokolps@gmail.com>2014-04-12 14:58:46 +0200
committerdaniel0916 <theschokolps@gmail.com>2014-04-12 14:58:46 +0200
commite6e702e7fdbc8b7475d3dbecc0f81a08304997ae (patch)
tree1764949b84b4ae7a9da2330a90513c301d707820 /src/UI/Window.cpp
parentModified comment (diff)
downloadcuberite-e6e702e7fdbc8b7475d3dbecc0f81a08304997ae.tar
cuberite-e6e702e7fdbc8b7475d3dbecc0f81a08304997ae.tar.gz
cuberite-e6e702e7fdbc8b7475d3dbecc0f81a08304997ae.tar.bz2
cuberite-e6e702e7fdbc8b7475d3dbecc0f81a08304997ae.tar.lz
cuberite-e6e702e7fdbc8b7475d3dbecc0f81a08304997ae.tar.xz
cuberite-e6e702e7fdbc8b7475d3dbecc0f81a08304997ae.tar.zst
cuberite-e6e702e7fdbc8b7475d3dbecc0f81a08304997ae.zip
Diffstat (limited to 'src/UI/Window.cpp')
-rw-r--r--src/UI/Window.cpp86
1 files changed, 85 insertions, 1 deletions
diff --git a/src/UI/Window.cpp b/src/UI/Window.cpp
index 5d89534dd..c514e76e7 100644
--- a/src/UI/Window.cpp
+++ b/src/UI/Window.cpp
@@ -808,7 +808,10 @@ cCraftingWindow::cCraftingWindow(int a_BlockX, int a_BlockY, int a_BlockZ) :
// cEnchantingWindow:
cEnchantingWindow::cEnchantingWindow(int a_BlockX, int a_BlockY, int a_BlockZ) :
-cWindow(wtEnchantment, "Enchant")
+ cWindow(wtEnchantment, "Enchant"),
+ m_BlockX(a_BlockX),
+ m_BlockY(a_BlockY),
+ m_BlockZ(a_BlockZ)
{
m_SlotAreas.push_back(new cSlotAreaEnchanting(1, *this));
m_SlotAreas.push_back(new cSlotAreaInventory(*this));
@@ -819,6 +822,87 @@ cWindow(wtEnchantment, "Enchant")
+void cEnchantingWindow::SetProperty(int a_Property, int a_Value)
+{
+ if (a_Property == 0)
+ {
+ m_PropertyValue0 = a_Value;
+ }
+ else if (a_Property == 1)
+ {
+ m_PropertyValue1 = a_Value;
+ }
+ else if (a_Property == 2)
+ {
+ m_PropertyValue2 = a_Value;
+ }
+
+ cCSLock Lock(m_CS);
+ for (cPlayerList::iterator itr = m_OpenedBy.begin(), end = m_OpenedBy.end(); itr != end; ++itr)
+ {
+ (*itr)->GetClientHandle()->SendWindowProperty(*this, a_Property, a_Value);
+ } // for itr - m_OpenedBy[]
+}
+
+
+
+
+
+void cEnchantingWindow::SetProperty(int a_Property, int a_Value, cPlayer & a_Player)
+{
+ if (a_Property == 0)
+ {
+ m_PropertyValue0 = a_Value;
+ }
+ else if (a_Property == 1)
+ {
+ m_PropertyValue1 = a_Value;
+ }
+ else if (a_Property == 2)
+ {
+ m_PropertyValue2 = a_Value;
+ }
+
+ a_Player.GetClientHandle()->SendWindowProperty(*this, a_Property, a_Value);
+}
+
+
+
+
+
+int cEnchantingWindow::GetPropertyValue(int a_Property)
+{
+ if (a_Property == 0)
+ {
+ return m_PropertyValue0;
+ }
+ else if (a_Property == 1)
+ {
+ return m_PropertyValue1;
+ }
+ else if (a_Property == 2)
+ {
+ return m_PropertyValue2;
+ }
+
+ return -1;
+}
+
+
+
+
+
+void cEnchantingWindow::GetBlockPos(int & a_PosX, int & a_PosY, int & a_PosZ)
+{
+ a_PosX = m_BlockX;
+ a_PosY = m_BlockY;
+ a_PosZ = m_BlockZ;
+}
+
+
+
+
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cChestWindow: