diff --git a/Source/automap.cpp b/Source/automap.cpp index f2f870633..238e57a08 100644 --- a/Source/automap.cpp +++ b/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 LoadAutomapData(size_t &tileCount) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 119d4c8d3..c6de57a18 100644 --- a/Source/diablo.cpp +++ b/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(); });