summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-23 22:13:50 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-23 22:13:50 +0300
commit81a7b06f2ff1fad4b012068b15975bdb5e86a0e4 (patch)
tree74719015e27e35928403aded155ac31abede5e6c
parent1a652f220d1c74333cd2f54953dbaf41907314b6 (diff)
downloadplus-81a7b06f2ff1fad4b012068b15975bdb5e86a0e4.tar.gz
plus-81a7b06f2ff1fad4b012068b15975bdb5e86a0e4.tar.bz2
plus-81a7b06f2ff1fad4b012068b15975bdb5e86a0e4.tar.xz
plus-81a7b06f2ff1fad4b012068b15975bdb5e86a0e4.zip
Move chat command /clear into actions.
-rw-r--r--src/actions/chat.cpp10
-rw-r--r--src/actions/chat.h1
-rw-r--r--src/commands.cpp10
-rw-r--r--src/commands.h3
-rw-r--r--src/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h11
-rw-r--r--src/input/pages/chat.cpp6
7 files changed, 28 insertions, 14 deletions
diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp
index 858b5acbb..74f3fc691 100644
--- a/src/actions/chat.cpp
+++ b/src/actions/chat.cpp
@@ -232,4 +232,14 @@ impHandler(query)
return true;
}
+impHandler0(clearChatTab)
+{
+ if (chatWindow)
+ {
+ chatWindow->clearTab();
+ return true;
+ }
+ return false;
+}
+
} // namespace Actions
diff --git a/src/actions/chat.h b/src/actions/chat.h
index fe35021be..8a5e3a3c8 100644
--- a/src/actions/chat.h
+++ b/src/actions/chat.h
@@ -37,6 +37,7 @@ namespace Actions
decHandler(scrollChatDown);
decHandler(msg);
decHandler(query);
+ decHandler(clearChatTab);
} // namespace Actions
#undef decHandler
diff --git a/src/commands.cpp b/src/commands.cpp
index 8e90532c8..7491c678e 100644
--- a/src/commands.cpp
+++ b/src/commands.cpp
@@ -251,16 +251,6 @@ static void outStringNormal(ChatTab *const tab,
}
}
-impHandler0(clear)
-{
- if (chatWindow)
- {
- chatWindow->clearTab();
- return true;
- }
- return false;
-}
-
impHandler0(cleanGraphics)
{
ResourceManager::getInstance()->clearCache();
diff --git a/src/commands.h b/src/commands.h
index 9c18eb1df..1dbd3a27d 100644
--- a/src/commands.h
+++ b/src/commands.h
@@ -51,7 +51,6 @@ struct CommandInfo final
namespace Commands
{
- decHandler(clear);
decHandler(cleanGraphics);
decHandler(cleanFonts);
decHandler(createParty);
@@ -144,7 +143,6 @@ enum
COMMAND_BLACKLIST,
COMMAND_ENEMY,
COMMAND_ERASE,
- COMMAND_CLEAR,
COMMAND_CLEANGRAPHICS,
COMMAND_CLEANFONTS,
COMMAND_CREATEPARTY,
@@ -229,7 +227,6 @@ static const CommandInfo commands[] =
{"blacklist", &Commands::blackList, -1, true},
{"enemy", &Commands::enemy, -1, true},
{"erase", &Commands::erase, -1, true},
- {"clear", &Commands::clear, -1, true},
{"cleangraphics", &Commands::cleanGraphics, -1, false},
{"cleanfonts", &Commands::cleanFonts, -1, false},
{"createparty", &Commands::createParty, -1, true},
diff --git a/src/input/inputaction.h b/src/input/inputaction.h
index 15af94ec7..36adc4759 100644
--- a/src/input/inputaction.h
+++ b/src/input/inputaction.h
@@ -349,6 +349,7 @@ namespace InputAction
WHO,
WHISPER,
QUERY,
+ CLEAR_CHAT_TAB,
TOTAL
};
} // namespace InputAction
diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h
index fc2b601b6..b5498427d 100644
--- a/src/input/inputactionmap.h
+++ b/src/input/inputactionmap.h
@@ -2910,7 +2910,16 @@ static const InputActionData inputActionData[InputAction::TOTAL] = {
InputAction::NO_VALUE, 50,
InputCondition::INGAME,
"q|query",
- true}
+ true},
+ {"keyClearChatTab",
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ InputType::UNKNOWN, InputAction::NO_VALUE,
+ Input::GRP_DEFAULT,
+ &Actions::clearChatTab,
+ InputAction::NO_VALUE, 50,
+ InputCondition::INGAME,
+ "clear",
+ false}
};
#endif // INPUT_INPUTACTIONMAP_H
diff --git a/src/input/pages/chat.cpp b/src/input/pages/chat.cpp
index d61f7855a..234892c77 100644
--- a/src/input/pages/chat.cpp
+++ b/src/input/pages/chat.cpp
@@ -62,6 +62,12 @@ SetupActionData setupActionDataChat[] =
},
{
// TRANSLATORS: input action name
+ N_("Clear current chat tab"),
+ InputAction::CLEAR_CHAT_TAB,
+ "",
+ },
+ {
+ // TRANSLATORS: input action name
N_("Close current Chat Tab"),
InputAction::CLOSE_CHAT_TAB,
"",