From bd8b907d131ac9e5b471a0a31928849b95f5d1f0 Mon Sep 17 00:00:00 2001 From: erorcun Date: Sun, 29 Nov 2020 19:19:50 +0300 Subject: PlayerPed and "Redefine controls" menu done, fixes --- src/render/Font.cpp | 18 ++++++++++++++++++ src/render/Font.h | 1 + 2 files changed, 19 insertions(+) (limited to 'src/render') diff --git a/src/render/Font.cpp b/src/render/Font.cpp index 78a8599e..5a6ff94f 100644 --- a/src/render/Font.cpp +++ b/src/render/Font.cpp @@ -1437,3 +1437,21 @@ CFont::SetDropColor(CRGBA col) if (Details.alphaFade < 255.0f) Details.dropColor.a *= Details.alphaFade / 255.0f; } + +void +CFont::FilterOutTokensFromString(wchar *str) +{ + int newIdx = 0; + wchar copy[256], *c; + UnicodeStrcpy(copy, str); + + for (c = copy; *c != '\0'; c++) { + if (*c == '~') { + c++; + while (*c != '~') c++; + } else { + str[newIdx++] = *c; + } + } + str[newIdx] = '\0'; +} diff --git a/src/render/Font.h b/src/render/Font.h index 47a39f73..8942bcc6 100644 --- a/src/render/Font.h +++ b/src/render/Font.h @@ -200,6 +200,7 @@ public: static void SetColor(CRGBA col); static void SetDropColor(CRGBA col); static wchar FindNewCharacter(wchar c); + static void FilterOutTokensFromString(wchar*); #ifdef MORE_LANGUAGES static void ReloadFonts(uint8 set); -- cgit v1.2.3