summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-04-04 21:25:57 +0300
committerAndrei Karas <akaras@inbox.ru>2017-04-04 21:25:57 +0300
commit73a19644de201aa63ed9d1cf9feaa80873a85b4d (patch)
treeed11be06d0a58a433ed91a2db1526fb455d03811 /src/being/being.cpp
parent22bdb49dc36281ed99b1f2b5199ef36c9417dcf5 (diff)
downloadmv-73a19644de201aa63ed9d1cf9feaa80873a85b4d.tar.gz
mv-73a19644de201aa63ed9d1cf9feaa80873a85b4d.tar.bz2
mv-73a19644de201aa63ed9d1cf9feaa80873a85b4d.tar.xz
mv-73a19644de201aa63ed9d1cf9feaa80873a85b4d.zip
Show player language badge.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 45aa67bac..eef9b1d40 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -89,6 +89,7 @@
#include "resources/db/emotedb.h"
#include "resources/db/homunculusdb.h"
#include "resources/db/horsedb.h"
+#include "resources/db/languagedb.h"
#include "resources/db/mercenarydb.h"
#include "resources/db/monsterdb.h"
#include "resources/db/npcdb.h"
@@ -248,6 +249,7 @@ Being::Being(const BeingId id,
mManner(0),
mAreaSize(11),
mCastEndTime(0),
+ mLanguageId(-1),
mCreatorId(BeingId_zero),
mTeamId(0U),
mLook(0U),
@@ -5326,3 +5328,20 @@ void Being::fixDirectionOffsets(int &offsetX,
offsetX = tmp;
}
}
+
+void Being::setLanguageId(const int lang) restrict2 noexcept2
+{
+ if (lang != mLanguageId)
+ {
+ delete2(mBadges[BadgeIndex::Lang]);
+ const std::string badge = LanguageDb::getIcon(lang);
+ if (!badge.empty())
+ {
+ mBadges[BadgeIndex::Lang] = AnimatedSprite::load(pathJoin(
+ paths.getStringValue("languageIcons"),
+ badge));
+ }
+
+ mLanguageId = lang;
+ }
+}