diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-09-05 17:05:55 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-09-05 17:55:52 +0300 |
commit | 720b445bf4eea777d1fac9bac4c23aae59062826 (patch) | |
tree | 26941b003c1598fafb211ab909a8096df14655e8 /src/being/being.cpp | |
parent | df5cdaf58478f3b6309b52c36b1696e5fe8dc157 (diff) | |
download | mv-720b445bf4eea777d1fac9bac4c23aae59062826.tar.gz mv-720b445bf4eea777d1fac9bac4c23aae59062826.tar.bz2 mv-720b445bf4eea777d1fac9bac4c23aae59062826.tar.xz mv-720b445bf4eea777d1fac9bac4c23aae59062826.zip |
Add shop badge to beings.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r-- | src/being/being.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 902811206..1980436d5 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2100,7 +2100,7 @@ std::string Being::getGenderSign() const } if (mShowPlayersStatus) { - if (mShop) + if (mShop && !mShowBadges) str.append("$"); if (mAway) { @@ -2517,6 +2517,7 @@ bool Being::updateFromCache() mInactive = false; } + showShopBadge(mShop); updateAwayEffect(); if (mType == ActorType::Player || mTeamId) updateColors(); @@ -3368,6 +3369,7 @@ void Being::setState(const uint8_t state) mAway = away; mInactive = inactive; updateAwayEffect(); + showShopBadge(mShop); if (needUpdate) { @@ -3880,6 +3882,7 @@ void Being::showBadges(const bool show) showGmBadge(show); showPartyBadge(show); showNameBadge(show); + showShopBadge(show); } void Being::showPartyBadge(const bool show) @@ -3897,6 +3900,7 @@ void Being::showPartyBadge(const bool show) updateBadgesCount(); } + void Being::setPartyName(const std::string &name) { if (mPartyName != name) @@ -3906,6 +3910,21 @@ void Being::setPartyName(const std::string &name) } } +void Being::showShopBadge(const bool show) +{ + delete2(mBadges[BadgeIndex::Shop]); + if (show && mShop && mShowBadges) + { + const std::string badge = paths.getStringValue("shopbadge"); + if (!badge.empty()) + { + mBadges[BadgeIndex::Shop] = AnimatedSprite::load( + paths.getStringValue("badges") + badge); + } + } + updateBadgesCount(); +} + void Being::updateBadgesCount() { mBadgesCount = 0; @@ -3928,6 +3947,7 @@ void Being::setSellBoard(const std::string &text) mShop = !text.empty() || !mBuyBoard.empty(); mSellBoard = text; updateName(); + showShopBadge(mShop); } void Being::setBuyBoard(const std::string &text) @@ -3935,6 +3955,7 @@ void Being::setBuyBoard(const std::string &text) mShop = !text.empty() || !mSellBoard.empty(); mBuyBoard = text; updateName(); + showShopBadge(mShop); } #endif @@ -3942,6 +3963,7 @@ void Being::enableShop(const bool b) { mShop = b; updateName(); + showShopBadge(mShop); } bool Being::isBuyShopEnabled() const |