From 2e7bfc350d38e16b3d340f8e4ea69e6ff6748f5c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 26 Aug 2011 18:25:58 +0300 Subject: Add auction buttons in shop window for send buy or sell list to auction bot. --- src/gui/shopwindow.cpp | 14 ++++++++++++++ src/gui/shopwindow.h | 2 ++ 2 files changed, 16 insertions(+) (limited to 'src/gui') diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp index 4311a04d2..0988ef759 100644 --- a/src/gui/shopwindow.cpp +++ b/src/gui/shopwindow.cpp @@ -119,9 +119,11 @@ ShopWindow::ShopWindow(): mBuyAddButton = new Button(_("Add"), "add buy", this); mBuyDeleteButton = new Button(_("Delete"), "delete buy", this); mBuyAnnounceButton = new Button(_("Announce"), "announce buy", this); + mBuyAuctionButton = new Button(_("Auction"), "auction buy", this); mSellAddButton = new Button(_("Add"), "add sell", this); mSellDeleteButton = new Button(_("Delete"), "delete sell", this); mSellAnnounceButton = new Button(_("Announce"), "announce sell", this); + mSellAuctionButton = new Button(_("Auction"), "auction sell", this); mAnnounceLinks = new CheckBox(_("Show links in announce"), false, this, "link announce"); @@ -135,9 +137,11 @@ ShopWindow::ShopWindow(): place(0, 6, mBuyAddButton); place(1, 6, mBuyDeleteButton); place(3, 6, mBuyAnnounceButton); + place(4, 6, mBuyAuctionButton); place(8, 6, mSellAddButton); place(9, 6, mSellDeleteButton); place(11, 6, mSellAnnounceButton); + place(12, 6, mSellAuctionButton); place(0, 7, mAnnounceLinks, 8); place(15, 7, mCloseButton); @@ -207,6 +211,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; diff --git a/src/gui/shopwindow.h b/src/gui/shopwindow.h index e3fd9a5ca..8b170f31e 100644 --- a/src/gui/shopwindow.h +++ b/src/gui/shopwindow.h @@ -151,9 +151,11 @@ class ShopWindow : public Window, public gcn::ActionListener, gcn::Button *mBuyAddButton; gcn::Button *mBuyDeleteButton; gcn::Button *mBuyAnnounceButton; + gcn::Button *mBuyAuctionButton; gcn::Button *mSellAddButton; gcn::Button *mSellDeleteButton; gcn::Button *mSellAnnounceButton; + gcn::Button *mSellAuctionButton; gcn::CheckBox *mAnnounceLinks; ShopItems *mBuyShopItems; -- cgit v1.2.3-60-g2f50