diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-07-21 14:15:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-07-21 14:15:43 +0300 |
commit | e2a97fe7991d05a721be8070f70cbfbd7c169698 (patch) | |
tree | 763ddca35111acc2caccb3578645e91374df8631 /src/being.cpp | |
parent | b5a9c89e9d4d8b21bceda9cf2507dc7f6b726c91 (diff) | |
download | manaplus-e2a97fe7991d05a721be8070f70cbfbd7c169698.tar.gz manaplus-e2a97fe7991d05a721be8070f70cbfbd7c169698.tar.bz2 manaplus-e2a97fe7991d05a721be8070f70cbfbd7c169698.tar.xz manaplus-e2a97fe7991d05a721be8070f70cbfbd7c169698.zip |
Add settings for monster hp bar offset.
New attributes: hpBarOffsetX, hpBarOffsetY
Example: <monster id="0" name="Piou" targetCursor="small" walkType="fly" hpBarOffsetX="30">
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/being.cpp b/src/being.cpp index fc0f9a9c3..1ed1700f4 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -2167,14 +2167,18 @@ bool Being::drawSpriteAt(Graphics *const graphics, drawHpBar(graphics, maxHP, mHP, mDamageTaken, UserPalette::MONSTER_HP, UserPalette::MONSTER_HP2, - x - 50 + 16, y + 32 - 6, 2 * 50, 4); + x - 50 + 16 + mInfo->getHpBarOffsetX(), + y + 32 - 6 + mInfo->getHpBarOffsetY(), + 2 * 50, 4); } - if (mShowOwnHP && player_node == this && mAction != DEAD) + if (mShowOwnHP && mInfo && player_node == this && mAction != DEAD) { drawHpBar(graphics, PlayerInfo::getAttribute(PlayerInfo::MAX_HP), PlayerInfo::getAttribute(PlayerInfo::HP), 0, UserPalette::PLAYER_HP, UserPalette::PLAYER_HP2, - x - 50 + 16, y + 32 - 6, 2 * 50, 4); + x - 50 + 16 + mInfo->getHpBarOffsetX(), + y + 32 - 6 + mInfo->getHpBarOffsetY(), + 2 * 50, 4); } return res; } |