From f0d5e3da15a308fcc962590330e7d8e39e8874b9 Mon Sep 17 00:00:00 2001 From: Majin Sniper Date: Thu, 12 Mar 2009 22:42:42 +0100 Subject: 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. --- src/localplayer.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/localplayer.cpp') diff --git a/src/localplayer.cpp b/src/localplayer.cpp index d6acc48f..f72aa59a 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -37,6 +37,7 @@ #include "text.h" #include "gui/gui.h" +#include "gui/palette.h" #include "gui/storagewindow.h" #include "net/messageout.h" @@ -201,7 +202,9 @@ void LocalPlayer::logic() void LocalPlayer::setGM() { mIsGM = !mIsGM; - mNameColor = mIsGM ? 0x009000: 0x202020; + mNameColor = mIsGM ? + &guiPalette->getColor(Palette::GM) : + &guiPalette->getColor(Palette::PLAYER); setName(getName()); config.setValue(getName() + "GMassert", mIsGM); } @@ -608,10 +611,9 @@ void LocalPlayer::setXp(int xp) const std::string text = toString(xp - mXp) + " xp"; // Show XP number - particleEngine->addTextRiseFadeOutEffect(text, - gui->getInfoParticleFont(), - mPx + 16, mPy - 16, - 255, 255, 0, true); + particleEngine->addTextRiseFadeOutEffect(text, mPx + 16, mPy - 16, + &guiPalette->getColor(Palette::EXP_INFO), + gui->getInfoParticleFont(), true); } mXp = xp; } @@ -621,10 +623,9 @@ void LocalPlayer::pickedUp(std::string item) if (mMap) { // Show pickup notification - particleEngine->addTextRiseFadeOutEffect(item, - gui->getInfoParticleFont (), - mPx + 16, mPy - 16, - 40, 220, 40, true); + particleEngine->addTextRiseFadeOutEffect(item, mPx + 16, mPy - 16, + &guiPalette->getColor(Palette::PICKUP_INFO), + gui->getInfoParticleFont (), true); } } -- cgit v1.2.3-60-g2f50