summaryrefslogtreecommitdiff
path: root/src/resources/db
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-03-04 01:39:30 +0300
committerAndrei Karas <akaras@inbox.ru>2018-03-04 01:39:30 +0300
commit44ef6547161dd3cd2e1bb4053bb5e8619e6dc0d0 (patch)
tree16ef6000be72c8959672d1210e89f595a55925a5 /src/resources/db
parentb889e7fe2d2b1162bad9cf39831e1becf3d9e480 (diff)
downloadmanaverse-44ef6547161dd3cd2e1bb4053bb5e8619e6dc0d0.tar.gz
manaverse-44ef6547161dd3cd2e1bb4053bb5e8619e6dc0d0.tar.bz2
manaverse-44ef6547161dd3cd2e1bb4053bb5e8619e6dc0d0.tar.xz
manaverse-44ef6547161dd3cd2e1bb4053bb5e8619e6dc0d0.zip
Add support for hightlight attribute in groups.xml
This attribute allow to highlight gm groups based on groups.xml
Diffstat (limited to 'src/resources/db')
-rw-r--r--src/resources/db/groupdb.cpp14
-rw-r--r--src/resources/db/groupdb.h1
2 files changed, 15 insertions, 0 deletions
diff --git a/src/resources/db/groupdb.cpp b/src/resources/db/groupdb.cpp
index e09e773aa..1d1d1bffa 100644
--- a/src/resources/db/groupdb.cpp
+++ b/src/resources/db/groupdb.cpp
@@ -314,6 +314,9 @@ void GroupDb::loadXmlFile(const std::string &fileName,
group->showBadge = XML::getBoolProperty(node,
"showBadge",
false);
+ group->highlightName = XML::getBoolProperty(node,
+ "highlightName",
+ false);
loadSubNodes(node, id, group);
parseInherit(node, id, group);
}
@@ -364,6 +367,17 @@ bool GroupDb::getShowBadge(const int id)
return (*it).second->showBadge;
}
+bool GroupDb::getHighlightName(const int id)
+{
+ GroupInfos::const_iterator it = mGroups.find(id);
+ if (it == mGroups.end())
+ {
+ reportAlways("Unknown group id requested: %d", id);
+ return mEmptyGroup.highlightName;
+ }
+ return (*it).second->highlightName;
+}
+
const std::string &GroupDb::getBadge(const int id)
{
GroupInfos::const_iterator it = mGroups.find(id);
diff --git a/src/resources/db/groupdb.h b/src/resources/db/groupdb.h
index a8fd1dcf3..f447baa96 100644
--- a/src/resources/db/groupdb.h
+++ b/src/resources/db/groupdb.h
@@ -41,6 +41,7 @@ namespace GroupDb
const std::string &getName(const int id) A_WARN_UNUSED;
const std::string &getLongName(const int id) A_WARN_UNUSED;
bool getShowBadge(const int id) A_WARN_UNUSED;
+ bool getHighlightName(const int id) A_WARN_UNUSED;
const std::string &getBadge(const int id) A_WARN_UNUSED;
const GroupInfo *getGroup(const int id) A_WARN_UNUSED RETURNS_NONNULL;