From ab545fee3daf930dc46aaf303355c1c578320484 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Oct 2011 01:41:54 +0300 Subject: Add blacklist relation. In this mode blocked trades, emotes, speech text. --- src/gui/chatwindow.cpp | 1 + src/gui/popupmenu.cpp | 38 ++++++++++++++++++++++++++++++++++++++ src/gui/setup_relations.cpp | 3 ++- src/gui/whoisonline.cpp | 1 + 4 files changed, 42 insertions(+), 1 deletion(-) (limited to 'src/gui') diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 82d6c2ff5..59bd173bd 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -293,6 +293,7 @@ void ChatWindow::fillCommands() mCommands.push_back("/addpriorityattack "); mCommands.push_back("/removeattack "); mCommands.push_back("/addignoreattack "); + mCommands.push_back("/blacklist "); } void ChatWindow::resetToDefaultSize() diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index 16e3d9ec7..d7c7e54df 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -144,10 +144,19 @@ void PopupMenu::showPopup(int x, int y, Being *being) mBrowserBox->addRow("friend", _("Be friend")); mBrowserBox->addRow("disregard", _("Disregard")); mBrowserBox->addRow("ignore", _("Ignore")); + mBrowserBox->addRow("blacklist", _("Black list")); mBrowserBox->addRow("erase", _("Erase")); break; case PlayerRelation::FRIEND: + mBrowserBox->addRow("disregard", _("Disregard")); + mBrowserBox->addRow("ignore", _("Ignore")); + mBrowserBox->addRow("blacklist", _("Black list")); + mBrowserBox->addRow("erase", _("Erase")); + break; + + case PlayerRelation::BLACKLISTED: + mBrowserBox->addRow("unignore", _("Unignore")); mBrowserBox->addRow("disregard", _("Disregard")); mBrowserBox->addRow("ignore", _("Ignore")); mBrowserBox->addRow("erase", _("Erase")); @@ -369,10 +378,19 @@ void PopupMenu::showPlayerPopup(int x, int y, std::string nick) mBrowserBox->addRow("friend", _("Be friend")); mBrowserBox->addRow("disregard", _("Disregard")); mBrowserBox->addRow("ignore", _("Ignore")); + mBrowserBox->addRow("blacklist", _("Black list")); mBrowserBox->addRow("erase", _("Erase")); break; case PlayerRelation::FRIEND: + mBrowserBox->addRow("disregard", _("Disregard")); + mBrowserBox->addRow("ignore", _("Ignore")); + mBrowserBox->addRow("blacklist", _("Black list")); + mBrowserBox->addRow("erase", _("Erase")); + break; + + case PlayerRelation::BLACKLISTED: + mBrowserBox->addRow("unignore", _("Unignore")); mBrowserBox->addRow("disregard", _("Disregard")); mBrowserBox->addRow("ignore", _("Ignore")); mBrowserBox->addRow("erase", _("Erase")); @@ -606,10 +624,19 @@ void PopupMenu::showChatPopup(int x, int y, ChatTab *tab) mBrowserBox->addRow("friend", _("Be friend")); mBrowserBox->addRow("disregard", _("Disregard")); mBrowserBox->addRow("ignore", _("Ignore")); + mBrowserBox->addRow("blacklist", _("Black list")); mBrowserBox->addRow("erase", _("Erase")); break; case PlayerRelation::FRIEND: + mBrowserBox->addRow("disregard", _("Disregard")); + mBrowserBox->addRow("ignore", _("Ignore")); + mBrowserBox->addRow("blacklist", _("Black list")); + mBrowserBox->addRow("erase", _("Erase")); + break; + + case PlayerRelation::BLACKLISTED: + mBrowserBox->addRow("unignore", _("Unignore")); mBrowserBox->addRow("disregard", _("Disregard")); mBrowserBox->addRow("ignore", _("Ignore")); mBrowserBox->addRow("erase", _("Erase")); @@ -857,6 +884,17 @@ void PopupMenu::handleLink(const std::string &link, { player_relations.setRelation(mNick, PlayerRelation::IGNORED); } + + else if (link == "blacklist" && being && + being->getType() == ActorSprite::PLAYER) + { + player_relations.setRelation(being->getName(), + PlayerRelation::BLACKLISTED); + } + else if (link == "blacklist" && !mNick.empty()) + { + player_relations.setRelation(mNick, PlayerRelation::BLACKLISTED); + } else if (link == "erase" && being && being->getType() == ActorSprite::PLAYER) { diff --git a/src/gui/setup_relations.cpp b/src/gui/setup_relations.cpp index 57a51e435..de88c2bee 100644 --- a/src/gui/setup_relations.cpp +++ b/src/gui/setup_relations.cpp @@ -71,7 +71,8 @@ static const char *RELATION_NAMES[PlayerRelation::RELATIONS_NR] = N_("Friend"), N_("Disregarded"), N_("Ignored"), - N_("Erased") + N_("Erased"), + N_("Black listed") }; class PlayerRelationListModel : public gcn::ListModel diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp index a14e99afc..3c34da9ec 100644 --- a/src/gui/whoisonline.cpp +++ b/src/gui/whoisonline.cpp @@ -278,6 +278,7 @@ void WhoIsOnline::loadList() break; case PlayerRelation::DISREGARDED: + case PlayerRelation::BLACKLISTED: disregard.push_back(prepareNick(nick, level, "8")); break; -- cgit v1.2.3-60-g2f50