From 1333ccee41e2acca4ecf4a90a6b230e8bbd23f7d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 26 Aug 2014 00:02:45 +0300 Subject: Move chat command /emotepet into actions. --- src/actions/commands.cpp | 9 +++++++++ src/actions/commands.h | 1 + src/commands.cpp | 7 ------- src/commands.h | 5 +---- src/input/inputaction.h | 1 + src/input/inputactionmap.h | 9 +++++++++ 6 files changed, 21 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/actions/commands.cpp b/src/actions/commands.cpp index 3a44a58b9..2ee223386 100644 --- a/src/actions/commands.cpp +++ b/src/actions/commands.cpp @@ -69,6 +69,7 @@ #include "gui/widgets/tabs/whispertab.h" #include "net/adminhandler.h" +#include "net/pethandler.h" #include "net/net.h" #include "utils/gettext.h" @@ -338,4 +339,12 @@ impHandler(commandEmote) return false; } +impHandler(commandEmotePet) +{ + // need use actual pet id + Net::getPetHandler()->emote(static_cast( + atoi(event.args.c_str())), 0); + return true; +} + } // namespace Actions diff --git a/src/actions/commands.h b/src/actions/commands.h index 3577aab36..4b0150d12 100644 --- a/src/actions/commands.h +++ b/src/actions/commands.h @@ -42,6 +42,7 @@ namespace Actions decHandler(setTarget); decHandler(commandOutfit); decHandler(commandEmote); + decHandler(commandEmotePet); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index 9bf94be48..f8e391a41 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -166,13 +166,6 @@ impHandler(navigate) return true; } -impHandler(emotePet) -{ - // need use actual pet id - Net::getPetHandler()->emote(static_cast(atoi(event.args.c_str())), 0); - return true; -} - impHandler(away) { if (localPlayer) diff --git a/src/commands.h b/src/commands.h index a1e826ee6..e29ea7d2b 100644 --- a/src/commands.h +++ b/src/commands.h @@ -51,7 +51,6 @@ struct CommandInfo final namespace Commands { - decHandler(emotePet); decHandler(away); decHandler(pseudoAway); decHandler(follow); @@ -111,8 +110,7 @@ namespace Commands enum { - COMMAND_EMOTEPET = 0, - COMMAND_AWAY, + COMMAND_AWAY = 0, COMMAND_PSEUDOAWAY, COMMAND_FOLLOW, COMMAND_HEAL, @@ -171,7 +169,6 @@ enum static const CommandInfo commands[] = { - {"emotepet", &Commands::emotePet, -1, true}, {"away", &Commands::away, -1, true}, {"pseudoaway", &Commands::pseudoAway, -1, true}, {"follow", &Commands::follow, -1, true}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index ef541cbe7..c58de0c58 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -372,6 +372,7 @@ namespace InputAction ATTACK_HUMAN, COMMAMD_OUTFIT, COMMAMD_EMOTE, + COMMAND_EMOTE_PET, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 42d664f66..63dbb622c 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3117,6 +3117,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "emote", + true}, + {"keyEmotePet", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::commandEmotePet, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "emotepet", true} }; -- cgit v1.2.3-70-g09d2