diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-09-05 17:31:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-09-05 17:55:52 +0300 |
commit | 8c8e641b2ce47daa2f824a87b27d63bfeb609098 (patch) | |
tree | 7464828be387d10ea0e9fe1f6cba225075bfed4f /src/being | |
parent | 720b445bf4eea777d1fac9bac4c23aae59062826 (diff) | |
download | plus-8c8e641b2ce47daa2f824a87b27d63bfeb609098.tar.gz plus-8c8e641b2ce47daa2f824a87b27d63bfeb609098.tar.bz2 plus-8c8e641b2ce47daa2f824a87b27d63bfeb609098.tar.xz plus-8c8e641b2ce47daa2f824a87b27d63bfeb609098.zip |
Add inactive being badge.
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 20 | ||||
-rw-r--r-- | src/being/being.h | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 1980436d5..63be12ebe 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2107,7 +2107,7 @@ std::string Being::getGenderSign() const // TRANSLATORS: this away status writed in player nick str.append(_("A")); } - else if (mInactive) + else if (mInactive && !mShowBadges) { // TRANSLATORS: this inactive status writed in player nick str.append(_("I")); @@ -2518,6 +2518,7 @@ bool Being::updateFromCache() } showShopBadge(mShop); + showInactiveBadge(mInactive); updateAwayEffect(); if (mType == ActorType::Player || mTeamId) updateColors(); @@ -3370,6 +3371,7 @@ void Being::setState(const uint8_t state) mInactive = inactive; updateAwayEffect(); showShopBadge(mShop); + showInactiveBadge(mInactive); if (needUpdate) { @@ -3883,6 +3885,7 @@ void Being::showBadges(const bool show) showPartyBadge(show); showNameBadge(show); showShopBadge(show); + showInactiveBadge(show); } void Being::showPartyBadge(const bool show) @@ -3925,6 +3928,21 @@ void Being::showShopBadge(const bool show) updateBadgesCount(); } +void Being::showInactiveBadge(const bool show) +{ + delete2(mBadges[BadgeIndex::Inactive]); + if (show && mShop && mShowBadges) + { + const std::string badge = paths.getStringValue("inactivebadge"); + if (!badge.empty()) + { + mBadges[BadgeIndex::Inactive] = AnimatedSprite::load( + paths.getStringValue("badges") + badge); + } + } + updateBadgesCount(); +} + void Being::updateBadgesCount() { mBadgesCount = 0; diff --git a/src/being/being.h b/src/being/being.h index 656eb21fb..47a904479 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -944,6 +944,8 @@ class Being notfinal : public ActorSprite, void showShopBadge(const bool show); + void showInactiveBadge(const bool show); + void showBadges(const bool show); uint16_t getTeamId() const |