summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-11-13 06:11:48 +0300
committerAndrei Karas <akaras@inbox.ru>2011-11-13 06:31:58 +0300
commitbc6e0ea4d7042ad48164b8bad69bff02ca5f8a5a (patch)
treea378ebc4970084cbc7539a0a457431876c451333
parentb24a71e73815ef3196456c8697150443aa58d8df (diff)
downloadmv-bc6e0ea4d7042ad48164b8bad69bff02ca5f8a5a.tar.gz
mv-bc6e0ea4d7042ad48164b8bad69bff02ca5f8a5a.tar.bz2
mv-bc6e0ea4d7042ad48164b8bad69bff02ca5f8a5a.tar.xz
mv-bc6e0ea4d7042ad48164b8bad69bff02ca5f8a5a.zip
Show enemy relation in online list.
-rw-r--r--src/gui/whoisonline.cpp17
-rw-r--r--src/playerrelations.cpp1
2 files changed, 17 insertions, 1 deletions
diff --git a/src/gui/whoisonline.cpp b/src/gui/whoisonline.cpp
index ead38f42b..e0fa4ebcf 100644
--- a/src/gui/whoisonline.cpp
+++ b/src/gui/whoisonline.cpp
@@ -198,6 +198,7 @@ void WhoIsOnline::loadList()
std::vector<std::string> friends;
std::vector<std::string> neutral;
std::vector<std::string> disregard;
+ std::vector<std::string> enemy;
// Tokenize and add each line separately
char *line = strtok(mMemoryBuffer, "\n");
@@ -270,6 +271,7 @@ void WhoIsOnline::loadList()
switch (player_relations.getRelation(nick))
{
case PlayerRelation::NEUTRAL:
+ default:
neutral.push_back(prepareNick(nick, level, "0"));
break;
@@ -282,9 +284,12 @@ void WhoIsOnline::loadList()
disregard.push_back(prepareNick(nick, level, "8"));
break;
+ case PlayerRelation::ENEMY2:
+ enemy.push_back(prepareNick(nick, level, "1"));
+ break;
+
case PlayerRelation::IGNORED:
case PlayerRelation::ERASED:
- default:
//Ignore the ignored.
break;
}
@@ -316,6 +321,16 @@ void WhoIsOnline::loadList()
mBrowserBox->addRow("---");
addedFromSection = false;
}
+ for (int i = 0; i < static_cast<int>(enemy.size()); i++)
+ {
+ mBrowserBox->addRow(enemy.at(i));
+ addedFromSection = true;
+ }
+ if (addedFromSection == true)
+ {
+ mBrowserBox->addRow("---");
+ addedFromSection = false;
+ }
for (int i = 0; i < static_cast<int>(neutral.size()); i++)
{
mBrowserBox->addRow(neutral.at(i));
diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp
index 324dac065..1bf63aa81 100644
--- a/src/playerrelations.cpp
+++ b/src/playerrelations.cpp
@@ -282,6 +282,7 @@ unsigned int PlayerRelationsManager::checkPermissionSilently(
case PlayerRelation::IGNORED:
case PlayerRelation::ERASED:
case PlayerRelation::BLACKLISTED:
+ case PlayerRelation::ENEMY2:
default:
permissions &= mDefaultPermissions; // narrow
}