From 1bc515864c9f317562b3edb0267a3cc4db5737ad Mon Sep 17 00:00:00 2001 From: Tametomo Date: Fri, 1 May 2009 02:18:56 -0600 Subject: De-hardcoded the color values for the minimap, and set them to their equivalent Palette color type. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Tametomo Signed-off-by: Bjørn Lindeijer --- src/gui/minimap.cpp | 30 ++++++++++++++++++++---------- src/player.h | 5 +++++ 2 files changed, 25 insertions(+), 10 deletions(-) (limited to 'src') 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(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 @@ -59,6 +59,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. * -- cgit v1.2.3-70-g09d2