summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-31 01:04:26 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-31 01:04:26 +0300
commitd86a26ea47f5ae35bd112c7fdb8b13c7663d75d8 (patch)
tree0147dc7337d2c0536685d1d4ec5825b456fcbb92
parent913f45eda0dde5775254fb776e6960b03a015fd4 (diff)
downloadmanaverse-d86a26ea47f5ae35bd112c7fdb8b13c7663d75d8.tar.gz
manaverse-d86a26ea47f5ae35bd112c7fdb8b13c7663d75d8.tar.bz2
manaverse-d86a26ea47f5ae35bd112c7fdb8b13c7663d75d8.tar.xz
manaverse-d86a26ea47f5ae35bd112c7fdb8b13c7663d75d8.zip
Fix show badges if player name hidden.
-rw-r--r--src/being/being.cpp55
1 files changed, 38 insertions, 17 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 4621b99a2..73ee9cec0 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -2274,31 +2274,52 @@ void Being::drawEmotion(Graphics *restrict const graphics,
{
int x;
int y;
- if (mShowBadges == BadgeDrawType::Right &&
- mDispName != nullptr &&
+ if (mDispName != nullptr &&
gui != nullptr)
{
- const Font *restrict const font = gui->getFont();
- x = mDispName->getX() - offsetX + mDispName->getWidth();
- y = mDispName->getY() - offsetY - font->getHeight();
- }
- else if (mShowBadges == BadgeDrawType::Bottom &&
- mDispName != nullptr &&
- gui != nullptr)
- {
- x = px + 8 - mBadgesCount * 8;
- if (mVisibleNamePos == VisibleNamePos::Buttom)
- y = mDispName->getY() - offsetY;
+ if (mShowBadges == BadgeDrawType::Right)
+ {
+ const Font *restrict const font = gui->getFont();
+ x = mDispName->getX() - offsetX + mDispName->getWidth();
+ y = mDispName->getY() - offsetY - font->getHeight();
+ }
+ else if (mShowBadges == BadgeDrawType::Bottom)
+ {
+ x = px + 8 - mBadgesCount * 8;
+ if (mVisibleNamePos == VisibleNamePos::Buttom)
+ y = mDispName->getY() - offsetY;
+ else
+ y = py + getHeight() + 16;
+ }
else
- y = py + getHeight() + 16;
+ {
+ x = px + 8 - mBadgesCount * 8;
+ if (mVisibleNamePos == VisibleNamePos::Top)
+ y = py - mDispName->getHeight();
+ else
+ y = py;
+ }
}
else
{
- x = px + 8 - mBadgesCount * 8;
- if (mVisibleNamePos == VisibleNamePos::Top)
- y = py - mDispName->getHeight();
+ if (mShowBadges == BadgeDrawType::Right)
+ {
+ x = px + getWidth();
+ y = py;
+ }
+ else if (mShowBadges == BadgeDrawType::Bottom)
+ {
+ x = px + 8 - mBadgesCount * 8;
+ if (mVisibleNamePos == VisibleNamePos::Buttom)
+ y = py + getHeight();
+ else
+ y = py + getHeight() + 16;
+ }
else
+ {
+ x = px + 8 - mBadgesCount * 8;
y = py;
+ }
}
for_each_badges()
{