diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-09 16:14:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-09 16:14:29 +0300 |
commit | d1e0481311baa698d9febff251babc7d955b50ed (patch) | |
tree | bd1010649dd0215927407b4050897d113ba2ee4c /src | |
parent | 1fe5aff1f892886b5362f0921b5c047c1896daa5 (diff) | |
download | manaplus-d1e0481311baa698d9febff251babc7d955b50ed.tar.gz manaplus-d1e0481311baa698d9febff251babc7d955b50ed.tar.bz2 manaplus-d1e0481311baa698d9febff251babc7d955b50ed.tar.xz manaplus-d1e0481311baa698d9febff251babc7d955b50ed.zip |
Fix show overhead message with format "text".
Diffstat (limited to 'src')
-rw-r--r-- | src/being/being.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index e3a690441..6721d4031 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -547,7 +547,7 @@ void Being::setPixelPositionF(const Vector &restrict pos) restrict2 if (mText) { mText->adviseXY(CAST_S32(pos.x), - CAST_S32(pos.y) - getHeight() - mText->getHeight() - 6, + CAST_S32(pos.y) - getHeight() - mText->getHeight() - 9, mMoveNames); } } @@ -657,12 +657,16 @@ void Being::setSpeech(const std::string &restrict text, if (speech == BeingSpeech::TEXT_OVERHEAD) { delete mText; + mText = nullptr; mText = new Text(mSpeech, mPixelX, mPixelY - getHeight(), Graphics::CENTER, &userPalette->getColor(UserColorId::PARTICLE), Speech_true); + mText->adviseXY(mPixelX, + (mY + 1) * mapTileSize - getHeight() - mText->getHeight() - 9, + mMoveNames); } else { @@ -1802,13 +1806,7 @@ void Being::logic() restrict2 { mSpeechTime--; if (mSpeechTime == 0 && mText != nullptr) - { - delete2(mText) - } - else if (mText != nullptr) - { delete2(mText) - } } const int time = tick_time * MILLISECONDS_IN_A_TICK; @@ -2228,6 +2226,9 @@ void Being::drawSpeech(const int offsetX, Graphics::CENTER, &theme->getColor(ThemeColorId::BUBBLE_TEXT, 255), Speech_true); + mText->adviseXY(mPixelX, + (mY + 1) * mapTileSize - getHeight() - mText->getHeight() - 9, + mMoveNames); } } else if (speech == BeingSpeech::NO_SPEECH) |