summaryrefslogtreecommitdiff
path: root/src/being/being.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-10-16 01:58:12 +0300
committerAndrei Karas <akaras@inbox.ru>2016-10-16 01:58:12 +0300
commit036df13f60e4d5c4e30d92c09fa376c147a68e9c (patch)
treea976693604fb050bb0f81681621e797a8162f6c6 /src/being/being.cpp
parentbdc9cb6d5886af2bf068bfb5ea37f724f0cecae6 (diff)
downloadmv-036df13f60e4d5c4e30d92c09fa376c147a68e9c.tar.gz
mv-036df13f60e4d5c4e30d92c09fa376c147a68e9c.tar.bz2
mv-036df13f60e4d5c4e30d92c09fa376c147a68e9c.tar.xz
mv-036df13f60e4d5c4e30d92c09fa376c147a68e9c.zip
Add option to show player name only for selected player.s20161017
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r--src/being/being.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 5ad4a1006..c401f9d0b 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -275,7 +275,7 @@ Being::Being(const BeingId id,
setMap(map);
setSubtype(subtype, 0);
- bool showName1 = false;
+ VisibleName::Type showName1 = VisibleName::Hide;
switch (mType)
{
@@ -284,11 +284,12 @@ Being::Being(const BeingId id,
case ActorType::Pet:
case ActorType::Homunculus:
case ActorType::Elemental:
- showName1 = config.getBoolValue("visiblenames");
+ showName1 = static_cast<VisibleName::Type>(
+ config.getIntValue("visiblenames"));
break;
case ActorType::Portal:
case ActorType::SkillUnit:
- showName1 = false;
+ showName1 = VisibleName::Hide;
break;
default:
case ActorType::Unknown:
@@ -306,10 +307,11 @@ Being::Being(const BeingId id,
reReadConfig();
- if (mType == ActorType::Npc)
+ if (mType == ActorType::Npc ||
+ showName1 == VisibleName::Show)
+ {
setShowName(true);
- else if (showName1)
- setShowName(showName1);
+ }
updateColors();
updatePercentHP();
@@ -2398,7 +2400,7 @@ void Being::updateCoords() restrict2
void Being::optionChanged(const std::string &restrict value) restrict2
{
if (mType == ActorType::Player && value == "visiblenames")
- setShowName(config.getBoolValue("visiblenames"));
+ setShowName(config.getIntValue("visiblenames") == VisibleName::Show);
}
void Being::flashName(const int time) restrict2