summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-26 12:14:29 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-26 12:14:29 +0300
commitce0c0778675908f7be557b1c115de3eabb828079 (patch)
treeb927c494bf5d2777c56494776ad379a9564b45a0
parent1a9a7ece01b6633e1fe860cba03bfd0d895c172d (diff)
downloadmv-ce0c0778675908f7be557b1c115de3eabb828079.tar.gz
mv-ce0c0778675908f7be557b1c115de3eabb828079.tar.bz2
mv-ce0c0778675908f7be557b1c115de3eabb828079.tar.xz
mv-ce0c0778675908f7be557b1c115de3eabb828079.zip
Move chat command /mail into actions.
-rw-r--r--src/actions/commands.cpp11
-rw-r--r--src/actions/commands.h1
-rw-r--r--src/commands.cpp10
-rw-r--r--src/commands.h5
-rw-r--r--src/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h9
6 files changed, 23 insertions, 14 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 29414b18d..6e8fca4a0 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -21,6 +21,7 @@
#include "actions/commands.h"
#include "actormanager.h"
+#include "auctionmanager.h"
#include "configuration.h"
#include "dropshortcut.h"
#include "emoteshortcut.h"
@@ -423,4 +424,14 @@ impHandler(imitation)
return true;
}
+impHandler(sendMail)
+{
+ if (auctionManager && auctionManager->getEnableAuctionBot())
+ {
+ auctionManager->sendMail(event.args);
+ return true;
+ }
+ return false;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index fbee9e125..98f13b2d5 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -48,6 +48,7 @@ namespace Actions
decHandler(follow);
decHandler(navigate);
decHandler(imitation);
+ decHandler(sendMail);
} // namespace Actions
#undef decHandler
diff --git a/src/commands.cpp b/src/commands.cpp
index 464148a87..72ba9f6c1 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -157,16 +157,6 @@ impHandler(hack)
return true;
}
-impHandler(mail)
-{
- if (auctionManager && auctionManager->getEnableAuctionBot())
- {
- auctionManager->sendMail(event.args);
- return true;
- }
- return false;
-}
-
impHandler0(priceLoad)
{
if (shopWindow)
diff --git a/src/commands.h b/src/commands.h
index 0f42ddb9a..b09979050 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -51,7 +51,6 @@ struct CommandInfo final
namespace Commands
{
- decHandler(mail);
decHandler(hack);
decHandler(priceLoad);
decHandler(priceSave);
@@ -104,8 +103,7 @@ namespace Commands
enum
{
- COMMAND_MAIL = 0,
- COMMAND_TRADE,
+ COMMAND_TRADE = 0,
COMMAND_PRICELOAD,
COMMAND_PRICESAVE,
COMMAND_CACHEINFO,
@@ -157,7 +155,6 @@ enum
static const CommandInfo commands[] =
{
- {"mail", &Commands::mail, -1, true},
{"trade", &Commands::trade, -1, true},
{"priceload", &Commands::priceLoad, -1, false},
{"pricesave", &Commands::priceSave, -1, false},
diff --git a/src/input/inputaction.h b/src/input/inputaction.h
index aa7cd90a4..dae8cbf53 100644
--- a/src/input/inputaction.h
+++ b/src/input/inputaction.h
@@ -378,6 +378,7 @@ namespace InputAction
FOLLOW,
NAVIGATE,
IMITATION,
+ SEND_MAIL,
TOTAL
};
} // namespace InputAction
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 01953a71d..6657b0909 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -3171,6 +3171,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
InputAction::NO_VALUE, 50,
InputCondition::INGAME,
"imitation",
+ true},
+ {"keySendMail",
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ Input::GRP_DEFAULT,
+ &Actions::sendMail,
+ InputAction::NO_VALUE, 50,
+ InputCondition::INGAME,
+ "mail",
true}
};