summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-08-28 20:29:06 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-08-28 20:29:06 +0000
commitbdb09d26fc6c489228cb2c28be75024f9a49eb75 (patch)
tree28ea782fa98c6fe8b060da71a0bb626781ab1b5d /src/player.h
parent9a8456c6c95f5d95c568664ba5adaeb466cfbb0d (diff)
downloadmana-client-bdb09d26fc6c489228cb2c28be75024f9a49eb75.tar.gz
mana-client-bdb09d26fc6c489228cb2c28be75024f9a49eb75.tar.bz2
mana-client-bdb09d26fc6c489228cb2c28be75024f9a49eb75.tar.xz
mana-client-bdb09d26fc6c489228cb2c28be75024f9a49eb75.zip
Accepted Patch by Scraggy that moves text in such a way that no text overlaps
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h47
1 files changed, 14 insertions, 33 deletions
diff --git a/src/player.h b/src/player.h
index fe24ceed..6347b0a6 100644
--- a/src/player.h
+++ b/src/player.h
@@ -25,23 +25,11 @@
#define _TMW_PLAYER_H
#include "being.h"
+#include "text.h"
class Graphics;
class Map;
-class Player;
-
-class PlayerNameDrawStrategy
-{
-public:
- virtual ~PlayerNameDrawStrategy(void) {}
-
- /**
- * Draw the player's name
- */
- virtual void draw(Player *p, Graphics *graphics, int px, int py) = 0;
-};
-
/**
* A player being. Players have their name drawn beneath them. This class also
* implements player-specific loading of base sprite, hair sprite and equipment
@@ -52,6 +40,14 @@ class Player : public Being
public:
Player(int id, int job, Map *map);
+ ~Player();
+
+ /**
+ * Set up mName to be the character's name
+ */
+ virtual void
+ setName(const std::string &name);
+
virtual void
logic();
@@ -59,9 +55,6 @@ class Player : public Being
getType() const;
virtual void
- drawName(Graphics *graphics, int offsetX, int offsetY);
-
- virtual void
setGender(int gender);
/**
@@ -83,27 +76,15 @@ class Player : public Being
setSprite(int slot, int id, std::string color = "");
/**
- * Sets the strategy responsible for drawing the player's name
- *
- * \param draw_strategy A strategy describing how the player's name
- * should be drawn, or NULL for default
+ * Flash the player's name
*/
- virtual void
- setNameDrawStrategy(PlayerNameDrawStrategy *draw_strategy);
-
- virtual PlayerNameDrawStrategy *
- getNameDrawStrategy(void) const { return mDrawStrategy; }
+ void flash(int time);
- /**
- * Triggers a visual/audio effect, such as `level up'
- *
- * \param effect_id ID of the effect to trigger
- */
- virtual void
- triggerEffect(int effectId) { internalTriggerEffect(effectId, true, true); }
+ protected:
+ void updateCoords();
private:
- PlayerNameDrawStrategy *mDrawStrategy;
+ FlashText *mName;
};
#endif