diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-10-30 21:19:30 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-10-30 21:19:30 +0300 |
commit | 5b6848e817bea37e286f197f8702ab29f1de3bc8 (patch) | |
tree | 2f38f5ac1c38fc1e7766d4d09535f7badecd05ea /src/gui/widgets/itemcontainer.h | |
parent | bd429077f8985c5ee45a53009d02e2f495b4ad90 (diff) | |
download | plus-5b6848e817bea37e286f197f8702ab29f1de3bc8.tar.gz plus-5b6848e817bea37e286f197f8702ab29f1de3bc8.tar.bz2 plus-5b6848e817bea37e286f197f8702ab29f1de3bc8.tar.xz plus-5b6848e817bea37e286f197f8702ab29f1de3bc8.zip |
Add item container max columns limit.
Also fix some issues with adding items to npc item container.
Diffstat (limited to 'src/gui/widgets/itemcontainer.h')
-rw-r--r-- | src/gui/widgets/itemcontainer.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h index 42aeb2684..4e29cf2c5 100644 --- a/src/gui/widgets/itemcontainer.h +++ b/src/gui/widgets/itemcontainer.h @@ -60,6 +60,7 @@ class ItemContainer final : public Widget, */ ItemContainer(const Widget2 *const widget, Inventory *const inventory, + const int maxColumns = 100000, const ShowEmptyRows showEmptyRows = ShowEmptyRows_false, const ForceQuantity forceQuantity = ForceQuantity_false); @@ -96,6 +97,8 @@ class ItemContainer final : public Widget, // WidgetListener void widgetResized(const Event &event) override final; + void widgetMoved(const Event &event) override final; + /** * Returns the selected item. */ @@ -171,7 +174,7 @@ class ItemContainer final : public Widget, void distributeValueChangedEvent(); /** - * Gets the slot index based on the cursor position. + * Gets the inventory slot index based on the cursor position. * * @param x The X coordinate position. * @param y The Y coordinate position. @@ -179,6 +182,8 @@ class ItemContainer final : public Widget, */ int getSlotIndex(int x, int y) const; + int getSlotByXY(int x, int y) const; + Inventory *mInventory; Image *mSelImg; Image *mProtectedImg; @@ -207,6 +212,7 @@ class ItemContainer final : public Widget, int mEquippedTextPadding; int mPaddingItemX; int mPaddingItemY; + int mMaxColumns; SelectionState mSelectionStatus; ForceQuantity mForceQuantity; ShowEmptyRows mShowEmptyRows; |