summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-27 16:13:27 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-27 16:13:27 +0300
commit4455f3a3dd5fa28ef7fc1d1cf6d2bff723c90b47 (patch)
tree087515469a7301ea367ae7218dc276f5549caaa9 /src
parent32ec83a137def94dbea627350f0318c21afbbc09 (diff)
downloadplus-4455f3a3dd5fa28ef7fc1d1cf6d2bff723c90b47.tar.gz
plus-4455f3a3dd5fa28ef7fc1d1cf6d2bff723c90b47.tar.bz2
plus-4455f3a3dd5fa28ef7fc1d1cf6d2bff723c90b47.tar.xz
plus-4455f3a3dd5fa28ef7fc1d1cf6d2bff723c90b47.zip
Move chat command /talkpet into actions.
Diffstat (limited to 'src')
-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 e0514f902..ee04acc65 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -36,6 +36,7 @@
#include "being/playerinfo.h"
#include "being/playerrelations.h"
+#include "gui/chatconsts.h"
#include "gui/dialogsmanager.h"
#include "gui/gui.h"
#include "gui/popupmanager.h"
@@ -663,4 +664,14 @@ impHandler(talkRaw)
return true;
}
+impHandler(talkPet)
+{
+ // in future probably need add channel detection
+ if (!localPlayer->getPets().empty())
+ Net::getChatHandler()->talkPet(event.args, GENERAL_CHANNEL);
+ else
+ Net::getChatHandler()->talk(event.args, GENERAL_CHANNEL);
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index db0c6eb5e..eb9ab4575 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -67,6 +67,7 @@ namespace Actions
decHandler(enableAway);
decHandler(testParticle);
decHandler(talkRaw);
+ decHandler(talkPet);
} // namespace Actions
#undef decHandler
diff --git a/src/commands.cpp b/src/commands.cpp
index 2a067fb90..e33a78fb6 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -106,16 +106,6 @@ impHandler(hack)
return true;
}
-impHandler(talkPet)
-{
- // in future probably need add channel detection
- if (!localPlayer->getPets().empty())
- Net::getChatHandler()->talkPet(event.args, GENERAL_CHANNEL);
- else
- Net::getChatHandler()->talk(event.args, GENERAL_CHANNEL);
- return true;
-}
-
impHandler(gm)
{
Net::getChatHandler()->talk("@wgm " + event.args, GENERAL_CHANNEL);
diff --git a/src/commands.h b/src/commands.h
index be9000623..907ed82d3 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -52,7 +52,6 @@ struct CommandInfo final
namespace Commands
{
decHandler(hack);
- decHandler(talkPet);
decHandler(uploadConfig);
decHandler(uploadServerConfig);
decHandler(uploadLog);
@@ -64,8 +63,7 @@ namespace Commands
enum
{
- COMMAND_TALKPET = 0,
- COMMAND_UPLOADCONFIG,
+ COMMAND_UPLOADCONFIG = 0,
COMMAND_UPLOADSERVERCONFIG,
COMMAND_UPLOADLOG,
COMMAND_GM,
@@ -76,7 +74,6 @@ enum
static const CommandInfo commands[] =
{
- {"talkpet", &Commands::talkPet, -1, true},
{"uploadconfig", &Commands::uploadConfig, -1, false},
{"uploadserverconfig", &Commands::uploadServerConfig, -1, false},
{"uploadlog", &Commands::uploadLog, -1, false},
diff --git a/src/input/inputaction.h b/src/input/inputaction.h
index 65663cd57..c7296258d 100644
--- a/src/input/inputaction.h
+++ b/src/input/inputaction.h
@@ -417,6 +417,7 @@ namespace InputAction
TEST_PARTICLE,
CREATE_ITEMS,
TALK_RAW,
+ TALK_PET,
TOTAL
};
} // namespace InputAction
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index baaee04d1..33d1a3826 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -3530,6 +3530,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
InputAction::NO_VALUE, 50,
InputCondition::INGAME,
"talkraw",
+ false},
+ {"keyTalkPet",
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ Input::GRP_DEFAULT,
+ &Actions::talkPet,
+ InputAction::NO_VALUE, 50,
+ InputCondition::INGAME,
+ "talkpet",
false}
};