From 44ef6547161dd3cd2e1bb4053bb5e8619e6dc0d0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 4 Mar 2018 01:39:30 +0300 Subject: Add support for hightlight attribute in groups.xml This attribute allow to highlight gm groups based on groups.xml --- src/being/being.cpp | 6 ++++++ src/being/localplayer.cpp | 7 +------ 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/being') diff --git a/src/being/being.cpp b/src/being/being.cpp index 3b012fd90..d447221f8 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -5586,5 +5586,11 @@ void Being::setGroupId(const int id) { mGroupId = id; showGmBadge(id != 0); + const bool gm = GroupDb::getHighlightName(mGroupId); + if (mIsGM != gm) + { + mIsGM = gm; + updateColors(); + } } } diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 9f805b21a..240228068 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -422,19 +422,14 @@ void LocalPlayer::setGroupId(const int id) { Being::setGroupId(id); - if (id > 0) + if (mIsGM != 0) { - setGM(true); if (chatWindow != nullptr) { chatWindow->loadGMCommands(); chatWindow->showGMTab(); } } - else - { - setGM(false); - } if (statusWindow != nullptr) statusWindow->updateLevelLabel(); } -- cgit v1.2.3-70-g09d2