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=0)
 
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="Window", const Modal modal=Modal_false, Window *const parent=0, std::string skin="")
 
virtual ~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=0, int offsetY=0)
 
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=0, const int offsetY=0)
 
virtual void resetToDefaultSize ()
 
void adjustPositionAfterResize (const int oldScreenWidth, const int oldScreenHeight)
 
LayoutgetLayout ()
 
void clearLayout ()
 
void reflowLayout (int w=0, int h=0)
 
LayoutCellplace (const int x, const int y, Widget *const wg, const int w=1, const int h=1)
 
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)
 
virtual ~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)
 
virtual ~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)
 
virtual ~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=255U) 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=0) const
 
bool getOptionBool (const std::string &name, const bool def=false) 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 82 of file inventorywindow.cpp.

References _, Widget::addActionListener(), WidgetGroup::addButton(), Inventory::addInventoyListener(), Widget::addKeyListener(), ItemContainer::addSelectionListener(), 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.

82  :
83  Window("Inventory", Modal_false, nullptr, "inventory.xml"),
85  KeyListener(),
89  mInventory(inventory),
90  mItems(new ItemContainer(this, mInventory)),
91  mUseButton(nullptr),
92  mDropButton(nullptr),
93  mOutfitButton(nullptr),
94  mShopButton(nullptr),
95  mCartButton(nullptr),
96  mEquipmentButton(nullptr),
97  mStoreButton(nullptr),
98  mRetrieveButton(nullptr),
99  mInvCloseButton(nullptr),
100  mWeightBar(nullptr),
101  mSlotsBar(new ProgressBar(this, 0.0F, 100, 0,
103  "slotsprogressbar.xml", "slotsprogressbar_fill.xml")),
104  mFilter(nullptr),
106  mSortDropDown(new DropDown(this, mSortModel, false,
107  Modal_false, this, "sort")),
109  this, "namefilter", true)),
110  mSortDropDownCell(nullptr),
111  mNameFilterCell(nullptr),
112  mFilterCell(nullptr),
113  mSlotsBarCell(nullptr),
114  mSplit(false),
115  mCompactMode(false)
116 {
119 
120  if (inventory != nullptr)
121  {
122  setCaption(gettext(inventory->getName().c_str()));
123  setWindowName(inventory->getName());
124  switch (inventory->getType())
125  {
128  case InventoryType::Npc:
134  default:
136  "inventorySortOrder"));
137  break;
140  "storageSortOrder"));
141  break;
142  case InventoryType::Cart:
144  "cartSortOrder"));
145  break;
146  };
147  }
148  else
149  {
150  // TRANSLATORS: inventory window name
151  setCaption(_("Inventory"));
152  setWindowName("Inventory");
154  }
155 
156  if ((setupWindow != nullptr) &&
157  (inventory != nullptr) &&
158  inventory->getType() != InventoryType::Storage)
159  {
161  }
162 
163  setResizable(true);
164  setCloseButton(true);
165  setSaveVisible(true);
166  setStickyButtonLock(true);
167 
168  if (mainGraphics->mWidth > 600)
170  else
172  setMinWidth(310);
173  setMinHeight(179);
174  addKeyListener(this);
175 
177 
178  const int size = config.getIntValue("fontSize");
179  mFilter = new TabStrip(this, "filter_" + getWindowName(), size + 16);
180  mFilter->addActionListener(this);
181  mFilter->setActionEventId("tag_");
182  mFilter->setSelectable(false);
183 
184  StringVect tags = ItemDB::getTags();
185  const size_t sz = tags.size();
186  for (size_t f = 0; f < sz; f ++)
187  mFilter->addButton(tags[f], tags[f], false);
188 
189  if (mInventory == nullptr)
190  {
191  invInstances.push_back(this);
192  return;
193  }
194 
195  ScrollArea *const invenScroll = new ScrollArea(this, mItems,
196  fromBool(getOptionBool("showbackground"), Opaque),
197  "inventory_background.xml");
199 
200  switch (mInventory->getType())
201  {
203  {
204  // TRANSLATORS: inventory button
205  const std::string equip = _("Equip");
206  // TRANSLATORS: inventory button
207  const std::string use = _("Use");
208  // TRANSLATORS: inventory button
209  const std::string unequip = _("Unequip");
210 
211  std::string longestUseString = getFont()->getWidth(equip) >
212  getFont()->getWidth(use) ? equip : use;
213 
214  if (getFont()->getWidth(longestUseString) <
215  getFont()->getWidth(unequip))
216  {
217  longestUseString = unequip;
218  }
219 
220  mUseButton = new Button(this, longestUseString, "use", this);
221  // TRANSLATORS: inventory button
222  mDropButton = new Button(this, _("Drop..."), "drop", this);
223  // TRANSLATORS: inventory outfits button
224  mOutfitButton = new Button(this, _("O"), "outfit", this);
225  // TRANSLATORS: inventory cart button
226  mCartButton = new Button(this, _("C"), "cart", this);
227  // TRANSLATORS: inventory shop button
228  mShopButton = new Button(this, _("S"), "shop", this);
229  // TRANSLATORS: inventory equipment button
230  mEquipmentButton = new Button(this, _("E"), "equipment", this);
231  mWeightBar = new ProgressBar(this, 0.0F, 100, 0,
233  "weightprogressbar.xml", "weightprogressbar_fill.xml");
236 
237  // TRANSLATORS: outfits button tooltip
238  mOutfitButton->setDescription(_("Outfits"));
239  // TRANSLATORS: cart button tooltip
240  mCartButton->setDescription(_("Cart"));
241  // TRANSLATORS: shop button tooltip
242  mShopButton->setDescription(_("Shop"));
243  // TRANSLATORS: equipment button tooltip
244  mEquipmentButton->setDescription(_("Equipment"));
245 
246  place(0, 0, mWeightBar, 4);
247  mSlotsBarCell = &place(4, 0, mSlotsBar, 4);
249 
250  mFilterCell = &place(0, 1, mFilter, 10).setPadding(3);
251  mNameFilterCell = &place(8, 1, mNameFilter, 3);
252 
253  place(0, 2, invenScroll, 11).setPadding(3);
254  place(0, 3, mUseButton);
255  place(1, 3, mDropButton);
256  ContainerPlacer placer = getPlacer(10, 3);
257  placer(0, 0, mShopButton);
258  placer(1, 0, mOutfitButton);
259  placer(2, 0, mCartButton);
260  placer(3, 0, mEquipmentButton);
261 
262  updateWeight();
263  break;
264  }
265 
267  {
268  // TRANSLATORS: storage button
269  mStoreButton = new Button(this, _("Store"), "store", this);
270  // TRANSLATORS: storage button
271  mRetrieveButton = new Button(this, _("Retrieve"),
272  "retrieve", this);
273  // TRANSLATORS: storage button
274  mInvCloseButton = new Button(this, _("Close"), "close", this);
275 
276  mSlotsBarCell = &place(0, 0, mSlotsBar, 6);
278 
279  mFilterCell = &place(0, 1, mFilter, 7).setPadding(3);
280  mNameFilterCell = &place(6, 1, mNameFilter, 1);
281 
282  place(0, 2, invenScroll, 7, 4);
283  place(0, 6, mStoreButton);
284  place(1, 6, mRetrieveButton);
285  place(6, 6, mInvCloseButton);
286  break;
287  }
288 
289  case InventoryType::Cart:
290  {
291  // TRANSLATORS: storage button
292  mStoreButton = new Button(this, _("Store"), "store", this);
293  // TRANSLATORS: storage button
294  mRetrieveButton = new Button(this, _("Retrieve"),
295  "retrieve", this);
296  // TRANSLATORS: storage button
297  mInvCloseButton = new Button(this, _("Close"), "close", this);
298 
299  mWeightBar = new ProgressBar(this, 0.0F, 100, 0,
301  "weightprogressbar.xml", "weightprogressbar_fill.xml");
304 
305  mSlotsBarCell = &place(3, 0, mSlotsBar, 3);
307 
308  mFilterCell = &place(0, 1, mFilter, 7).setPadding(3);
309  mNameFilterCell = &place(6, 1, mNameFilter, 1);
310 
311  place(0, 0, mWeightBar, 3);
312  place(0, 2, invenScroll, 7, 4);
313  place(0, 6, mStoreButton);
314  place(1, 6, mRetrieveButton);
315  place(6, 6, mInvCloseButton);
316  break;
317  }
318 
319  default:
321  case InventoryType::Npc:
327  break;
328  };
329 
330  Layout &layout = getLayout();
331  layout.setRowHeight(2, LayoutType::SET);
332 
334 
335  invInstances.push_back(this);
336 
337  if (inventory->isMainInventory())
338  {
340  }
341  else
342  {
343  if (!invInstances.empty())
344  invInstances.front()->updateDropButton();
345  }
346 
347  loadWindowState();
348  enableVisibleSound(true);
349 }
Font * getFont() const
Definition: widget.cpp:330
void setDefaultSize()
Definition: window.cpp:1186
#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
const StringVect & getTags()
Definition: itemdb.cpp:771
const Color & getThemeColor(const ThemeColorIdT type, const unsigned int alpha=255U) const A_INLINE
Definition: widget2.h:44
void loadWindowState()
Definition: window.cpp:1075
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:579
int mWidth
Definition: graphics.h:483
Definition: button.h:94
Configuration config
bool getOptionBool(const std::string &name, const bool def=false) const
Definition: window.cpp:1454
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
Inventory * mInventory
#define fromBool(val, name)
Definition: booldefines.h:48
Button * mRetrieveButton
LayoutCell & place(const int x, const int y, Widget *const wg, const int w=1, const int h=1)
Definition: window.cpp:1372
bool isMainInventory() const
Definition: inventory.h:178
Graphics * mainGraphics
Definition: graphics.cpp:108
void setCloseButton(const bool flag)
Definition: window.cpp:737
void addKeyListener(KeyListener *const keyListener)
Definition: widget.cpp:271
TabStrip * mFilter
void enableVisibleSound(bool b)
Definition: window.h:473
const std::string & getWindowName() const
Definition: window.h:359
void setMinHeight(const int height)
Definition: window.cpp:592
ContainerPlacer getPlacer(const int x, const int y)
Definition: window.cpp:1379
LayoutCell & setPadding(int p)
Definition: layoutcell.h:59
Layout & getLayout()
Definition: window.cpp:1353
void setSaveVisible(const bool save)
Definition: window.h:298
Button * mOutfitButton
void addSelectionListener(SelectionListener *listener)
LayoutCell * mSortDropDownCell
ProgressBar * mSlotsBar
int getWidth(const std::string &text) const
Definition: font.cpp:333
Button * mEquipmentButton
static WindowList invInstances
Button * mInvCloseButton
void setResizable(const bool resize)
Definition: window.cpp:615
void setStickyButtonLock(const bool sticky)
Definition: window.cpp:760
SetupWindow * setupWindow
Definition: setupwindow.cpp:63
void addInventoyListener(InventoryListener *const listener)
Definition: inventory.cpp:301
Window(const std::string &caption="Window", const Modal modal=Modal_false, Window *const parent=0, std::string skin="")
Definition: window.cpp:108
void setDescription(const std::string &text)
Definition: button.h:167
LayoutCell * mNameFilterCell
Definition: layout.h:43
void setCaption(const std::string &caption)
Definition: window.h:523
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:510
DropDown * mSortDropDown
void setWindowName(const std::string &name)
Definition: window.h:353
void setHorizontalScrollPolicy(const ScrollPolicy hPolicy)

◆ ~InventoryWindow()

InventoryWindow::~InventoryWindow ( )

Destructor.

Definition at line 365 of file inventorywindow.cpp.

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

366 {
367  invInstances.remove(this);
368  if (mInventory != nullptr)
370  if (!invInstances.empty())
371  invInstances.front()->updateDropButton();
372 
373  mSortDropDown->hideDrop(false);
375 }
#define delete2(var)
Definition: delete2.h:24
SortListModelInv * mSortModel
Inventory * mInventory
static WindowList invInstances
void hideDrop(bool event=true)
Definition: dropdown.cpp:374
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 407 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.

408 {
409  const std::string &eventId = event.getId();
410  if (eventId == "outfit")
411  {
413  }
414  else if (eventId == "shop")
415  {
417  }
418  else if (eventId == "equipment")
419  {
421  }
422  else if (eventId == "cart")
423  {
425  }
426  else if (eventId == "close")
427  {
428  close();
429  }
430  else if (eventId == "store")
431  {
432  if (inventoryWindow == nullptr || !inventoryWindow->isWindowVisible())
433  return;
434 
436 
437  if (item == nullptr)
438  return;
439 
440  if (storageWindow != nullptr)
441  {
443  this, item);
444  }
445  else if ((cartWindow != nullptr) && cartWindow->isWindowVisible())
446  {
448  this, item);
449  }
450  }
451  else if (eventId == "sort")
452  {
454  storeSortOrder();
455  return;
456  }
457  else if (eventId == "namefilter")
458  {
460  mItems->updateMatrix();
461  }
462  else if (eventId.find("tag_") == 0u)
463  {
464  std::string tagName = event.getId().substr(4);
465  mItems->setFilter(ItemDB::getTagId(tagName));
466  return;
467  }
468 
469  Item *const item = mItems->getSelectedItem();
470 
471  if (item == nullptr)
472  return;
473 
474  if (eventId == "use")
475  {
477  }
478  if (eventId == "equip")
479  {
481  }
482  else if (eventId == "drop")
483  {
484  if (isStorageActive())
485  {
487  item->getInvIndex(),
488  item->getQuantity(),
490  }
491  else if ((cartWindow != nullptr) && cartWindow->isWindowVisible())
492  {
494  item->getInvIndex(),
495  item->getQuantity(),
497  }
498  else
499  {
500  if (PlayerInfo::isItemProtected(item->getId()))
501  return;
502 
504  {
505  PlayerInfo::dropItem(item, item->getQuantity(), Sfx_true);
506  }
507  else
508  {
510  this, item);
511  }
512  }
513  }
514  else if (eventId == "split")
515  {
517  this, item,
518  (item->getQuantity() - 1));
519  }
520  else if (eventId == "retrieve")
521  {
522  if (storageWindow != nullptr)
523  {
525  this, item);
526  }
527  else if ((cartWindow != nullptr) && cartWindow->isWindowVisible())
528  {
530  this, item);
531  }
532  }
533 }
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
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:776
void useEquipItem(const Item *const item, const int16_t useType, const Sfx sfx)
Definition: playerinfo.cpp:274
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:325
Definition: item.h:48
bool isWindowVisible() const
Definition: window.h:476
Net::InventoryHandler * inventoryHandler
Definition: net.cpp:82
static void showWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, int maxRange=0, const int tag=0)
bool isItemProtected(const int id)
Definition: playerinfo.cpp:526
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:225
int getSelected() const
Definition: dropdown.cpp:505
void dropItem(const Item *const item, const int amount, const Sfx sfx)
Definition: playerinfo.cpp:366
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 809 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().

810 {
811  if (mInventory == nullptr)
812  {
813  Window::close();
814  return;
815  }
816 
817  switch (mInventory->getType())
818  {
820  case InventoryType::Cart:
822  break;
823 
825  if (inventoryHandler != nullptr)
826  {
829  }
830  scheduleDelete();
831  break;
832 
833  default:
835  case InventoryType::Npc:
841  break;
842  }
843 }
void setVisible(Visible visible)
virtual void close()
Definition: window.cpp:890
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:82
virtual void scheduleDelete()
Definition: window.cpp:819
InventoryTypeT getType() const
Definition: inventory.h:175

◆ combineItems()

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

Definition at line 1022 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().

1024 {
1025  if (mInventory == nullptr)
1026  return;
1027  const Item *item1 = mInventory->getItem(index1);
1028  if (item1 == nullptr)
1029  return;
1030  const Item *item2 = mInventory->getItem(index2);
1031  if (item2 == nullptr)
1032  return;
1033 
1034  if (item1->getType() != ItemType::Card)
1035  {
1036  const Item *tmpItem = item1;
1037  item1 = item2;
1038  item2 = tmpItem;
1039  }
1040 
1042  // TRANSLATORS: question dialog title
1043  _("Insert card request"),
1044  // TRANSLATORS: question dialog message
1045  strprintf(_("Insert %s into %s?"),
1046  item1->getName().c_str(),
1047  item2->getName().c_str()),
1048  SOUND_REQUEST,
1049  false,
1050  Modal_true);
1053  confirmDlg->addActionListener(&insertCardListener);
1054 }
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:46
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 933 of file inventorywindow.cpp.

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

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

934 {
935  std::set<Widget*> list;
936  FOR_EACH (WindowList::const_iterator, it, invInstances)
937  {
938  if (((*it) != nullptr) && (*it)->isWindowVisible())
939  list.insert(*it);
940  }
941  return dynamic_cast<InventoryWindow*>(
943 }
#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 535 of file inventorywindow.cpp.

References ItemContainer::getSelectedItem(), and mItems.

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

536 {
537  return mItems->getSelectedItem();
538 }
Item * getSelectedItem() const
ItemContainer * mItems

◆ isAnyInputFocused()

bool InventoryWindow::isAnyInputFocused ( )
static

Definition at line 923 of file inventorywindow.cpp.

References FOR_EACH, and invInstances.

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

924 {
925  FOR_EACH (WindowList::const_iterator, it, invInstances)
926  {
927  if (((*it) != nullptr) && (*it)->isInputFocused())
928  return true;
929  }
930  return false;
931 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
static WindowList invInstances

◆ isInputFocused()

bool InventoryWindow::isInputFocused ( ) const

Definition at line 918 of file inventorywindow.cpp.

References Widget::isFocused(), and mNameFilter.

Referenced by isStorageActive().

919 {
920  return (mNameFilter != nullptr) && mNameFilter->isFocused();
921 }
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 735 of file inventorywindow.cpp.

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

736 {
737  if (event.getActionId() == InputAction::GUI_MOD)
738  mSplit = true;
739 }
InputActionT getActionId() const
Definition: keyevent.h:130

◆ keyReleased()

void InventoryWindow::keyReleased ( KeyEvent event)
virtual

Handles the key releases.

Reimplemented from KeyListener.

Definition at line 741 of file inventorywindow.cpp.

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

742 {
743  if (event.getActionId() == InputAction::GUI_MOD)
744  mSplit = false;
745 }
InputActionT getActionId() const
Definition: keyevent.h:130

◆ mouseClicked()

void InventoryWindow::mouseClicked ( MouseEvent event)
virtual

Handles the mouse clicks.

Reimplemented from MouseListener.

Definition at line 552 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().

553 {
554  Window::mouseClicked(event);
555 
556  const int clicks = event.getClickCount();
557 
558  if (clicks == 2 && (gui != nullptr))
559  gui->resetClickCount();
560 
561  const bool mod = (isStorageActive() &&
563 
564  const bool mod2 = (tradeWindow != nullptr &&
567 
568  if (mInventory != nullptr)
569  {
570  if (!mod && !mod2 && event.getButton() == MouseButton::RIGHT)
571  {
572  Item *const item = mItems->getSelectedItem();
573 
574  if (item == nullptr)
575  return;
576 
577  /* Convert relative to the window coordinates to absolute screen
578  * coordinates.
579  */
580  const int mx = event.getX() + getX();
581  const int my = event.getY() + getY();
582 
583  if (popupMenu != nullptr)
584  {
585  popupMenu->showPopup(this,
586  mx, my,
587  item,
588  mInventory->getType());
589  }
590  }
591  }
592  else
593  {
594  return;
595  }
596 
597  if (event.getButton() == MouseButton::LEFT ||
598  event.getButton() == MouseButton::RIGHT)
599  {
600  Item *const item = mItems->getSelectedItem();
601 
602  if (item == nullptr)
603  return;
604 
605  if (mod)
606  {
608  {
609  if (event.getButton() == MouseButton::RIGHT)
610  {
614  item);
615  }
616  else
617  {
619  item->getInvIndex(),
620  item->getQuantity(),
622  }
623  }
624  else
625  {
626  if (event.getButton() == MouseButton::RIGHT)
627  {
631  item);
632  }
633  else
634  {
636  item->getInvIndex(),
637  item->getQuantity(),
639  }
640  }
641  }
642  else if (mod2 && mInventory->isMainInventory())
643  {
644  if (PlayerInfo::isItemProtected(item->getId()))
645  return;
646  if (event.getButton() == MouseButton::RIGHT)
647  {
649  tradeWindow, item);
650  }
651  else
652  {
653  if (tradeWindow != nullptr)
654  tradeWindow->tradeItem(item, item->getQuantity(), true);
655  }
656  }
657  else if (clicks == 2)
658  {
660  {
661  if (isStorageActive())
662  {
665  inventoryWindow, item);
666  }
667  else if (tradeWindow != nullptr &&
669  {
670  if (PlayerInfo::isItemProtected(item->getId()))
671  return;
674  tradeWindow, item);
675  }
676  else
677  {
679  }
680  }
681  else
682  {
683  if (isStorageActive())
684  {
687  inventoryWindow, item);
688  }
689  }
690  }
691  }
692 }
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:113
const bool Sfx_true
Definition: sfx.h:29
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:274
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:968
Definition: item.h:48
bool isWindowVisible() const
Definition: window.h:476
Net::InventoryHandler * inventoryHandler
Definition: net.cpp:82
static void showWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, int maxRange=0, const int tag=0)
int getX() const
Definition: widget.h:268
bool isItemProtected(const int id)
Definition: playerinfo.cpp:526
int getId() const
Definition: item.h:80
void tradeItem(const Item *const item, const int quantity, const bool check=false) const
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:201

◆ 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 730 of file inventorywindow.cpp.

References Popup::hide(), and textPopup.

Referenced by isStorageActive().

731 {
732  textPopup->hide();
733 }
void hide()
Definition: popup.cpp:259
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 694 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().

695 {
696  Window::mouseMoved(event);
697  if (textPopup == nullptr)
698  return;
699 
700  const Widget *const src = event.getSource();
701  if (src == nullptr)
702  {
703  textPopup->hide();
704  return;
705  }
706  const int x = event.getX();
707  const int y = event.getY();
708  const Rect &rect = mDimension;
709  if (src == mSlotsBar || src == mWeightBar)
710  {
711  // TRANSLATORS: money label
712  textPopup->show(rect.x + x, rect.y + y, strprintf(_("Money: %s"),
714  Attributes::MONEY)).c_str()));
715  }
716  else
717  {
718  const Button *const btn = dynamic_cast<const Button *>(src);
719  if (btn == nullptr)
720  {
721  textPopup->hide();
722  return;
723  }
724  const std::string text = btn->getDescription();
725  if (!text.empty())
726  textPopup->show(x + rect.x, y + rect.y, text);
727  }
728 }
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:94
void mouseMoved(MouseEvent &event)
Definition: window.cpp:955
std::string formatCurrency(const int value)
Definition: unitsdb.cpp:323
ProgressBar * mWeightBar
int x
Definition: rect.h:208
void hide()
Definition: popup.cpp:259
std::string getDescription() const
Definition: button.h:170
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 1056 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().

1057 {
1058  if (npcHandler == nullptr)
1059  return;
1060 
1061  Item *const item = mItems->getSelectedItem();
1062  if (item == nullptr)
1063  return;
1064 
1065  NpcDialog *const dialog = npcHandler->getCurrentNpcDialog();
1066  if ((dialog != nullptr) &&
1068  {
1069  if (item->getQuantity() > 1
1071  {
1074  item,
1075  0,
1076  craftSlot);
1077  }
1078  else
1079  {
1080  dialog->addCraftItem(item, 1, craftSlot);
1081  }
1082  }
1083 }
Item * getSelectedItem() const
NpcInputStateT getInputState()
Definition: npcdialog.h:234
ItemContainer * mItems
bool isActionActive(const InputActionT index) const
virtual NpcDialog * getCurrentNpcDialog() const =0
int getQuantity() const
Definition: item.h:104
Definition: item.h:48
static void showWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, int maxRange=0, const int tag=0)
Net::NpcHandler * npcHandler
Definition: net.cpp:86
InputManager inputManager
void addCraftItem(Item *const item, const int amount, const int slot)
Definition: npcdialog.cpp:1376

◆ nextTab()

void InventoryWindow::nextTab ( )
static

Definition at line 945 of file inventorywindow.cpp.

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

Referenced by isStorageActive().

946 {
947  const InventoryWindow *const window = getFirstVisible();
948  if (window != nullptr)
949  window->mFilter->nextTab();
950 }
void nextTab()
Definition: tabstrip.cpp:88
static InventoryWindow * getFirstVisible()
TabStrip * mFilter

◆ postInit()

void InventoryWindow::postInit ( )
virtual

Reimplemented from Window.

Definition at line 351 of file inventorywindow.cpp.

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

352 {
355 
357  widgetResized(Event(nullptr));
358  if (mInventory != nullptr &&
360  {
362  }
363 }
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:505
void postInit()
Definition: window.cpp:241
DropDown * mSortDropDown

◆ prevTab()

void InventoryWindow::prevTab ( )
static

Definition at line 952 of file inventorywindow.cpp.

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

Referenced by isStorageActive().

953 {
954  const InventoryWindow *const window = getFirstVisible();
955  if (window != nullptr)
956  window->mFilter->prevTab();
957 }
void prevTab()
Definition: tabstrip.cpp:106
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 991 of file inventorywindow.cpp.

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

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

992 {
993  if (visible == Visible_false)
995  Window::setVisible(visible);
996 }
const bool Visible_false
Definition: visible.h:29
virtual void setVisible(Visible visible)
Definition: window.cpp:766
void hideDrop(bool event=true)
Definition: dropdown.cpp:374
DropDown * mSortDropDown

◆ slotsChanged()

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

Implements InventoryListener.

Definition at line 873 of file inventorywindow.cpp.

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

Referenced by postInit().

874 {
875  if (inventory == mInventory)
876  {
877  const int usedSlots = mInventory->getNumberOfSlotsUsed();
878  const int maxSlots = mInventory->getSize();
879 
880  if (maxSlots != 0)
881  {
882  mSlotsBar->setProgress(static_cast<float>(usedSlots)
883  / static_cast<float>(maxSlots));
884  }
885 
886  mSlotsBar->setText(strprintf("%d/%d", usedSlots, maxSlots));
887  mItems->updateMatrix();
888  }
889 }
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 377 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().

378 {
379  if (mInventory != nullptr)
380  {
381  switch (mInventory->getType())
382  {
385  case InventoryType::Npc:
391  default:
392  config.setValue("inventorySortOrder",
394  break;
396  config.setValue("storageSortOrder",
398  break;
399  case InventoryType::Cart:
400  config.setValue("cartSortOrder",
402  break;
403  };
404  }
405 }
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:505
DropDown * mSortDropDown

◆ unselectItem()

void InventoryWindow::unselectItem ( )

Unselect item

Definition at line 540 of file inventorywindow.cpp.

References mItems, and ItemContainer::selectNone().

Referenced by ItemShortcutContainer::mousePressed().

541 {
542  mItems->selectNone();
543 }
ItemContainer * mItems

◆ unsetInventory()

void InventoryWindow::unsetInventory ( )

Definition at line 998 of file inventorywindow.cpp.

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

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

999 {
1000  if (mInventory != nullptr)
1001  {
1003  if (mItems != nullptr)
1005  }
1006  mInventory = nullptr;
1007 }
void unsetInventory()
ItemContainer * mItems
Inventory * mInventory
void removeInventoyListener(InventoryListener *const listener)
Definition: inventory.cpp:306

◆ updateButtons()

void InventoryWindow::updateButtons ( const Item item = 0)

Definition at line 763 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().

764 {
765  if ((mInventory == nullptr) || !mInventory->isMainInventory())
766  return;
767 
768  const Item *const selectedItem = mItems->getSelectedItem();
769  if ((item != nullptr) && selectedItem != item)
770  return;
771 
772  if (item == nullptr)
773  item = selectedItem;
774 
775  if ((item == nullptr) || item->getQuantity() == 0)
776  {
777  if (mUseButton != nullptr)
778  mUseButton->setEnabled(false);
779  if (mDropButton != nullptr)
780  mDropButton->setEnabled(false);
781  return;
782  }
783 
784  if (mDropButton != nullptr)
785  mDropButton->setEnabled(true);
786 
787  if (mUseButton != nullptr)
788  {
789  const ItemInfo &info = item->getInfo();
790  const std::string &str = (item->isEquipment() == Equipm_true
791  && item->isEquipped() == Equipped_true)
792  ? info.getUseButton2() : info.getUseButton();
793  if (str.empty())
794  {
795  mUseButton->setEnabled(false);
796  // TRANSLATORS: default use button name
797  mUseButton->setCaption(_("Use"));
798  }
799  else
800  {
801  mUseButton->setEnabled(true);
802  mUseButton->setCaption(str);
803  }
804  }
805 
807 }
#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:214
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 891 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().

892 {
893  if (mDropButton == nullptr)
894  return;
895 
896  if (isStorageActive() ||
897  (cartWindow != nullptr && cartWindow->isWindowVisible()))
898  {
899  // TRANSLATORS: inventory button
900  mDropButton->setCaption(_("Store"));
901  }
902  else
903  {
904  const Item *const item = mItems->getSelectedItem();
905  if ((item != nullptr) && item->getQuantity() > 1)
906  {
907  // TRANSLATORS: inventory button
908  mDropButton->setCaption(_("Drop..."));
909  }
910  else
911  {
912  // TRANSLATORS: inventory button
913  mDropButton->setCaption(_("Drop"));
914  }
915  }
916 }
static bool isStorageActive()
#define _(s)
Definition: gettext.h:34
Item * getSelectedItem() const
ItemContainer * mItems
void setCaption(const std::string &caption)
Definition: button.h:214
int getQuantity() const
Definition: item.h:104
Definition: item.h:48
bool isWindowVisible() const
Definition: window.h:476
InventoryWindow * cartWindow

◆ updateWeight()

void InventoryWindow::updateWeight ( )
private

Updates the weight bar.

Definition at line 845 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().

846 {
847  if ((mInventory == nullptr) || (mWeightBar == nullptr))
848  return;
849  const InventoryTypeT type = mInventory->getType();
850  if (type != InventoryType::Inventory &&
851  type != InventoryType::Cart)
852  {
853  return;
854  }
855 
856  const bool isInv = type == InventoryType::Inventory;
857  const int total = PlayerInfo::getAttribute(isInv
859  const int max = PlayerInfo::getAttribute(isInv
861 
862  if (max <= 0)
863  return;
864 
865  // Adjust progress bar
866  mWeightBar->setProgress(static_cast<float>(total)
867  / static_cast<float>(max));
868  mWeightBar->setText(strprintf("%s/%s",
869  UnitsDb::formatWeight(total).c_str(),
870  UnitsDb::formatWeight(max).c_str()));
871 }
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 747 of file inventorywindow.cpp.

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

748 {
749  if ((mInventory == nullptr) || !mInventory->isMainInventory())
750  return;
751 
752  Item *const item = mItems->getSelectedItem();
753 
754  if (mSplit && (item != nullptr) && inventoryHandler->
755  canSplit(mItems->getSelectedItem()))
756  {
758  this, item, item->getQuantity() - 1);
759  }
760  updateButtons(item);
761 }
Item * getSelectedItem() const
ItemContainer * mItems
void updateButtons(const Item *item=0)
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:82
static void showWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, int maxRange=0, const int tag=0)

◆ widgetHidden()

void InventoryWindow::widgetHidden ( const Event event)
virtual

Handles closing of the window

Reimplemented from Window.

Definition at line 545 of file inventorywindow.cpp.

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

546 {
547  Window::widgetHidden(event);
548  if (itemPopup != nullptr)
550 }
void setVisible(Visible visible)
Definition: widget.cpp:224
void widgetHidden(const Event &event)
Definition: window.cpp:713
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 959 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().

960 {
961  Window::widgetResized(event);
962 
963  if (mInventory == nullptr)
964  return;
965  const InventoryTypeT type = mInventory->getType();
966  if (type != InventoryType::Inventory &&
967  type != InventoryType::Cart)
968  {
969  return;
970  }
971 
972  if (getWidth() < 600)
973  {
974  if (!mCompactMode)
975  {
979  mCompactMode = true;
980  }
981  }
982  else if (mCompactMode)
983  {
987  mCompactMode = false;
988  }
989 }
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:643
Inventory * mInventory
void setType(int t)
Definition: layoutcell.h:125
const bool Visible_false
Definition: visible.h:29
int getWidth() const
Definition: layoutcell.h:128
void setWidth(const int w)
Definition: layoutcell.h:134
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: