ManaPlus
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes

#include <inventorywindow.h>

Inheritance diagram for InventoryWindow:
Window ActionListener KeyListener SelectionListener InventoryListener AttributeListener BasicContainer2 MouseListener WidgetListener BasicContainer Widget WidgetDeathListener Widget2

Public Member Functions

 InventoryWindow (Inventory *const inventory)
 
 ~InventoryWindow ()
 
void postInit ()
 
void storeSortOrder () const
 
void action (const ActionEvent &event)
 
ItemgetSelectedItem () const
 
void unselectItem ()
 
void widgetHidden (const Event &event)
 
void mouseClicked (MouseEvent &event)
 
void keyPressed (KeyEvent &event)
 
void keyReleased (KeyEvent &event)
 
void valueChanged (const SelectionEvent &event)
 
void close ()
 
void slotsChanged (const Inventory *const inventory)
 
bool isMainInventory () const
 
void updateDropButton ()
 
void updateButtons (const Item *item)
 
bool isInputFocused () const
 
void widgetResized (const Event &event)
 
void mouseMoved (MouseEvent &event)
 
void mouseExited (MouseEvent &event)
 
void setVisible (Visible visible)
 
void unsetInventory ()
 
void attributeChanged (const AttributesT id, const int64_t oldVal, const int64_t newVal)
 
void combineItems (const int index1, const int index2)
 
void moveItemToCraft (const int craftSlot)
 
- Public Member Functions inherited from Window
 Window (const std::string &caption, const Modal modal, Window *const parent, std::string skin)
 
 ~Window ()
 
void draw (Graphics *const graphics)
 
void safeDraw (Graphics *const graphics)
 
void setContentSize (int width, int height)
 
void setLocationRelativeTo (const Widget *const widget)
 
void setLocationHorisontallyRelativeTo (const Widget *const widget)
 
void setLocationRelativeTo (const ImagePosition::Type &position, int offsetX, int offsetY)
 
void setResizable (const bool resize)
 
void redraw ()
 
void widgetMoved (const Event &event)
 
void setCloseButton (const bool flag)
 
bool getCloseButton () const
 
void setAllowClose (const bool b)
 
bool getAlowClose () const
 
bool isResizable () const
 
void setMinWidth (const int width)
 
int getMinWidth () const
 
void setMinHeight (const int height)
 
int getMinHeight () const
 
void setMaxWidth (const int width)
 
int getMaxWidth () const
 
void setMaxHeight (const int height)
 
int getMaxHeight () const
 
void setShowTitle (bool flag)
 
void setStickyButton (const bool flag)
 
void setSticky (const bool sticky)
 
bool isSticky () const
 
void setStickyButtonLock (const bool sticky)
 
bool isStickyButtonLock () const
 
void setVisible (const Visible visible, const bool forceSticky)
 
bool isDefaultVisible () const
 
void setDefaultVisible (const bool save)
 
bool willSaveVisible () const
 
void setSaveVisible (const bool save)
 
WindowgetParentWindow () const
 
virtual void scheduleDelete ()
 
void mousePressed (MouseEvent &event)
 
void mouseDragged (MouseEvent &event)
 
void mouseReleased (MouseEvent &event)
 
void mouseEntered (MouseEvent &event)
 
void updateResizeHandler (MouseEvent &event)
 
void setWindowName (const std::string &name)
 
const std::string & getWindowName () const
 
void loadWindowState ()
 
void saveWindowState ()
 
void setDefaultSize (const int defaultX, const int defaultY, int defaultWidth, int defaultHeight)
 
void setDefaultSize ()
 
void setDefaultSize (const int defaultWidth, const int defaultHeight, const ImagePosition::Type &position, const int offsetx, const int offsetY)
 
virtual void resetToDefaultSize ()
 
void adjustPositionAfterResize (const int oldScreenWidth, const int oldScreenHeight)
 
LayoutgetLayout ()
 
void clearLayout ()
 
void reflowLayout (int w, int h)
 
LayoutCellplace (const int x, const int y, Widget *const wg, const int w, const int h)
 
ContainerPlacer getPlacer (const int x, const int y)
 
void center ()
 
void centerHorisontally ()
 
void setModal (const Modal modal)
 
Rect getWindowArea () const
 
bool isResizeAllowed (const MouseEvent &event) const
 
void setCaptionFont (Font *font)
 
void enableVisibleSound (bool b)
 
bool isWindowVisible () const
 
void setPadding (int padding)
 
int getPadding () const
 
void setTitleBarHeight (unsigned int height)
 
unsigned int getTitleBarHeight () const
 
void setCaption (const std::string &caption)
 
const std::string & getCaption () const
 
void setAlignment (Graphics::Alignment alignment)
 
Graphics::Alignment getAlignment () const
 
void setMovable (Move movable)
 
bool isMovable () const
 
Rect getChildrenArea ()
 
virtual void resizeToContent ()
 
- Public Member Functions inherited from BasicContainer2
 BasicContainer2 (const Widget2 *const widget)
 
 ~BasicContainer2 ()
 
void setOpaque (Opaque opaque)
 
bool isOpaque () const
 
virtual void add (Widget *const widget)
 
void addXY (Widget *const widget, const int x, const int y)
 
- Public Member Functions inherited from BasicContainer
 BasicContainer (const Widget2 *const widget)
 
 ~BasicContainer ()
 
void showWidgetPart (Widget *const widget, const Rect &area)
 
void moveToTop (Widget *const widget)
 
void moveToBottom (Widget *const widget)
 
void focusNext ()
 
void focusPrevious ()
 
void logic ()
 
void setFocusHandler (FocusHandler *const focusHandler)
 
void setInternalFocusHandler (FocusHandler *const focusHandler)
 
WidgetgetWidgetAt (int x, int y)
 
void death (const Event &event)
 
WidgetfindFirstWidget (const std::set< Widget *> &list)
 
void add (Widget *const widget)
 
virtual void remove (Widget *const widget)
 
virtual void clear ()
 
- Public Member Functions inherited from Widget
 Widget (const Widget2 *const widget)
 
 ~Widget ()
 
virtual void drawFrame (Graphics *graphics)
 
virtual void safeDrawFrame (Graphics *graphics)
 
void setFrameSize (const unsigned int frameSize)
 
unsigned int getFrameSize () const
 
WidgetgetParent () const
 
void setWidth (const int width)
 
int getWidth () const
 
void setHeight (const int height)
 
int getHeight () const
 
void setSize (const int width, const int height)
 
void setX (const int x)
 
int getX () const
 
void setY (const int y)
 
int getY () const
 
void setPosition (const int x, const int y)
 
void setDimension (const Rect &dimension)
 
const RectgetDimension () const
 
void setFocusable (const bool focusable)
 
bool isFocusable () const
 
virtual bool isFocused () const
 
void setEnabled (const bool enabled)
 
bool isEnabled () const
 
void setVisible (Visible visible)
 
bool isVisible () const
 
void setBaseColor (const Color &color)
 
const ColorgetBaseColor () const
 
void setForegroundColor (const Color &color)
 
const ColorgetForegroundColor () const
 
void setBackgroundColor (const Color &color)
 
const ColorgetBackgroundColor () const
 
virtual void requestFocus ()
 
virtual void requestMoveToTop ()
 
virtual void requestMoveToBottom ()
 
FocusHandlergetFocusHandler ()
 
void addActionListener (ActionListener *const actionListener)
 
void removeActionListener (ActionListener *const actionListener)
 
void addDeathListener (WidgetDeathListener *const deathListener)
 
void removeDeathListener (WidgetDeathListener *const deathListener)
 
void addMouseListener (MouseListener *const mouseListener)
 
void removeMouseListener (MouseListener *const mouseListener)
 
void addKeyListener (KeyListener *const keyListener)
 
void removeKeyListener (KeyListener *const keyListener)
 
void addFocusListener (FocusListener *const focusListener)
 
void removeFocusListener (FocusListener *const focusListener)
 
void addWidgetListener (WidgetListener *const widgetListener)
 
void removeWidgetListener (WidgetListener *const widgetListener)
 
void setActionEventId (const std::string &actionEventId)
 
const std::string & getActionEventId () const
 
virtual void getAbsolutePosition (int &x, int &y) const
 
virtual void setParent (Widget *parent)
 
FontgetFont () const
 
void setFont (Font *const font)
 
virtual void fontChanged ()
 
bool isTabInEnabled () const
 
void setTabInEnabled (const bool enabled)
 
bool isTabOutEnabled () const
 
void setTabOutEnabled (const bool enabled)
 
void requestModalFocus ()
 
virtual void requestModalMouseInputFocus ()
 
virtual void releaseModalFocus ()
 
virtual void releaseModalMouseInputFocus ()
 
virtual bool isModalFocused () const
 
virtual bool isModalMouseInputFocused () const
 
const std::list< MouseListener * > & getMouseListeners () const A_CONST
 
const std::list< KeyListener * > & getKeyListeners () const A_CONST
 
const std::list< FocusListener * > & getFocusListeners () const A_CONST
 
virtual FocusHandlergetInternalFocusHandler ()
 
void setInternalFocusHandler (FocusHandler *const internalFocusHandler)
 
void setId (const std::string &id)
 
const std::string & getId () const
 
virtual void showPart (const Rect &rectangle)
 
bool isAllowLogic () const
 
void setMouseConsume (const bool b)
 
bool isMouseConsume () const
 
void setRedraw (const bool b)
 
virtual bool isSelectable () const
 
void setSelectable (const bool selectable)
 
void windowResized ()
 
- Public Member Functions inherited from Widget2
virtual ~Widget2 ()
 
const ColorgetThemeColor (const ThemeColorIdT type, const unsigned int alpha) const A_INLINE
 
const ColorgetThemeCharColor (const signed char c, bool &valid) const A_INLINE
 
virtual void setWidget2 (const Widget2 *const widget)
 
void setPalette (int palette)
 
void checkPalette ()
 
void setForegroundColor2 (const Color &color)
 
WidgetgetWindow () const
 
virtual void setWindow (Widget *const window)
 
- Public Member Functions inherited from WidgetDeathListener
virtual ~WidgetDeathListener ()
 
- Public Member Functions inherited from MouseListener
virtual ~MouseListener ()
 
virtual void mouseWheelMovedUp (MouseEvent &event)
 
virtual void mouseWheelMovedDown (MouseEvent &event)
 
- Public Member Functions inherited from WidgetListener
virtual ~WidgetListener ()
 
virtual void widgetShown (const Event &event)
 
- Public Member Functions inherited from ActionListener
virtual ~ActionListener ()
 
- Public Member Functions inherited from KeyListener
virtual ~KeyListener ()
 
- Public Member Functions inherited from SelectionListener
virtual ~SelectionListener ()
 
- Public Member Functions inherited from InventoryListener
virtual ~InventoryListener ()
 
- Public Member Functions inherited from AttributeListener
 AttributeListener ()
 
virtual ~ AttributeListener ()
 

Static Public Member Functions

static bool isStorageActive ()
 
static bool isAnyInputFocused ()
 
static InventoryWindowgetFirstVisible ()
 
static void nextTab ()
 
static void prevTab ()
 
- Static Public Member Functions inherited from Window
static void setWindowContainer (WindowContainer *const windowContainer)
 
- Static Public Member Functions inherited from Widget
static void setGlobalFont (Font *const font)
 
static FontgetGloablFont ()
 
static void cleanGlobalFont ()
 
static bool widgetExists (const Widget *const widget)
 
static void distributeWindowResizeEvent ()
 
static WidgetcallPostInit (Widget *const widget)
 
- Static Public Member Functions inherited from AttributeListener
static void distributeEvent (const AttributesT id, const int64_t oldVal, const int64_t newVal)
 
static void addListener (AttributeListener *const listener)
 
static void removeListener (const AttributeListener *const listener)
 

Private Types

typedef std::list< InventoryWindow * > WindowList
 

Private Member Functions

void updateWeight ()
 

Private Attributes

InventorymInventory
 
ItemContainermItems
 
ButtonmUseButton
 
ButtonmDropButton
 
ButtonmOutfitButton
 
ButtonmShopButton
 
ButtonmCartButton
 
ButtonmEquipmentButton
 
ButtonmStoreButton
 
ButtonmRetrieveButton
 
ButtonmInvCloseButton
 
ProgressBarmWeightBar
 
ProgressBarmSlotsBar
 
TabStripmFilter
 
SortListModelInvmSortModel
 
DropDownmSortDropDown
 
TextFieldmNameFilter
 
LayoutCellmSortDropDownCell
 
LayoutCellmNameFilterCell
 
LayoutCellmFilterCell
 
LayoutCellmSlotsBarCell
 
bool mSplit
 
bool mCompactMode
 

Static Private Attributes

static WindowList invInstances
 

Additional Inherited Members

- Data Fields inherited from Widget
Visible mVisible
 
- Protected Types inherited from BasicContainer
typedef std::vector< Widget * > WidgetList
 
typedef WidgetList::iterator WidgetListIterator
 
typedef WidgetList::const_iterator WidgetListConstIterator
 
typedef WidgetList::reverse_iterator WidgetListReverseIterator
 
typedef WidgetList::const_reverse_iterator WidgetListCReverseIterator
 
- Protected Types inherited from Widget
typedef std::list< MouseListener * > MouseListenerList
 
typedef MouseListenerList::iterator MouseListenerIterator
 
typedef std::list< KeyListener * > KeyListenerList
 
typedef KeyListenerList::iterator KeyListenerIterator
 
typedef std::list< ActionListener * > ActionListenerList
 
typedef ActionListenerList::iterator ActionListenerIterator
 
typedef std::list< WidgetDeathListener * > WidgetDeathListenerList
 
typedef WidgetDeathListenerList::iterator WidgetDeathListenerIterator
 
typedef std::list< FocusListener * > FocusListenerList
 
typedef FocusListenerList::iterator FocusListenerIterator
 
typedef std::list< WidgetListener * > WidgetListenerList
 
typedef WidgetListenerList::iterator WidgetListenerIterator
 
- Protected Member Functions inherited from Window
bool canMove () const
 
int getOption (const std::string &name, const int def) const
 
bool getOptionBool (const std::string &name, const bool def) const
 
void setTitlePadding (const int p)
 
int getTitlePadding () const
 
- Protected Member Functions inherited from BasicContainer
virtual void drawChildren (Graphics *const graphics)
 
virtual void safeDrawChildren (Graphics *const graphics)
 
virtual void logicChildren ()
 
- Protected Member Functions inherited from Widget
void distributeActionEvent ()
 
void distributeResizedEvent ()
 
void distributeMovedEvent ()
 
void distributeHiddenEvent ()
 
void distributeShownEvent ()
 
- Protected Member Functions inherited from Widget2
 Widget2 (const Widget2 *const widget)
 
- Protected Member Functions inherited from WidgetDeathListener
 WidgetDeathListener ()
 
- Protected Member Functions inherited from MouseListener
 MouseListener ()
 
- Protected Member Functions inherited from WidgetListener
 WidgetListener ()
 
- Protected Member Functions inherited from ActionListener
 ActionListener ()
 
- Protected Member Functions inherited from KeyListener
 KeyListener ()
 
- Protected Member Functions inherited from SelectionListener
 SelectionListener ()
 
- Protected Member Functions inherited from InventoryListener
 InventoryListener ()
 
- Protected Attributes inherited from Window
std::string mCaption
 
Graphics::Alignment mAlignment
 
int mPadding
 
unsigned int mTitleBarHeight
 
Move mMovable
 
int mDragOffsetX
 
int mDragOffsetY
 
bool mMoved
 
SkinmSkin
 
int mDefaultX
 
int mDefaultY
 
int mDefaultWidth
 
int mDefaultHeight
 
int mCaptionOffsetX
 
int mCaptionOffsetY
 
bool mShowTitle
 
bool mLastRedraw
 
- Protected Attributes inherited from BasicContainer2
Opaque mOpaque
 
- Protected Attributes inherited from BasicContainer
WidgetList mWidgets
 
WidgetList mLogicWidgets
 
- Protected Attributes inherited from Widget
MouseListenerList mMouseListeners
 
KeyListenerList mKeyListeners
 
ActionListenerList mActionListeners
 
WidgetDeathListenerList mDeathListeners
 
FocusListenerList mFocusListeners
 
WidgetListenerList mWidgetListeners
 
Color mForegroundColor
 
Color mBackgroundColor
 
Color mBaseColor
 
Rect mDimension
 
std::string mActionEventId
 
std::string mId
 
FocusHandlermFocusHandler
 
FocusHandlermInternalFocusHandler
 
WidgetmParent
 
FontmCurrentFont
 
unsigned int mFrameSize
 
bool mFocusable
 
bool mTabIn
 
bool mTabOut
 
bool mEnabled
 
bool mAllowLogic
 
bool mMouseConsume
 
bool mRedraw
 
bool mSelectable
 
- Protected Attributes inherited from Widget2
int mPaletteOffset
 
WidgetmWindow
 
Color mForegroundColor2
 
- Static Protected Attributes inherited from Widget
static FontmGlobalFont = 0
 

Detailed Description

Inventory dialog.

Definition at line 56 of file inventorywindow.h.

Member Typedef Documentation

◆ WindowList

typedef std::list<InventoryWindow*> InventoryWindow::WindowList
private

Definition at line 179 of file inventorywindow.h.

Constructor & Destructor Documentation

◆ InventoryWindow()

InventoryWindow::InventoryWindow ( Inventory *const  inventory)
explicit

Constructor.

Definition at line 84 of file inventorywindow.cpp.

References _, Widget::addActionListener(), WidgetGroup::addButton(), Inventory::addInventoyListener(), Widget::addKeyListener(), ItemContainer::addSelectionListener(), BUTTON_SKIN, InventoryType::Cart, ImagePosition::CENTER, config, InventoryType::Craft, Window::enableVisibleSound(), fromBool, Widget::getFont(), Configuration::getIntValue(), Window::getLayout(), Inventory::getName(), Window::getOptionBool(), Window::getPlacer(), ItemDB::getTags(), Widget2::getThemeColor(), Inventory::getType(), Font::getWidth(), Widget::getWidth(), Window::getWindowName(), InventoryType::Inventory, invInstances, Inventory::isMainInventory(), Window::loadWindowState(), InventoryType::MailEdit, InventoryType::MailView, mainGraphics, mCartButton, mDropButton, mEquipmentButton, mFilter, mFilterCell, mInvCloseButton, mInventory, mItems, mNameFilter, mNameFilterCell, mOutfitButton, mRetrieveButton, mShopButton, mSlotsBar, mSlotsBarCell, mSortDropDown, mSortDropDownCell, mStoreButton, mUseButton, mWeightBar, Graphics::mWidth, InventoryType::Npc, Window::place(), ProgressColorId::PROG_WEIGHT, SetupWindow::registerWindowForReset(), LayoutType::SET, Widget::setActionEventId(), Window::setCaption(), Window::setCloseButton(), ProgressBar::setColor(), Window::setDefaultSize(), Button::setDescription(), ScrollArea::setHorizontalScrollPolicy(), Window::setMinHeight(), Window::setMinWidth(), LayoutCell::setPadding(), Window::setResizable(), LayoutCell::setRowHeight(), Window::setSaveVisible(), Widget::setSelectable(), DropDown::setSelected(), Window::setStickyButtonLock(), setupWindow, Window::setWindowName(), ScrollArea::SHOW_NEVER, ServerCommandType::size, ThemeColorId::SLOTS_BAR, ThemeColorId::SLOTS_BAR_OUTLINE, InventoryType::Storage, InventoryType::Trade, InventoryType::TypeEnd, updateDropButton(), updateWeight(), InventoryType::Vending, ThemeColorId::WEIGHT_BAR, and ThemeColorId::WEIGHT_BAR_OUTLINE.

84  :
85  Window("Inventory", Modal_false, nullptr, "inventory.xml"),
87  KeyListener(),
91  mInventory(inventory),
92  mItems(new ItemContainer(this, mInventory, 100000,
94  mUseButton(nullptr),
95  mDropButton(nullptr),
96  mOutfitButton(nullptr),
97  mShopButton(nullptr),
98  mCartButton(nullptr),
99  mEquipmentButton(nullptr),
100  mStoreButton(nullptr),
101  mRetrieveButton(nullptr),
102  mInvCloseButton(nullptr),
103  mWeightBar(nullptr),
104  mSlotsBar(new ProgressBar(this, 0.0F, 100, 0,
106  "slotsprogressbar.xml", "slotsprogressbar_fill.xml")),
107  mFilter(nullptr),
109  mSortDropDown(new DropDown(this, mSortModel, false,
110  Modal_false, this, "sort")),
112  this, "namefilter", true)),
113  mSortDropDownCell(nullptr),
114  mNameFilterCell(nullptr),
115  mFilterCell(nullptr),
116  mSlotsBarCell(nullptr),
117  mSplit(false),
118  mCompactMode(false)
119 {
122 
123  if (inventory != nullptr)
124  {
125  setCaption(gettext(inventory->getName().c_str()));
126  setWindowName(inventory->getName());
127  switch (inventory->getType())
128  {
131  case InventoryType::Npc:
137  default:
139  "inventorySortOrder"));
140  break;
143  "storageSortOrder"));
144  break;
145  case InventoryType::Cart:
147  "cartSortOrder"));
148  break;
149  };
150  }
151  else
152  {
153  // TRANSLATORS: inventory window name
154  setCaption(_("Inventory"));
155  setWindowName("Inventory");
157  }
158 
159  if ((setupWindow != nullptr) &&
160  (inventory != nullptr) &&
161  inventory->getType() != InventoryType::Storage)
162  {
164  }
165 
166  setResizable(true);
167  setCloseButton(true);
168  setSaveVisible(true);
169  setStickyButtonLock(true);
170 
171  if (mainGraphics->mWidth > 600)
172  setDefaultSize(450, 310, ImagePosition::CENTER, 0, 0);
173  else
174  setDefaultSize(387, 307, ImagePosition::CENTER, 0, 0);
175  setMinWidth(310);
176  setMinHeight(179);
177  addKeyListener(this);
178 
180 
181  const int size = config.getIntValue("fontSize");
182  mFilter = new TabStrip(this, "filter_" + getWindowName(), size + 16, 0);
183  mFilter->addActionListener(this);
184  mFilter->setActionEventId("tag_");
185  mFilter->setSelectable(false);
186 
187  StringVect tags = ItemDB::getTags();
188  const size_t sz = tags.size();
189  for (size_t f = 0; f < sz; f ++)
190  mFilter->addButton(tags[f], tags[f], false);
191 
192  if (mInventory == nullptr)
193  {
194  invInstances.push_back(this);
195  return;
196  }
197 
198  ScrollArea *const invenScroll = new ScrollArea(this, mItems,
199  fromBool(getOptionBool("showbackground", false), Opaque),
200  "inventory_background.xml");
202 
203  switch (mInventory->getType())
204  {
206  {
207  // TRANSLATORS: inventory button
208  const std::string equip = _("Equip");
209  // TRANSLATORS: inventory button
210  const std::string use = _("Use");
211  // TRANSLATORS: inventory button
212  const std::string unequip = _("Unequip");
213 
214  std::string longestUseString = getFont()->getWidth(equip) >
215  getFont()->getWidth(use) ? equip : use;
216 
217  if (getFont()->getWidth(longestUseString) <
218  getFont()->getWidth(unequip))
219  {
220  longestUseString = unequip;
221  }
222 
223  mUseButton = new Button(this,
224  longestUseString,
225  "use",
226  BUTTON_SKIN,
227  this);
228  mDropButton = new Button(this,
229  // TRANSLATORS: inventory button
230  _("Drop..."),
231  "drop",
232  BUTTON_SKIN,
233  this);
234  mOutfitButton = new Button(this,
235  // TRANSLATORS: inventory outfits button
236  _("O"),
237  "outfit",
238  BUTTON_SKIN,
239  this);
240  mCartButton = new Button(this,
241  // TRANSLATORS: inventory cart button
242  _("C"),
243  "cart",
244  BUTTON_SKIN,
245  this);
246  mShopButton = new Button(this,
247  // TRANSLATORS: inventory shop button
248  _("S"),
249  "shop",
250  BUTTON_SKIN,
251  this);
252  mEquipmentButton = new Button(this,
253  // TRANSLATORS: inventory equipment button
254  _("E"),
255  "equipment",
256  BUTTON_SKIN,
257  this);
258  mWeightBar = new ProgressBar(this, 0.0F, 100, 0,
260  "weightprogressbar.xml", "weightprogressbar_fill.xml");
263 
264  // TRANSLATORS: outfits button tooltip
265  mOutfitButton->setDescription(_("Outfits"));
266  // TRANSLATORS: cart button tooltip
267  mCartButton->setDescription(_("Cart"));
268  // TRANSLATORS: shop button tooltip
269  mShopButton->setDescription(_("Shop"));
270  // TRANSLATORS: equipment button tooltip
271  mEquipmentButton->setDescription(_("Equipment"));
272 
273  place(0, 0, mWeightBar, 4, 1);
274  mSlotsBarCell = &place(4, 0, mSlotsBar, 4, 1);
275  mSortDropDownCell = &place(8, 0, mSortDropDown, 3, 1);
276 
277  mFilterCell = &place(0, 1, mFilter, 10, 1).setPadding(3);
278  mNameFilterCell = &place(8, 1, mNameFilter, 3, 1);
279 
280  place(0, 2, invenScroll, 11, 1).setPadding(3);
281  place(0, 3, mUseButton, 1, 1);
282  place(1, 3, mDropButton, 1, 1);
283  ContainerPlacer placer = getPlacer(10, 3);
284  placer(0, 0, mShopButton, 1, 1);
285  placer(1, 0, mOutfitButton, 1, 1);
286  placer(2, 0, mCartButton, 1, 1);
287  placer(3, 0, mEquipmentButton, 1, 1);
288 
289  updateWeight();
290  break;
291  }
292 
294  {
295  mStoreButton = new Button(this,
296  // TRANSLATORS: storage button
297  _("Store"),
298  "store",
299  BUTTON_SKIN,
300  this);
301  mRetrieveButton = new Button(this,
302  // TRANSLATORS: storage button
303  _("Retrieve"),
304  "retrieve",
305  BUTTON_SKIN,
306  this);
307  mInvCloseButton = new Button(this,
308  // TRANSLATORS: storage button
309  _("Close"),
310  "close",
311  BUTTON_SKIN,
312  this);
313 
314  mSlotsBarCell = &place(0, 0, mSlotsBar, 6, 1);
315  mSortDropDownCell = &place(6, 0, mSortDropDown, 1, 1);
316 
317  mFilterCell = &place(0, 1, mFilter, 7, 1).setPadding(3);
318  mNameFilterCell = &place(6, 1, mNameFilter, 1, 1);
319 
320  place(0, 2, invenScroll, 7, 4);
321  place(0, 6, mStoreButton, 1, 1);
322  place(1, 6, mRetrieveButton, 1, 1);
323  place(6, 6, mInvCloseButton, 1, 1);
324  break;
325  }
326 
327  case InventoryType::Cart:
328  {
329  mStoreButton = new Button(this,
330  // TRANSLATORS: storage button
331  _("Store"),
332  "store",
333  BUTTON_SKIN,
334  this);
335  mRetrieveButton = new Button(this,
336  // TRANSLATORS: storage button
337  _("Retrieve"),
338  "retrieve",
339  BUTTON_SKIN,
340  this);
341  mInvCloseButton = new Button(this,
342  // TRANSLATORS: storage button
343  _("Close"),
344  "close",
345  BUTTON_SKIN,
346  this);
347 
348  mWeightBar = new ProgressBar(this, 0.0F, 100, 0,
350  "weightprogressbar.xml", "weightprogressbar_fill.xml");
353 
354  mSlotsBarCell = &place(3, 0, mSlotsBar, 3, 1);
355  mSortDropDownCell = &place(6, 0, mSortDropDown, 1, 1);
356 
357  mFilterCell = &place(0, 1, mFilter, 7, 1).setPadding(3);
358  mNameFilterCell = &place(6, 1, mNameFilter, 1, 1);
359 
360  place(0, 0, mWeightBar, 3, 1);
361  place(0, 2, invenScroll, 7, 4);
362  place(0, 6, mStoreButton, 1, 1);
363  place(1, 6, mRetrieveButton, 1, 1);
364  place(6, 6, mInvCloseButton, 1, 1);
365  break;
366  }
367 
368  default:
370  case InventoryType::Npc:
376  break;
377  };
378 
379  Layout &layout = getLayout();
380  layout.setRowHeight(2, LayoutType::SET);
381 
383 
384  invInstances.push_back(this);
385 
386  if (inventory->isMainInventory())
387  {
389  }
390  else
391  {
392  if (!invInstances.empty())
393  invInstances.front()->updateDropButton();
394  }
395 
396  loadWindowState();
397  enableVisibleSound(true);
398 }
Font * getFont() const
Definition: widget.cpp:330
void setDefaultSize()
Definition: window.cpp:1193
LayoutCell & place(const int x, const int y, Widget *const wg, const int w, const int h)
Definition: window.cpp:1379
#define _(s)
Definition: gettext.h:34
std::string getName() const
Definition: inventory.cpp:350
int getWidth() const
Definition: widget.h:220
const bool LoseFocusOnTab_true
bool getOptionBool(const std::string &name, const bool def) const
Definition: window.cpp:1461
const StringVect & getTags()
Definition: itemdb.cpp:749
void loadWindowState()
Definition: window.cpp:1082
const bool ShowEmptyRows_false
Definition: showemptyrows.h:29
virtual void addButton(const std::string &text, const std::string &tag, const bool pressed)
Definition: widgetgroup.cpp:41
TextField * mNameFilter
void addActionListener(ActionListener *const actionListener)
Definition: widget.cpp:251
void setMinWidth(const int width)
Definition: window.cpp:586
int mWidth
Definition: graphics.h:483
Definition: button.h:96
Configuration config
LayoutCell * mSlotsBarCell
int getIntValue(const std::string &key) const
ItemContainer * mItems
void setActionEventId(const std::string &actionEventId)
Definition: widget.h:595
std::vector< std::string > StringVect
Definition: stringvector.h:28
SortListModelInv * mSortModel
void registerWindowForReset(Window *const window)
ProgressBar * mWeightBar
void setSelectable(const bool selectable)
Definition: widget.h:947
const std::string BUTTON_SKIN
Definition: button.h:88
Inventory * mInventory
#define fromBool(val, name)
Definition: booldefines.h:48
Button * mRetrieveButton
bool isMainInventory() const
Definition: inventory.h:178
Graphics * mainGraphics
Definition: graphics.cpp:108
void setCloseButton(const bool flag)
Definition: window.cpp:744
void addKeyListener(KeyListener *const keyListener)
Definition: widget.cpp:271
TabStrip * mFilter
void enableVisibleSound(bool b)
Definition: window.h:480
const std::string & getWindowName() const
Definition: window.h:360
void setMinHeight(const int height)
Definition: window.cpp:599
ContainerPlacer getPlacer(const int x, const int y)
Definition: window.cpp:1386
LayoutCell & setPadding(int p)
Definition: layoutcell.h:59
Layout & getLayout()
Definition: window.cpp:1360
void setSaveVisible(const bool save)
Definition: window.h:299
Button * mOutfitButton
void addSelectionListener(SelectionListener *listener)
LayoutCell * mSortDropDownCell
ProgressBar * mSlotsBar
int getWidth(const std::string &text) const
Definition: font.cpp:333
const bool ForceQuantity_false
Definition: forcequantity.h:29
Button * mEquipmentButton
static WindowList invInstances
Button * mInvCloseButton
void setResizable(const bool resize)
Definition: window.cpp:622
void setStickyButtonLock(const bool sticky)
Definition: window.cpp:767
const Color & getThemeColor(const ThemeColorIdT type, const unsigned int alpha) const A_INLINE
Definition: widget2.h:44
SetupWindow * setupWindow
Definition: setupwindow.cpp:63
void addInventoyListener(InventoryListener *const listener)
Definition: inventory.cpp:301
void setDescription(const std::string &text)
Definition: button.h:164
LayoutCell * mNameFilterCell
Definition: layout.h:43
void setCaption(const std::string &caption)
Definition: window.h:530
void setColor(const Color &color1, const Color &color2)
InventoryTypeT getType() const
Definition: inventory.h:175
void setRowHeight(const int n, const int h)
Definition: layoutcell.cpp:127
LayoutCell * mFilterCell
void setSelected(int selected)
Definition: dropdown.cpp:514
Window(const std::string &caption, const Modal modal, Window *const parent, std::string skin)
Definition: window.cpp:108
DropDown * mSortDropDown
void setWindowName(const std::string &name)
Definition: window.h:354
void setHorizontalScrollPolicy(const ScrollPolicy hPolicy)

◆ ~InventoryWindow()

InventoryWindow::~InventoryWindow ( )

Destructor.

Definition at line 414 of file inventorywindow.cpp.

References delete2, DropDown::hideDrop(), invInstances, mInventory, mSortDropDown, mSortModel, and Inventory::removeInventoyListener().

415 {
416  invInstances.remove(this);
417  if (mInventory != nullptr)
419  if (!invInstances.empty())
420  invInstances.front()->updateDropButton();
421 
422  mSortDropDown->hideDrop(false);
424 }
void hideDrop(bool event)
Definition: dropdown.cpp:378
#define delete2(var)
Definition: delete2.h:24
SortListModelInv * mSortModel
Inventory * mInventory
static WindowList invInstances
DropDown * mSortDropDown
void removeInventoyListener(InventoryListener *const listener)
Definition: inventory.cpp:306

Member Function Documentation

◆ action()

void InventoryWindow::action ( const ActionEvent event)
virtual

Called when receiving actions from the widgets.

Implements ActionListener.

Definition at line 456 of file inventorywindow.cpp.

References InventoryType::Cart, ItemAmountWindowUsage::CartAdd, ItemAmountWindowUsage::CartRemove, close(), PlayerInfo::dropItem(), InputManager::executeAction(), Item::getId(), Item::getInvIndex(), Item::getQuantity(), DropDown::getSelected(), getSelectedItem(), ItemContainer::getSelectedItem(), ItemDB::getTagId(), TextField::getText(), inputManager, InventoryType::Inventory, inventoryHandler, InputManager::isActionActive(), PlayerInfo::isItemProtected(), isStorageActive(), Window::isWindowVisible(), ServerCommandType::item, ItemAmountWindowUsage::ItemDrop, ItemAmountWindowUsage::ItemSplit, mItems, mNameFilter, Net::InventoryHandler::moveItem2(), mSortDropDown, ItemContainer::setFilter(), ItemContainer::setName(), ItemContainer::setSortType(), Sfx_true, ItemAmountWindow::showWindow(), InputAction::STOP_ATTACK, InventoryType::Storage, ItemAmountWindowUsage::StoreAdd, ItemAmountWindowUsage::StoreRemove, storeSortOrder(), ItemContainer::updateMatrix(), PlayerInfo::useEquipItem(), PlayerInfo::useEquipItem2(), InputAction::WINDOW_CART, InputAction::WINDOW_EQUIPMENT, InputAction::WINDOW_OUTFIT, and InputAction::WINDOW_SHOP.

457 {
458  const std::string &eventId = event.getId();
459  if (eventId == "outfit")
460  {
462  }
463  else if (eventId == "shop")
464  {
466  }
467  else if (eventId == "equipment")
468  {
470  }
471  else if (eventId == "cart")
472  {
474  }
475  else if (eventId == "close")
476  {
477  close();
478  }
479  else if (eventId == "store")
480  {
481  if (inventoryWindow == nullptr || !inventoryWindow->isWindowVisible())
482  return;
483 
485 
486  if (item == nullptr)
487  return;
488 
489  if (storageWindow != nullptr)
490  {
492  this,
493  item,
494  0,
495  0);
496  }
497  else if ((cartWindow != nullptr) && cartWindow->isWindowVisible())
498  {
500  this,
501  item,
502  0,
503  0);
504  }
505  }
506  else if (eventId == "sort")
507  {
509  storeSortOrder();
510  return;
511  }
512  else if (eventId == "namefilter")
513  {
515  mItems->updateMatrix();
516  }
517  else if (eventId.find("tag_") == 0u)
518  {
519  std::string tagName = event.getId().substr(4);
520  mItems->setFilter(ItemDB::getTagId(tagName));
521  return;
522  }
523 
524  Item *const item = mItems->getSelectedItem();
525 
526  if (item == nullptr)
527  return;
528 
529  if (eventId == "use")
530  {
532  }
533  if (eventId == "equip")
534  {
536  }
537  else if (eventId == "drop")
538  {
539  if (isStorageActive())
540  {
542  item->getInvIndex(),
543  item->getQuantity(),
545  }
546  else if ((cartWindow != nullptr) && cartWindow->isWindowVisible())
547  {
549  item->getInvIndex(),
550  item->getQuantity(),
552  }
553  else
554  {
555  if (PlayerInfo::isItemProtected(item->getId()))
556  return;
557 
559  {
560  PlayerInfo::dropItem(item, item->getQuantity(), Sfx_true);
561  }
562  else
563  {
565  this,
566  item,
567  0,
568  0);
569  }
570  }
571  }
572  else if (eventId == "split")
573  {
575  this,
576  item,
577  item->getQuantity() - 1,
578  9);
579  }
580  else if (eventId == "retrieve")
581  {
582  if (storageWindow != nullptr)
583  {
585  this,
586  item,
587  0,
588  0);
589  }
590  else if ((cartWindow != nullptr) && cartWindow->isWindowVisible())
591  {
593  this,
594  item,
595  0,
596  0);
597  }
598  }
599 }
int getInvIndex() const
Definition: item.h:164
static bool isStorageActive()
virtual void moveItem2(const InventoryTypeT source, const int slot, const int amount, const InventoryTypeT destination) const =0
void storeSortOrder() const
Item * getSelectedItem() const
TextField * mNameFilter
const bool Sfx_true
Definition: sfx.h:29
static void showWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, int maxRange, const int tag)
ItemContainer * mItems
InventoryWindow * inventoryWindow
bool isActionActive(const InputActionT index) const
void setName(const std::string &str)
int getTagId(const std::string &tagName)
Definition: itemdb.cpp:754
void useEquipItem(const Item *const item, const int16_t useType, const Sfx sfx)
Definition: playerinfo.cpp:259
InventoryWindow * storageWindow
int getQuantity() const
Definition: item.h:104
void useEquipItem2(const Item *const item, const int16_t useType, const Sfx sfx)
Definition: playerinfo.cpp:310
Definition: item.h:48
bool isWindowVisible() const
Definition: window.h:483
Net::InventoryHandler * inventoryHandler
Definition: net.cpp:85
bool isItemProtected(const int id)
Definition: playerinfo.cpp:511
int getId() const
Definition: item.h:80
InventoryWindow * cartWindow
Item * getSelectedItem() const
void setSortType(const int sortType)
InputManager inputManager
void executeAction(const InputActionT keyNum)
void setFilter(const int tag)
const std::string & getText() const
Definition: textfield.h:223
int getSelected() const
Definition: dropdown.cpp:509
void dropItem(const Item *const item, const int amount, const Sfx sfx)
Definition: playerinfo.cpp:351
DropDown * mSortDropDown

◆ attributeChanged()

void InventoryWindow::attributeChanged ( const AttributesT  id,
const int64_t  oldVal,
const int64_t  newVal 
)
virtual

◆ close()

void InventoryWindow::close ( )
virtual

Closes the Storage Window, as well as telling the server that the window has been closed.

Reimplemented from Window.

Definition at line 894 of file inventorywindow.cpp.

References InventoryType::Cart, Window::close(), Net::InventoryHandler::closeStorage(), InventoryType::Craft, Net::InventoryHandler::forgotStorage(), Inventory::getType(), InventoryType::Inventory, inventoryHandler, InventoryType::MailEdit, InventoryType::MailView, mInventory, InventoryType::Npc, Window::scheduleDelete(), setVisible(), InventoryType::Storage, InventoryType::Trade, InventoryType::TypeEnd, InventoryType::Vending, and Visible_false.

Referenced by action(), Ea::InventoryHandler::destroyStorage(), Ea::InventoryRecv::processPlayerStorageClose(), and Ea::InventoryHandler::~InventoryHandler().

895 {
896  if (mInventory == nullptr)
897  {
898  Window::close();
899  return;
900  }
901 
902  switch (mInventory->getType())
903  {
905  case InventoryType::Cart:
907  break;
908 
910  if (inventoryHandler != nullptr)
911  {
914  }
915  scheduleDelete();
916  break;
917 
918  default:
920  case InventoryType::Npc:
926  break;
927  }
928 }
void setVisible(Visible visible)
virtual void close()
Definition: window.cpp:897
Inventory * mInventory
const bool Visible_false
Definition: visible.h:29
virtual void forgotStorage() const =0
virtual void closeStorage() const =0
Net::InventoryHandler * inventoryHandler
Definition: net.cpp:85
virtual void scheduleDelete()
Definition: window.cpp:826
InventoryTypeT getType() const
Definition: inventory.h:175

◆ combineItems()

void InventoryWindow::combineItems ( const int  index1,
const int  index2 
)

Definition at line 1107 of file inventorywindow.cpp.

References _, Widget::addActionListener(), ItemType::Card, InsertCardListener::cardIndex, confirmDlg, CREATEWIDGETR, Item::getInvIndex(), Inventory::getItem(), Item::getName(), Item::getType(), ServerCommandType::item2, InsertCardListener::itemIndex, mInventory, Modal_true, SOUND_REQUEST, and strprintf().

Referenced by isStorageActive(), and ItemContainer::mouseReleased().

1109 {
1110  if (mInventory == nullptr)
1111  return;
1112  const Item *item1 = mInventory->getItem(index1);
1113  if (item1 == nullptr)
1114  return;
1115  const Item *item2 = mInventory->getItem(index2);
1116  if (item2 == nullptr)
1117  return;
1118 
1119  if (item1->getType() != ItemType::Card)
1120  {
1121  const Item *tmpItem = item1;
1122  item1 = item2;
1123  item2 = tmpItem;
1124  }
1125 
1127  // TRANSLATORS: question dialog title
1128  _("Insert card request"),
1129  // TRANSLATORS: question dialog message
1130  strprintf(_("Insert %s into %s?"),
1131  item1->getName().c_str(),
1132  item2->getName().c_str()),
1133  SOUND_REQUEST,
1134  false,
1135  Modal_true,
1136  nullptr);
1139  confirmDlg->addActionListener(&insertCardListener);
1140 }
int getInvIndex() const
Definition: item.h:164
#define _(s)
Definition: gettext.h:34
void addActionListener(ActionListener *const actionListener)
Definition: widget.cpp:251
static const std::string SOUND_REQUEST
Definition: sound.h:28
InsertCardListener insertCardListener
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
Inventory * mInventory
Definition: item.h:48
std::string getName() const
Definition: item.cpp:139
ConfirmDialog * confirmDlg
Definition: traderecv.cpp:48
ItemTypeT getType() const
Definition: item.h:224
#define CREATEWIDGETR(type,...)
Definition: createwidget.h:35
Item * getItem(const int index) const
Definition: inventory.cpp:82

◆ getFirstVisible()

InventoryWindow * InventoryWindow::getFirstVisible ( )
static

Definition at line 1018 of file inventorywindow.cpp.

References BasicContainer::findFirstWidget(), FOR_EACH, invInstances, and windowContainer.

Referenced by isStorageActive(), nextTab(), and prevTab().

1019 {
1020  std::set<Widget*> list;
1021  FOR_EACH (WindowList::const_iterator, it, invInstances)
1022  {
1023  if (((*it) != nullptr) && (*it)->isWindowVisible())
1024  list.insert(*it);
1025  }
1026  return dynamic_cast<InventoryWindow*>(
1028 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
WindowContainer * windowContainer
Widget * findFirstWidget(const std::set< Widget *> &list)
static WindowList invInstances

◆ getSelectedItem()

Item * InventoryWindow::getSelectedItem ( ) const

Returns the selected item.

Definition at line 601 of file inventorywindow.cpp.

References ItemContainer::getSelectedItem(), and mItems.

Referenced by MailEditWindow::action(), action(), NpcDialog::action(), and TradeWindow::action().

602 {
603  return mItems->getSelectedItem();
604 }
Item * getSelectedItem() const
ItemContainer * mItems

◆ isAnyInputFocused()

bool InventoryWindow::isAnyInputFocused ( )
static

Definition at line 1008 of file inventorywindow.cpp.

References FOR_EACH, and invInstances.

Referenced by Game::handleMove(), isStorageActive(), and InputManager::updateConditionMask().

1009 {
1010  FOR_EACH (WindowList::const_iterator, it, invInstances)
1011  {
1012  if (((*it) != nullptr) && (*it)->isInputFocused())
1013  return true;
1014  }
1015  return false;
1016 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
static WindowList invInstances

◆ isInputFocused()

bool InventoryWindow::isInputFocused ( ) const

Definition at line 1003 of file inventorywindow.cpp.

References Widget::isFocused(), and mNameFilter.

Referenced by isStorageActive().

1004 {
1005  return (mNameFilter != nullptr) && mNameFilter->isFocused();
1006 }
TextField * mNameFilter
virtual bool isFocused() const
Definition: widget.cpp:183

◆ isMainInventory()

bool InventoryWindow::isMainInventory ( ) const
inline

Definition at line 128 of file inventorywindow.h.

References Inventory::isMainInventory(), and mInventory.

129  {
130  return mInventory != nullptr ?
131  mInventory->isMainInventory() : false;
132  }
Inventory * mInventory
bool isMainInventory() const
Definition: inventory.h:178

◆ isStorageActive()

static bool InventoryWindow::isStorageActive ( )
inlinestatic

◆ keyPressed()

void InventoryWindow::keyPressed ( KeyEvent event)
virtual

Handles the key presses.

Reimplemented from KeyListener.

Definition at line 817 of file inventorywindow.cpp.

References KeyEvent::getActionId(), InputAction::GUI_MOD, and mSplit.

818 {
819  if (event.getActionId() == InputAction::GUI_MOD)
820  mSplit = true;
821 }
InputActionT getActionId() const
Definition: keyevent.h:126

◆ keyReleased()

void InventoryWindow::keyReleased ( KeyEvent event)
virtual

Handles the key releases.

Reimplemented from KeyListener.

Definition at line 823 of file inventorywindow.cpp.

References KeyEvent::getActionId(), InputAction::GUI_MOD, and mSplit.

824 {
825  if (event.getActionId() == InputAction::GUI_MOD)
826  mSplit = false;
827 }
InputActionT getActionId() const
Definition: keyevent.h:126

◆ mouseClicked()

void InventoryWindow::mouseClicked ( MouseEvent event)
virtual

Handles the mouse clicks.

Reimplemented from MouseListener.

Definition at line 618 of file inventorywindow.cpp.

References MouseEvent::getButton(), Item::getId(), Item::getInvIndex(), Item::getQuantity(), ItemContainer::getSelectedItem(), Inventory::getType(), Widget::getX(), Widget::getY(), gui, inputManager, InventoryType::Inventory, inventoryHandler, InputManager::isActionActive(), PlayerInfo::isItemProtected(), Inventory::isMainInventory(), isStorageActive(), Window::isWindowVisible(), ServerCommandType::item, MouseButton::LEFT, mInventory, mItems, MouseListener::mouseClicked(), Net::InventoryHandler::moveItem2(), popupMenu, Gui::resetClickCount(), MouseButton::RIGHT, Sfx_true, PopupMenu::showPopup(), ItemAmountWindow::showWindow(), InputAction::STOP_ATTACK, InventoryType::Storage, ItemAmountWindowUsage::StoreAdd, ItemAmountWindowUsage::StoreRemove, ItemAmountWindowUsage::TradeAdd, TradeWindow::tradeItem(), tradeWindow, and PlayerInfo::useEquipItem().

619 {
620  Window::mouseClicked(event);
621 
622  const int clicks = event.getClickCount();
623 
624  if (clicks == 2 && (gui != nullptr))
625  gui->resetClickCount();
626 
627  const bool mod = (isStorageActive() &&
629 
630  const bool mod2 = (tradeWindow != nullptr &&
633 
634  if (mInventory != nullptr)
635  {
636  if (!mod && !mod2 && event.getButton() == MouseButton::RIGHT)
637  {
638  Item *const item = mItems->getSelectedItem();
639 
640  if (item == nullptr)
641  return;
642 
643  /* Convert relative to the window coordinates to absolute screen
644  * coordinates.
645  */
646  const int mx = event.getX() + getX();
647  const int my = event.getY() + getY();
648 
649  if (popupMenu != nullptr)
650  {
651  popupMenu->showPopup(this,
652  mx, my,
653  item,
654  mInventory->getType());
655  }
656  }
657  }
658  else
659  {
660  return;
661  }
662 
663  if (event.getButton() == MouseButton::LEFT ||
664  event.getButton() == MouseButton::RIGHT)
665  {
666  Item *const item = mItems->getSelectedItem();
667 
668  if (item == nullptr)
669  return;
670 
671  if (mod)
672  {
674  {
675  if (event.getButton() == MouseButton::RIGHT)
676  {
680  item,
681  0,
682  0);
683  }
684  else
685  {
687  item->getInvIndex(),
688  item->getQuantity(),
690  }
691  }
692  else
693  {
694  if (event.getButton() == MouseButton::RIGHT)
695  {
699  item,
700  0,
701  0);
702  }
703  else
704  {
706  item->getInvIndex(),
707  item->getQuantity(),
709  }
710  }
711  }
712  else if (mod2 && mInventory->isMainInventory())
713  {
714  if (PlayerInfo::isItemProtected(item->getId()))
715  return;
716  if (event.getButton() == MouseButton::RIGHT)
717  {
719  tradeWindow,
720  item,
721  0,
722  0);
723  }
724  else
725  {
726  if (tradeWindow != nullptr)
727  tradeWindow->tradeItem(item, item->getQuantity(), true);
728  }
729  }
730  else if (clicks == 2)
731  {
733  {
734  if (isStorageActive())
735  {
739  item,
740  0,
741  0);
742  }
743  else if (tradeWindow != nullptr &&
745  {
746  if (PlayerInfo::isItemProtected(item->getId()))
747  return;
750  tradeWindow,
751  item,
752  0,
753  0);
754  }
755  else
756  {
758  }
759  }
760  else
761  {
762  if (isStorageActive())
763  {
767  item,
768  0,
769  0);
770  }
771  }
772  }
773  }
774 }
int getInvIndex() const
Definition: item.h:164
static bool isStorageActive()
virtual void moveItem2(const InventoryTypeT source, const int slot, const int amount, const InventoryTypeT destination) const =0
TradeWindow * tradeWindow
Definition: tradewindow.cpp:64
Gui * gui
Definition: gui.cpp:110
Item * getSelectedItem() const
int getY() const
Definition: widget.h:287
MouseButtonT getButton() const
Definition: mouseevent.h:115
const bool Sfx_true
Definition: sfx.h:29
static void showWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, int maxRange, const int tag)
ItemContainer * mItems
InventoryWindow * inventoryWindow
bool isActionActive(const InputActionT index) const
void useEquipItem(const Item *const item, const int16_t useType, const Sfx sfx)
Definition: playerinfo.cpp:259
Inventory * mInventory
int getQuantity() const
Definition: item.h:104
bool isMainInventory() const
Definition: inventory.h:178
PopupMenu * popupMenu
Definition: popupmenu.cpp:102
void resetClickCount()
Definition: gui.cpp:978
Definition: item.h:48
bool isWindowVisible() const
Definition: window.h:483
Net::InventoryHandler * inventoryHandler
Definition: net.cpp:85
void tradeItem(const Item *const item, const int quantity, const bool check) const
int getX() const
Definition: widget.h:268
bool isItemProtected(const int id)
Definition: playerinfo.cpp:511
int getId() const
Definition: item.h:80
virtual void mouseClicked(MouseEvent &event)
InputManager inputManager
InventoryTypeT getType() const
Definition: inventory.h:175
void showPopup(const int x, const int y, const Being *const being)
Definition: popupmenu.cpp:202

◆ mouseExited()

void InventoryWindow::mouseExited ( MouseEvent event)
virtual

When the mouse leaves the window this ensures that the custom cursor is restored back to it's standard image.

Reimplemented from Window.

Definition at line 812 of file inventorywindow.cpp.

References Popup::hide(), and textPopup.

Referenced by isStorageActive().

813 {
814  textPopup->hide();
815 }
void hide()
Definition: popup.cpp:262
TextPopup * textPopup
Definition: textpopup.cpp:32

◆ mouseMoved()

void InventoryWindow::mouseMoved ( MouseEvent event)
virtual

Implements custom cursor image changing context, based on mouse relative position.

Reimplemented from Window.

Definition at line 776 of file inventorywindow.cpp.

References _, UnitsDb::formatCurrency(), PlayerInfo::getAttribute(), Button::getDescription(), Popup::hide(), Widget::mDimension, Attributes::MONEY, Window::mouseMoved(), mSlotsBar, mWeightBar, TextPopup::show(), strprintf(), textPopup, x, Rect::x, y, and Rect::y.

Referenced by isStorageActive().

777 {
778  Window::mouseMoved(event);
779  if (textPopup == nullptr)
780  return;
781 
782  const Widget *const src = event.getSource();
783  if (src == nullptr)
784  {
785  textPopup->hide();
786  return;
787  }
788  const int x = event.getX();
789  const int y = event.getY();
790  const Rect &rect = mDimension;
791  if (src == mSlotsBar || src == mWeightBar)
792  {
793  // TRANSLATORS: money label
794  textPopup->show(rect.x + x, rect.y + y, strprintf(_("Money: %s"),
796  Attributes::MONEY)).c_str()));
797  }
798  else
799  {
800  const Button *const btn = dynamic_cast<const Button *>(src);
801  if (btn == nullptr)
802  {
803  textPopup->hide();
804  return;
805  }
806  const std::string text = btn->getDescription();
807  if (!text.empty())
808  textPopup->show(x + rect.x, y + rect.y, text);
809  }
810 }
void show(const int x, const int y, const std::string &str1)
Definition: textpopup.h:56
#define _(s)
Definition: gettext.h:34
Definition: rect.h:72
Definition: button.h:96
void mouseMoved(MouseEvent &event)
Definition: window.cpp:962
std::string formatCurrency(const int value)
Definition: unitsdb.cpp:323
ProgressBar * mWeightBar
int x
Definition: rect.h:208
void hide()
Definition: popup.cpp:262
std::string getDescription() const
Definition: button.h:167
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
int y
Definition: rect.h:213
Definition: widget.h:97
ProgressBar * mSlotsBar
int32_t getAttribute(const AttributesT id)
Definition: playerinfo.cpp:100
Rect mDimension
Definition: widget.h:1100
TextPopup * textPopup
Definition: textpopup.cpp:32

◆ moveItemToCraft()

void InventoryWindow::moveItemToCraft ( const int  craftSlot)

Definition at line 1142 of file inventorywindow.cpp.

References NpcDialog::addCraftItem(), ItemAmountWindowUsage::CraftAdd, Net::NpcHandler::getCurrentNpcDialog(), NpcDialog::getInputState(), Item::getQuantity(), ItemContainer::getSelectedItem(), inputManager, InputManager::isActionActive(), ServerCommandType::item, NpcInputState::ITEM_CRAFT, mItems, npcHandler, ItemAmountWindow::showWindow(), and InputAction::STOP_ATTACK.

Referenced by Actions::changeRelation(), Actions::doSit(), and isStorageActive().

1143 {
1144  if (npcHandler == nullptr)
1145  return;
1146 
1147  Item *const item = mItems->getSelectedItem();
1148  if (item == nullptr)
1149  return;
1150 
1151  NpcDialog *const dialog = npcHandler->getCurrentNpcDialog();
1152  if ((dialog != nullptr) &&
1154  {
1155  if (item->getQuantity() > 1
1157  {
1160  item,
1161  0,
1162  craftSlot);
1163  }
1164  else
1165  {
1166  dialog->addCraftItem(item, 1, craftSlot);
1167  }
1168  }
1169 }
Item * getSelectedItem() const
NpcInputStateT getInputState()
Definition: npcdialog.h:236
static void showWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, int maxRange, const int tag)
ItemContainer * mItems
bool isActionActive(const InputActionT index) const
virtual NpcDialog * getCurrentNpcDialog() const =0
int getQuantity() const
Definition: item.h:104
Definition: item.h:48
Net::NpcHandler * npcHandler
Definition: net.cpp:89
InputManager inputManager
void addCraftItem(Item *const item, const int amount, const int slot)
Definition: npcdialog.cpp:1381

◆ nextTab()

void InventoryWindow::nextTab ( )
static

Definition at line 1030 of file inventorywindow.cpp.

References getFirstVisible(), mFilter, and TabStrip::nextTab().

Referenced by isStorageActive().

1031 {
1032  const InventoryWindow *const window = getFirstVisible();
1033  if (window != nullptr)
1034  window->mFilter->nextTab();
1035 }
void nextTab()
Definition: tabstrip.cpp:89
static InventoryWindow * getFirstVisible()
TabStrip * mFilter

◆ postInit()

void InventoryWindow::postInit ( )
virtual

Reimplemented from Window.

Definition at line 400 of file inventorywindow.cpp.

References DropDown::getSelected(), Inventory::getType(), mInventory, mItems, mSortDropDown, Window::postInit(), ItemContainer::setSortType(), setVisible(), slotsChanged(), InventoryType::Storage, Visible_true, and widgetResized().

401 {
404 
406  widgetResized(Event(nullptr));
407  if (mInventory != nullptr &&
409  {
411  }
412 }
const bool Visible_true
Definition: visible.h:29
ItemContainer * mItems
void setVisible(Visible visible)
void slotsChanged(const Inventory *const inventory)
Inventory * mInventory
void widgetResized(const Event &event)
Definition: event.h:77
void setSortType(const int sortType)
InventoryTypeT getType() const
Definition: inventory.h:175
int getSelected() const
Definition: dropdown.cpp:509
void postInit()
Definition: window.cpp:248
DropDown * mSortDropDown

◆ prevTab()

void InventoryWindow::prevTab ( )
static

Definition at line 1037 of file inventorywindow.cpp.

References getFirstVisible(), mFilter, and TabStrip::prevTab().

Referenced by isStorageActive().

1038 {
1039  const InventoryWindow *const window = getFirstVisible();
1040  if (window != nullptr)
1041  window->mFilter->prevTab();
1042 }
void prevTab()
Definition: tabstrip.cpp:107
static InventoryWindow * getFirstVisible()
TabStrip * mFilter

◆ setVisible()

void InventoryWindow::setVisible ( Visible  visible)
virtual

Overloads window setVisible by Guichan to allow sticky window handling.

Reimplemented from Window.

Definition at line 1076 of file inventorywindow.cpp.

References DropDown::hideDrop(), mSortDropDown, Window::setVisible(), and Visible_false.

Referenced by TradeWindow::action(), close(), isStorageActive(), and postInit().

1077 {
1078  if (visible == Visible_false)
1079  mSortDropDown->hideDrop(true);
1080  Window::setVisible(visible);
1081 }
void hideDrop(bool event)
Definition: dropdown.cpp:378
const bool Visible_false
Definition: visible.h:29
virtual void setVisible(Visible visible)
Definition: window.cpp:773
DropDown * mSortDropDown

◆ slotsChanged()

void InventoryWindow::slotsChanged ( const Inventory *const  inventory)
virtual

Implements InventoryListener.

Definition at line 958 of file inventorywindow.cpp.

References Inventory::getNumberOfSlotsUsed(), Inventory::getSize(), mInventory, mItems, mSlotsBar, ProgressBar::setProgress(), ProgressBar::setText(), strprintf(), and ItemContainer::updateMatrix().

Referenced by postInit().

959 {
960  if (inventory == mInventory)
961  {
962  const int usedSlots = mInventory->getNumberOfSlotsUsed();
963  const int maxSlots = mInventory->getSize();
964 
965  if (maxSlots != 0)
966  {
967  mSlotsBar->setProgress(static_cast<float>(usedSlots)
968  / static_cast<float>(maxSlots));
969  }
970 
971  mSlotsBar->setText(strprintf("%d/%d", usedSlots, maxSlots));
972  mItems->updateMatrix();
973  }
974 }
int getNumberOfSlotsUsed() const
Definition: inventory.h:163
ItemContainer * mItems
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
Inventory * mInventory
void setText(const std::string &str)
ProgressBar * mSlotsBar
void setProgress(const float progress)
unsigned getSize() const
Definition: inventory.h:75

◆ storeSortOrder()

void InventoryWindow::storeSortOrder ( ) const

Definition at line 426 of file inventorywindow.cpp.

References InventoryType::Cart, config, InventoryType::Craft, DropDown::getSelected(), Inventory::getType(), InventoryType::Inventory, InventoryType::MailEdit, InventoryType::MailView, mInventory, mSortDropDown, InventoryType::Npc, Configuration::setValue(), InventoryType::Storage, InventoryType::Trade, InventoryType::TypeEnd, and InventoryType::Vending.

Referenced by action().

427 {
428  if (mInventory != nullptr)
429  {
430  switch (mInventory->getType())
431  {
434  case InventoryType::Npc:
440  default:
441  config.setValue("inventorySortOrder",
443  break;
445  config.setValue("storageSortOrder",
447  break;
448  case InventoryType::Cart:
449  config.setValue("cartSortOrder",
451  break;
452  };
453  }
454 }
Configuration config
Inventory * mInventory
InventoryTypeT getType() const
Definition: inventory.h:175
void setValue(const std::string &key, const std::string &value)
int getSelected() const
Definition: dropdown.cpp:509
DropDown * mSortDropDown

◆ unselectItem()

void InventoryWindow::unselectItem ( )

Unselect item

Definition at line 606 of file inventorywindow.cpp.

References mItems, and ItemContainer::selectNone().

Referenced by ItemShortcutContainer::mousePressed().

607 {
608  mItems->selectNone();
609 }
ItemContainer * mItems

◆ unsetInventory()

void InventoryWindow::unsetInventory ( )

Definition at line 1083 of file inventorywindow.cpp.

References mInventory, mItems, Inventory::removeInventoyListener(), and ItemContainer::unsetInventory().

Referenced by Ea::InventoryHandler::destroyStorage(), isStorageActive(), and Ea::InventoryRecv::processPlayerStorageClose().

1084 {
1085  if (mInventory != nullptr)
1086  {
1088  if (mItems != nullptr)
1090  }
1091  mInventory = nullptr;
1092 }
void unsetInventory()
ItemContainer * mItems
Inventory * mInventory
void removeInventoyListener(InventoryListener *const listener)
Definition: inventory.cpp:306

◆ updateButtons()

void InventoryWindow::updateButtons ( const Item item)

Definition at line 848 of file inventorywindow.cpp.

References _, Equipm_true, Equipped_true, Item::getInfo(), Item::getQuantity(), ItemContainer::getSelectedItem(), ItemInfo::getUseButton(), ItemInfo::getUseButton2(), Actions::info(), Item::isEquipment(), Item::isEquipped(), Inventory::isMainInventory(), mDropButton, mInventory, mItems, mUseButton, Button::setCaption(), Widget::setEnabled(), ServerCommandType::str, and updateDropButton().

Referenced by isStorageActive(), Ea::EquipBackend::setEquipment(), and valueChanged().

849 {
850  if ((mInventory == nullptr) || !mInventory->isMainInventory())
851  return;
852 
853  const Item *const selectedItem = mItems->getSelectedItem();
854  if ((item != nullptr) && selectedItem != item)
855  return;
856 
857  if (item == nullptr)
858  item = selectedItem;
859 
860  if ((item == nullptr) || item->getQuantity() == 0)
861  {
862  if (mUseButton != nullptr)
863  mUseButton->setEnabled(false);
864  if (mDropButton != nullptr)
865  mDropButton->setEnabled(false);
866  return;
867  }
868 
869  if (mDropButton != nullptr)
870  mDropButton->setEnabled(true);
871 
872  if (mUseButton != nullptr)
873  {
874  const ItemInfo &info = item->getInfo();
875  const std::string &str = (item->isEquipment() == Equipm_true
876  && item->isEquipped() == Equipped_true)
877  ? info.getUseButton2() : info.getUseButton();
878  if (str.empty())
879  {
880  mUseButton->setEnabled(false);
881  // TRANSLATORS: default use button name
882  mUseButton->setCaption(_("Use"));
883  }
884  else
885  {
886  mUseButton->setEnabled(true);
887  mUseButton->setCaption(str);
888  }
889  }
890 
892 }
#define _(s)
Definition: gettext.h:34
Item * getSelectedItem() const
Equipped isEquipped() const
Definition: item.h:128
ItemContainer * mItems
const bool Equipped_true
Definition: equipped.h:29
const std::string & getUseButton() const
Definition: iteminfo.h:117
void setCaption(const std::string &caption)
Definition: button.h:211
const std::string & getUseButton2() const
Definition: iteminfo.h:123
Inventory * mInventory
const bool Equipm_true
Definition: equipm.h:29
int getQuantity() const
Definition: item.h:104
bool info(InputEvent &event)
Definition: commands.cpp:56
bool isMainInventory() const
Definition: inventory.h:178
Definition: item.h:48
const ItemInfo & getInfo() const
Definition: item.h:170
void setEnabled(const bool enabled)
Definition: widget.h:351
Equipm isEquipment() const
Definition: item.h:116

◆ updateDropButton()

void InventoryWindow::updateDropButton ( )

Definition at line 976 of file inventorywindow.cpp.

References _, Item::getQuantity(), ItemContainer::getSelectedItem(), isStorageActive(), Window::isWindowVisible(), ServerCommandType::item, mDropButton, mItems, and Button::setCaption().

Referenced by InventoryWindow(), isStorageActive(), Actions::showHideWindow(), and updateButtons().

977 {
978  if (mDropButton == nullptr)
979  return;
980 
981  if (isStorageActive() ||
982  (cartWindow != nullptr && cartWindow->isWindowVisible()))
983  {
984  // TRANSLATORS: inventory button
985  mDropButton->setCaption(_("Store"));
986  }
987  else
988  {
989  const Item *const item = mItems->getSelectedItem();
990  if ((item != nullptr) && item->getQuantity() > 1)
991  {
992  // TRANSLATORS: inventory button
993  mDropButton->setCaption(_("Drop..."));
994  }
995  else
996  {
997  // TRANSLATORS: inventory button
998  mDropButton->setCaption(_("Drop"));
999  }
1000  }
1001 }
static bool isStorageActive()
#define _(s)
Definition: gettext.h:34
Item * getSelectedItem() const
ItemContainer * mItems
void setCaption(const std::string &caption)
Definition: button.h:211
int getQuantity() const
Definition: item.h:104
Definition: item.h:48
bool isWindowVisible() const
Definition: window.h:483
InventoryWindow * cartWindow

◆ updateWeight()

void InventoryWindow::updateWeight ( )
private

Updates the weight bar.

Definition at line 930 of file inventorywindow.cpp.

References InventoryType::Cart, Attributes::CART_MAX_WEIGHT, Attributes::CART_TOTAL_WEIGHT, UnitsDb::formatWeight(), PlayerInfo::getAttribute(), Inventory::getType(), InventoryType::Inventory, Attributes::MAX_WEIGHT, mInventory, mWeightBar, ProgressBar::setProgress(), ProgressBar::setText(), strprintf(), and Attributes::TOTAL_WEIGHT.

Referenced by attributeChanged(), InventoryWindow(), and isStorageActive().

931 {
932  if ((mInventory == nullptr) || (mWeightBar == nullptr))
933  return;
934  const InventoryTypeT type = mInventory->getType();
935  if (type != InventoryType::Inventory &&
936  type != InventoryType::Cart)
937  {
938  return;
939  }
940 
941  const bool isInv = type == InventoryType::Inventory;
942  const int total = PlayerInfo::getAttribute(isInv
944  const int max = PlayerInfo::getAttribute(isInv
946 
947  if (max <= 0)
948  return;
949 
950  // Adjust progress bar
951  mWeightBar->setProgress(static_cast<float>(total)
952  / static_cast<float>(max));
953  mWeightBar->setText(strprintf("%s/%s",
954  UnitsDb::formatWeight(total).c_str(),
955  UnitsDb::formatWeight(max).c_str()));
956 }
InventoryType ::T InventoryTypeT
Definition: inventorytype.h:41
std::string formatWeight(const int value)
Definition: unitsdb.cpp:351
ProgressBar * mWeightBar
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
Inventory * mInventory
void setText(const std::string &str)
int32_t getAttribute(const AttributesT id)
Definition: playerinfo.cpp:100
InventoryTypeT getType() const
Definition: inventory.h:175
void setProgress(const float progress)

◆ valueChanged()

void InventoryWindow::valueChanged ( const SelectionEvent event)
virtual

Updates labels to currently selected item.

Reimplemented from SelectionListener.

Definition at line 829 of file inventorywindow.cpp.

References Item::getQuantity(), ItemContainer::getSelectedItem(), inventoryHandler, Inventory::isMainInventory(), ServerCommandType::item, ItemAmountWindowUsage::ItemSplit, mInventory, mItems, mSplit, ItemAmountWindow::showWindow(), and updateButtons().

830 {
831  if ((mInventory == nullptr) || !mInventory->isMainInventory())
832  return;
833 
834  Item *const item = mItems->getSelectedItem();
835 
836  if (mSplit && (item != nullptr) && inventoryHandler->
837  canSplit(mItems->getSelectedItem()))
838  {
840  this,
841  item,
842  item->getQuantity() - 1,
843  0);
844  }
845  updateButtons(item);
846 }
Item * getSelectedItem() const
static void showWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, int maxRange, const int tag)
void updateButtons(const Item *item)
ItemContainer * mItems
Inventory * mInventory
int getQuantity() const
Definition: item.h:104
bool isMainInventory() const
Definition: inventory.h:178
Definition: item.h:48
Net::InventoryHandler * inventoryHandler
Definition: net.cpp:85

◆ widgetHidden()

void InventoryWindow::widgetHidden ( const Event event)
virtual

Handles closing of the window

Reimplemented from Window.

Definition at line 611 of file inventorywindow.cpp.

References itemPopup, Widget::setVisible(), Visible_false, and Window::widgetHidden().

612 {
613  Window::widgetHidden(event);
614  if (itemPopup != nullptr)
616 }
void setVisible(Visible visible)
Definition: widget.cpp:224
void widgetHidden(const Event &event)
Definition: window.cpp:720
const bool Visible_false
Definition: visible.h:29
ItemPopup * itemPopup
Definition: itempopup.cpp:63

◆ widgetResized()

void InventoryWindow::widgetResized ( const Event event)
virtual

Called whenever the widget changes size.

Reimplemented from Window.

Definition at line 1044 of file inventorywindow.cpp.

References InventoryType::Cart, Inventory::getType(), LayoutCell::getWidth(), Widget::getWidth(), InventoryType::Inventory, mCompactMode, mFilterCell, mInventory, mNameFilter, mNameFilterCell, LayoutCell::NONE, LayoutCell::setType(), Widget::setVisible(), LayoutCell::setWidth(), Visible_false, Visible_true, LayoutCell::WIDGET, and Window::widgetResized().

Referenced by isStorageActive(), and postInit().

1045 {
1046  Window::widgetResized(event);
1047 
1048  if (mInventory == nullptr)
1049  return;
1050  const InventoryTypeT type = mInventory->getType();
1051  if (type != InventoryType::Inventory &&
1052  type != InventoryType::Cart)
1053  {
1054  return;
1055  }
1056 
1057  if (getWidth() < 600)
1058  {
1059  if (!mCompactMode)
1060  {
1064  mCompactMode = true;
1065  }
1066  }
1067  else if (mCompactMode)
1068  {
1072  mCompactMode = false;
1073  }
1074 }
int getWidth() const
Definition: widget.h:220
const bool Visible_true
Definition: visible.h:29
TextField * mNameFilter
InventoryType ::T InventoryTypeT
Definition: inventorytype.h:41
void setVisible(Visible visible)
Definition: widget.cpp:224
void widgetResized(const Event &event)
Definition: window.cpp:650
Inventory * mInventory
void setType(int t)
Definition: layoutcell.h:133
const bool Visible_false
Definition: visible.h:29
int getWidth() const
Definition: layoutcell.h:136
void setWidth(const int w)
Definition: layoutcell.h:142
LayoutCell * mNameFilterCell
InventoryTypeT getType() const
Definition: inventory.h:175
LayoutCell * mFilterCell

Field Documentation

◆ invInstances

InventoryWindow::WindowList InventoryWindow::invInstances
staticprivate

◆ mCartButton

Button* InventoryWindow::mCartButton
private

Definition at line 189 of file inventorywindow.h.

Referenced by InventoryWindow().

◆ mCompactMode

bool InventoryWindow::mCompactMode
private

Definition at line 207 of file inventorywindow.h.

Referenced by widgetResized().

◆ mDropButton

Button* InventoryWindow::mDropButton
private

Definition at line 186 of file inventorywindow.h.

Referenced by InventoryWindow(), updateButtons(), and updateDropButton().

◆ mEquipmentButton

Button* InventoryWindow::mEquipmentButton
private

Definition at line 190 of file inventorywindow.h.

Referenced by InventoryWindow().

◆ mFilter

TabStrip* InventoryWindow::mFilter
private

Definition at line 197 of file inventorywindow.h.

Referenced by InventoryWindow(), nextTab(), and prevTab().

◆ mFilterCell

LayoutCell* InventoryWindow::mFilterCell
private

Definition at line 203 of file inventorywindow.h.

Referenced by InventoryWindow(), and widgetResized().

◆ mInvCloseButton

Button* InventoryWindow::mInvCloseButton
private

Definition at line 193 of file inventorywindow.h.

Referenced by InventoryWindow().

◆ mInventory

Inventory* InventoryWindow::mInventory
private

◆ mItems

ItemContainer* InventoryWindow::mItems
private

◆ mNameFilter

TextField* InventoryWindow::mNameFilter
private

Definition at line 200 of file inventorywindow.h.

Referenced by action(), InventoryWindow(), isInputFocused(), and widgetResized().

◆ mNameFilterCell

LayoutCell* InventoryWindow::mNameFilterCell
private

Definition at line 202 of file inventorywindow.h.

Referenced by InventoryWindow(), and widgetResized().

◆ mOutfitButton

Button* InventoryWindow::mOutfitButton
private

Definition at line 187 of file inventorywindow.h.

Referenced by InventoryWindow().

◆ mRetrieveButton

Button* InventoryWindow::mRetrieveButton
private

Definition at line 192 of file inventorywindow.h.

Referenced by InventoryWindow().

◆ mShopButton

Button* InventoryWindow::mShopButton
private

Definition at line 188 of file inventorywindow.h.

Referenced by InventoryWindow().

◆ mSlotsBar

ProgressBar* InventoryWindow::mSlotsBar
private

Definition at line 196 of file inventorywindow.h.

Referenced by InventoryWindow(), mouseMoved(), and slotsChanged().

◆ mSlotsBarCell

LayoutCell* InventoryWindow::mSlotsBarCell
private

Definition at line 204 of file inventorywindow.h.

Referenced by InventoryWindow().

◆ mSortDropDown

DropDown* InventoryWindow::mSortDropDown
private

◆ mSortDropDownCell

LayoutCell* InventoryWindow::mSortDropDownCell
private

Definition at line 201 of file inventorywindow.h.

Referenced by InventoryWindow().

◆ mSortModel

SortListModelInv* InventoryWindow::mSortModel
private

Definition at line 198 of file inventorywindow.h.

Referenced by ~InventoryWindow().

◆ mSplit

bool InventoryWindow::mSplit
private

Definition at line 206 of file inventorywindow.h.

Referenced by keyPressed(), keyReleased(), and valueChanged().

◆ mStoreButton

Button* InventoryWindow::mStoreButton
private

Definition at line 191 of file inventorywindow.h.

Referenced by InventoryWindow().

◆ mUseButton

Button* InventoryWindow::mUseButton
private

Definition at line 185 of file inventorywindow.h.

Referenced by InventoryWindow(), and updateButtons().

◆ mWeightBar

ProgressBar* InventoryWindow::mWeightBar
private

Definition at line 195 of file inventorywindow.h.

Referenced by InventoryWindow(), mouseMoved(), and updateWeight().


The documentation for this class was generated from the following files: