28#include <guichan/actionlistener.hpp>
29#include <guichan/selectionlistener.hpp>
41 public gcn::SelectionListener
61 void addItem(
int id,
int amount,
int price);
66 void action(
const gcn::ActionEvent &event)
override;
76 void valueChanged(
const gcn::SelectionEvent &event)
override;
void reset()
Resets the dialog, clearing shop inventory.
static DialogList instances
gcn::Button * mQuitButton
gcn::Label * mQuantityLabel
static void closeAll()
Closes all instances.
void action(const gcn::ActionEvent &event) override
Called when receiving actions from the widgets.
gcn::ScrollArea * mScrollArea
void addItem(int id, int amount, int price)
Adds an item to the shop inventory.
std::list< BuyDialog * > DialogList
gcn::Button * mDecreaseButton
gcn::Button * mAddMaxButton
gcn::Button * mIncreaseButton
void mouseClicked(gcn::MouseEvent &mouseEvent) override
Allows for quick-buying by extending double-click events.
void updateButtonsAndLabels()
Updates the state of buttons and labels.
ShopListBox * mShopItemList
void setVisible(bool visible) override
Sets the visibility of this window.
void valueChanged(const gcn::SelectionEvent &event) override
Updates the labels according to the selected item.
void setMoney(int amount)
Sets the amount of available money.
std::string getElementAt(int i)
Returns the name of item number i in the shop inventory.
int getNumberOfElements()
Returns the number of items in the shop inventory.
A list box, meant to be used inside a scroll area.
This class handles the list of items available in a shop.
A list box, meant to be used inside a scroll area.