Skip to content

Commit

Permalink
Small adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
kphoenix137 committed Mar 24, 2024
1 parent 41d4ea8 commit 41d78ed
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
15 changes: 5 additions & 10 deletions Source/control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1373,26 +1373,21 @@ void DrawDeathText(const Surface &out)
.spacing = 2
};
std::string text;
int largeTextHeight = 42;
Point linePosition { 0, gnScreenHeight / 2 - (largeTextHeight * 2) };
int verticalPadding = 42;
Point linePosition { 0, gnScreenHeight / 2 - (verticalPadding * 2) };

text = _("You have died");
DrawString(out, text, linePosition, largeTextOptions);
linePosition.y += largeTextHeight;
linePosition.y += verticalPadding;
if (!gbIsMultiplayer) {
if (gbValidSaveFile)
text = _("Press ESC to load last save.");
else
text = _("Press ESC to exit game.");
DrawString(out, text, linePosition, largeTextOptions);
} else {
text = _("Press ESC to continue.");
DrawString(out, text, linePosition, smallTextOptions);

linePosition.y += largeTextHeight;
text = fmt::format(fmt::runtime(_("Death takes its toll of {:d} Gold")), LostGold);
DrawString(out, text, linePosition, smallTextOptions);
text = _("Press ESC to continue.");
}
DrawString(out, text, linePosition, smallTextOptions);
}

void DrawGoldSplit(const Surface &out)
Expand Down
4 changes: 0 additions & 4 deletions Source/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ Player *MyPlayer;
std::vector<Player> Players;
Player *InspectPlayer;
bool MyPlayerIsDead;
int LostGold;

namespace {

Expand Down Expand Up @@ -390,9 +389,6 @@ void DropHalfPlayersGold(Player &player)
DropGold(player, remainingGold, false);
}

if (&player == MyPlayer)
LostGold = player._pGold / 2;

player._pGold /= 2;
}

Expand Down
2 changes: 0 additions & 2 deletions Source/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,4 @@ void SetPlrVit(Player &player, int v);
void InitDungMsgs(Player &player);
void PlayDungMsgs();

extern int LostGold;

} // namespace devilution

0 comments on commit 41d78ed

Please sign in to comment.