diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-09-05 02:13:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-09-05 02:13:29 +0300 |
commit | dc706af3765b75330e4e7c557ea3e4cf1f119631 (patch) | |
tree | 183a32a615ba1b2d8450474cfc829828bc5831de | |
parent | 92232a86a44bd31701f0f7957a46f40e89ef4b92 (diff) | |
download | plus-dc706af3765b75330e4e7c557ea3e4cf1f119631.tar.gz plus-dc706af3765b75330e4e7c557ea3e4cf1f119631.tar.bz2 plus-dc706af3765b75330e4e7c557ea3e4cf1f119631.tar.xz plus-dc706af3765b75330e4e7c557ea3e4cf1f119631.zip |
Add option for enable manamarket intergration and support /mail command. (for tmw only).
But because bot limitation, only some players can send mails.
-rw-r--r-- | src/actions/commands.cpp | 5 | ||||
-rw-r--r-- | src/configmanager.cpp | 10 | ||||
-rw-r--r-- | src/gui/widgets/tabs/setup_other.cpp | 5 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 2 |
4 files changed, 21 insertions, 1 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 0a8ef91ba..0f34689ee 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -518,6 +518,11 @@ impHandler(imitation) impHandler0(sendMail) { // +++ need impliment for hercules + if (serverConfig.getBoolValue("enableManaMarketBot")) + { + chatHandler->privateMessage("ManaMarket", "!mail " + event.args); + return true; + } return false; } diff --git a/src/configmanager.cpp b/src/configmanager.cpp index b0f3a28e2..8e130e315 100644 --- a/src/configmanager.cpp +++ b/src/configmanager.cpp @@ -67,6 +67,16 @@ void ConfigManager::initServerConfig(const std::string &serverName) serverConfig.setDefaultValues(getConfigDefaults()); logger->log("serverConfigPath: " + configPath); } + + int val = serverConfig.getValue("enableManaMarketBot", -1); + if (val == -1) + { + if (client->isTmw()) + val = 1; + else + val = 0; + serverConfig.setValue("enableManaMarketBot", val); + } } void ConfigManager::initConfiguration() diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp index afa0e9987..4e86abd8c 100644 --- a/src/gui/widgets/tabs/setup_other.cpp +++ b/src/gui/widgets/tabs/setup_other.cpp @@ -295,6 +295,11 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : "guild support"), "", "enableGuildBot", this, "enableGuildBotEvent", false); + // TRANSLATORS: settings option + new SetupItemCheckBox(_("Enable manamarket bot bot support"), + "", "enableManaMarketBot", this, + "enableManaMarketBotEvent", false); + // TRANSLATORS: settings group new SetupItemLabel(_("Keyboard"), "", this); diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 9c00f0557..1676b19c7 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -2978,7 +2978,7 @@ static const InputActionData inputActionData {"keySendMail", defaultAction(&Actions::sendMail), InputCondition::INGAME, - "mail", + "sendmail|mailsend|mailto", UseArgs_true}, {"keyTradeCommand", defaultAction(&Actions::trade), |