diff options
Diffstat (limited to 'src/gui/shopwindow.cpp')
-rw-r--r-- | src/gui/shopwindow.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp index 4311a04d2..9aaf88bf3 100644 --- a/src/gui/shopwindow.cpp +++ b/src/gui/shopwindow.cpp @@ -40,6 +40,7 @@ #include "gui/widgets/tradetab.h" #include "actorspritemanager.h" +#include "auctionmanager.h" #include "configuration.h" #include "confirmdialog.h" #include "inventory.h" @@ -85,6 +86,7 @@ ShopWindow::ShopWindow(): setWindowName("Personal Shop"); setResizable(true); setCloseButton(true); + setStickyButtonLock(true); setMinWidth(260); setMinHeight(230); setDefaultSize(380, 300, ImageRect::CENTER); @@ -141,6 +143,19 @@ ShopWindow::ShopWindow(): place(0, 7, mAnnounceLinks, 8); place(15, 7, mCloseButton); + if (auctionManager && auctionManager->getEnableAuctionBot()) + { + mBuyAuctionButton = new Button(_("Auction"), "auction buy", this); + mSellAuctionButton = new Button(_("Auction"), "auction sell", this); + place(4, 6, mBuyAuctionButton); + place(12, 6, mSellAuctionButton); + } + else + { + mBuyAuctionButton = 0; + mSellAuctionButton = 0; + } + Layout &layout = getLayout(); layout.setRowHeight(0, Layout::AUTO_SET); @@ -207,6 +222,16 @@ void ShopWindow::action(const gcn::ActionEvent &event) { announce(mSellShopItems, SELL); } + else if (event.getId() == "auction buy" && mBuyShopItems + && mBuyShopItems->getNumberOfElements() > 0) + { + Net::getChatHandler()->privateMessage("AuctionBot", "!pull4144 seek"); + } + else if (event.getId() == "auction sell" && mSellShopItems + && mSellShopItems->getNumberOfElements() > 0) + { + Net::getChatHandler()->privateMessage("AuctionBot", "!pull4144 offer"); + } if (mSelectedItem < 1) return; |