diff --git a/Source/DiabloUI/selconn.cpp b/Source/DiabloUI/selconn.cpp index c780055db..c7b55e812 100644 --- a/Source/DiabloUI/selconn.cpp +++ b/Source/DiabloUI/selconn.cpp @@ -4,7 +4,6 @@ #include "stores.h" #include "storm/storm_net.hpp" #include "utils/language.h" -#include "utils/utf8.hpp" namespace devilution { @@ -105,22 +104,21 @@ void SelconnFocus(int value) int players = MAX_PLRS; switch (vecConnItems[value]->m_value) { case SELCONN_TCP: - CopyUtf8(selconn_Description, _("All computers must be connected to a TCP-compatible network."), sizeof(selconn_Description)); + strcpy(selconn_Description, _("All computers must be connected to a TCP-compatible network.")); players = MAX_PLRS; break; case SELCONN_ZT: - CopyUtf8(selconn_Description, _("All computers must be connected to the internet."), sizeof(selconn_Description)); + strcpy(selconn_Description, _("All computers must be connected to the internet.")); players = MAX_PLRS; break; case SELCONN_LOOPBACK: - CopyUtf8(selconn_Description, _("Play by yourself with no network exposure."), sizeof(selconn_Description)); + strcpy(selconn_Description, _("Play by yourself with no network exposure.")); players = 1; break; } - CopyUtf8(selconn_MaxPlayers, fmt::format(_("Players Supported: {:d}"), players), sizeof(selconn_MaxPlayers)); - const std::string wrapped = WordWrapString(selconn_Description, DESCRIPTION_WIDTH); - CopyUtf8(selconn_Description, wrapped, sizeof(selconn_Description)); + strcpy(selconn_MaxPlayers, fmt::format(_("Players Supported: {:d}"), players).c_str()); + strcpy(selconn_Description, WordWrapString(selconn_Description, DESCRIPTION_WIDTH).c_str()); } void SelconnSelect(int value) diff --git a/Source/DiabloUI/selgame.cpp b/Source/DiabloUI/selgame.cpp index a22eadf8d..148ff79ac 100644 --- a/Source/DiabloUI/selgame.cpp +++ b/Source/DiabloUI/selgame.cpp @@ -12,7 +12,6 @@ #include "options.h" #include "storm/storm_net.hpp" #include "utils/language.h" -#include "utils/utf8.hpp" namespace devilution { @@ -120,20 +119,19 @@ void selgame_GameSelection_Focus(int value) HighlightedItem = value; switch (vecSelGameDlgItems[value]->m_value) { case 0: - CopyUtf8(selgame_Description, _("Create a new game with a difficulty setting of your choice."), sizeof(selgame_Description)); + strcpy(selgame_Description, _("Create a new game with a difficulty setting of your choice.")); break; case 1: - CopyUtf8(selgame_Description, _("Create a new public game that anyone can join with a difficulty setting of your choice."), sizeof(selgame_Description)); + strcpy(selgame_Description, _("Create a new public game that anyone can join with a difficulty setting of your choice.")); break; case 2: - CopyUtf8(selgame_Description, _("Enter an IP or a hostname and join a game already in progress at that address."), sizeof(selgame_Description)); + strcpy(selgame_Description, _("Enter an IP or a hostname and join a game already in progress at that address.")); break; default: - CopyUtf8(selgame_Description, _("Join the public game already in progress at this address."), sizeof(selgame_Description)); + strcpy(selgame_Description, _("Join the public game already in progress at this address.")); break; } - const std::string wrapped = WordWrapString(selgame_Description, DESCRIPTION_WIDTH); - CopyUtf8(selgame_Description, wrapped.data(), sizeof(selgame_Description)); + strcpy(selgame_Description, WordWrapString(selgame_Description, DESCRIPTION_WIDTH).c_str()); } /** @@ -237,20 +235,19 @@ void selgame_Diff_Focus(int value) { switch (vecSelGameDlgItems[value]->m_value) { case DIFF_NORMAL: - CopyUtf8(selgame_Label, _("Normal"), sizeof(selgame_Label)); - CopyUtf8(selgame_Description, _("Normal Difficulty\nThis is where a starting character should begin the quest to defeat Diablo."), sizeof(selgame_Description)); + strcpy(selgame_Label, _("Normal")); + strcpy(selgame_Description, _("Normal Difficulty\nThis is where a starting character should begin the quest to defeat Diablo.")); break; case DIFF_NIGHTMARE: - CopyUtf8(selgame_Label, _("Nightmare"), sizeof(selgame_Label)); - CopyUtf8(selgame_Description, _("Nightmare Difficulty\nThe denizens of the Labyrinth have been bolstered and will prove to be a greater challenge. This is recommended for experienced characters only."), sizeof(selgame_Description)); + strcpy(selgame_Label, _("Nightmare")); + strcpy(selgame_Description, _("Nightmare Difficulty\nThe denizens of the Labyrinth have been bolstered and will prove to be a greater challenge. This is recommended for experienced characters only.")); break; case DIFF_HELL: - CopyUtf8(selgame_Label, _("Hell"), sizeof(selgame_Label)); - CopyUtf8(selgame_Description, _("Hell Difficulty\nThe most powerful of the underworld's creatures lurk at the gateway into Hell. Only the most experienced characters should venture in this realm."), sizeof(selgame_Description)); + strcpy(selgame_Label, _("Hell")); + strcpy(selgame_Description, _("Hell Difficulty\nThe most powerful of the underworld's creatures lurk at the gateway into Hell. Only the most experienced characters should venture in this realm.")); break; } - const std::string wrapped = WordWrapString(selgame_Description, DESCRIPTION_WIDTH); - CopyUtf8(selgame_Description, wrapped, sizeof(selgame_Description)); + strcpy(selgame_Description, WordWrapString(selgame_Description, DESCRIPTION_WIDTH).c_str()); } bool IsDifficultyAllowed(int value) @@ -362,24 +359,23 @@ void selgame_Speed_Focus(int value) { switch (vecSelGameDlgItems[value]->m_value) { case 20: - CopyUtf8(selgame_Label, _("Normal"), sizeof(selgame_Label)); - CopyUtf8(selgame_Description, _("Normal Speed\nThis is where a starting character should begin the quest to defeat Diablo."), sizeof(selgame_Description)); + strcpy(selgame_Label, _("Normal")); + strcpy(selgame_Description, _("Normal Speed\nThis is where a starting character should begin the quest to defeat Diablo.")); break; case 30: - CopyUtf8(selgame_Label, _("Fast"), sizeof(selgame_Label)); - CopyUtf8(selgame_Description, _("Fast Speed\nThe denizens of the Labyrinth have been hastened and will prove to be a greater challenge. This is recommended for experienced characters only."), sizeof(selgame_Description)); + strcpy(selgame_Label, _("Fast")); + strcpy(selgame_Description, _("Fast Speed\nThe denizens of the Labyrinth have been hastened and will prove to be a greater challenge. This is recommended for experienced characters only.")); break; case 40: - CopyUtf8(selgame_Label, _("Faster"), sizeof(selgame_Label)); - CopyUtf8(selgame_Description, _("Faster Speed\nMost monsters of the dungeon will seek you out quicker than ever before. Only an experienced champion should try their luck at this speed."), sizeof(selgame_Description)); + strcpy(selgame_Label, _("Faster")); + strcpy(selgame_Description, _("Faster Speed\nMost monsters of the dungeon will seek you out quicker than ever before. Only an experienced champion should try their luck at this speed.")); break; case 50: - CopyUtf8(selgame_Label, _("Fastest"), sizeof(selgame_Label)); - CopyUtf8(selgame_Description, _("Fastest Speed\nThe minions of the underworld will rush to attack without hesitation. Only a true speed demon should enter at this pace."), sizeof(selgame_Description)); + strcpy(selgame_Label, _("Fastest")); + strcpy(selgame_Description, _("Fastest Speed\nThe minions of the underworld will rush to attack without hesitation. Only a true speed demon should enter at this pace.")); break; } - const std::string wrapped = WordWrapString(selgame_Description, DESCRIPTION_WIDTH); - CopyUtf8(selgame_Description, wrapped, sizeof(selgame_Description)); + strcpy(selgame_Description, WordWrapString(selgame_Description, DESCRIPTION_WIDTH).c_str()); } void selgame_Speed_Esc() diff --git a/Source/DiabloUI/selhero.cpp b/Source/DiabloUI/selhero.cpp index dd07a0990..1532cb08a 100644 --- a/Source/DiabloUI/selhero.cpp +++ b/Source/DiabloUI/selhero.cpp @@ -16,7 +16,6 @@ #include "options.h" #include "pfile.h" #include "utils/language.h" -#include "utils/utf8.hpp" #include