diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-26 11:58:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-26 11:58:28 +0300 |
commit | ae4062ed3c48706127c32efbc70cca0cc5ce19f8 (patch) | |
tree | ba2576179837ca60fe4340e55aef627b9df84405 | |
parent | 2018073c8ec531d936321f2e6561b68d386f36a5 (diff) | |
download | plus-ae4062ed3c48706127c32efbc70cca0cc5ce19f8.tar.gz plus-ae4062ed3c48706127c32efbc70cca0cc5ce19f8.tar.bz2 plus-ae4062ed3c48706127c32efbc70cca0cc5ce19f8.tar.xz plus-ae4062ed3c48706127c32efbc70cca0cc5ce19f8.zip |
Move chat command /navigate into actions.
-rw-r--r-- | src/actions/commands.cpp | 15 | ||||
-rw-r--r-- | src/actions/commands.h | 1 | ||||
-rw-r--r-- | src/commands.cpp | 15 | ||||
-rw-r--r-- | src/commands.h | 5 | ||||
-rw-r--r-- | src/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 9 |
6 files changed, 27 insertions, 19 deletions
diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 5038d9f57..29e7e740c 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -394,4 +394,19 @@ impHandler(follow) return true; } +impHandler(navigate) +{ + if (!localPlayer) + return false; + + int x = 0; + int y = 0; + + if (parse2Int(event.args, x, y)) + localPlayer->navigateTo(x, y); + else + localPlayer->navigateClean(); + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index 7034d0638..f5f4b4a5e 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -46,6 +46,7 @@ namespace Actions decHandler(awayMessage); decHandler(pseudoAway); decHandler(follow); + decHandler(navigate); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index 38683ea2a..0929d525d 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -151,21 +151,6 @@ static void outStringNormal(ChatTab *const tab, } } -impHandler(navigate) -{ - if (!localPlayer) - return false; - - int x = 0; - int y = 0; - - if (parse2Int(event.args, x, y)) - localPlayer->navigateTo(x, y); - else - localPlayer->navigateClean(); - return true; -} - impHandler(imitation) { if (!localPlayer) diff --git a/src/commands.h b/src/commands.h index 84f6b20d0..19c311320 100644 --- a/src/commands.h +++ b/src/commands.h @@ -52,7 +52,6 @@ struct CommandInfo final namespace Commands { decHandler(imitation); - decHandler(navigate); decHandler(mail); decHandler(hack); decHandler(priceLoad); @@ -106,8 +105,7 @@ namespace Commands enum { - COMMAND_NAVIGATE = 0, - COMMAND_IMITATION, + COMMAND_IMITATION = 0, COMMAND_MAIL, COMMAND_TRADE, COMMAND_PRICELOAD, @@ -161,7 +159,6 @@ enum static const CommandInfo commands[] = { - {"navigate", &Commands::navigate, -1, true}, {"imitation", &Commands::imitation, -1, true}, {"mail", &Commands::mail, -1, true}, {"trade", &Commands::trade, -1, true}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 55310593a..7a9dcaecf 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -376,6 +376,7 @@ namespace InputAction AWAY_MESSAGE, PSEUDO_AWAY, FOLLOW, + NAVIGATE, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 533771384..ca359804b 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3153,6 +3153,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "follow", + true}, + {"keyNavigate", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::navigate, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "navigate", true} }; |