summaryrefslogtreecommitdiff
path: root/src/gui/minimap.cpp
diff options
context:
space:
mode:
authorTametomo <irarice@gmail.com>2009-05-01 02:18:56 -0600
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-05-03 11:36:59 +0200
commit1bc515864c9f317562b3edb0267a3cc4db5737ad (patch)
tree402de13d4951f65dc13d6f8149fafc61e7edbe15 /src/gui/minimap.cpp
parentd592883f61eef2abb7829a6b624d2c85fe54dd5e (diff)
downloadmana-client-1bc515864c9f317562b3edb0267a3cc4db5737ad.tar.gz
mana-client-1bc515864c9f317562b3edb0267a3cc4db5737ad.tar.bz2
mana-client-1bc515864c9f317562b3edb0267a3cc4db5737ad.tar.xz
mana-client-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>
Diffstat (limited to 'src/gui/minimap.cpp')
-rw-r--r--src/gui/minimap.cpp30
1 files changed, 20 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: