From bd56bf8afdab16383ed8ad08412a8c807f84af85 Mon Sep 17 00:00:00 2001 From: Björn Steinbrink Date: Sun, 22 Jan 2006 13:31:13 +0000 Subject: Merged NETWORK branch (includes BEING_OVERHAUL). --- src/gui/buysell.cpp | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) (limited to 'src/gui/buysell.cpp') 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); } -- cgit v1.2.3-70-g09d2