summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp56
1 files changed, 26 insertions, 30 deletions
diff --git a/src/being.cpp b/src/being.cpp
index db9a9deb..91fe4bc0 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -263,10 +263,8 @@ void Being::setPath(const Path &path)
void Being::setSpeech(const std::string &text, int time)
{
- // Remove colors
- mSpeech = removeColors(text);
-
- // Trim whitespace
+ mSpeech = text;
+ removeColors(mSpeech);
trim(mSpeech);
// Check for links
@@ -483,15 +481,15 @@ void Being::setShowName(bool doShowName)
void Being::setGuildName(const std::string &name)
{
- logger->log("Got guild name \"%s\" for being %s(%i)", name.c_str(),
- mName.c_str(), mId);
+ Log::info("Got guild name \"%s\" for being %s(%i)", name.c_str(),
+ mName.c_str(), mId);
}
void Being::setGuildPos(const std::string &pos)
{
- logger->log("Got guild position \"%s\" for being %s(%i)", pos.c_str(),
- mName.c_str(), mId);
+ Log::info("Got guild position \"%s\" for being %s(%i)", pos.c_str(),
+ mName.c_str(), mId);
}
void Being::addGuild(Guild *guild)
@@ -980,7 +978,7 @@ void Being::drawSpeech(int offsetX, int offsetY)
delete mText;
mText = nullptr;
- mSpeechBubble->setCaption(showName ? mName : "", mTextColor);
+ mSpeechBubble->setCaption(showName ? mName : std::string(), mNameColor);
mSpeechBubble->setText(mSpeech, showName);
mSpeechBubble->setPosition(px - (mSpeechBubble->getWidth() / 2),
@@ -1108,28 +1106,16 @@ void Being::restoreAllSpriteParticles()
void Being::updateColors()
{
- if (getType() == MONSTER)
- {
- mNameColor = &userPalette->getColor(UserPalette::MONSTER);
- mTextColor = &userPalette->getColor(UserPalette::MONSTER);
- }
- else if (getType() == NPC)
- {
- mNameColor = &userPalette->getColor(UserPalette::NPC);
- mTextColor = &userPalette->getColor(UserPalette::NPC);
- }
- else if (this == local_player)
- {
- mNameColor = &userPalette->getColor(UserPalette::SELF);
- mTextColor = &Theme::getThemeColor(Theme::PLAYER);
- }
- else
- {
- mTextColor = &userPalette->getColor(Theme::PLAYER);
-
- if (mIsGM)
+ switch (getType()) {
+ case ActorSprite::UNKNOWN:
+ return;
+ case ActorSprite::PLAYER:
+ if (this == local_player)
+ {
+ mNameColor = &userPalette->getColor(UserPalette::SELF);
+ }
+ else if (mIsGM)
{
- mTextColor = &userPalette->getColor(UserPalette::GM);
mNameColor = &userPalette->getColor(UserPalette::GM);
}
else if (mParty && mParty == local_player->getParty())
@@ -1140,6 +1126,16 @@ void Being::updateColors()
{
mNameColor = &userPalette->getColor(UserPalette::PC);
}
+ break;
+ case ActorSprite::NPC:
+ mNameColor = &userPalette->getColor(UserPalette::NPC);
+ break;
+ case ActorSprite::MONSTER:
+ mNameColor = &userPalette->getColor(UserPalette::MONSTER);
+ break;
+ case ActorSprite::FLOOR_ITEM:
+ case ActorSprite::PORTAL:
+ return;
}
if (mDispName)