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

#include <shopwindow.h>

Inheritance diagram for ShopWindow:
Window VendingModeListener VendingSlotsListener BuyingStoreModeListener BuyingStoreSlotsListener ActionListener SelectionListener BasicContainer2 MouseListener WidgetListener BasicContainer Widget WidgetDeathListener Widget2

Public Types

enum  ShopMode { BUY = 0 , SELL = 1 }
 

Public Member Functions

 ShopWindow ()
 
 ~ShopWindow ()
 
void postInit ()
 
void action (const ActionEvent &event)
 
void valueChanged (const SelectionEvent &event)
 
void updateButtonsAndLabels ()
 
void setVisible (Visible visible)
 
void setItemSelected (const int id)
 
void addBuyItem (const Item *const item, const int amount, const int price)
 
void addSellItem (const Item *const item, const int amount, const int price)
 
void loadList ()
 
void saveList () const
 
void setAcceptPlayer (const std::string &name)
 
const std::string & getAcceptPlayer () const
 
void announce (ShopItems *const list, const int mode)
 
void giveList (const std::string &nick, const int mode)
 
void sendMessage (const std::string &nick, std::string data, const bool random)
 
void processRequest (const std::string &nick, std::string data, const int mode)
 
void updateTimes ()
 
bool findShopItem (const ShopItem *const shopItem, const int mode) const
 
bool isShopEmpty () const
 
void vendingEnabled (const bool b)
 
void vendingSlotsChanged (const int slots)
 
void buyingStoreEnabled (const bool b)
 
void buyingStoreSlotsChanged (const int slots)
 
void setShopName (const std::string &name)
 
- 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 widgetResized (const Event &event)
 
void widgetMoved (const Event &event)
 
void widgetHidden (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 mouseMoved (MouseEvent &event)
 
void mouseReleased (MouseEvent &event)
 
void mouseExited (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 ()
 
virtual void close ()
 
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 mouseClicked (MouseEvent &event)
 
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 VendingModeListener
 VendingModeListener ()
 
virtual ~ VendingModeListener ()
 
- Public Member Functions inherited from VendingSlotsListener
 VendingSlotsListener ()
 
virtual ~ VendingSlotsListener ()
 
- Public Member Functions inherited from BuyingStoreModeListener
 BuyingStoreModeListener ()
 
virtual ~ BuyingStoreModeListener ()
 
- Public Member Functions inherited from BuyingStoreSlotsListener
 BuyingStoreSlotsListener ()
 
virtual ~ BuyingStoreSlotsListener ()
 
- Public Member Functions inherited from ActionListener
virtual ~ActionListener ()
 
- Public Member Functions inherited from SelectionListener
virtual ~SelectionListener ()
 

Static Public Member Functions

static bool isActive ()
 
static void showList (const std::string &nick, std::string data)
 
static bool checkFloodCounter (time_t &counterTime)
 
static int sumAmount (const Item *const shopItem)
 
- 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 VendingModeListener
static void distributeEvent (const bool b)
 
static void addListener (VendingModeListener *const listener)
 
static void removeListener (const VendingModeListener *const listener)
 
- Static Public Member Functions inherited from VendingSlotsListener
static void distributeEvent (const int slots)
 
static void addListener (VendingSlotsListener *const listener)
 
static void removeListener (const VendingSlotsListener *const listener)
 
- Static Public Member Functions inherited from BuyingStoreModeListener
static void distributeEvent (const bool b)
 
static void addListener (BuyingStoreModeListener *const listener)
 
static void removeListener (const BuyingStoreModeListener *const listener)
 
- Static Public Member Functions inherited from BuyingStoreSlotsListener
static void distributeEvent (const int slots)
 
static void addListener (BuyingStoreSlotsListener *const listener)
 
static void removeListener (const BuyingStoreSlotsListener *const listener)
 

Private Types

typedef std::list< ShopWindow * > DialogList
 

Private Member Functions

void startTrade ()
 
void updateSelection ()
 
void updateShopName ()
 

Private Attributes

ButtonmCloseButton
 
ShopItemsmBuyShopItems
 
ShopItemsmSellShopItems
 
ShopItemmTradeItem
 
ShopListBoxmBuyShopItemList
 
ShopListBoxmSellShopItemList
 
ShopListBoxmCurrentShopItemList
 
ScrollAreamScrollArea
 
ButtonmAddButton
 
ButtonmDeleteButton
 
ButtonmAnnounceButton
 
ButtonmPublishButton
 
ButtonmRenameButton
 
CheckBoxmAnnounceLinks
 
TabStripmTabs
 
std::string mAcceptPlayer
 
std::string mTradeNick
 
std::string mSellShopName
 
int mSelectedItem
 
time_t mAnnonceTime
 
time_t mLastRequestTimeList
 
time_t mLastRequestTimeItem
 
int mRandCounter
 
int mTradeMoney
 
int mSellShopSize
 
int mBuyShopSize
 
bool isBuySelected
 
bool mHaveVending
 
bool mEnableBuyingStore
 
bool mEnableVending
 

Static Private Attributes

static DialogList instances
 

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 SelectionListener
 SelectionListener ()
 
- 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

The buy dialog.

Definition at line 50 of file shopwindow.h.

Member Typedef Documentation

◆ DialogList

typedef std::list<ShopWindow*> ShopWindow::DialogList
private

Definition at line 170 of file shopwindow.h.

Member Enumeration Documentation

◆ ShopMode

Enumerator
BUY 
SELL 

Definition at line 59 of file shopwindow.h.

60  {
61  BUY = 0,
62  SELL = 1
63  };

Constructor & Destructor Documentation

◆ ShopWindow()

ShopWindow::ShopWindow ( )

Constructor.

See also
Window::Window

Definition at line 105 of file shopwindow.cpp.

105  :
106  // TRANSLATORS: shop window name
107  Window(_("Personal Shop"), Modal_false, nullptr, "shop.xml"),
112  ActionListener(),
114  // TRANSLATORS: shop window button
115  mCloseButton(new Button(this, _("Close"), "close", BUTTON_SKIN, this)),
118  mTradeItem(nullptr),
123  mCurrentShopItemList(nullptr),
125  fromBool(getOptionBool("showbuybackground", false), Opaque),
126  "shop_buy_background.xml")),
127  // TRANSLATORS: shop window label
128  mAddButton(new Button(this, _("Add"), "add", BUTTON_SKIN, this)),
129  // TRANSLATORS: shop window label
130  mDeleteButton(new Button(this, _("Delete"), "delete", BUTTON_SKIN, this)),
131  mAnnounceButton(nullptr),
132  mPublishButton(nullptr),
133  mRenameButton(nullptr),
134  mAnnounceLinks(nullptr),
135  mTabs(nullptr),
136  mAcceptPlayer(),
137  mTradeNick(),
138  mSellShopName(serverConfig.getStringValue("sellShopName")),
139  mSelectedItem(-1),
140  mAnnonceTime(0),
143  mRandCounter(0),
144  mTradeMoney(0),
145  mSellShopSize(0),
146  mBuyShopSize(0),
147  isBuySelected(true),
149  mEnableBuyingStore(false),
150  mEnableVending(false)
151 {
152  setWindowName("Personal Shop");
153  setResizable(true);
154  setCloseButton(true);
155  setStickyButtonLock(true);
156  setMinWidth(300);
157  setMinHeight(220);
158  if (mainGraphics->mWidth > 600)
159  setDefaultSize(500, 300, ImagePosition::CENTER, 0, 0);
160  else
161  setDefaultSize(380, 300, ImagePosition::CENTER, 0, 0);
162 
163  if (setupWindow != nullptr)
165 
166  const int size = config.getIntValue("fontSize")
167  + getOption("tabHeightAdjust", 16);
168  mTabs = new TabStrip(this, "shop", size, 0);
169  mTabs->addActionListener(this);
170  mTabs->setActionEventId("tab_");
171  // TRANSLATORS: shop window tab name
172  mTabs->addButton(_("Buy"), "buy", true);
173  // TRANSLATORS: shop window tab name
174  mTabs->addButton(_("Sell"), "sell", false);
175  mTabs->setSelectable(false);
176  mScrollArea->setSelectable(false);
177 
178  loadList();
179 
182 
184 
187 
188  ContainerPlacer placer(nullptr, nullptr);
189  placer = getPlacer(0, 0);
190 
191  placer(0, 0, mTabs, 8, 1).setPadding(3);
192 
193  if (mHaveVending)
194  {
195  mPublishButton = new Button(this,
196  // TRANSLATORS: shop window button
197  _("Publish"),
198  "publish",
199  BUTTON_SKIN,
200  this);
201  mRenameButton = new Button(this,
202  // TRANSLATORS: shop window button
203  _("Rename"),
204  "rename",
205  BUTTON_SKIN,
206  this);
207  placer(2, 6, mPublishButton, 1, 1);
208  placer(3, 6, mRenameButton, 1, 1);
209  }
210  else
211  {
212  mAnnounceButton = new Button(this,
213  // TRANSLATORS: shop window button
214  _("Announce"),
215  "announce",
216  BUTTON_SKIN,
217  this);
218  // TRANSLATORS: shop window checkbox
219  mAnnounceLinks = new CheckBox(this, _("Show links in announce"), false,
220  this, "link announce");
221 
222  placer(2, 6, mAnnounceButton, 1, 1);
223  placer(0, 7, mAnnounceLinks, 7, 1);
224  }
225 
226  placer(0, 1, mScrollArea, 8, 5).setPadding(3);
227  placer(0, 6, mAddButton, 1, 1);
228  placer(1, 6, mDeleteButton, 1, 1);
229  placer(7, 6, mCloseButton, 1, 1);
230 
231  Layout &layout = getLayout();
232  layout.setRowHeight(0, LayoutType::SET);
233 
234  center();
235  loadWindowState();
236  updateShopName();
237  instances.push_back(this);
238 }
#define fromBool(val, name)
Definition: booldefines.h:49
const std::string BUTTON_SKIN
Definition: button.h:89
Definition: button.h:102
std::string getStringValue(const std::string &key) const
int getIntValue(const std::string &key) const
int mWidth
Definition: graphics.h:484
void setRowHeight(const int n, const int h)
Definition: layoutcell.cpp:128
Definition: layout.h:45
void addSelectionListener(SelectionListener *const selectionListener)
Definition: listbox.cpp:435
void setHorizontalScrollPolicy(const ScrollPolicy hPolicy)
void registerWindowForReset(Window *const window)
void setPriceCheck(const bool check)
Button * mAddButton
Definition: shopwindow.h:183
int mRandCounter
Definition: shopwindow.h:197
bool mEnableBuyingStore
Definition: shopwindow.h:203
ShopItems * mBuyShopItems
Definition: shopwindow.h:175
Button * mCloseButton
Definition: shopwindow.h:173
time_t mLastRequestTimeItem
Definition: shopwindow.h:196
ShopListBox * mCurrentShopItemList
Definition: shopwindow.h:181
ShopItems * mSellShopItems
Definition: shopwindow.h:176
time_t mLastRequestTimeList
Definition: shopwindow.h:195
ShopItem * mTradeItem
Definition: shopwindow.h:177
int mBuyShopSize
Definition: shopwindow.h:200
ShopListBox * mSellShopItemList
Definition: shopwindow.h:180
std::string mAcceptPlayer
Definition: shopwindow.h:190
TabStrip * mTabs
Definition: shopwindow.h:189
static DialogList instances
Definition: shopwindow.h:171
Button * mPublishButton
Definition: shopwindow.h:186
std::string mSellShopName
Definition: shopwindow.h:192
bool mEnableVending
Definition: shopwindow.h:204
ShopListBox * mBuyShopItemList
Definition: shopwindow.h:179
Button * mAnnounceButton
Definition: shopwindow.h:185
bool isBuySelected
Definition: shopwindow.h:201
CheckBox * mAnnounceLinks
Definition: shopwindow.h:188
void loadList()
Definition: shopwindow.cpp:546
time_t mAnnonceTime
Definition: shopwindow.h:194
ScrollArea * mScrollArea
Definition: shopwindow.h:182
Button * mRenameButton
Definition: shopwindow.h:187
std::string mTradeNick
Definition: shopwindow.h:191
int mSelectedItem
Definition: shopwindow.h:193
int mTradeMoney
Definition: shopwindow.h:198
bool mHaveVending
Definition: shopwindow.h:202
Button * mDeleteButton
Definition: shopwindow.h:184
void updateShopName()
int mSellShopSize
Definition: shopwindow.h:199
virtual void addButton(const std::string &text, const std::string &tag, const bool pressed)
Definition: widgetgroup.cpp:42
void setActionEventId(const std::string &actionEventId)
Definition: widget.h:596
void setSelectable(const bool selectable)
Definition: widget.h:948
void addActionListener(ActionListener *const actionListener)
Definition: widget.cpp:252
void center()
Definition: window.cpp:1417
void setResizable(const bool resize)
Definition: window.cpp:627
ContainerPlacer getPlacer(const int x, const int y)
Definition: window.cpp:1391
bool getOptionBool(const std::string &name, const bool def) const
Definition: window.cpp:1466
Layout & getLayout()
Definition: window.cpp:1365
void setWindowName(const std::string &name)
Definition: window.h:355
int getOption(const std::string &name, const int def) const
Definition: window.cpp:1454
Window(const std::string &caption, const Modal modal, Window *const parent, std::string skin)
Definition: window.cpp:109
void setMinHeight(const int height)
Definition: window.cpp:604
void setMinWidth(const int width)
Definition: window.cpp:591
void setCloseButton(const bool flag)
Definition: window.cpp:749
void setStickyButtonLock(const bool sticky)
Definition: window.cpp:772
void setDefaultSize()
Definition: window.cpp:1198
void loadWindowState()
Definition: window.cpp:1087
Configuration config
Configuration serverConfig
#define CREATEWIDGETR(type,...)
Definition: createwidget.h:36
const std::string DEFAULT_CURRENCY
Definition: currency.h:27
#define _(s)
Definition: gettext.h:35
Graphics * mainGraphics
Definition: graphics.cpp:109
const bool Modal_false
Definition: modal.h:30
int size()
Definition: emotedb.cpp:306
ServerTypeT getNetworkType()
Definition: net.cpp:189
bool Opaque
Definition: opaque.h:30
SetupWindow * setupWindow
Definition: setupwindow.cpp:64

References _, Widget::addActionListener(), WidgetGroup::addButton(), ListBox::addSelectionListener(), BUTTON_SKIN, ImagePosition::CENTER, Window::center(), config, Configuration::getIntValue(), Window::getLayout(), Window::getOption(), Window::getPlacer(), instances, loadList(), Window::loadWindowState(), mAddButton, mainGraphics, mAnnounceButton, mAnnounceLinks, mBuyShopItemList, mCloseButton, mDeleteButton, mHaveVending, mPublishButton, mRenameButton, mScrollArea, mSellShopItemList, mTabs, Graphics::mWidth, SetupWindow::registerWindowForReset(), LayoutType::SET, Widget::setActionEventId(), Window::setCloseButton(), Window::setDefaultSize(), ScrollArea::setHorizontalScrollPolicy(), Window::setMinHeight(), Window::setMinWidth(), ShopListBox::setPriceCheck(), Window::setResizable(), LayoutCell::setRowHeight(), Widget::setSelectable(), Window::setStickyButtonLock(), setupWindow, Window::setWindowName(), ScrollArea::SHOW_NEVER, EmoteDB::size(), and updateShopName().

◆ ~ShopWindow()

ShopWindow::~ShopWindow ( )

Destructor

Definition at line 248 of file shopwindow.cpp.

249 {
250  saveList();
251 
257 
258  instances.remove(this);
259 }
void saveList() const
Definition: shopwindow.cpp:609
#define delete2(var)
Definition: delete2.h:25

References delete2, instances, mBuyShopItemList, mBuyShopItems, mSellShopItemList, mSellShopItems, mTradeItem, and saveList().

Member Function Documentation

◆ action()

void ShopWindow::action ( const ActionEvent event)
virtual

Called when receiving actions from the widgets.

Implements ActionListener.

Definition at line 261 of file shopwindow.cpp.

262 {
263  const std::string &eventId = event.getId();
264  if (eventId == "close")
265  {
266  close();
267  return;
268  }
269 #ifdef TMWA_SUPPORT
270  else if (eventId == "yes")
271  {
272  startTrade();
273  }
274  else if (eventId == "no")
275  {
276  mTradeNick.clear();
277  }
278  else if (eventId == "ignore")
279  {
281  mTradeNick.clear();
282  }
283  else if (eventId == "announce")
284  {
285  if (isBuySelected)
286  {
289  }
290  else if (mSellShopItems->getNumberOfElements() > 0)
291  {
293  }
294  }
295 #endif // TMWA_SUPPORT
296  else if (eventId == "delete")
297  {
298  if (isBuySelected)
299  {
300  if (mBuyShopItemList != nullptr &&
302  {
304  if (isShopEmpty() && (localPlayer != nullptr))
306  }
307  }
308  else if ((mSellShopItemList != nullptr)
309  && mSellShopItemList->getSelected() >= 0)
310  {
312  if (isShopEmpty() && (localPlayer != nullptr))
314  }
315  }
316  else if (eventId == "tab_buy")
317  {
318  isBuySelected = true;
319  updateSelection();
320  }
321  else if (eventId == "tab_sell")
322  {
323  isBuySelected = false;
324  updateSelection();
325  }
326  else if (eventId == "publish")
327  {
328  if (isBuySelected)
329  {
330  if (mEnableBuyingStore)
331  {
334  }
335  else
336  {
337  STD_VECTOR<ShopItem*> &items = mBuyShopItems->items();
338  if (!items.empty())
339  {
342  true,
343  items);
344  }
345  }
346  }
347  else
348  {
349  if (mEnableVending)
350  {
353  }
354  else
355  {
356  STD_VECTOR<ShopItem*> &oldItems = mSellShopItems->items();
357  STD_VECTOR<ShopItem*> items;
358  const Inventory *const inv = PlayerInfo::getCartInventory();
359  if (inv == nullptr)
360  return;
361  FOR_EACH (STD_VECTOR<ShopItem*>::iterator, it, oldItems)
362  {
363  ShopItem *const item = *it;
364  if (item == nullptr)
365  continue;
366  const Item *const cartItem = inv->findItem(item->getId(),
367  item->getColor());
368  if (cartItem == nullptr)
369  continue;
370  item->setInvIndex(cartItem->getInvIndex());
371  const int amount = cartItem->getQuantity();
372  if (amount == 0)
373  continue;
374  if (item->getQuantity() > amount)
375  item->setQuantity(amount);
376  items.push_back(item);
377  if (static_cast<signed int>(items.size()) >= mSellShopSize)
378  break;
379  }
380  if (!items.empty())
381  vendingHandler->createShop(mSellShopName, true, items);
382  }
383  }
384  }
385  else if (eventId == "rename")
386  {
387  EditDialog *const dialog = CREATEWIDGETR(EditDialog,
388  // TRANSLATORS: shop rename dialog title
389  _("Please enter new shop name"),
391  "OK",
392  300,
393  nullptr,
394  Modal_true);
397  }
398 
399  if (mSelectedItem < 1)
400  return;
401 
402  const Inventory *const inv = mHaveVending && !isBuySelected
404  if (inv == nullptr)
405  return;
406 
407  // +++ need support for colors
408  Item *const item = inv->findItem(mSelectedItem, ItemColor_zero);
409  if (item != nullptr)
410  {
411  if (eventId == "add")
412  {
413  if (isBuySelected)
414  {
416  this,
417  item,
418  sumAmount(item),
419  0);
420  }
421  else
422  {
425  this,
426  item,
427  sumAmount(item),
428  0);
429  }
430  }
431  }
432 }
Net::BuyingStoreHandler * buyingStoreHandler
Definition: net.cpp:107
static void distributeEvent(const bool b)
Item * findItem(const int itemId, const ItemColor color) const
Definition: inventory.cpp:94
static void showWindow(const ItemAmountWindowUsageT usage, Window *const parent, Item *const item, int maxRange, const int tag)
Definition: item.h:50
void setQuantity(const int quantity)
Definition: item.h:93
void setInvIndex(const int index)
Definition: item.h:159
int getQuantity() const
Definition: item.h:105
int getInvIndex() const
Definition: item.h:165
int getId() const
Definition: item.h:81
ItemColor getColor() const
Definition: item.h:181
int getSelected() const
Definition: listbox.h:168
void updateStatus() const
virtual void create(const std::string &name, const int maxMoney, const bool flag, const std::vector< ShopItem * > &items) const =0
virtual void close() const =0
virtual void close() const =0
virtual void createShop(const std::string &name, const bool flag, const std::vector< ShopItem * > &items) const =0
void ignoreTrade(const std::string &name) const
std::vector< ShopItem * > & items()
Definition: shopitems.h:136
void del(const unsigned int i)
Definition: shopitems.cpp:161
int getNumberOfElements()
Definition: shopitems.h:99
void setDialog(EditDialog *const dialog)
void startTrade()
Definition: shopwindow.cpp:734
bool isShopEmpty() const
void announce(ShopItems *const list, const int mode)
Definition: shopwindow.cpp:675
void updateSelection()
static int sumAmount(const Item *const shopItem)
static void distributeEvent(const bool b)
virtual void close()
Definition: window.cpp:902
#define FOR_EACH(type, iter, array)
Definition: foreach.h:25
const ItemColor ItemColor_zero
Definition: itemcolor.h:30
LocalPlayer * localPlayer
const bool Modal_true
Definition: modal.h:30
Inventory * getInventory()
Definition: playerinfo.cpp:195
int32_t getAttribute(const AttributesT id)
Definition: playerinfo.cpp:102
Inventory * getCartInventory()
Definition: playerinfo.cpp:207
Net::VendingHandler * vendingHandler
Definition: net.cpp:122
PlayerRelationsManager playerRelations
ShopRenameListener shopRenameListener

References _, Widget::addActionListener(), announce(), BUY, buyingStoreHandler, Window::close(), Net::BuyingStoreHandler::close(), Net::VendingHandler::close(), Net::BuyingStoreHandler::create(), Net::VendingHandler::createShop(), CREATEWIDGETR, ShopItems::del(), BuyingStoreModeListener::distributeEvent(), VendingModeListener::distributeEvent(), Inventory::findItem(), FOR_EACH, PlayerInfo::getAttribute(), PlayerInfo::getCartInventory(), Item::getColor(), Item::getId(), PlayerInfo::getInventory(), Item::getInvIndex(), ShopItems::getNumberOfElements(), Item::getQuantity(), ListBox::getSelected(), PlayerRelationsManager::ignoreTrade(), isBuySelected, isShopEmpty(), ItemColor_zero, ShopItems::items(), localPlayer, mBuyShopItemList, mBuyShopItems, mEnableBuyingStore, mEnableVending, mHaveVending, Modal_true, Attributes::MONEY, mSelectedItem, mSellShopItemList, mSellShopItems, mSellShopName, mSellShopSize, mTradeNick, playerRelations, SELL, ShopRenameListener::setDialog(), Item::setInvIndex(), Item::setQuantity(), ItemAmountWindowUsage::ShopBuyAdd, shopRenameListener, ItemAmountWindowUsage::ShopSellAdd, ItemAmountWindow::showWindow(), startTrade(), sumAmount(), updateSelection(), LocalPlayer::updateStatus(), and vendingHandler.

◆ addBuyItem()

void ShopWindow::addBuyItem ( const Item *const  item,
const int  amount,
const int  price 
)

Definition at line 512 of file shopwindow.cpp.

514 {
515  if (item == nullptr)
516  return;
517  const bool emp = isShopEmpty();
519  item->getType(),
520  item->getColor(),
521  amount,
522  price);
523  if (emp && (localPlayer != nullptr))
525 
527 }
ItemTypeT getType() const
Definition: item.h:225
ShopItem * addItemNoDup(const int id, const ItemTypeT type, const ItemColor color, const int amount, const int price)
Definition: shopitems.cpp:77
void updateButtonsAndLabels()
Definition: shopwindow.cpp:439

References ShopItems::addItemNoDup(), Item::getColor(), Item::getId(), Item::getType(), isShopEmpty(), localPlayer, mBuyShopItems, updateButtonsAndLabels(), and LocalPlayer::updateStatus().

Referenced by ItemAmountWindow::finish().

◆ addSellItem()

void ShopWindow::addSellItem ( const Item *const  item,
const int  amount,
const int  price 
)

Definition at line 529 of file shopwindow.cpp.

531 {
532  if (item == nullptr)
533  return;
534  const bool emp = isShopEmpty();
536  item->getType(),
537  item->getColor(),
538  amount,
539  price);
540  if (emp && (localPlayer != nullptr))
542 
544 }

References ShopItems::addItemNoDup(), Item::getColor(), Item::getId(), Item::getType(), isShopEmpty(), localPlayer, mSellShopItems, updateButtonsAndLabels(), and LocalPlayer::updateStatus().

Referenced by ItemAmountWindow::finish().

◆ announce()

void ShopWindow::announce ( ShopItems *const  list,
const int  mode 
)

Definition at line 675 of file shopwindow.cpp.

676 {
677  if (list == nullptr)
678  return;
679 
680  std::string data;
681  if (mode == BUY)
682  data.append("Buy ");
683  else
684  data.append("Sell ");
685 
686  if (mAnnonceTime != 0 &&
687  (mAnnonceTime + (2 * 60) > cur_time || mAnnonceTime > cur_time))
688  {
689  return;
690  }
691 
693  if (mAnnounceButton != nullptr)
694  mAnnounceButton->setEnabled(false);
695 
696  STD_VECTOR<ShopItem*> items = list->items();
697 
698  FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items)
699  {
700  const ShopItem *const item = *(it);
701  if (item->getQuantity() > 1)
702  {
703  if (mAnnounceLinks->isSelected())
704  {
705  data.append(strprintf("[@@%d|%[email protected]@] (%dGP) %d, ", item->getId(),
706  item->getInfo().getName().c_str(),
707  item->getPrice(), item->getQuantity()));
708  }
709  else
710  {
711  data.append(strprintf("%s (%dGP) %d, ",
712  item->getInfo().getName().c_str(),
713  item->getPrice(), item->getQuantity()));
714  }
715  }
716  else
717  {
718  if (mAnnounceLinks->isSelected())
719  {
720  data.append(strprintf("[@@%d|%[email protected]@] (%dGP), ", item->getId(),
721  item->getInfo().getName().c_str(), item->getPrice()));
722  }
723  else
724  {
725  data.append(strprintf("%s (%dGP), ",
726  item->getInfo().getName().c_str(), item->getPrice()));
727  }
728  }
729  }
730 
732 }
volatile time_t cur_time
Definition: timer.cpp:58
Net::ChatHandler * chatHandler
Definition: net.cpp:86
bool isSelected() const
Definition: checkbox.h:147
const std::string & getName() const
Definition: iteminfo.h:74
const ItemInfo & getInfo() const
Definition: item.h:171
virtual void channelMessage(const std::string &channel, const std::string &text) const =0
int getPrice() const
Definition: shopitem.h:132
void setEnabled(const bool enabled)
Definition: widget.h:352
const std::string TRADE_CHANNEL
Definition: chat.h:31
uint32_t data
std::string strprintf(const char *const format,...)

References BUY, Net::ChatHandler::channelMessage(), chatHandler, cur_time, data, FOR_EACH, Item::getId(), Item::getInfo(), ItemInfo::getName(), ShopItem::getPrice(), Item::getQuantity(), CheckBox::isSelected(), ShopItems::items(), mAnnonceTime, mAnnounceButton, mAnnounceLinks, Widget::setEnabled(), strprintf(), and TRADE_CHANNEL.

Referenced by action().

◆ buyingStoreEnabled()

void ShopWindow::buyingStoreEnabled ( const bool  b)
virtual

Implements BuyingStoreModeListener.

Definition at line 1191 of file shopwindow.cpp.

1192 {
1193  mEnableBuyingStore = b;
1194  localPlayer->enableShop(b);
1195  if (!b)
1196  mBuyShopSize = 0;
1198 }
void enableShop(const bool b)
Definition: being.cpp:5344

References Being::enableShop(), localPlayer, mBuyShopSize, mEnableBuyingStore, and updateButtonsAndLabels().

◆ buyingStoreSlotsChanged()

void ShopWindow::buyingStoreSlotsChanged ( const int  slots)
virtual

Implements BuyingStoreSlotsListener.

Definition at line 1185 of file shopwindow.cpp.

1186 {
1187  mBuyShopSize = slots;
1189 }

References mBuyShopSize, and updateButtonsAndLabels().

◆ checkFloodCounter()

bool ShopWindow::checkFloodCounter ( time_t &  counterTime)
static

Definition at line 1073 of file shopwindow.cpp.

1074 {
1075  if (counterTime == 0 || counterTime > cur_time)
1076  counterTime = cur_time;
1077  else if (counterTime + 10 > cur_time)
1078  return false;
1079  else
1080  counterTime = cur_time;
1081  return true;
1082 }

References cur_time.

Referenced by giveList(), and processRequest().

◆ findShopItem()

bool ShopWindow::findShopItem ( const ShopItem *const  shopItem,
const int  mode 
) const

Definition at line 1084 of file shopwindow.cpp.

1086 {
1087  if (shopItem == nullptr)
1088  return false;
1089 
1090  STD_VECTOR<ShopItem*> items;
1091  if (mode == SELL)
1092  items = mSellShopItems->items();
1093  else
1094  items = mBuyShopItems->items();
1095 
1096  FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items)
1097  {
1098  const ShopItem *const item = *(it);
1099  if (item == nullptr)
1100  continue;
1101 
1102  if (item->getId() == shopItem->getId()
1103  && item->getPrice() == shopItem->getPrice()
1104  && item->getQuantity() >= shopItem->getQuantity())
1105  {
1106  return true;
1107  }
1108  }
1109  return false;
1110 }

References FOR_EACH, Item::getId(), ShopItem::getPrice(), Item::getQuantity(), ShopItems::items(), mBuyShopItems, mSellShopItems, and SELL.

Referenced by processRequest().

◆ getAcceptPlayer()

const std::string& ShopWindow::getAcceptPlayer ( ) const
inline

Definition at line 124 of file shopwindow.h.

125  { return mAcceptPlayer; }

References mAcceptPlayer.

◆ giveList()

void ShopWindow::giveList ( const std::string &  nick,
const int  mode 
)

Definition at line 759 of file shopwindow.cpp.

760 {
762  return;
763 
764  std::string data("\302\202");
765 
766  ShopItems *list;
767  if (mode == BUY)
768  {
769  list = mBuyShopItems;
770  data.append("S1");
771  }
772  else
773  {
774  list = mSellShopItems;
775  data.append("B1");
776  }
777  if (list == nullptr)
778  return;
779 
780  const Inventory *const inv = PlayerInfo::getInventory();
781  if (inv == nullptr)
782  return;
783 
784  STD_VECTOR<ShopItem*> items = list->items();
785 
786  FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items)
787  {
788  const ShopItem *const item = *(it);
789  if (item == nullptr)
790  continue;
791 
792  if (mode == SELL)
793  {
794  const Item *const item2 = inv->findItem(item->getId(),
796  if (item2 != nullptr)
797  {
798  int amount = item->getQuantity();
799  if (item2->getQuantity() < amount)
800  amount = item2->getQuantity();
801 
802  if (amount != 0)
803  {
804  data.append(strprintf("%s%s%s",
805  encodeStr(item->getId(), 2).c_str(),
806  encodeStr(item->getPrice(), 4).c_str(),
807  encodeStr(amount, 3).c_str()));
808  }
809  }
810  }
811  else
812  {
813  int amount = item->getQuantity();
814  if (item->getPrice() * amount > PlayerInfo::getAttribute(
816  {
818  / item->getPrice();
819  }
820 
821  if (amount > 0)
822  {
823  data.append(strprintf("%s%s%s",
824  encodeStr(item->getId(), 2).c_str(),
825  encodeStr(item->getPrice(), 4).c_str(),
826  encodeStr(amount, 3).c_str()));
827  }
828  }
829  }
830  sendMessage(nick, data, true);
831 }
void sendMessage(const std::string &nick, std::string data, const bool random)
Definition: shopwindow.cpp:833
static bool checkFloodCounter(time_t &counterTime)
const std::string encodeStr(unsigned int value, const unsigned int size)

References BUY, checkFloodCounter(), data, encodeStr(), Inventory::findItem(), FOR_EACH, PlayerInfo::getAttribute(), Item::getId(), PlayerInfo::getInventory(), ShopItem::getPrice(), Item::getQuantity(), ItemColor_zero, ShopItems::items(), mBuyShopItems, mLastRequestTimeList, Attributes::MONEY, mSellShopItems, SELL, sendMessage(), and strprintf().

Referenced by TmwAthena::ChatRecv::processWhisperContinue().

◆ isActive()

static bool ShopWindow::isActive ( )
inlinestatic

Returns true if any instances exist.

Definition at line 104 of file shopwindow.h.

105  { return !instances.empty(); }

References instances.

◆ isShopEmpty()

bool ShopWindow::isShopEmpty ( ) const

Definition at line 1132 of file shopwindow.cpp.

1133 {
1134  if (mBuyShopItems->empty() && mSellShopItems->empty())
1135  return true;
1136  return false;
1137 }
bool empty() const
Definition: shopitems.h:102

References ShopItems::empty(), mBuyShopItems, and mSellShopItems.

Referenced by action(), addBuyItem(), addSellItem(), LocalPlayer::slowLogic(), and LocalPlayer::updateStatus().

◆ loadList()

void ShopWindow::loadList ( )

Definition at line 546 of file shopwindow.cpp.

547 {
548  std::ifstream shopFile;
549  struct stat statbuf;
550 
551  mBuyShopItems->clear();
553 
554  const std::string shopListName = settings.serverConfigDir
555  + "/shoplist.txt";
556 
557  if (stat(shopListName.c_str(), &statbuf) == 0 &&
558  S_ISREG(statbuf.st_mode))
559  {
560  shopFile.open(shopListName.c_str(), std::ios::in);
561  if (!shopFile.is_open())
562  {
563  reportAlways("Error opening file for reading: %s",
564  shopListName.c_str())
565  shopFile.close();
566  return;
567  }
568  char line[101];
569  while (shopFile.getline(line, 100))
570  {
571  std::string buf;
572  const std::string str = line;
573  if (!str.empty())
574  {
575  STD_VECTOR<int> tokens;
576  std::stringstream ss(str);
577 
578  while (ss >> buf)
579  tokens.push_back(atoi(buf.c_str()));
580 
581  if (tokens.size() == 5 && (tokens[0] != 0))
582  {
583  // +++ need impliment colors?
584  if ((tokens[1] != 0) && (tokens[2] != 0))
585  {
587  tokens[0],
590  tokens[1],
591  tokens[2]);
592  }
593  if ((tokens[3] != 0) && (tokens[4] != 0))
594  {
596  tokens[0],
599  tokens[3],
600  tokens[4]);
601  }
602  }
603  }
604  }
605  shopFile.close();
606  }
607 }
#define reportAlways(...)
Definition: checkutils.h:253
std::string serverConfigDir
Definition: settings.h:117
ShopItem * addItem(const int id, const ItemTypeT type, const ItemColor color, const int amount, const int price)
Definition: shopitems.cpp:59
void clear()
Definition: shopitems.cpp:174
const ItemColor ItemColor_one
Definition: itemcolor.h:30
@ Unknown
Definition: itemtype.h:30
Settings settings
Definition: settings.cpp:32

References ShopItems::addItem(), ShopItems::clear(), ItemColor_one, mBuyShopItems, mSellShopItems, reportAlways, Settings::serverConfigDir, settings, and ItemType::Unknown.

Referenced by ShopWindow().

◆ postInit()

void ShopWindow::postInit ( )
virtual

Reimplemented from Window.

Definition at line 240 of file shopwindow.cpp.

241 {
244  enableVisibleSound(true);
245  updateSelection();
246 }
void setVisible(Visible visible)
Definition: shopwindow.cpp:507
void postInit()
Definition: window.cpp:249
void enableVisibleSound(bool b)
Definition: window.h:481
const bool Visible_false
Definition: visible.h:30

References Window::enableVisibleSound(), Window::postInit(), setVisible(), updateSelection(), and Visible_false.

◆ processRequest()

void ShopWindow::processRequest ( const std::string &  nick,
std::string  data,
const int  mode 
)

Definition at line 924 of file shopwindow.cpp.

927 {
928  if (localPlayer == nullptr ||
929  !mTradeNick.empty() ||
931  actorManager == nullptr ||
933  {
934  return;
935  }
936 
937  const Inventory *const inv = PlayerInfo::getInventory();
938  if (inv == nullptr)
939  return;
940 
941  const size_t idx = data.find(' ');
942  if (idx == std::string::npos)
943  return;
944 
946  return;
947 
948  if (!mTradeNick.empty())
949  {
950  sendMessage(nick,
951  // TRANSLATORS: error buy/sell shop request
952  _("error: player busy") + std::string(" "),
953  true);
954  return;
955  }
956 
957  data = data.substr(idx + 1);
958 
959  std::string part1;
960  std::string part2;
961  std::string part3;
962  std::stringstream ss(data);
963  int id;
964  int price;
965  int amount;
966 
967  if (!(ss >> part1))
968  return;
969 
970  if (!(ss >> part2))
971  return;
972 
973  if (!(ss >> part3))
974  return;
975 
976  id = atoi(part1.c_str());
977  price = atoi(part2.c_str());
978  amount = atoi(part3.c_str());
979 
980  delete mTradeItem;
981  // +++ need impliment colors?
982  mTradeItem = new ShopItem(-1,
983  id,
986  amount,
987  price,
989 
990  if (mode == BUY)
991  {
992  // +++ need support for colors
993  const Item *const item2 = inv->findItem(mTradeItem->getId(),
995  if (item2 == nullptr ||
996  item2->getQuantity() < amount ||
998  {
999  sendMessage(nick,
1000  // TRANSLATORS: error buy/sell shop request
1001  _("error: Can't sell this item") + std::string(" "),
1002  true);
1003  return;
1004  }
1005  mTradeMoney = 0;
1006  }
1007  else
1008  {
1009  if (!findShopItem(mTradeItem, BUY))
1010  {
1011  sendMessage(nick,
1012  // TRANSLATORS: error buy/sell shop request
1013  _("error: Can't buy this item") + std::string(" "),
1014  true);
1015  return;
1016  }
1018  }
1019 
1020  mTradeNick = nick;
1021 
1022  if (config.getBoolValue("autoShop"))
1023  {
1025  startTrade();
1026  }
1027  else
1028  {
1029  std::string msg;
1030  if (mode == BUY)
1031  {
1032  // TRANSLATORS: buy shop request (nick, item)
1033  msg = strprintf(_("%s wants to buy %s do you accept?"),
1034  nick.c_str(),
1035  mTradeItem->getInfo().getName().c_str());
1036  }
1037  else
1038  {
1039  // TRANSLATORS: sell shop request (nick, item)
1040  msg = strprintf(_("%s wants to sell %s do you accept?"),
1041  nick.c_str(),
1042  mTradeItem->getInfo().getName().c_str());
1043  }
1044 
1046  // TRANSLATORS: shop window dialog
1047  _("Request for Trade"),
1048  msg,
1049  SOUND_REQUEST,
1050  true,
1051  Modal_false,
1052  nullptr);
1054  }
1055 }
ActorManager * actorManager
Being * findBeingByName(const std::string &name, const ActorTypeT type) const
bool getBoolValue(const std::string &key) const
bool findShopItem(const ShopItem *const shopItem, const int mode) const
void playGuiSound(const std::string &name)
bool msg(InputEvent &event)
Definition: chat.cpp:39
Trading isTrading()
Definition: playerinfo.cpp:391
ConfirmDialog * confirmDlg
Definition: traderecv.cpp:49
static const std::string SOUND_TRADE
Definition: sound.h:30
static const std::string SOUND_REQUEST
Definition: sound.h:29
SoundManager soundManager
const bool Trading_true
Definition: trading.h:30

References _, actorManager, Widget::addActionListener(), BUY, checkFloodCounter(), config, confirmDlg, CREATEWIDGETR, data, DEFAULT_CURRENCY, ActorManager::findBeingByName(), Inventory::findItem(), findShopItem(), Configuration::getBoolValue(), Item::getId(), Item::getInfo(), PlayerInfo::getInventory(), ItemInfo::getName(), ShopItem::getPrice(), Item::getQuantity(), PlayerInfo::isTrading(), ItemColor_one, ItemColor_zero, localPlayer, mLastRequestTimeItem, Modal_false, Actions::msg(), mTradeItem, mTradeMoney, mTradeNick, ActorType::Player, SoundManager::playGuiSound(), SELL, sendMessage(), SOUND_REQUEST, SOUND_TRADE, soundManager, startTrade(), strprintf(), Trading_true, and ItemType::Unknown.

Referenced by TmwAthena::ChatRecv::processWhisperContinue().

◆ saveList()

void ShopWindow::saveList ( ) const

Definition at line 609 of file shopwindow.cpp.

610 {
611  std::ofstream shopFile;
612  const std::string shopListName = settings.serverConfigDir
613  + "/shoplist.txt";
614  std::map<int, ShopItem*> mapItems;
615 
616  shopFile.open(shopListName.c_str(), std::ios::binary);
617  if (!shopFile.is_open())
618  {
619  reportAlways("Error opening file writing: %s",
620  shopListName.c_str())
621  return;
622  }
623 
624  STD_VECTOR<ShopItem*> items = mBuyShopItems->items();
625  FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items)
626  {
627  ShopItem *const item = *(it);
628  if (item != nullptr)
629  mapItems[item->getId()] = item;
630  }
631 
632  items = mSellShopItems->items();
633  FOR_EACH (STD_VECTOR<ShopItem*>::const_iterator, it, items)
634  {
635  if ((*it) == nullptr)
636  continue;
637  const ShopItem *const sellItem = *(it);
638  const ShopItem *const buyItem = mapItems[sellItem->getId()];
639 
640  shopFile << sellItem->getId();
641  if (buyItem != nullptr)
642  {
643  shopFile << strprintf(" %d %d ", buyItem->getQuantity(),
644  buyItem->getPrice());
645  mapItems.erase(sellItem->getId());
646  }
647  else
648  {
649  shopFile << " 0 0 ";
650  }
651 
652  shopFile << strprintf("%d %d", sellItem->getQuantity(),
653  sellItem->getPrice()) << std::endl;
654  }
655 
656  for (std::map<int, ShopItem*>::const_iterator mapIt = mapItems.begin(),
657  mapIt_fend = mapItems.end();
658  mapIt != mapIt_fend;
659  ++mapIt)
660  {
661  const ShopItem *const buyItem = (*mapIt).second;
662  if (buyItem != nullptr)
663  {
664  shopFile << buyItem->getId();
665  shopFile << strprintf(" %d %d ", buyItem->getQuantity(),
666  buyItem->getPrice());
667  shopFile << "0 0" << std::endl;
668  }
669  }
670 
671  shopFile.close();
672 }
#define STD_VECTOR
Definition: vector.h:30

References FOR_EACH, Item::getId(), ShopItem::getPrice(), Item::getQuantity(), ShopItems::items(), mBuyShopItems, mSellShopItems, reportAlways, Settings::serverConfigDir, settings, and strprintf().

Referenced by ~ShopWindow().

◆ sendMessage()

void ShopWindow::sendMessage ( const std::string &  nick,
std::string  data,
const bool  random 
)

Definition at line 833 of file shopwindow.cpp.

836 {
837  if (chatWindow == nullptr)
838  return;
839 
840  if (random)
841  {
842  mRandCounter ++;
843  if (mRandCounter > 200)
844  mRandCounter = 0;
845  data.append(encodeStr(mRandCounter, 2));
846  }
847 
848  if (config.getBoolValue("hideShopMessages"))
850  else
852 }
ChatWindow * chatWindow
Definition: chatwindow.cpp:94
void addWhisper(const std::string &nick, const std::string &mes, const ChatMsgTypeT own)
virtual void privateMessage(const std::string &recipient, const std::string &text) const =0

References ChatWindow::addWhisper(), ChatMsgType::BY_PLAYER, chatHandler, chatWindow, config, data, encodeStr(), Configuration::getBoolValue(), mRandCounter, and Net::ChatHandler::privateMessage().

Referenced by giveList(), and processRequest().

◆ setAcceptPlayer()

void ShopWindow::setAcceptPlayer ( const std::string &  name)
inline

◆ setItemSelected()

void ShopWindow::setItemSelected ( const int  id)
inline

Definition at line 107 of file shopwindow.h.

References mSelectedItem, and updateButtonsAndLabels().

Referenced by ItemContainer::mousePressed().

◆ setShopName()

void ShopWindow::setShopName ( const std::string &  name)

Definition at line 1163 of file shopwindow.cpp.

1164 {
1165  mSellShopName = name;
1166  serverConfig.setValue("sellShopName", mSellShopName);
1167  updateShopName();
1168 }
void setValue(const std::string &key, const std::string &value)

References mSellShopName, serverConfig, Configuration::setValue(), and updateShopName().

Referenced by ShopRenameListener::action().

◆ setVisible()

void ShopWindow::setVisible ( Visible  visible)
virtual

Sets the visibility of this window.

Reimplemented from Window.

Definition at line 507 of file shopwindow.cpp.

508 {
509  Window::setVisible(visible);
510 }
virtual void setVisible(Visible visible)
Definition: window.cpp:778

References Window::setVisible().

Referenced by postInit().

◆ showList()

void ShopWindow::showList ( const std::string &  nick,
std::string  data 
)
static

Definition at line 854 of file shopwindow.cpp.

855 {
856  const Inventory *const inv = PlayerInfo::getInventory();
857  if (inv == nullptr)
858  return;
859 
860  BuyDialog *buyDialog = nullptr;
861  SellDialog *sellDialog = nullptr;
862  if (data.find("B1") == 0)
863  {
864  data = data.substr(2);
865  CREATEWIDGETV(buyDialog, BuyDialog, nick, DEFAULT_CURRENCY);
866  }
867  else if (data.find("S1") == 0)
868  {
869  data = data.substr(2);
870  CREATEWIDGETV(sellDialog, ShopSellDialog, nick);
871  }
872  else
873  {
874  return;
875  }
876 
877  if (buyDialog != nullptr)
879  if (sellDialog != nullptr)
881 
882  for (size_t f = 0; f < data.length(); f += 9)
883  {
884  if (f + 9 > data.length())
885  break;
886 
887  const int id = decodeStr(data.substr(f, 2));
888  const int price = decodeStr(data.substr(f + 2, 4));
889  int amount = decodeStr(data.substr(f + 6, 3));
890  if (buyDialog != nullptr && amount > 0)
891  {
892  buyDialog->addItem(id,
895  amount,
896  price);
897  }
898  if (sellDialog != nullptr)
899  {
900  const Item *const item = inv->findItem(id, ItemColor_zero);
901  if (item != nullptr)
902  {
903  if (item->getQuantity() < amount)
904  amount = item->getQuantity();
905  }
906  else
907  {
908  amount = 0;
909  }
910  ShopItem *const shopItem = sellDialog->addItem(id,
913  amount,
914  price);
915 
916  if (shopItem != nullptr && amount <= 0)
917  shopItem->setDisabled(true);
918  }
919  }
920  if (buyDialog != nullptr)
921  buyDialog->sort();
922 }
void sort()
Definition: buydialog.cpp:472
ShopItem * addItem(const int id, const ItemTypeT type, const ItemColor color, const int amount, const int price)
Definition: buydialog.cpp:457
void setMoney(const int amount)
Definition: buydialog.cpp:437
void addItem(const Item *const item, const int price)
Definition: selldialog.cpp:238
void setMoney(const int amount)
Definition: selldialog.cpp:340
void setDisabled(const bool b)
Definition: shopitem.h:154
#define CREATEWIDGETV(var, type,...)
Definition: createwidget.h:25
unsigned int decodeStr(const std::string &str)

References BuyDialog::addItem(), SellDialog::addItem(), CREATEWIDGETV, data, decodeStr(), DEFAULT_CURRENCY, Inventory::findItem(), PlayerInfo::getAttribute(), PlayerInfo::getInventory(), Item::getQuantity(), ItemColor_one, ItemColor_zero, Attributes::MONEY, ShopItem::setDisabled(), SellDialog::setMoney(), BuyDialog::setMoney(), BuyDialog::sort(), and ItemType::Unknown.

Referenced by TmwAthena::ChatRecv::processWhisperContinue().

◆ startTrade()

void ShopWindow::startTrade ( )
private

Definition at line 734 of file shopwindow.cpp.

735 {
736  if (actorManager == nullptr ||
737  tradeWindow == nullptr)
738  {
739  return;
740  }
741 
742  const Being *const being = actorManager->findBeingByName(
744  tradeWindow->clear();
745  if (mTradeMoney != 0)
746  {
748  }
749  else
750  {
753  }
754  tradeHandler->request(being);
756  mTradeNick.clear();
757 }
Definition: being.h:96
virtual void request(const Being *const being) const
Definition: tradehandler.h:46
void addAutoMoney(const std::string &nick, const int money)
void addAutoItem(const std::string &nick, Item *const item, const int amount)
Net::TradeHandler * tradeHandler
Definition: net.cpp:98
std::string tradePartnerName
Definition: popupmenu.cpp:101
TradeWindow * tradeWindow
Definition: tradewindow.cpp:65

References actorManager, TradeWindow::addAutoItem(), TradeWindow::addAutoMoney(), TradeWindow::clear(), ActorManager::findBeingByName(), Item::getQuantity(), mTradeItem, mTradeMoney, mTradeNick, ActorType::Player, Net::TradeHandler::request(), tradeHandler, tradePartnerName, and tradeWindow.

Referenced by action(), and processRequest().

◆ sumAmount()

int ShopWindow::sumAmount ( const Item *const  shopItem)
static

Definition at line 1113 of file shopwindow.cpp.

1114 {
1115  if ((localPlayer == nullptr) || (shopItem == nullptr))
1116  return 0;
1117 
1118  const Inventory *const inv = PlayerInfo::getInventory();
1119  if (inv == nullptr)
1120  return 0;
1121  int sum = 0;
1122 
1123  for (unsigned f = 0; f < inv->getSize(); f ++)
1124  {
1125  const Item *const item = inv->getItem(f);
1126  if ((item != nullptr) && item->getId() == shopItem->getId())
1127  sum += item->getQuantity();
1128  }
1129  return sum;
1130 }
Item * getItem(const int index) const
Definition: inventory.cpp:83
unsigned getSize() const
Definition: inventory.h:76

References Item::getId(), PlayerInfo::getInventory(), Inventory::getItem(), Item::getQuantity(), Inventory::getSize(), and localPlayer.

Referenced by action().

◆ updateButtonsAndLabels()

void ShopWindow::updateButtonsAndLabels ( )

Updates the state of buttons and labels.

Definition at line 439 of file shopwindow.cpp.

440 {
441  bool allowDel(false);
442  bool allowAdd(false);
443  if (isBuySelected)
444  {
445  allowAdd = !mEnableBuyingStore;
446  allowDel = !mEnableBuyingStore
447  && mBuyShopItemList->getSelected() != -1
449  if (mPublishButton != nullptr)
450  {
451  if (mEnableBuyingStore)
452  {
453  // TRANSLATORS: unpublish shop button
454  mPublishButton->setCaption(_("Unpublish"));
455  }
456  else
457  {
458  // TRANSLATORS: publish shop button
459  mPublishButton->setCaption(_("Publish"));
460  }
462  if (mBuyShopSize > 0)
463  mPublishButton->setEnabled(true);
464  else
465  mPublishButton->setEnabled(false);
466  }
467  }
468  else
469  {
470  const bool sellNotEmpty = mSellShopItems->getNumberOfElements() > 0;
471  allowAdd = !mEnableVending && mSelectedItem != -1;
472  allowDel = !mEnableVending
473  && mSellShopItemList->getSelected() != -1
474  && sellNotEmpty;
475  if (mPublishButton != nullptr)
476  {
477  if (mEnableVending)
478  {
479  // TRANSLATORS: unpublish shop button
480  mPublishButton->setCaption(_("Unpublish"));
481  }
482  else
483  {
484  // TRANSLATORS: publish shop button
485  mPublishButton->setCaption(_("Publish"));
486  }
488  if (sellNotEmpty
489  && mSellShopSize > 0
490  && (localPlayer != nullptr)
491  && localPlayer->getHaveCart())
492  {
493  mPublishButton->setEnabled(true);
494  }
495  else
496  {
497  mPublishButton->setEnabled(false);
498  }
499  }
500  }
501  mAddButton->setEnabled(allowAdd);
502  mDeleteButton->setEnabled(allowDel);
503  if (mRenameButton != nullptr)
505 }
bool getHaveCart() const
Definition: actorsprite.h:175
void setCaption(const std::string &caption)
Definition: button.h:214
void adjustSize()
Definition: button.cpp:799

References _, Button::adjustSize(), ActorSprite::getHaveCart(), ShopItems::getNumberOfElements(), ListBox::getSelected(), isBuySelected, localPlayer, mAddButton, mBuyShopItemList, mBuyShopItems, mBuyShopSize, mDeleteButton, mEnableBuyingStore, mEnableVending, mPublishButton, mRenameButton, mSelectedItem, mSellShopItemList, mSellShopItems, mSellShopSize, Button::setCaption(), and Widget::setEnabled().

Referenced by addBuyItem(), addSellItem(), buyingStoreEnabled(), buyingStoreSlotsChanged(), setItemSelected(), updateSelection(), valueChanged(), vendingEnabled(), and vendingSlotsChanged().

◆ updateSelection()

void ShopWindow::updateSelection ( )
private

◆ updateShopName()

void ShopWindow::updateShopName ( )
private

Definition at line 1149 of file shopwindow.cpp.

1150 {
1151  if (mSellShopName.empty())
1152  {
1153  // TRANSLATORS: shop window name
1154  setCaption(_("Personal Shop"));
1155  }
1156  else
1157  {
1158  // TRANSLATORS: shop window name
1159  setCaption(strprintf(_("Personal Shop - %s"), mSellShopName.c_str()));
1160  }
1161 }
void setCaption(const std::string &caption)
Definition: window.h:531

References _, mSellShopName, Window::setCaption(), and strprintf().

Referenced by setShopName(), and ShopWindow().

◆ updateTimes()

void ShopWindow::updateTimes ( )

Definition at line 1057 of file shopwindow.cpp.

1058 {
1059  BLOCK_START("ShopWindow::updateTimes")
1060  if (mAnnounceButton == nullptr)
1061  {
1062  BLOCK_END("ShopWindow::updateTimes")
1063  return;
1064  }
1065  if (mAnnonceTime + (2 * 60) < cur_time ||
1067  {
1068  mAnnounceButton->setEnabled(true);
1069  }
1070  BLOCK_END("ShopWindow::updateTimes")
1071 }
if(!vert) return
#define BLOCK_END(name)
Definition: perfomance.h:80
#define BLOCK_START(name)
Definition: perfomance.h:79

References BLOCK_END, BLOCK_START, cur_time, mAnnonceTime, mAnnounceButton, and Widget::setEnabled().

Referenced by Game::slowLogic().

◆ valueChanged()

void ShopWindow::valueChanged ( const SelectionEvent event)
virtual

Updates the labels according to the selected item.

Reimplemented from SelectionListener.

Definition at line 434 of file shopwindow.cpp.

435 {
437 }

References updateButtonsAndLabels().

◆ vendingEnabled()

void ShopWindow::vendingEnabled ( const bool  b)
virtual

Implements VendingModeListener.

Definition at line 1176 of file shopwindow.cpp.

1177 {
1178  mEnableVending = b;
1179  localPlayer->enableShop(b);
1180  if (!b)
1181  mSellShopSize = 0;
1183 }

References Being::enableShop(), localPlayer, mEnableVending, mSellShopSize, and updateButtonsAndLabels().

◆ vendingSlotsChanged()

void ShopWindow::vendingSlotsChanged ( const int  slots)
virtual

Implements VendingSlotsListener.

Definition at line 1170 of file shopwindow.cpp.

1171 {
1172  mSellShopSize = slots;
1174 }

References mSellShopSize, and updateButtonsAndLabels().

Field Documentation

◆ instances

ShopWindow::DialogList ShopWindow::instances
staticprivate

Definition at line 171 of file shopwindow.h.

Referenced by isActive(), ShopWindow(), and ~ShopWindow().

◆ isBuySelected

bool ShopWindow::isBuySelected
private

Definition at line 201 of file shopwindow.h.

Referenced by action(), updateButtonsAndLabels(), and updateSelection().

◆ mAcceptPlayer

std::string ShopWindow::mAcceptPlayer
private

Definition at line 190 of file shopwindow.h.

Referenced by getAcceptPlayer(), and setAcceptPlayer().

◆ mAddButton

Button* ShopWindow::mAddButton
private

Definition at line 183 of file shopwindow.h.

Referenced by ShopWindow(), and updateButtonsAndLabels().

◆ mAnnonceTime

time_t ShopWindow::mAnnonceTime
private

Definition at line 194 of file shopwindow.h.

Referenced by announce(), and updateTimes().

◆ mAnnounceButton

Button* ShopWindow::mAnnounceButton
private

Definition at line 185 of file shopwindow.h.

Referenced by announce(), ShopWindow(), and updateTimes().

◆ mAnnounceLinks

CheckBox* ShopWindow::mAnnounceLinks
private

Definition at line 188 of file shopwindow.h.

Referenced by announce(), and ShopWindow().

◆ mBuyShopItemList

ShopListBox* ShopWindow::mBuyShopItemList
private

◆ mBuyShopItems

ShopItems* ShopWindow::mBuyShopItems
private

◆ mBuyShopSize

int ShopWindow::mBuyShopSize
private

◆ mCloseButton

Button* ShopWindow::mCloseButton
private

Definition at line 173 of file shopwindow.h.

Referenced by ShopWindow().

◆ mCurrentShopItemList

ShopListBox* ShopWindow::mCurrentShopItemList
private

Definition at line 181 of file shopwindow.h.

Referenced by updateSelection().

◆ mDeleteButton

Button* ShopWindow::mDeleteButton
private

Definition at line 184 of file shopwindow.h.

Referenced by ShopWindow(), and updateButtonsAndLabels().

◆ mEnableBuyingStore

bool ShopWindow::mEnableBuyingStore
private

Definition at line 203 of file shopwindow.h.

Referenced by action(), buyingStoreEnabled(), and updateButtonsAndLabels().

◆ mEnableVending

bool ShopWindow::mEnableVending
private

Definition at line 204 of file shopwindow.h.

Referenced by action(), updateButtonsAndLabels(), and vendingEnabled().

◆ mHaveVending

bool ShopWindow::mHaveVending
private

Definition at line 202 of file shopwindow.h.

Referenced by action(), and ShopWindow().

◆ mLastRequestTimeItem

time_t ShopWindow::mLastRequestTimeItem
private

Definition at line 196 of file shopwindow.h.

Referenced by processRequest().

◆ mLastRequestTimeList

time_t ShopWindow::mLastRequestTimeList
private

Definition at line 195 of file shopwindow.h.

Referenced by giveList().

◆ mPublishButton

Button* ShopWindow::mPublishButton
private

Definition at line 186 of file shopwindow.h.

Referenced by ShopWindow(), and updateButtonsAndLabels().

◆ mRandCounter

int ShopWindow::mRandCounter
private

Definition at line 197 of file shopwindow.h.

Referenced by sendMessage().

◆ mRenameButton

Button* ShopWindow::mRenameButton
private

Definition at line 187 of file shopwindow.h.

Referenced by ShopWindow(), and updateButtonsAndLabels().

◆ mScrollArea

ScrollArea* ShopWindow::mScrollArea
private

Definition at line 182 of file shopwindow.h.

Referenced by ShopWindow(), and updateSelection().

◆ mSelectedItem

int ShopWindow::mSelectedItem
private

Definition at line 193 of file shopwindow.h.

Referenced by action(), setItemSelected(), and updateButtonsAndLabels().

◆ mSellShopItemList

ShopListBox* ShopWindow::mSellShopItemList
private

◆ mSellShopItems

ShopItems* ShopWindow::mSellShopItems
private

◆ mSellShopName

std::string ShopWindow::mSellShopName
private

Definition at line 192 of file shopwindow.h.

Referenced by action(), setShopName(), and updateShopName().

◆ mSellShopSize

int ShopWindow::mSellShopSize
private

Definition at line 199 of file shopwindow.h.

Referenced by action(), updateButtonsAndLabels(), vendingEnabled(), and vendingSlotsChanged().

◆ mTabs

TabStrip* ShopWindow::mTabs
private

Definition at line 189 of file shopwindow.h.

Referenced by ShopWindow().

◆ mTradeItem

ShopItem* ShopWindow::mTradeItem
private

Definition at line 177 of file shopwindow.h.

Referenced by processRequest(), startTrade(), and ~ShopWindow().

◆ mTradeMoney

int ShopWindow::mTradeMoney
private

Definition at line 198 of file shopwindow.h.

Referenced by processRequest(), and startTrade().

◆ mTradeNick

std::string ShopWindow::mTradeNick
private

Definition at line 191 of file shopwindow.h.

Referenced by action(), processRequest(), and startTrade().


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