diff options
author | Tametomo <irarice@gmail.com> | 2009-05-01 02:18:56 -0600 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-05-03 11:36:59 +0200 |
commit | 1bc515864c9f317562b3edb0267a3cc4db5737ad (patch) | |
tree | 402de13d4951f65dc13d6f8149fafc61e7edbe15 | |
parent | d592883f61eef2abb7829a6b624d2c85fe54dd5e (diff) | |
download | mana-1bc515864c9f317562b3edb0267a3cc4db5737ad.tar.gz mana-1bc515864c9f317562b3edb0267a3cc4db5737ad.tar.bz2 mana-1bc515864c9f317562b3edb0267a3cc4db5737ad.tar.xz mana-1bc515864c9f317562b3edb0267a3cc4db5737ad.zip |
De-hardcoded the color values for the minimap, and set them to their
equivalent Palette color type.
Signed-off-by: Tametomo <irarice@gmail.com>
Signed-off-by: Bjørn Lindeijer <bjorn@lindeijer.nl>
-rw-r--r-- | src/gui/minimap.cpp | 30 | ||||
-rw-r--r-- | src/player.h | 5 |
2 files changed, 25 insertions, 10 deletions
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp index 8fc4c9ff..b4a70d18 100644 --- a/src/gui/minimap.cpp +++ b/src/gui/minimap.cpp @@ -26,8 +26,11 @@ #include "configuration.h" #include "graphics.h" #include "localplayer.h" -#include "map.h" #include "log.h" +#include "map.h" +#include "player.h" + +#include "gui/palette.h" #include "resources/image.h" #include "resources/resourcemanager.h" @@ -167,27 +170,34 @@ void Minimap::draw(gcn::Graphics *graphics) for (Beings::const_iterator bi = beings.begin(), bi_end = beings.end(); bi != bi_end; ++bi) { - const Being *being = (*bi); + Being *being = (*bi); int dotSize = 2; switch (being->getType()) { case Being::PLAYER: - if (being == player_node) { - dotSize = 3; - graphics->setColor(gcn::Color(61, 209, 52)); + Palette::ColorType type = Palette::PC; + + if (being == player_node) + { + type = Palette::SELF; + dotSize = 3; + } + + if (static_cast<Player*>(being)->isGM()) + type = Palette::GM_NAME; + + graphics->setColor(guiPalette->getColor(type)); break; - } - graphics->setColor(gcn::Color(61, 52, 209)); - break; + } case Being::MONSTER: - graphics->setColor(gcn::Color(209, 52, 61)); + graphics->setColor(guiPalette->getColor(Palette::MONSTER)); break; case Being::NPC: - graphics->setColor(gcn::Color(255, 255, 0)); + graphics->setColor(guiPalette->getColor(Palette::NPC)); break; default: diff --git a/src/player.h b/src/player.h index d1155f4b..53b70b1d 100644 --- a/src/player.h +++ b/src/player.h @@ -60,6 +60,11 @@ class Player : public Being virtual void setGender(Gender gender); /** + * Whether or not this player is a GM. + */ + bool isGM() { return mIsGM; } + + /** * Sets the hair style and color for this player. * * Only for convenience in 0.0 client. When porting |