From b76970dadf4c973180644a2b150729f071ef579a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 14 Dec 2014 12:52:50 +0300 Subject: Add chat command for kick player from party. New chat command: /kickparty NAME Alias: /partykick NAME --- src/actions/chat.cpp | 18 ++++++++++++++++++ src/actions/chat.h | 1 + src/input/inputaction.h | 1 + src/input/inputactionmap.h | 9 +++++++++ 4 files changed, 29 insertions(+) diff --git a/src/actions/chat.cpp b/src/actions/chat.cpp index 3fc8b9728..8c5a8ebb4 100644 --- a/src/actions/chat.cpp +++ b/src/actions/chat.cpp @@ -432,4 +432,22 @@ impHandler(toggle) } } +impHandler(kickParty) +{ + if (!event.args.empty()) + { + partyHandler->kick(event.args); + } + else + { + if (event.tab) + { + // TRANSLATORS: party kick message + event.tab->chatLog(_("Please specify a name."), + ChatMsgType::BY_SERVER); + } + } + return true; +} + } // namespace Actions diff --git a/src/actions/chat.h b/src/actions/chat.h index c42e4940b..3171d4118 100644 --- a/src/actions/chat.h +++ b/src/actions/chat.h @@ -46,6 +46,7 @@ namespace Actions decHandler(guild); decHandler(me); decHandler(toggle); + decHandler(kickParty); } // namespace Actions #undef decHandler diff --git a/src/input/inputaction.h b/src/input/inputaction.h index efd606db9..f482eeab5 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -510,6 +510,7 @@ namespace InputAction STORAGE_TO_INV, ITEM_PROTECT, ITEM_UNPROTECT, + KICK_PARTY, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 146ecba1c..c32fec039 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -4333,6 +4333,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputCondition::INGAME, "unprotectitem|itemunprotect", true}, + {"keyKickParty", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::kickParty, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "kickparty|partykick", + true}, }; #endif // INPUT_INPUTACTIONMAP_H -- cgit v1.2.3-70-g09d2