summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
authorMajin Sniper <majinsniper@gmx.de>2009-03-12 22:42:42 +0100
committerJared Adams <jaxad0127@gmail.com>2009-03-12 19:38:55 -0600
commit3b1fbbe072e4da86be4c8f8f22655d04565379d2 (patch)
tree9bae46138230c01fd2998395e146556f9a9db05b /src/being.cpp
parentb9191530c81595b0ad3d2faa6c4d21d75a720c29 (diff)
downloadmana-3b1fbbe072e4da86be4c8f8f22655d04565379d2.tar.gz
mana-3b1fbbe072e4da86be4c8f8f22655d04565379d2.tar.bz2
mana-3b1fbbe072e4da86be4c8f8f22655d04565379d2.tar.xz
mana-3b1fbbe072e4da86be4c8f8f22655d04565379d2.zip
Make use of the new available colors
This patch lets all being derivatives use the palette to set their name's colors. Text Particle Effects all respect the new settings. Some widgets were updated to use the colors.
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp37
1 files changed, 14 insertions, 23 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 60fb8d13..66273710 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -45,6 +45,7 @@
#include "resources/resourcemanager.h"
#include "gui/gui.h"
+#include "gui/palette.h"
#include "gui/speechbubble.h"
#include "utils/dtor.h"
@@ -101,7 +102,7 @@ Being::Being(int id, int job, Map *map):
mSpeechBubble = new SpeechBubble;
mSpeech = "";
- mNameColor = 0x202020;
+ mNameColor = &guiPalette->getColor(Palette::CHAT);
mText = 0;
}
@@ -202,17 +203,14 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type)
gcn::Font *font;
std::string damage = amount ? toString(amount) : type == FLEE ?
"dodge" : "miss";
-
- int red, green, blue;
+ const gcn::Color* color;
font = gui->getInfoParticleFont();
// Selecting the right color
if (type == CRITICAL || type == FLEE)
{
- red = 255;
- green = 128;
- blue = 0;
+ color = &guiPalette->getColor(Palette::HIT_CRITICAL);
}
else if (!amount)
{
@@ -220,33 +218,25 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type)
{
// This is intended to be the wrong direction to visually
// differentiate between hits and misses
- red = 0;
- green = 100;
- blue = 255;
+ color = &guiPalette->getColor(Palette::HIT_MONSTER_PLAYER);
}
else
{
- red = 255;
- green = 255;
- blue = 0;
- }
- }
+ color = &guiPalette->getColor(Palette::MISS);
+ }
+ }
else if (getType() == MONSTER)
{
- red = 0;
- green = 100;
- blue = 255;
+ color = &guiPalette->getColor(Palette::HIT_PLAYER_MONSTER);
}
else
{
- red = 255;
- green = 50;
- blue = 50;
+ color = &guiPalette->getColor(Palette::HIT_MONSTER_PLAYER);
}
// Show damage number
- particleEngine->addTextSplashEffect(damage, red, green, blue, font,
- mPx + 16, mPy + 16, true);
+ particleEngine->addTextSplashEffect(damage, mPx + 16, mPy + 16,
+ color, font, true);
if (amount > 0)
{
@@ -531,7 +521,8 @@ void Being::drawSpeech(int offsetX, int offsetY)
delete mText;
mText = new Text(mSpeech, mPx + X_SPEECH_OFFSET, mPy - Y_SPEECH_OFFSET,
- gcn::Graphics::CENTER, gcn::Color(255, 255, 255));
+ gcn::Graphics::CENTER,
+ &guiPalette->getColor(Palette::PARTICLE));
}
else if (speech == NO_SPEECH)
{