diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-22 13:31:13 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2006-01-22 13:31:13 +0000 |
commit | bd56bf8afdab16383ed8ad08412a8c807f84af85 (patch) | |
tree | 0e963ada63bcbe3c50dd77986aaa15b9ba49816a /src/gui/buysell.cpp | |
parent | 5359640b6f271af31f6423df9d661433eff89a3e (diff) | |
download | mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.gz mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.bz2 mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.tar.xz mana-bd56bf8afdab16383ed8ad08412a8c807f84af85.zip |
Merged NETWORK branch (includes BEING_OVERHAUL).
Diffstat (limited to 'src/gui/buysell.cpp')
-rw-r--r-- | src/gui/buysell.cpp | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/src/gui/buysell.cpp b/src/gui/buysell.cpp index 178c2719..6547a849 100644 --- a/src/gui/buysell.cpp +++ b/src/gui/buysell.cpp @@ -25,17 +25,14 @@ #include "button.h" -#include "../game.h" - -#include "../net/messageout.h" -#include "../net/protocol.h" +#include "../npc.h" BuySellDialog::BuySellDialog(): Window("Shop") { - buyButton = new Button("Buy"); - sellButton = new Button("Sell"); - cancelButton = new Button("Cancel"); + gcn::Button *buyButton = new Button("Buy"); + gcn::Button *sellButton = new Button("Sell"); + gcn::Button *cancelButton = new Button("Cancel"); buyButton->setPosition(10, 10); sellButton->setPosition( @@ -63,22 +60,13 @@ BuySellDialog::BuySellDialog(): void BuySellDialog::action(const std::string& eventId) { - int actionId = -1; - if (eventId == "buy") { - actionId = 0; + current_npc->buy(); } else if (eventId == "sell") { - actionId = 1; + current_npc->sell(); } else if (eventId == "cancel") { current_npc = 0; } - if (actionId > -1) { - MessageOut outMsg; - outMsg.writeInt16(CMSG_NPC_BUY_SELL_REQUEST); - outMsg.writeInt32(current_npc); - outMsg.writeInt8(actionId); - } - setVisible(false); } |