107 "slotsprogressbar.xml",
"slotsprogressbar_fill.xml")),
110 mSortDropDown(
new DropDown(this, mSortModel, false,
113 this,
"namefilter", true)),
124 if (inventory !=
nullptr)
140 "inventorySortOrder"));
144 "storageSortOrder"));
161 (inventory !=
nullptr) &&
189 const size_t sz = tags.size();
190 for (
size_t f = 0; f < sz; f ++)
201 "inventory_background.xml");
209 const std::string equip =
_(
"Equip");
211 const std::string use =
_(
"Use");
213 const std::string unequip =
_(
"Unequip");
221 longestUseString = unequip;
261 "weightprogressbar.xml",
"weightprogressbar_fill.xml");
321 place(0, 2, invenScroll, 7, 4);
351 "weightprogressbar.xml",
"weightprogressbar_fill.xml");
362 place(0, 2, invenScroll, 7, 4);
459 const std::string &eventId =
event.getId();
460 if (eventId ==
"outfit")
464 else if (eventId ==
"shop")
468 else if (eventId ==
"equipment")
472 else if (eventId ==
"cart")
476 else if (eventId ==
"close")
480 else if (eventId ==
"store")
507 else if (eventId ==
"sort")
513 else if (eventId ==
"namefilter")
518 else if (eventId.find(
"tag_") == 0U)
520 std::string tagName =
event.getId().substr(4);
530 if (eventId ==
"use")
534 if (eventId ==
"equip")
538 else if (eventId ==
"drop")
573 else if (eventId ==
"split")
581 else if (eventId ==
"retrieve")
623 const int clicks =
event.getClickCount();
625 if (clicks == 2 && (
gui !=
nullptr))
649 const int mx =
event.getX() +
getX();
650 const int my =
event.getY() +
getY();
731 else if (clicks == 2)
783 const Widget *
const src =
event.getSource();
789 const int x =
event.getX();
790 const int y =
event.getY();
801 const Button *
const btn =
dynamic_cast<const Button *
>(src);
855 if ((item !=
nullptr) && selectedItem != item)
878 ?
info.getUseButton2() :
info.getUseButton();
953 /
static_cast<float>(max));
969 /
static_cast<float>(maxSlots));
1013 if (((*it) !=
nullptr) && (*it)->isInputFocused())
1021 std::set<Widget*> list;
1024 if (((*it) !=
nullptr) && (*it)->isWindowVisible())
1034 if (window !=
nullptr)
1041 if (window !=
nullptr)
1114 if (item1 ==
nullptr)
1117 if (item2 ==
nullptr)
1122 const Item *tmpItem = item1;
1129 _(
"Insert card request"),
1149 if (item ==
nullptr)
1153 if ((dialog !=
nullptr) &&
Attributes ::T AttributesT
#define fromBool(val, name)
Widget * findFirstWidget(const std::set< Widget * > &list)
void setValue(const std::string &key, const std::string &value)
int getIntValue(const std::string &key) const
void hideDrop(bool event)
void setSelected(int selected)
int getWidth(const std::string &text) const
void mouseExited(MouseEvent &event)
void moveItemToCraft(const int craftSlot)
void action(const ActionEvent &event)
static WindowList invInstances
void storeSortOrder() const
void combineItems(const int index1, const int index2)
void attributeChanged(const AttributesT id, const int64_t oldVal, const int64_t newVal)
InventoryWindow(Inventory *const inventory)
bool isInputFocused() const
static bool isAnyInputFocused()
void widgetResized(const Event &event)
void keyReleased(KeyEvent &event)
LayoutCell * mSortDropDownCell
void valueChanged(const SelectionEvent &event)
static bool isStorageActive()
LayoutCell * mNameFilterCell
LayoutCell * mSlotsBarCell
void slotsChanged(const Inventory *const inventory)
Button * mEquipmentButton
SortListModelInv * mSortModel
void mouseClicked(MouseEvent &event)
static InventoryWindow * getFirstVisible()
std::list< InventoryWindow * > WindowList
void keyPressed(KeyEvent &event)
void setVisible(Visible visible)
void mouseMoved(MouseEvent &event)
void widgetHidden(const Event &event)
Item * getSelectedItem() const
void updateButtons(const Item *item)
Item * getItem(const int index) const
bool isMainInventory() const
std::string getName() const
InventoryTypeT getType() const
void removeInventoyListener(InventoryListener *const listener)
void addInventoyListener(InventoryListener *const listener)
int getNumberOfSlotsUsed() const
static void showWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, int maxRange, const int tag)
void setFilter(const int tag)
void setName(const std::string &str)
void addSelectionListener(SelectionListener *listener)
Item * getSelectedItem() const
void setSortType(const int sortType)
Equipm isEquipment() const
Equipped isEquipped() const
std::string getName() const
ItemTypeT getType() const
const ItemInfo & getInfo() const
InputActionT getActionId() const
LayoutCell & setPadding(int p)
void setRowHeight(const int n, const int h)
void setWidth(const int w)
MouseButtonT getButton() const
virtual void mouseClicked(MouseEvent &event)
virtual void moveItem2(const InventoryTypeT source, const int slot, const int amount, const InventoryTypeT destination) const =0
virtual void forgotStorage() const =0
virtual void closeStorage() const =0
virtual NpcDialog * getCurrentNpcDialog() const =0
NpcInputStateT getInputState()
void addCraftItem(Item *const item, const int amount, const int slot)
void setProgress(const float progress)
void setColor(const Color &color1, const Color &color2)
void setText(const std::string &str)
void registerWindowForReset(Window *const window)
const std::string & getText() const
void tradeItem(const Item *const item, const int quantity, const bool check) const
void setSaveVisible(const bool save)
void setResizable(const bool resize)
void widgetHidden(const Event &event)
ContainerPlacer getPlacer(const int x, const int y)
virtual void setVisible(Visible visible)
bool isWindowVisible() const
bool getOptionBool(const std::string &name, const bool def) const
void setWindowName(const std::string &name)
void setCaption(const std::string &caption)
void setMinHeight(const int height)
void mouseMoved(MouseEvent &event)
void setMinWidth(const int width)
void enableVisibleSound(bool b)
void widgetResized(const Event &event)
const std::string & getWindowName() const
void setCloseButton(const bool flag)
virtual void scheduleDelete()
void setStickyButtonLock(const bool sticky)
LayoutCell & place(const int x, const int y, Widget *const wg, const int w, const int h)
const bool ForceQuantity_false
#define FOR_EACH(type, iter, array)
Net::InventoryHandler * inventoryHandler
InventoryType ::T InventoryTypeT
InventoryWindow * inventoryWindow
InsertCardListener insertCardListener
InventoryWindow * cartWindow
InventoryWindow * storageWindow
const bool LoseFocusOnTab_true
bool info(InputEvent &event)
const StringVect & getTags()
int getTagId(const std::string &tagName)
void useEquipItem(const Item *const item, const int16_t useType, const Sfx sfx)
void dropItem(const Item *const item, const int amount, const Sfx sfx)
void useEquipItem2(const Item *const item, const int16_t useType, const Sfx sfx)
int32_t getAttribute(const AttributesT id)
bool isItemProtected(const int id)
std::string formatCurrency(const int value)
std::string formatWeight(const int value)
Net::NpcHandler * npcHandler
ConfirmDialog * confirmDlg
SetupWindow * setupWindow
const bool ShowEmptyRows_false
static const std::string SOUND_REQUEST
std::string strprintf(const char *const format,...)
std::vector< std::string > StringVect
TradeWindow * tradeWindow
WindowContainer * windowContainer