From 036df13f60e4d5c4e30d92c09fa376c147a68e9c Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 16 Oct 2016 01:58:12 +0300 Subject: Add option to show player name only for selected player. --- src/being/being.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/being/being.cpp') 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( + 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 -- cgit v1.2.3-60-g2f50