44 static const char *buttonNames[] = {
45 N_(
"Buy"),
N_(
"Sell"),
N_(
"Cancel"),
nullptr
49 for (
const char **curBtn = buttonNames; *curBtn; curBtn++)
54 btn->setPosition(x, y);
56 x += btn->getWidth() + 10;
96 if (event.getId() ==
"Buy")
100 else if (event.getId() ==
"Sell")
static void closeAll()
Closes all instances.
std::list< BuySellDialog * > DialogList
~BuySellDialog() override
void action(const gcn::ActionEvent &event) override
Called when receiving actions from the widgets.
static DialogList instances
BuySellDialog(int npcId)
Constructor.
void setVisible(bool visible) override
Overloads window setVisible by Guichan to allow sticky window handling.
virtual void sell(int beingId)=0
virtual void buy(int beingId)=0
void center()
Positions the window in the center of it's parent.
virtual void setVisible(bool visible)
Overloads window setVisible by Guichan to allow sticky window handling.
virtual void close()
Overrideable functionality for when the window is to close.
void setContentSize(int width, int height)
Sets the size of this window.
void setWindowName(const std::string &name)
Sets the name of the window.
void scheduleDelete()
Schedule this window for deletion.
void setCloseButton(bool flag)
Sets whether or not the window has a close button.
void setDefaultSize()
Set the default win pos and size to the current ones.
void loadWindowState()
Reads the position (and the size for resizable windows) in the configuration based on the given strin...
NpcHandler * getNpcHandler()
void setBuySellState(BuySellState buySellState)
Sets which buy, sell, or related interaction the player is currently involved in.
BuySellState getBuySellState()
Returns the current buy, sell, or related interaction the player is involved in.