106 "slotsprogressbar.xml",
"slotsprogressbar_fill.xml")),
109 mSortDropDown(
new DropDown(this, mSortModel, false,
112 this,
"namefilter", true)),
123 if (inventory !=
nullptr)
139 "inventorySortOrder"));
143 "storageSortOrder"));
160 (inventory !=
nullptr) &&
188 const size_t sz = tags.size();
189 for (
size_t f = 0; f < sz; f ++)
200 "inventory_background.xml");
208 const std::string equip =
_(
"Equip");
210 const std::string use =
_(
"Use");
212 const std::string unequip =
_(
"Unequip");
220 longestUseString = unequip;
260 "weightprogressbar.xml",
"weightprogressbar_fill.xml");
320 place(0, 2, invenScroll, 7, 4);
350 "weightprogressbar.xml",
"weightprogressbar_fill.xml");
361 place(0, 2, invenScroll, 7, 4);
458 const std::string &eventId =
event.getId();
459 if (eventId ==
"outfit")
463 else if (eventId ==
"shop")
467 else if (eventId ==
"equipment")
471 else if (eventId ==
"cart")
475 else if (eventId ==
"close")
479 else if (eventId ==
"store")
489 if (storageWindow !=
nullptr)
506 else if (eventId ==
"sort")
512 else if (eventId ==
"namefilter")
517 else if (eventId.find(
"tag_") == 0U)
519 std::string tagName =
event.getId().substr(4);
529 if (eventId ==
"use")
533 if (eventId ==
"equip")
537 else if (eventId ==
"drop")
572 else if (eventId ==
"split")
580 else if (eventId ==
"retrieve")
582 if (storageWindow !=
nullptr)
622 const int clicks =
event.getClickCount();
624 if (clicks == 2 && (
gui !=
nullptr))
646 const int mx =
event.getX() +
getX();
647 const int my =
event.getY() +
getY();
730 else if (clicks == 2)
782 const Widget *
const src =
event.getSource();
788 const int x =
event.getX();
789 const int y =
event.getY();
800 const Button *
const btn =
dynamic_cast<const Button *
>(src);
854 if ((item !=
nullptr) && selectedItem != item)
952 / static_cast<float>(max));
968 / static_cast<float>(maxSlots));
1012 if (((*it) !=
nullptr) && (*it)->isInputFocused())
1020 std::set<Widget*> list;
1023 if (((*it) !=
nullptr) && (*it)->isWindowVisible())
1033 if (window !=
nullptr)
1040 if (window !=
nullptr)
1096 const int64_t newVal A_UNUSED)
1113 if (item1 ==
nullptr)
1116 if (item2 ==
nullptr)
1121 const Item *tmpItem = item1;
1128 _(
"Insert card request"),
1148 if (item ==
nullptr)
1152 if ((dialog !=
nullptr) &&
#define FOR_EACH(type, iter, array)
static bool isStorageActive()
LayoutCell & place(const int x, const int y, Widget *const wg, const int w, const int h)
virtual void moveItem2(const InventoryTypeT source, const int slot, const int amount, const InventoryTypeT destination) const =0
std::string getName() const
int getNumberOfSlotsUsed() const
const bool LoseFocusOnTab_true
bool getOptionBool(const std::string &name, const bool def) const
TradeWindow * tradeWindow
const StringVect & getTags()
void action(const ActionEvent &event)
void storeSortOrder() const
Item * getSelectedItem() const
NpcInputStateT getInputState()
WindowContainer * windowContainer
const bool ShowEmptyRows_false
void keyPressed(KeyEvent &event)
void hideDrop(bool event)
InventoryType ::T InventoryTypeT
Equipped isEquipped() const
std::string formatWeight(const int value)
MouseButtonT getButton() const
Widget * findFirstWidget(const std::set< Widget *> &list)
void widgetHidden(const Event &event)
void setMinWidth(const int width)
std::list< InventoryWindow * > WindowList
static void showWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, int maxRange, const int tag)
static const std::string SOUND_REQUEST
void updateButtons(const Item *item)
void mouseMoved(MouseEvent &event)
std::string formatCurrency(const int value)
InputActionT getActionId() const
LayoutCell * mSlotsBarCell
int getIntValue(const std::string &key) const
void mouseMoved(MouseEvent &event)
std::vector< std::string > StringVect
SortListModelInv * mSortModel
InsertCardListener insertCardListener
void setVisible(Visible visible)
InventoryWindow * inventoryWindow
void registerWindowForReset(Window *const window)
const std::string & getUseButton() const
void setName(const std::string &str)
InventoryWindow(Inventory *const inventory)
bool isInputFocused() const
void widgetHidden(const Event &event)
virtual NpcDialog * getCurrentNpcDialog() const =0
int getTagId(const std::string &tagName)
void widgetResized(const Event &event)
void useEquipItem(const Item *const item, const int16_t useType, const Sfx sfx)
InventoryWindow * storageWindow
const std::string & getUseButton2() const
void attributeChanged(const AttributesT id, const int64_t oldVal, const int64_t newVal)
void slotsChanged(const Inventory *const inventory)
std::string strprintf(const char *const format,...)
#define fromBool(val, name)
static InventoryWindow * getFirstVisible()
bool info(InputEvent &event)
void useEquipItem2(const Item *const item, const int16_t useType, const Sfx sfx)
virtual void forgotStorage() const =0
static bool isAnyInputFocused()
bool isMainInventory() const
void combineItems(const int index1, const int index2)
bool isWindowVisible() const
void setCloseButton(const bool flag)
const ItemInfo & getInfo() const
void moveItemToCraft(const int craftSlot)
virtual void closeStorage() const =0
void enableVisibleSound(bool b)
void widgetResized(const Event &event)
const std::string & getWindowName() const
void setMinHeight(const int height)
ContainerPlacer getPlacer(const int x, const int y)
Net::InventoryHandler * inventoryHandler
LayoutCell & setPadding(int p)
void setText(const std::string &str)
virtual void scheduleDelete()
void tradeItem(const Item *const item, const int quantity, const bool check) const
std::string getName() const
void setSaveVisible(const bool save)
void addSelectionListener(SelectionListener *listener)
bool isItemProtected(const int id)
LayoutCell * mSortDropDownCell
virtual void setVisible(Visible visible)
InventoryWindow * cartWindow
Item * getSelectedItem() const
ConfirmDialog * confirmDlg
int getWidth(const std::string &text) const
void valueChanged(const SelectionEvent &event)
const bool ForceQuantity_false
Attributes ::T AttributesT
ItemTypeT getType() const
Equipm isEquipment() const
Button * mEquipmentButton
void setSortType(const int sortType)
static WindowList invInstances
void keyReleased(KeyEvent &event)
void setResizable(const bool resize)
virtual void mouseClicked(MouseEvent &event)
void setStickyButtonLock(const bool sticky)
Net::NpcHandler * npcHandler
void setWidth(const int w)
SetupWindow * setupWindow
void addInventoyListener(InventoryListener *const listener)
Item * getItem(const int index) const
LayoutCell * mNameFilterCell
void addCraftItem(Item *const item, const int amount, const int slot)
int32_t getAttribute(const AttributesT id)
void setCaption(const std::string &caption)
void setColor(const Color &color1, const Color &color2)
InventoryTypeT getType() const
void setRowHeight(const int n, const int h)
void setSelected(int selected)
void setValue(const std::string &key, const std::string &value)
void setFilter(const int tag)
const std::string & getText() const
void mouseClicked(MouseEvent &event)
void setProgress(const float progress)
void dropItem(const Item *const item, const int amount, const Sfx sfx)
void mouseExited(MouseEvent &event)
void setWindowName(const std::string &name)
void removeInventoyListener(InventoryListener *const listener)