From a9ee5940fcfcbdf1af1ced1ea20e8f95585b5d68 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 25 Nov 2019 00:28:59 +0100 Subject: [PATCH] - localization wrappers Currently a no-op, but if it's in it won't be forgotten later. --- source/common/utility/stringtable.h | 12 ++++++++++++ source/duke3d/src/gamedef.cpp | 5 +++-- source/rr/src/gamedef.cpp | 5 +++-- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/source/common/utility/stringtable.h b/source/common/utility/stringtable.h index e4137de3d..c9f71bfa2 100644 --- a/source/common/utility/stringtable.h +++ b/source/common/utility/stringtable.h @@ -111,6 +111,18 @@ private: void DeleteForLabel(int lumpnum, FName label); static size_t ProcessEscapes (char *str); +public: + static FString MakeMacro(const char *str) + { + //return FStringf("${%s}", str); + return str; + } + + static FString MakeMacro(const char *str, size_t len) + { + //return FStringf("${%.*s}", len, str); + return FString(str, len); + } }; #endif //__STRINGTABLE_H__ diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 8af2b6b0c..3893ceb09 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -37,6 +37,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "printf.h" #include "m_argv.h" #include "menu/menu.h" +#include "stringtable.h" BEGIN_DUKE_NS @@ -5017,7 +5018,7 @@ repeatcase: } i = strcspn(textptr, "\r\n"); - gVolumeNames[j] = FString(textptr, i); + gVolumeNames[j] = StringTable::MakeMacro(textptr, i); textptr += i; g_volumeCnt = j+1; @@ -5118,7 +5119,7 @@ repeatcase: } i = strcspn(textptr, "\r\n"); - gSkillNames[j] = FString(textptr, i); + gSkillNames[j] = StringTable::MakeMacro(textptr, i); textptr+=i; for (i=0; i