summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp19
-rw-r--r--src/being/being.h3
2 files changed, 22 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;
+ }
+}
diff --git a/src/being/being.h b/src/being/being.h
index ae4fe3dd8..0110f3141 100644
--- a/src/being/being.h
+++ b/src/being/being.h
@@ -1061,6 +1061,8 @@ class Being notfinal : public ActorSprite,
void showBadges(const bool show) restrict2;
+ void setLanguageId(const int lang) restrict2 noexcept2;
+
uint16_t getTeamId() const restrict2 noexcept2 A_WARN_UNUSED
{ return mTeamId; }
@@ -1323,6 +1325,7 @@ class Being notfinal : public ActorSprite,
int mManner;
int mAreaSize;
int mCastEndTime;
+ int mLanguageId;
BeingId mCreatorId;
uint16_t mTeamId;
uint16_t mLook;