diff options
Diffstat (limited to 'src/being')
-rw-r--r-- | src/being/being.cpp | 26 | ||||
-rw-r--r-- | src/being/being.h | 2 |
2 files changed, 24 insertions, 4 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 63be12ebe..b3cda4463 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2098,16 +2098,16 @@ std::string Being::getGenderSign() const else if (getGender() == Gender::MALE) str = "\u2642"; } - if (mShowPlayersStatus) + if (mShowPlayersStatus && !mShowBadges) { - if (mShop && !mShowBadges) + if (mShop) str.append("$"); if (mAway) { // TRANSLATORS: this away status writed in player nick str.append(_("A")); } - else if (mInactive && !mShowBadges) + else if (mInactive) { // TRANSLATORS: this inactive status writed in player nick str.append(_("I")); @@ -2519,6 +2519,7 @@ bool Being::updateFromCache() showShopBadge(mShop); showInactiveBadge(mInactive); + showAwayBadge(mInactive); updateAwayEffect(); if (mType == ActorType::Player || mTeamId) updateColors(); @@ -3372,6 +3373,7 @@ void Being::setState(const uint8_t state) updateAwayEffect(); showShopBadge(mShop); showInactiveBadge(mInactive); + showAwayBadge(mInactive); if (needUpdate) { @@ -3886,6 +3888,7 @@ void Being::showBadges(const bool show) showNameBadge(show); showShopBadge(show); showInactiveBadge(show); + showAwayBadge(show); } void Being::showPartyBadge(const bool show) @@ -3931,7 +3934,7 @@ void Being::showShopBadge(const bool show) void Being::showInactiveBadge(const bool show) { delete2(mBadges[BadgeIndex::Inactive]); - if (show && mShop && mShowBadges) + if (show && mInactive && mShowBadges) { const std::string badge = paths.getStringValue("inactivebadge"); if (!badge.empty()) @@ -3943,6 +3946,21 @@ void Being::showInactiveBadge(const bool show) updateBadgesCount(); } +void Being::showAwayBadge(const bool show) +{ + delete2(mBadges[BadgeIndex::Away]); + if (show && mAway && mShowBadges) + { + const std::string badge = paths.getStringValue("awaybadge"); + if (!badge.empty()) + { + mBadges[BadgeIndex::Away] = 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 47a904479..3105edc0e 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -946,6 +946,8 @@ class Being notfinal : public ActorSprite, void showInactiveBadge(const bool show); + void showAwayBadge(const bool show); + void showBadges(const bool show); uint16_t getTeamId() const |