From bc6e0ea4d7042ad48164b8bad69bff02ca5f8a5a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 13 Nov 2011 06:11:48 +0300 Subject: Show enemy relation in online list. --- src/gui/whoisonline.cpp | 17 ++++++++++++++++- src/playerrelations.cpp | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) 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 friends; std::vector neutral; std::vector disregard; + std::vector 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(enemy.size()); i++) + { + mBrowserBox->addRow(enemy.at(i)); + addedFromSection = true; + } + if (addedFromSection == true) + { + mBrowserBox->addRow("---"); + addedFromSection = false; + } for (int i = 0; i < static_cast(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 } -- cgit v1.2.3-70-g09d2