Browse Source

Show game Difficulty in Automap (#3867)

pull/3876/head
KPhoenix 4 years ago committed by GitHub
parent
commit
d544a467e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 20
      Source/automap.cpp
  2. 10
      Source/diablo.cpp

20
Source/automap.cpp

@ -18,6 +18,7 @@
#include "utils/language.h"
#include "utils/stdcompat/algorithm.hpp"
#include "utils/ui_fwd.h"
#include "utils/utf8.hpp"
namespace devilution {
@ -481,13 +482,13 @@ void DrawAutomapText(const Surface &out)
if (gbIsMultiplayer) {
if (strcasecmp("0.0.0.0", szPlayerName) != 0) {
strcat(strcpy(desc, _("game: ")), szPlayerName);
strcat(strcpy(desc, _("Game: ")), szPlayerName);
DrawString(out, desc, linePosition);
linePosition.y += 15;
}
if (!PublicGame)
strcat(strcpy(desc, _("password: ")), szPlayerDescript);
strcat(strcpy(desc, _("Password: ")), szPlayerDescript);
else
strcpy(desc, _("Public Game"));
DrawString(out, desc, linePosition);
@ -509,7 +510,22 @@ void DrawAutomapText(const Surface &out)
}
DrawString(out, desc, linePosition);
linePosition.y += 15;
}
string_view difficulty;
switch (sgGameInitInfo.nDifficulty) {
case DIFF_NORMAL:
difficulty = _("Normal");
break;
case DIFF_NIGHTMARE:
difficulty = _("Nightmare");
break;
case DIFF_HELL:
difficulty = _("Hell");
break;
}
CopyUtf8(desc, fmt::format(_(/* TRANSLATORS: {:s} means: Game Difficulty. */ "Difficulty: {:s}"), difficulty), sizeof(desc));
DrawString(out, desc, linePosition);
}
std::unique_ptr<AutomapTile[]> LoadAutomapData(size_t &tileCount)

10
Source/diablo.cpp

@ -1485,16 +1485,10 @@ void InitKeymapActions()
N_("Displays game infos."),
'V',
[] {
const char *difficulties[3] = {
_("Normal"),
_("Nightmare"),
_("Hell"),
};
EventPlrMsg(fmt::format(
_(/* TRANSLATORS: {:s} means: Character Name, Game Version, Game Difficulty. */ "{:s} {:s}, Difficulty: {:s}"),
_(/* TRANSLATORS: {:s} means: Character Name, Game Version, Game Difficulty. */ "{:s} {:s}"),
PROJECT_NAME,
PROJECT_VERSION,
difficulties[sgGameInitInfo.nDifficulty]),
PROJECT_VERSION),
UiFlags::ColorWhite);
},
[&]() { return !IsPlayerDead(); });

Loading…
Cancel
Save