81 if ((item1 ==
nullptr) || (item2 ==
nullptr))
84 const int price1 = item1->getPrice();
85 const int price2 = item2->getPrice();
87 return item1->getDisplayName() < item2->getDisplayName();
88 return price1 < price2;
100 if ((item1 ==
nullptr) || (item2 ==
nullptr))
103 const std::string &name1 = item1->getDisplayName();
104 const std::string &name2 = item2->getDisplayName();
106 return item1->getPrice() < item2->getPrice();
107 return name1 < name2;
119 if ((item1 ==
nullptr) || (item2 ==
nullptr))
122 const int id1 = item1->getId();
123 const int id2 = item2->getId();
125 return item1->getPrice() < item2->getPrice();
138 if ((item1 ==
nullptr) || (item2 ==
nullptr))
141 const int weight1 = item1->getInfo().getWeight();
142 const int weight2 = item2->getInfo().getWeight();
143 if (weight1 == weight2)
144 return item1->getPrice() < item2->getPrice();
145 return weight1 < weight2;
157 if ((item1 ==
nullptr) || (item2 ==
nullptr))
160 const int amount1 = item1->getQuantity();
161 const int amount2 = item2->getQuantity();
162 if (amount1 == amount2)
163 return item1->getPrice() < item2->getPrice();
164 return amount1 < amount2;
176 if ((item1 ==
nullptr) || (item2 ==
nullptr))
179 const ItemDbTypeT type1 = item1->getInfo().getType();
180 const ItemDbTypeT type2 = item2->getInfo().getType();
182 return item1->getPrice() < item2->getPrice();
183 return type1 < type2;
196 mSortDropDown(
new DropDown(this, mSortModel, false,
199 this,
"namefilter", true)),
213 const std::string ¤cy) :
221 this,
"namefilter", true)),
236 const std::string ¤cy) :
242 mSortDropDown(
new DropDown(this, mSortModel, false,
245 this,
"namefilter", true)),
260 const std::string ¤cy) :
266 mSortDropDown(
new DropDown(this, mSortModel, false,
269 this,
"namefilter", true)),
311 "buy_background.xml");
320 _(
"Price: %s / Total: %s"),
"",
""));
531 const std::string &eventId =
event.getId();
532 if (eventId ==
"quit")
537 else if (eventId ==
"sort")
544 else if (eventId ==
"namefilter")
555 if (eventId ==
"slider")
575 else if (eventId ==
"max")
582 else if (eventId ==
"amount")
658 else if (eventId ==
"confirm")
671 if (being !=
nullptr)
723 if (selectedItem > -1)
728 const int itemPrice = item->
getPrice();
733 else if (itemPrice != 0)
796 std::string filterStr = filter;
798 FOR_EACH (STD_VECTOR<ShopItem*>::iterator, it, items)
803 std::string name = item->
getName();
805 if (name.find(filterStr) != std::string::npos)
ActorManager * actorManager
Net::AdminHandler * adminHandler
#define fromBool(val, name)
Net::BuySellHandler * buySellHandler
Net::CashShopHandler * cashShopHandler
Being * findBeingByName(const std::string &name, const ActorTypeT type) const
static DialogList instances
void action(const ActionEvent &event)
IntTextField * mAmountField
void applyNameFilter(const std::string &filter)
void updateSlider(const int selectedItem)
void valueChanged(const SelectionEvent &event)
SortListModelBuy * mSortModel
TextField * mFilterTextField
void updateButtonsAndLabels()
void setVisible(Visible visible)
ShopListBox * mShopItemList
std::list< BuyDialog * > DialogList
ShopItem * addItem(const int id, const ItemTypeT type, const ItemColor color, const int amount, const int price)
void setMoney(const int amount)
void setValue(const std::string &key, const std::string &value)
int getIntValue(const std::string &key) const
void setSelected(int selected)
void setValue(const int value)
void setRange(const int minimum, const int maximum)
std::string getName() const
ItemColor getColor() const
ItemTypeT getType() const
void increaseQuantity(const int amount)
void setAlignment(Graphics::Alignment alignment)
void setCaption(const std::string &caption)
void setRowHeight(const int n, const int h)
void setDistributeMousePressed(const bool b)
void setSelected(const int selected)
void addSelectionListener(SelectionListener *const selectionListener)
virtual void createItems(const int id, const ItemColor color, const int amount) const =0
virtual void cleanDialogReference(const BuyDialog *const dialog) const =0
virtual void close() const =0
virtual void sendBuyRequest(const std::string &nick, const ShopItem *const item, const int amount) const =0
virtual void buyItem(const int points, const int itemId, const ItemColor color, const int amount) const =0
virtual void buyItems(const int points, const std::vector< ShopItem * > &items) const =0
virtual void close() const =0
virtual void close() const =0
virtual void buyItems(const std::vector< ShopItem * > &items) const =0
virtual void buyItem(const int itemId, const ItemTypeT type, const ItemColor color, const int amount) const =0
virtual void buyItems(std::vector< ShopItem * > &items) const =0
virtual void buyItem(const BeingId beingId, const int itemId, const ItemColor color, const int amount) const =0
virtual void buyItems(const Being *const being, const std::vector< ShopItem * > &items) const =0
virtual void close() const =0
void registerWindowForReset(Window *const window)
void increaseUsedQuantity(const int amount)
void setVisible(const bool b)
std::vector< ShopItem * > & allItems()
std::vector< ShopItem * > & items()
ShopItem * addItem(const int id, const ItemTypeT type, const ItemColor color, const int amount, const int price)
int getNumberOfElements()
ShopItem * at(const size_t i) const
void setPlayersMoney(const int money)
void setScale(const double scaleStart, const double scaleEnd)
void setValue(const double value)
const std::string & getText() const
void setSendAlwaysEvents(const bool b)
void addAutoMoney(const std::string &nick, const int money)
void setResizable(const bool resize)
ContainerPlacer getPlacer(const int x, const int y)
virtual void setVisible(Visible visible)
bool getOptionBool(const std::string &name, const bool def) const
void setWindowName(const std::string &name)
void setMinHeight(const int height)
void setMinWidth(const int width)
void enableVisibleSound(bool b)
void setCloseButton(const bool flag)
virtual void scheduleDelete()
void setStickyButtonLock(const bool sticky)
#define FOR_EACH(type, iter, array)
#define fromInt(val, name)
ItemDbType ::T ItemDbTypeT
#define A_DEFAULT_COPY(func)
const bool LoseFocusOnTab_true
Net::MarketHandler * marketHandler
std::string toLower(std::string const &s)
const std::string & getName(const int id)
ServerTypeT getNetworkType()
std::string formatCurrency(const int value)
class anonymous_namespace{buydialog.cpp}::SortItemAmountFunctor itemAmountBuySorter
class anonymous_namespace{buydialog.cpp}::SortItemIdFunctor itemIdBuySorter
class anonymous_namespace{buydialog.cpp}::SortItemNameFunctor itemNameBuySorter
class anonymous_namespace{buydialog.cpp}::SortItemTypeFunctor itemTypeBuySorter
class anonymous_namespace{buydialog.cpp}::SortItemPriceFunctor itemPriceBuySorter
class anonymous_namespace{buydialog.cpp}::SortItemWeightFunctor itemWeightBuySorter
Net::VendingHandler * vendingHandler
Net::NpcHandler * npcHandler
SetupWindow * setupWindow
std::string strprintf(const char *const format,...)
TradeWindow * tradeWindow