diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-26 00:25:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-26 00:25:26 +0300 |
commit | 369dccecf7540c8ea3c050116c2fde5914e75a40 (patch) | |
tree | 61503d6de7437c5c702e5f9758725a7f4b74fa78 | |
parent | 1333ccee41e2acca4ecf4a90a6b230e8bbd23f7d (diff) | |
download | manaplus-369dccecf7540c8ea3c050116c2fde5914e75a40.tar.gz manaplus-369dccecf7540c8ea3c050116c2fde5914e75a40.tar.bz2 manaplus-369dccecf7540c8ea3c050116c2fde5914e75a40.tar.xz manaplus-369dccecf7540c8ea3c050116c2fde5914e75a40.zip |
Move chat command /away into actions.
-rw-r--r-- | src/actions/commands.cpp | 10 | ||||
-rw-r--r-- | src/actions/commands.h | 1 | ||||
-rw-r--r-- | src/commands.cpp | 10 | ||||
-rw-r--r-- | src/commands.h | 5 | ||||
-rw-r--r-- | src/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 11 |
6 files changed, 23 insertions, 15 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 2ee223386..84e093a40 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -347,4 +347,14 @@ impHandler(commandEmotePet) return true; } +impHandler(awayMessage) +{ + if (localPlayer) + { + localPlayer->setAway(event.args); + return true; + } + return false; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index 4b0150d12..961029002 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -43,6 +43,7 @@ namespace Actions decHandler(commandOutfit); decHandler(commandEmote); decHandler(commandEmotePet); + decHandler(awayMessage); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index f8e391a41..279027306 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -166,16 +166,6 @@ impHandler(navigate) return true; } -impHandler(away) -{ - if (localPlayer) - { - localPlayer->setAway(event.args); - return true; - } - return false; -} - impHandler(pseudoAway) { if (localPlayer) diff --git a/src/commands.h b/src/commands.h index e29ea7d2b..d14d47dab 100644 --- a/src/commands.h +++ b/src/commands.h @@ -51,7 +51,6 @@ struct CommandInfo final namespace Commands { - decHandler(away); decHandler(pseudoAway); decHandler(follow); decHandler(imitation); @@ -110,8 +109,7 @@ namespace Commands enum { - COMMAND_AWAY = 0, - COMMAND_PSEUDOAWAY, + COMMAND_PSEUDOAWAY = 0, COMMAND_FOLLOW, COMMAND_HEAL, COMMAND_NAVIGATE, @@ -169,7 +167,6 @@ enum static const CommandInfo commands[] = { - {"away", &Commands::away, -1, true}, {"pseudoaway", &Commands::pseudoAway, -1, true}, {"follow", &Commands::follow, -1, true}, {"heal", &Commands::heal, -1, true}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index c58de0c58..44cb67704 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -373,6 +373,7 @@ namespace InputAction COMMAMD_OUTFIT, COMMAMD_EMOTE, COMMAND_EMOTE_PET, + AWAY_MESSAGE, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 63dbb622c..1a67b32c0 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3126,7 +3126,16 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "emotepet", - true} + true}, + {"keyAwayMessage", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::awayMessage, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "away", + true}, }; #endif // INPUT_INPUTACTIONMAP_H |