summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-03-28 02:11:46 +0300
committerAndrei Karas <akaras@inbox.ru>2013-03-28 02:11:46 +0300
commit83dc7593205d7d076fc38d307e2964a57157defc (patch)
tree9547fcd7e6f8c68bb632771f19d1b1946c691e58 /src/gui
parent1b719ca0b81e3c5df44ef8280255995418a2ec70 (diff)
downloadmanaplus-83dc7593205d7d076fc38d307e2964a57157defc.tar.gz
manaplus-83dc7593205d7d076fc38d307e2964a57157defc.tar.bz2
manaplus-83dc7593205d7d076fc38d307e2964a57157defc.tar.xz
manaplus-83dc7593205d7d076fc38d307e2964a57157defc.zip
Revert "Remove auction bot support."
This reverts commit 0b236e4e04a6d89d34925ce9d2875c002e135b23.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/setup_other.cpp3
-rw-r--r--src/gui/shopwindow.cpp28
-rw-r--r--src/gui/shopwindow.h2
3 files changed, 33 insertions, 0 deletions
diff --git a/src/gui/setup_other.cpp b/src/gui/setup_other.cpp
index 4404a26e9..c4ce2a500 100644
--- a/src/gui/setup_other.cpp
+++ b/src/gui/setup_other.cpp
@@ -201,6 +201,9 @@ Setup_Other::Setup_Other(const Widget2 *const widget) :
new SetupItemLabel(_("Bots support"), "", this);
+ new SetupItemCheckBox(_("Enable auction bot support"), "",
+ "enableAuctionBot", this, "enableAuctionBotEvent", false);
+
new SetupItemCheckBox(_("Enable guild bot support and disable native "
"guild support"), "", "enableGuildBot", this,
"enableGuildBotEvent", false);
diff --git a/src/gui/shopwindow.cpp b/src/gui/shopwindow.cpp
index ffe347099..17f9edc5b 100644
--- a/src/gui/shopwindow.cpp
+++ b/src/gui/shopwindow.cpp
@@ -39,6 +39,7 @@
#include "gui/widgets/tradetab.h"
#include "actorspritemanager.h"
+#include "auctionmanager.h"
#include "client.h"
#include "configuration.h"
#include "confirmdialog.h"
@@ -88,10 +89,12 @@ ShopWindow::ShopWindow():
mBuyAddButton(new Button(this, _("Add"), "add buy", this)),
mBuyDeleteButton(new Button(this, _("Delete"), "delete buy", this)),
mBuyAnnounceButton(new Button(this, _("Announce"), "announce buy", this)),
+ mBuyAuctionButton(nullptr),
mSellAddButton(new Button(this, _("Add"), "add sell", this)),
mSellDeleteButton(new Button(this, _("Delete"), "delete sell", this)),
mSellAnnounceButton(new Button(this, _("Announce"),
"announce sell", this)),
+ mSellAuctionButton(nullptr),
mAnnounceLinks(new CheckBox(this, _("Show links in announce"), false,
this, "link announce")),
mSelectedItem(-1),
@@ -142,6 +145,21 @@ ShopWindow::ShopWindow():
placer(0, 7, mAnnounceLinks, 8);
placer(15, 7, mCloseButton);
+ if (auctionManager && auctionManager->getEnableAuctionBot())
+ {
+ mBuyAuctionButton = new Button(this,
+ _("Auction"), "auction buy", this);
+ mSellAuctionButton = new Button(this,
+ _("Auction"), "auction sell", this);
+ placer(4, 6, mBuyAuctionButton);
+ placer(12, 6, mSellAuctionButton);
+ }
+ else
+ {
+ mBuyAuctionButton = nullptr;
+ mSellAuctionButton = nullptr;
+ }
+
Layout &layout = getLayout();
layout.setRowHeight(0, Layout::AUTO_SET);
@@ -214,6 +232,16 @@ void ShopWindow::action(const gcn::ActionEvent &event)
{
announce(mSellShopItems, SELL);
}
+ else if (eventId == "auction buy" && mBuyShopItems
+ && mBuyShopItems->getNumberOfElements() > 0)
+ {
+ Net::getChatHandler()->privateMessage("AuctionBot", "!pull4144 seek");
+ }
+ else if (eventId == "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 383016029..9b7e64572 100644
--- a/src/gui/shopwindow.h
+++ b/src/gui/shopwindow.h
@@ -155,9 +155,11 @@ class ShopWindow final : public Window, public gcn::ActionListener,
Button *mBuyAddButton;
Button *mBuyDeleteButton;
Button *mBuyAnnounceButton;
+ Button *mBuyAuctionButton;
Button *mSellAddButton;
Button *mSellDeleteButton;
Button *mSellAnnounceButton;
+ Button *mSellAuctionButton;
CheckBox *mAnnounceLinks;
int mSelectedItem;