summaryrefslogtreecommitdiffstats
path: root/source/UI
diff options
context:
space:
mode:
Diffstat (limited to 'source/UI')
-rw-r--r--source/UI/SlotArea.cpp2
-rw-r--r--source/UI/SlotArea.h8
2 files changed, 5 insertions, 5 deletions
diff --git a/source/UI/SlotArea.cpp b/source/UI/SlotArea.cpp
index 7c7b8cd4a..07b191292 100644
--- a/source/UI/SlotArea.cpp
+++ b/source/UI/SlotArea.cpp
@@ -613,7 +613,7 @@ void cSlotAreaInventoryBase::Clicked(cPlayer & a_Player, int a_SlotNum, eClickAc
const cItem * cSlotAreaInventoryBase::GetSlot(int a_SlotNum, cPlayer & a_Player)
{
- // a_SlotNum ranges from 0 to 35, map that to the player's inventory slots 9 to 44
+ // a_SlotNum ranges from 0 to 35, map that to the player's inventory slots according to the internal offset
return &a_Player.GetInventory().GetSlot(a_SlotNum + m_SlotOffset);
}
diff --git a/source/UI/SlotArea.h b/source/UI/SlotArea.h
index 2738e08e9..2b56f3228 100644
--- a/source/UI/SlotArea.h
+++ b/source/UI/SlotArea.h
@@ -8,7 +8,7 @@
#pragma once
-#include "../Item.h"
+#include "../Inventory.h"
@@ -97,7 +97,7 @@ class cSlotAreaInventory :
public:
cSlotAreaInventory(cWindow & a_ParentWindow) :
- cSlotAreaInventoryBase(27, 9, a_ParentWindow) // 27 slots, starting at inventory index 9
+ cSlotAreaInventoryBase(cInventory::invInventoryCount, cInventory::invInventoryOffset, a_ParentWindow)
{
}
} ;
@@ -114,7 +114,7 @@ class cSlotAreaHotBar :
public:
cSlotAreaHotBar(cWindow & a_ParentWindow) :
- cSlotAreaInventoryBase(9, 36, a_ParentWindow)
+ cSlotAreaInventoryBase(cInventory::invHotbarCount, cInventory::invHotbarOffset, a_ParentWindow)
{
}
} ;
@@ -129,7 +129,7 @@ class cSlotAreaArmor :
{
public:
cSlotAreaArmor(cWindow & a_ParentWindow) :
- cSlotAreaInventoryBase(4, 5, a_ParentWindow)
+ cSlotAreaInventoryBase(cInventory::invArmorCount, cInventory::invArmorOffset, a_ParentWindow)
{
}