summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-27 14:58:06 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-27 14:58:06 +0300
commit144204fd38ea7388d9ca97922862844636052bfc (patch)
treeb30a4e6f5369a7ebc9bda465ec472956599ce9fc /src/being/being.cpp
parentc5092e2ce5cd6edecde4339d4d2436d4585b60a6 (diff)
downloadplus-144204fd38ea7388d9ca97922862844636052bfc.tar.gz
plus-144204fd38ea7388d9ca97922862844636052bfc.tar.bz2
plus-144204fd38ea7388d9ca97922862844636052bfc.tar.xz
plus-144204fd38ea7388d9ca97922862844636052bfc.zip
Add option to show/hide badges. By default badges visible.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 62b35b386..ad86d56fe 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -117,6 +117,7 @@ bool Being::mEnableReorderSprites = true;
bool Being::mHideErased = false;
Move Being::mMoveNames = Move_false;
bool Being::mUseDiagonal = true;
+bool Being::mShowBadges = true;
int Being::mAwayEffect = -1;
std::list<BeingCacheEntry*> beingInfoCache;
@@ -288,6 +289,7 @@ Being::~Being()
delete2(mText);
delete2(mEmotionSprite);
delete2(mAnimationEffect);
+ delete2(mTeamBadge);
#ifdef EATHENA_SUPPORT
delete2(mChat);
#endif
@@ -1839,7 +1841,7 @@ void Being::drawEmotion(Graphics *const graphics,
mEmotionSprite->draw(graphics, px, py);
if (mAnimationEffect)
mAnimationEffect->draw(graphics, px, py);
- if (mTeamBadge)
+ if (mTeamBadge && mShowBadges)
{
if (mDispName && gui)
{
@@ -2365,6 +2367,7 @@ void Being::reReadConfig()
mHideErased = config.getBoolValue("hideErased");
mMoveNames = fromBool(config.getBoolValue("moveNames"), Move);
mUseDiagonal = config.getBoolValue("useDiagonalSpeed");
+ mShowBadges = config.getBoolValue("showBadges");
mUpdateConfigTime = cur_time;
}
@@ -3690,20 +3693,24 @@ void Being::setTeamId(const uint16_t teamId)
{
if (mTeamId != teamId)
{
- delete2(mTeamBadge);
- if (teamId)
- {
- mTeamBadge = AnimatedSprite::load(
- strprintf("%steam%d.xml",
- paths.getStringValue("badges").c_str(),
- teamId));
- }
-
mTeamId = teamId;
+ showBadges(mTeamId != 0);
updateColors();
}
}
+void Being::showBadges(const bool show)
+{
+ delete2(mTeamBadge);
+ if (show && mTeamId)
+ {
+ mTeamBadge = AnimatedSprite::load(
+ strprintf("%steam%d.xml",
+ paths.getStringValue("badges").c_str(),
+ mTeamId));
+ }
+}
+
#ifdef EATHENA_SUPPORT
void Being::setChat(ChatObject *const obj)
{