diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-08-28 20:29:06 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-08-28 20:29:06 +0000 |
commit | bdb09d26fc6c489228cb2c28be75024f9a49eb75 (patch) | |
tree | 28ea782fa98c6fe8b060da71a0bb626781ab1b5d /src/being.h | |
parent | 9a8456c6c95f5d95c568664ba5adaeb466cfbb0d (diff) | |
download | mana-bdb09d26fc6c489228cb2c28be75024f9a49eb75.tar.gz mana-bdb09d26fc6c489228cb2c28be75024f9a49eb75.tar.bz2 mana-bdb09d26fc6c489228cb2c28be75024f9a49eb75.tar.xz mana-bdb09d26fc6c489228cb2c28be75024f9a49eb75.zip |
Accepted Patch by Scraggy that moves text in such a way that no text overlaps
Diffstat (limited to 'src/being.h')
-rw-r--r-- | src/being.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/src/being.h b/src/being.h index c4f34503..d5fe7790 100644 --- a/src/being.h +++ b/src/being.h @@ -47,6 +47,7 @@ class Map; class Graphics; class ImageSet; class Particle; +class Text; /** * A position along a being's path. @@ -187,7 +188,7 @@ class Being : public Sprite * * @param name The name that should appear. */ - void + virtual void setName(const std::string &name) { mName = name; } /** @@ -239,24 +240,12 @@ class Being : public Sprite logic(); /** - * Draws the speech text above the being. - */ - void - drawSpeech(Graphics *graphics, int offsetX, int offsetY); - - /** * Draws the emotion picture above the being. */ void drawEmotion(Graphics *graphics, int offsetX, int offsetY); /** - * Draws the name text below the being. - */ - virtual void - drawName(Graphics *, int, int) {}; - - /** * Returns the type of the being. */ virtual Type getType() const; @@ -363,7 +352,11 @@ class Being : public Sprite */ void controlParticle(Particle *particle); - void setEmote(Uint8 emotion, Uint8 emote_time) { mEmotion = emotion; mEmotionTime = emote_time; } + void setEmote(Uint8 emotion, Uint8 emote_time) + { + mEmotion = emotion; + mEmotionTime = emote_time; + } /** * Triggers a visual effect, such as `level up' @@ -384,6 +377,11 @@ class Being : public Sprite void setPath(const Path &path); /** + * Let the sub-classes react to a replacement + */ + virtual void updateCoords() {} + + /** * Returns the sprite direction of this being. */ SpriteDirection getSpriteDirection() const; @@ -409,7 +407,7 @@ class Being : public Sprite const ItemInfo* mEquippedWeapon; Path mPath; - std::string mSpeech; + Text *mSpeech; Uint16 mHairStyle, mHairColor; Uint8 mGender; Uint32 mSpeechTime; |