diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-07-13 20:22:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-07-13 20:22:52 +0300 |
commit | 1f72c8a3f380325f5f4a82137f8bac02362916df (patch) | |
tree | 1fe50a1ae4dbf5c50358be2624d10c88af1ccb1f /src/resources/db/groupdb.cpp | |
parent | 56373bec70b817dded49a3de69a21cdbee21873f (diff) | |
download | manaplus-1f72c8a3f380325f5f4a82137f8bac02362916df.tar.gz manaplus-1f72c8a3f380325f5f4a82137f8bac02362916df.tar.bz2 manaplus-1f72c8a3f380325f5f4a82137f8bac02362916df.tar.xz manaplus-1f72c8a3f380325f5f4a82137f8bac02362916df.zip |
Add property "showBadge" to groups.
For default groups.xml show badges only for group id == 60.
Diffstat (limited to 'src/resources/db/groupdb.cpp')
-rw-r--r-- | src/resources/db/groupdb.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/resources/db/groupdb.cpp b/src/resources/db/groupdb.cpp index 4b25e94bd..c65406841 100644 --- a/src/resources/db/groupdb.cpp +++ b/src/resources/db/groupdb.cpp @@ -96,6 +96,9 @@ void GroupDb::loadXmlFile(const std::string &fileName, mGroups[id].longName = XML::langProperty(node, "longName", ""); + mGroups[id].showBadge = XML::getBoolProperty(node, + "showBadge", + false); } } } @@ -128,6 +131,17 @@ const std::string &GroupDb::getLongName(const int id) return (*it).second.longName; } +bool GroupDb::getShowBadge(const int id) +{ + GroupInfos::const_iterator it = mGroups.find(id); + if (it == mGroups.end()) + { + reportAlways("Unknown group id requested: %d", id); + return mEmptyGroup.showBadge; + } + return (*it).second.showBadge; +} + #ifdef UNITTESTS GroupDb::GroupInfos &GroupDb::getGroups() { |