From f96861c0115f6808d8246b3e6defc828ab3a255e Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 6 Sep 2015 19:09:39 +0300 Subject: Add option for creating screenshots on each complete trade. --- src/gui/widgets/tabs/setup_players.cpp | 4 ++++ src/gui/windows/tradewindow.cpp | 9 +++++++++ src/gui/windows/tradewindow.h | 2 ++ 3 files changed, 15 insertions(+) (limited to 'src/gui') diff --git a/src/gui/widgets/tabs/setup_players.cpp b/src/gui/widgets/tabs/setup_players.cpp index 4b04568ee..2f8039b6a 100644 --- a/src/gui/widgets/tabs/setup_players.cpp +++ b/src/gui/widgets/tabs/setup_players.cpp @@ -124,6 +124,10 @@ Setup_Players::Setup_Players(const Widget2 *const widget) : new SetupItemCheckBox(_("Use special diagonal speed in players moving"), "", "useDiagonalSpeed", this, "useDiagonalSpeedEvent"); + // TRANSLATORS: settings option + new SetupItemCheckBox(_("Create screenshots for each complete trades"), + "", "tradescreenshot", this, "tradescreenshotEvent"); + // TRANSLATORS: settings option new SetupItemCheckBox(_("Emulate right mouse button by long mouse click" " (useful for touch interfaces)"), diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index 7a835b686..edd685f30 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -23,6 +23,7 @@ #include "gui/windows/tradewindow.h" #include "configuration.h" +#include "game.h" #include "item.h" #include "units.h" @@ -296,6 +297,14 @@ void TradeWindow::receivedOk(const bool own) setStatus(ACCEPTING); } +void TradeWindow::completeTrade() +{ + if (config.getBoolValue("tradescreenshot")) + Game::createScreenshot(); + setVisible(Visible_false); + reset(); +} + void TradeWindow::tradeItem(const Item *const item, const int quantity, const bool check) const { diff --git a/src/gui/windows/tradewindow.h b/src/gui/windows/tradewindow.h index d82714816..8ad021cd6 100644 --- a/src/gui/windows/tradewindow.h +++ b/src/gui/windows/tradewindow.h @@ -164,6 +164,8 @@ class TradeWindow final : public Window, bool isInpupFocused() const A_WARN_UNUSED; + void completeTrade(); + private: enum Status { -- cgit v1.2.3-70-g09d2