56 struct RequestTradeListener :
public gcn::ActionListener
58 void action(
const gcn::ActionEvent &event)
override
60 if (event.getId() ==
"yes")
73 mAcceptTradeRequests(true)
75 static const Uint16 _messages[] = {
116 strprintf(
_(
"%s wants to trade with you, do you accept?"),
118 dlg->addActionListener(&listener);
ActorSpriteManager * actorSpriteManager
Being * findBeing(int id) const
Returns a specific Being, by id;.
const std::string & getName() const
Returns the name of the being.
Represents one or more instances of a certain item type.
int getInvIndex() const
Returns the inventory index of this item.
void increaseQuantity(int amount)
Increases the number of items by the given amount.
int getId() const
Returns the item id.
void send(const ManaServ::MessageOut &msg)
Sends a message.
Used for parsing an incoming message from manaserv.
uint16_t readInt16()
Reads an unsigned 16-bit integer from the message.
uint16_t getId() const
Returns the message ID.
uint32_t readInt32()
Reads an unsigned 32-bit integer from the message.
uint8_t readInt8()
Reads an unsigned 8-bit integer from the message.
Used for building an outgoing message to manaserv.
void writeInt16(uint16_t value)
Writes an unsigned 16-bit integer to the message.
void writeInt32(uint32_t value)
Writes an unsigned 32-bit integer to the message.
void writeInt8(uint8_t value)
Writes an unsigned 8-bit integer to the message.
void addItem(Item *item, int amount) override
bool acceptTradeRequests() const
Returns whether trade requests are accepted.
void setMoney(int amount) override
void request(Being *being) override
void removeItem(int slotNum, int amount) override
void respond(bool accept) override
bool mAcceptTradeRequests
void setAcceptTradeRequests(bool acceptTradeRequests)
Sets whether trade requests are accepted.
void handleMessage(MessageIn &msg) override
const uint16_t * handledMessages
void addItem(int id, bool own, int quantity)
Add an item to the trade window.
void reset()
Reset both item containers.
void receivedOk(bool own)
Player received ok message from server.
void setMoney(int quantity)
Displays expected money in the trade window.
virtual void setVisible(bool visible)
Overloads window setVisible by Guichan to allow sticky window handling.
void serverNotice(const std::string &message)
TradeWindow * tradeWindow
std::string tradePartnerName
Net::TradeHandler * tradeHandler
Connection * gameServerConnection
@ GPMSG_TRADE_BOTH_CONFIRM
TradeHandler * getTradeHandler()
std::string strprintf(char const *format,...)
A safe version of sprintf that returns a std::string of the result.