File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 13
13
#include < filesystem>
14
14
#define DECLARE_PROFILER_SECTION_Core
15
15
#include " profiler/SharedUtil.Profiler.h"
16
+ #define UTF8_FILE_HOOKS_PERSONALITY_Core
16
17
#include " SharedUtil.Win32Utf8FileHooks.hpp"
17
18
18
19
#define CORE_API extern " C" __declspec(dllexport)
Original file line number Diff line number Diff line change 46
46
and many more...
47
47
*/
48
48
49
+ #ifdef UTF8_FILE_HOOKS_PERSONALITY_Core
50
+ #include < filesystem>
51
+
52
+ extern std::filesystem::path g_gtaDirectory;
53
+ #endif
54
+
49
55
namespace SharedUtil
50
56
{
51
57
// ///////////////////////////////////////////////////////////
@@ -83,6 +89,16 @@ namespace SharedUtil
83
89
// ///////////////////////////////////////////////////////////
84
90
SString MakeSurePathIsUTF8 (const SString& strOriginal)
85
91
{
92
+ #ifdef UTF8_FILE_HOOKS_PERSONALITY_Core
93
+ static SString gtaDirCP = g_gtaDirectory.string ();
94
+ static SString gtaDirUTF8 = ToUTF8 (g_gtaDirectory.wstring ());
95
+ if (strOriginal.BeginsWithI (gtaDirCP))
96
+ {
97
+ SString tail = strOriginal.SubStr (gtaDirCP.length ());
98
+ return PathJoin (gtaDirUTF8, tail);
99
+ }
100
+ #endif
101
+
86
102
static SString strLaunchPathCP, strLaunchPathUTF8;
87
103
if (strLaunchPathCP.empty ())
88
104
{
You can’t perform that action at this time.
0 commit comments