summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-24 17:18:27 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-24 17:18:27 +0300
commitefa45459a4d79cf1adba3327f6dad02fc5aa55cd (patch)
treef9d6022981235006d34f6352bb13535ee7d72a56
parentf5651bc452096c8cd84d7c801228d64af3a165d2 (diff)
downloadmanaplus-efa45459a4d79cf1adba3327f6dad02fc5aa55cd.tar.gz
manaplus-efa45459a4d79cf1adba3327f6dad02fc5aa55cd.tar.bz2
manaplus-efa45459a4d79cf1adba3327f6dad02fc5aa55cd.tar.xz
manaplus-efa45459a4d79cf1adba3327f6dad02fc5aa55cd.zip
Move chat command /friend into actions.
-rw-r--r--src/actions/commands.cpp7
-rw-r--r--src/actions/commands.h1
-rw-r--r--src/commands.cpp7
-rw-r--r--src/commands.h7
-rw-r--r--src/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h9
6 files changed, 19 insertions, 13 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp
index 7e3d46446..0c029fa54 100644
--- a/src/actions/commands.cpp
+++ b/src/actions/commands.cpp
@@ -184,4 +184,11 @@ impHandler(chatUnignore)
return true;
}
+impHandler(chatFriend)
+{
+ // TRANSLATORS: adding friend command
+ changeRelation(event.args, PlayerRelation::FRIEND, _("friend"), event.tab);
+ return true;
+}
+
} // namespace Actions
diff --git a/src/actions/commands.h b/src/actions/commands.h
index afc5e0dd9..6b554e5fe 100644
--- a/src/actions/commands.h
+++ b/src/actions/commands.h
@@ -30,6 +30,7 @@ namespace Actions
decHandler(chatAnnounce);
decHandler(chatIgnore);
decHandler(chatUnignore);
+ decHandler(chatFriend);
} // namespace Actions
#undef decHandler
diff --git a/src/commands.cpp b/src/commands.cpp
index a4a531f36..b81ed5961 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -384,13 +384,6 @@ impHandler0(present)
return false;
}
-impHandler(beFriend)
-{
- // TRANSLATORS: adding friend command
- changeRelation(event.args, PlayerRelation::FRIEND, _("friend"), event.tab);
- return true;
-}
-
impHandler(disregard)
{
// TRANSLATORS: disregard command
diff --git a/src/commands.h b/src/commands.h
index 2c8d08805..41ee05818 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -59,7 +59,6 @@ namespace Commands
decHandler(me);
decHandler(toggle);
decHandler(present);
- decHandler(beFriend);
decHandler(disregard);
decHandler(neutral);
decHandler(blackList);
@@ -132,9 +131,7 @@ namespace Commands
enum
{
- COMMAND_FRIEND = 0,
- COMMAND_BEFRIEND,
- COMMAND_DISREGARD,
+ COMMAND_DISREGARD = 0,
COMMAND_NEUTRAL,
COMMAND_BLACKLIST,
COMMAND_ENEMY,
@@ -214,8 +211,6 @@ enum
static const CommandInfo commands[] =
{
- {"friend", Commands::beFriend, -1, true},
- {"befriend", &Commands::beFriend, -1, true},
{"disregard", &Commands::disregard, -1, true},
{"neutral", &Commands::neutral, -1, true},
{"blacklist", &Commands::blackList, -1, true},
diff --git a/src/input/inputaction.h b/src/input/inputaction.h
index e5072eb1e..8abf6f65d 100644
--- a/src/input/inputaction.h
+++ b/src/input/inputaction.h
@@ -352,6 +352,7 @@ namespace InputAction
CLEAR_CHAT_TAB,
IGNORE,
UNIGNORE,
+ FRIEND,
TOTAL
};
} // namespace InputAction
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index 10668f463..f94af5e9e 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -2937,6 +2937,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
InputAction::NO_VALUE, 50,
InputCondition::INGAME,
"unignore",
+ true},
+ {"keyFriend",
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ Input::GRP_DEFAULT,
+ &Actions::chatFriend,
+ InputAction::NO_VALUE, 50,
+ InputCondition::INGAME,
+ "friend|befriend",
true}
};