diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-03-04 22:41:19 -0700 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-03-12 14:49:27 -0700 |
commit | 781b3c9f17708cc5fe08eb3c9ee38d596364d97c (patch) | |
tree | 833797c9b9168ab58864ffe4cf8ed028060e44a2 /src/being.cpp | |
parent | 96b64757954f07d196599b3c1131a6603982c930 (diff) | |
download | mana-781b3c9f17708cc5fe08eb3c9ee38d596364d97c.tar.gz mana-781b3c9f17708cc5fe08eb3c9ee38d596364d97c.tar.bz2 mana-781b3c9f17708cc5fe08eb3c9ee38d596364d97c.tar.xz mana-781b3c9f17708cc5fe08eb3c9ee38d596364d97c.zip |
Split Palette into Theme and UserPalette
Themes can now control the colors they use. Colors in the Viewport (being
names, particles, etc) can still be changed by the user. Also make
ProgressBars more easily colored. DyePalette was made more flexible in the
process.
Also fixes comparing strings of different lengths insensitively.
Reviewed-by: Thorbjørn Lindeijer
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/being.cpp b/src/being.cpp index 2c7ba016..72bdef3d 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -35,7 +35,10 @@ #include "text.h" #include "statuseffect.h" +#include "gui/gui.h" #include "gui/speechbubble.h" +#include "gui/theme.h" +#include "gui/userpalette.h" #include "resources/colordb.h" #include "resources/emotedb.h" @@ -44,9 +47,6 @@ #include "resources/iteminfo.h" #include "resources/resourcemanager.h" -#include "gui/gui.h" -#include "gui/palette.h" -#include "gui/speechbubble.h" #include "utils/dtor.h" #include "utils/stringutils.h" @@ -96,8 +96,8 @@ Being::Being(int id, int job, Map *map): mSpeechBubble = new SpeechBubble; - mNameColor = &guiPalette->getColor(Palette::NPC); - mTextColor = &guiPalette->getColor(Palette::CHAT); + mNameColor = &userPalette->getColor(UserPalette::NPC); + mTextColor = &Theme::getThemeColor(Theme::CHAT); mWalkSpeed = Net::getPlayerHandler()->getDefaultWalkSpeed(); } @@ -305,7 +305,7 @@ void Being::setSpeech(const std::string &text, int time) mText = new Text(mSpeech, getPixelX(), getPixelY() - getHeight(), gcn::Graphics::CENTER, - &guiPalette->getColor(Palette::PARTICLE), + &userPalette->getColor(UserPalette::PARTICLE), true); } } @@ -322,7 +322,7 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type) // Selecting the right color if (type == CRITICAL || type == FLEE) { - color = &guiPalette->getColor(Palette::HIT_CRITICAL); + color = &userPalette->getColor(UserPalette::HIT_CRITICAL); } else if (!amount) { @@ -330,20 +330,20 @@ void Being::takeDamage(Being *attacker, int amount, AttackType type) { // This is intended to be the wrong direction to visually // differentiate between hits and misses - color = &guiPalette->getColor(Palette::HIT_MONSTER_PLAYER); + color = &userPalette->getColor(UserPalette::HIT_MONSTER_PLAYER); } else { - color = &guiPalette->getColor(Palette::MISS); + color = &userPalette->getColor(UserPalette::MISS); } } else if (getType() == MONSTER) { - color = &guiPalette->getColor(Palette::HIT_PLAYER_MONSTER); + color = &userPalette->getColor(UserPalette::HIT_PLAYER_MONSTER); } else { - color = &guiPalette->getColor(Palette::HIT_MONSTER_PLAYER); + color = &userPalette->getColor(UserPalette::HIT_MONSTER_PLAYER); } // Show damage number @@ -783,7 +783,7 @@ void Being::drawSpeech(int offsetX, int offsetY) mText = new Text(mSpeech, getPixelX(), getPixelY() - getHeight(), gcn::Graphics::CENTER, - &guiPalette->getColor(Palette::PARTICLE), + &userPalette->getColor(UserPalette::PARTICLE), true); } } |