summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-07-31 17:40:20 +0300
committerAndrei Karas <akaras@inbox.ru>2017-07-31 18:09:11 +0300
commitb0e37be06900f3889dfe9dffa55d799cad2f1f36 (patch)
tree6e48f177d48a8dfbe94f7844dbf30a73e80b7268 /src
parentd120817f73712bf2fd22be231200df752760d0d3 (diff)
downloadmv-b0e37be06900f3889dfe9dffa55d799cad2f1f36.tar.gz
mv-b0e37be06900f3889dfe9dffa55d799cad2f1f36.tar.bz2
mv-b0e37be06900f3889dfe9dffa55d799cad2f1f36.tar.xz
mv-b0e37be06900f3889dfe9dffa55d799cad2f1f36.zip
Show player name on fixed position on top.
Before it depend on sprite height and some times it was wrong.
Diffstat (limited to 'src')
-rw-r--r--src/being/being.cpp12
-rw-r--r--src/client.cpp2
-rw-r--r--src/defaults.cpp1
-rw-r--r--src/settings.h2
4 files changed, 8 insertions, 9 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index 6eae50281..31ea99b27 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -2292,9 +2292,7 @@ void Being::drawEmotion(Graphics *restrict const graphics,
}
else
{
- int height = getHeight();
- if (height < 64)
- height = 64;
+ int height = settings.playerNameOffset;
y = py + height + 16;
}
}
@@ -2317,9 +2315,7 @@ void Being::drawEmotion(Graphics *restrict const graphics,
else if (mShowBadges == BadgeDrawType::Bottom)
{
x = px + 8 - mBadgesCount * 8;
- int height = getHeight();
- if (height < 64)
- height = 64;
+ int height = settings.playerNameOffset;
if (mVisibleNamePos == VisibleNamePos::Buttom)
y = py + height;
else
@@ -2457,9 +2453,7 @@ void Being::updateCoords() restrict2
if (mType == ActorType::Monster ||
mVisibleNamePos == VisibleNamePos::Top)
{
- int height = getHeight();
- if (height < 64)
- height = 64;
+ int height = settings.playerNameOffset;
offsetY += - height - mDispName->getHeight();
}
diff --git a/src/client.cpp b/src/client.cpp
index 5867c9474..57e870b05 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -1730,6 +1730,8 @@ void Client::initPaths()
if (settings.linkCommandSymbol.empty())
settings.linkCommandSymbol = "=";
settings.overweightPercent = paths.getIntValue("overweightPercent");
+ settings.playerNameOffset = paths.getIntValue(
+ "playerNameOffset");
}
void Client::initTradeFilter()
diff --git a/src/defaults.cpp b/src/defaults.cpp
index 24aa3452c..934683f57 100644
--- a/src/defaults.cpp
+++ b/src/defaults.cpp
@@ -691,6 +691,7 @@ DefaultsData* getPathsDefaults()
AddDEF("defaultPaletteFile", "palette.gpl");
AddDEF("overweightPercent", 50);
+ AddDEF("playerNameStandOffset", 64);
#ifdef TMWA_SUPPORT
AddDEF("gmDefaultLevel", 60);
diff --git a/src/settings.h b/src/settings.h
index d9378b2db..7570e0df2 100644
--- a/src/settings.h
+++ b/src/settings.h
@@ -76,6 +76,7 @@ class Settings final
crazyMoveState(0U),
targetingType(0U),
overweightPercent(50U),
+ playerNameOffset(64),
mapDrawType(MapType::NORMAL),
emoteType(EmoteType::Player),
persistentIp(true),
@@ -137,6 +138,7 @@ class Settings final
unsigned int crazyMoveState;
unsigned int targetingType;
unsigned int overweightPercent;
+ int playerNameOffset;
MapTypeT mapDrawType;
EmoteTypeT emoteType;
bool persistentIp;