summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-12-22 02:51:13 +0300
committerAndrei Karas <akaras@inbox.ru>2017-12-22 02:51:27 +0300
commitc58b6c63c89e18a9feef819f584426d329ff38ac (patch)
treec4a79de160b0cd21f99677a0ca8d547b9f40705b /src/being
parentb54c0e944974669c4b5c1eb3f8018547c2179630 (diff)
downloadmv-c58b6c63c89e18a9feef819f584426d329ff38ac.tar.gz
mv-c58b6c63c89e18a9feef819f584426d329ff38ac.tar.bz2
mv-c58b6c63c89e18a9feef819f584426d329ff38ac.tar.xz
mv-c58b6c63c89e18a9feef819f584426d329ff38ac.zip
Remove default parameters from userpalette.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp85
-rw-r--r--src/being/flooritem.cpp3
-rw-r--r--src/being/localplayer.cpp4
3 files changed, 60 insertions, 32 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 6bb49a0c8..769c0d93f 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -642,7 +642,7 @@ void Being::setSpeech(const std::string &restrict text) restrict2
mPixelX,
mPixelY - getHeight(),
Graphics::CENTER,
- &userPalette->getColor(UserColorId::PARTICLE),
+ &userPalette->getColor(UserColorId::PARTICLE, 255U),
Speech_true,
nullptr);
mText->adviseXY(mPixelX,
@@ -688,11 +688,13 @@ void Being::takeDamage(Being *restrict const attacker,
if (attacker == localPlayer)
{
color = &userPalette->getColor(
- UserColorId::HIT_LOCAL_PLAYER_CRITICAL);
+ UserColorId::HIT_LOCAL_PLAYER_CRITICAL,
+ 255U);
}
else
{
- color = &userPalette->getColor(UserColorId::HIT_CRITICAL);
+ color = &userPalette->getColor(UserColorId::HIT_CRITICAL,
+ 255U);
}
}
else if (amount == 0)
@@ -701,11 +703,13 @@ void Being::takeDamage(Being *restrict const attacker,
{
// This is intended to be the wrong direction to visually
// differentiate between hits and misses
- color = &userPalette->getColor(UserColorId::HIT_LOCAL_PLAYER_MISS);
+ color = &userPalette->getColor(UserColorId::HIT_LOCAL_PLAYER_MISS,
+ 255U);
}
else
{
- color = &userPalette->getColor(UserColorId::MISS);
+ color = &userPalette->getColor(UserColorId::MISS,
+ 255U);
}
}
else if (mType == ActorType::Monster ||
@@ -717,12 +721,14 @@ void Being::takeDamage(Being *restrict const attacker,
if (attacker == localPlayer)
{
color = &userPalette->getColor(
- UserColorId::HIT_LOCAL_PLAYER_MONSTER);
+ UserColorId::HIT_LOCAL_PLAYER_MONSTER,
+ 255U);
}
else
{
color = &userPalette->getColor(
- UserColorId::HIT_PLAYER_MONSTER);
+ UserColorId::HIT_PLAYER_MONSTER,
+ 255U);
}
}
else if (mType == ActorType::Player &&
@@ -730,13 +736,15 @@ void Being::takeDamage(Being *restrict const attacker,
this == localPlayer)
{
// here player was attacked by other player. mark him as enemy.
- color = &userPalette->getColor(UserColorId::HIT_PLAYER_PLAYER);
+ color = &userPalette->getColor(UserColorId::HIT_PLAYER_PLAYER,
+ 255U);
attacker->setEnemy(true);
attacker->updateColors();
}
else
{
- color = &userPalette->getColor(UserColorId::HIT_MONSTER_PLAYER);
+ color = &userPalette->getColor(UserColorId::HIT_MONSTER_PLAYER,
+ 255U);
}
if (chatWindow != nullptr && mShowBattleEvents)
@@ -2605,16 +2613,20 @@ void Being::setDefaultNameColor(const UserColorIdT defaultColor) restrict2
{
case 0:
default:
- mNameColor = &userPalette->getColor(defaultColor);
+ mNameColor = &userPalette->getColor(defaultColor,
+ 255U);
break;
case 1:
- mNameColor = &userPalette->getColor(UserColorId::TEAM1);
+ mNameColor = &userPalette->getColor(UserColorId::TEAM1,
+ 255U);
break;
case 2:
- mNameColor = &userPalette->getColor(UserColorId::TEAM2);
+ mNameColor = &userPalette->getColor(UserColorId::TEAM2,
+ 255U);
break;
case 3:
- mNameColor = &userPalette->getColor(UserColorId::TEAM3);
+ mNameColor = &userPalette->getColor(UserColorId::TEAM3,
+ 255U);
break;
}
}
@@ -2626,31 +2638,36 @@ void Being::updateColors()
if (mType == ActorType::Monster)
{
setDefaultNameColor(UserColorId::MONSTER);
- mTextColor = &userPalette->getColor(UserColorId::MONSTER);
+ mTextColor = &userPalette->getColor(UserColorId::MONSTER,
+ 255U);
}
else if (mType == ActorType::Npc)
{
setDefaultNameColor(UserColorId::NPC);
- mTextColor = &userPalette->getColor(UserColorId::NPC);
+ mTextColor = &userPalette->getColor(UserColorId::NPC,
+ 255U);
}
else if (mType == ActorType::Pet)
{
setDefaultNameColor(UserColorId::PET);
- mTextColor = &userPalette->getColor(UserColorId::PET);
+ mTextColor = &userPalette->getColor(UserColorId::PET,
+ 255U);
}
else if (mType == ActorType::Homunculus)
{
setDefaultNameColor(UserColorId::HOMUNCULUS);
- mTextColor = &userPalette->getColor(UserColorId::HOMUNCULUS);
+ mTextColor = &userPalette->getColor(UserColorId::HOMUNCULUS,
+ 255U);
}
else if (mType == ActorType::SkillUnit)
{
setDefaultNameColor(UserColorId::SKILLUNIT);
- mTextColor = &userPalette->getColor(UserColorId::SKILLUNIT);
+ mTextColor = &userPalette->getColor(UserColorId::SKILLUNIT,
+ 255U);
}
else if (this == localPlayer)
{
- mNameColor = &userPalette->getColor(UserColorId::SELF);
+ mNameColor = &userPalette->getColor(UserColorId::SELF, 255U);
mTextColor = &theme->getColor(ThemeColorId::PLAYER, 255);
}
else
@@ -2664,43 +2681,52 @@ void Being::updateColors()
if (mIsGM)
{
- mTextColor = &userPalette->getColor(UserColorId::GM);
- mNameColor = &userPalette->getColor(UserColorId::GM);
+ mTextColor = &userPalette->getColor(UserColorId::GM,
+ 255U);
+ mNameColor = &userPalette->getColor(UserColorId::GM,
+ 255U);
}
else if (mEnemy)
{
- mNameColor = &userPalette->getColor(UserColorId::ENEMY);
+ mNameColor = &userPalette->getColor(UserColorId::ENEMY,
+ 255U);
}
else if ((mParty != nullptr) && (localPlayer != nullptr)
&& mParty == localPlayer->getParty())
{
- mNameColor = &userPalette->getColor(UserColorId::PARTY);
+ mNameColor = &userPalette->getColor(UserColorId::PARTY,
+ 255U);
}
else if ((localPlayer != nullptr) && (getGuild() != nullptr)
&& getGuild() == localPlayer->getGuild())
{
- mNameColor = &userPalette->getColor(UserColorId::GUILD);
+ mNameColor = &userPalette->getColor(UserColorId::GUILD,
+ 255U);
}
else if (playerRelations.getRelation(mName) == Relation::FRIEND)
{
- mNameColor = &userPalette->getColor(UserColorId::FRIEND);
+ mNameColor = &userPalette->getColor(UserColorId::FRIEND,
+ 255U);
}
else if (playerRelations.getRelation(mName) ==
Relation::DISREGARDED
|| playerRelations.getRelation(mName) ==
Relation::BLACKLISTED)
{
- mNameColor = &userPalette->getColor(UserColorId::DISREGARDED);
+ mNameColor = &userPalette->getColor(UserColorId::DISREGARDED,
+ 255U);
}
else if (playerRelations.getRelation(mName)
== Relation::IGNORED ||
playerRelations.getRelation(mName) == Relation::ENEMY2)
{
- mNameColor = &userPalette->getColor(UserColorId::IGNORED);
+ mNameColor = &userPalette->getColor(UserColorId::IGNORED,
+ 255U);
}
else if (playerRelations.getRelation(mName) == Relation::ERASED)
{
- mNameColor = &userPalette->getColor(UserColorId::ERASED);
+ mNameColor = &userPalette->getColor(UserColorId::ERASED,
+ 255U);
}
else
{
@@ -4189,7 +4215,8 @@ void Being::drawPortalSpriteAt(Graphics *restrict const graphics,
if (mDrawHotKeys && !mName.empty())
{
- const Color &color = userPalette->getColor(UserColorId::BEING);
+ const Color &color = userPalette->getColor(UserColorId::BEING,
+ 255U);
gui->getFont()->drawString(graphics, color, color, mName, x, y);
}
}
diff --git a/src/being/flooritem.cpp b/src/being/flooritem.cpp
index 041531e86..2652d8c35 100644
--- a/src/being/flooritem.cpp
+++ b/src/being/flooritem.cpp
@@ -207,7 +207,8 @@ void FloorItem::draw(Graphics *const graphics,
if (font != nullptr && mAmount > 1)
{
const Color &color = userPalette->getColor(
- UserColorId::FLOOR_ITEM_TEXT);
+ UserColorId::FLOOR_ITEM_TEXT,
+ 255U);
font->drawString(graphics,
color, color,
toString(mAmount),
diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp
index 9cfdc4d82..35cfbda38 100644
--- a/src/being/localplayer.cpp
+++ b/src/being/localplayer.cpp
@@ -189,7 +189,7 @@ LocalPlayer::LocalPlayer(const BeingId id,
mAdvanced = true;
mTextColor = &theme->getColor(ThemeColorId::PLAYER, 255);
if (userPalette != nullptr)
- mNameColor = &userPalette->getColor(UserColorId::SELF);
+ mNameColor = &userPalette->getColor(UserColorId::SELF, 255U);
else
mNameColor = nullptr;
@@ -296,7 +296,7 @@ void LocalPlayer::logic()
info.first,
mPixelX,
mPixelY - 48,
- &userPalette->getColor(info.second),
+ &userPalette->getColor(info.second, 255U),
gui->getInfoParticleFont(),
true);
}