summaryrefslogtreecommitdiff
path: root/src/gui/widgets/itemcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/itemcontainer.cpp')
-rw-r--r--src/gui/widgets/itemcontainer.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index c46131379..5994b1e1a 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -61,10 +61,9 @@ static const int BOX_HEIGHT = 43;
class ItemIdPair
{
public:
- ItemIdPair(int id, Item* item)
+ ItemIdPair(int id, Item* item) :
+ mId(id), mItem(item)
{
- mId = id;
- mItem = item;
}
int mId;
@@ -166,18 +165,17 @@ ItemContainer::ItemContainer(Inventory *inventory, bool forceQuantity):
mDescItems(false),
mTag(0),
mSortType(0),
- mShowMatrix(nullptr)
+ mItemPopup(new ItemPopup),
+ mShowMatrix(nullptr),
+ mEquipedColor(Theme::getThemeColor(Theme::ITEM_EQUIPPED)),
+ mUnEquipedColor(Theme::getThemeColor(Theme::ITEM_NOT_EQUIPPED))
{
- mItemPopup = new ItemPopup;
setFocusable(true);
mSelImg = Theme::getImageFromTheme("selection.png");
if (!mSelImg)
logger->log1("Error: Unable to load selection.png");
- mEquipedColor = Theme::getThemeColor(Theme::ITEM_EQUIPPED);
- mUnEquipedColor = Theme::getThemeColor(Theme::ITEM_NOT_EQUIPPED);
-
addKeyListener(this);
addMouseListener(this);
addWidgetListener(this);