diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-10-05 01:41:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-10-05 01:41:54 +0300 |
commit | ab545fee3daf930dc46aaf303355c1c578320484 (patch) | |
tree | 24c8286acb9fea22b1e689810be5534de2323623 /src/gui | |
parent | 851bee28374c5c60114c9f78299e28eaa14891b3 (diff) | |
download | manaplus-ab545fee3daf930dc46aaf303355c1c578320484.tar.gz manaplus-ab545fee3daf930dc46aaf303355c1c578320484.tar.bz2 manaplus-ab545fee3daf930dc46aaf303355c1c578320484.tar.xz manaplus-ab545fee3daf930dc46aaf303355c1c578320484.zip |
Add blacklist relation. In this mode blocked trades, emotes, speech text.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/chatwindow.cpp | 1 | ||||
-rw-r--r-- | src/gui/popupmenu.cpp | 38 | ||||
-rw-r--r-- | src/gui/setup_relations.cpp | 3 | ||||
-rw-r--r-- | src/gui/whoisonline.cpp | 1 |
4 files changed, 42 insertions, 1 deletions
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,12 +144,21 @@ 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")); break; @@ -369,12 +378,21 @@ 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")); break; @@ -606,12 +624,21 @@ 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")); break; @@ -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; |