diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-19 22:40:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-19 22:40:15 +0300 |
commit | d8d06e4c4ff2b84fbe74c902ac4bf50d349dc018 (patch) | |
tree | 38a1580cb5d26865a8e8e6d2bd459d5ab10faf99 /src/gui | |
parent | a348d4a8882300fa308d210e860dd29a4b974622 (diff) | |
download | manaverse-d8d06e4c4ff2b84fbe74c902ac4bf50d349dc018.tar.gz manaverse-d8d06e4c4ff2b84fbe74c902ac4bf50d349dc018.tar.bz2 manaverse-d8d06e4c4ff2b84fbe74c902ac4bf50d349dc018.tar.xz manaverse-d8d06e4c4ff2b84fbe74c902ac4bf50d349dc018.zip |
Add chat command for show/change share item drops in party.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/widgets/tabs/chat/partytab.cpp | 51 |
1 files changed, 3 insertions, 48 deletions
diff --git a/src/gui/widgets/tabs/chat/partytab.cpp b/src/gui/widgets/tabs/chat/partytab.cpp index 3786e916b..530b0eca8 100644 --- a/src/gui/widgets/tabs/chat/partytab.cpp +++ b/src/gui/widgets/tabs/chat/partytab.cpp @@ -84,54 +84,9 @@ bool PartyTab::handleCommand(const std::string &restrict type, } else if (type == "item") { - if (args.empty()) - { - switch (partyHandler->getShareItems()) - { - case PartyShare::YES: - // TRANSLATORS: chat message - chatLog(_("Item sharing enabled."), - ChatMsgType::BY_SERVER); - return true; - case PartyShare::NO: - // TRANSLATORS: chat message - chatLog(_("Item sharing disabled."), - ChatMsgType::BY_SERVER); - return true; - case PartyShare::NOT_POSSIBLE: - // TRANSLATORS: chat message - chatLog(_("Item sharing not possible."), - ChatMsgType::BY_SERVER); - return true; - case PartyShare::UNKNOWN: - // TRANSLATORS: chat message - chatLog(_("Item sharing unknown."), - ChatMsgType::BY_SERVER); - return true; - default: - break; - } - } - - const signed char opt = parseBoolean(args); - - switch (opt) - { - case 1: - partyHandler->setShareItems( - PartyShare::YES); - break; - case 0: - partyHandler->setShareItems( - PartyShare::NO); - break; - case -1: - chatLog(strprintf(BOOLEAN_OPTIONS, "item"), - ChatMsgType::BY_SERVER); - break; - default: - break; - } + inputManager.executeChatCommand(InputAction::PARTY_ITEM_SHARE, + args, + this); } else if (type == "exp") { |