mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-04-27 21:01:37 +00:00
Check for enabled option & replace backward slashes with forward ones in mod save file paths.
This commit is contained in:
parent
cf7aae2d83
commit
9a50459085
1 changed files with 5 additions and 1 deletions
|
|
@ -93,9 +93,12 @@ void ModLoader::Init()
|
||||||
if (!configIni.read("cpkredir.ini"))
|
if (!configIni.read("cpkredir.ini"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (!configIni.getBool("CPKREDIR", "Enabled", true))
|
||||||
|
return;
|
||||||
|
|
||||||
if (configIni.getBool("CPKREDIR", "EnableSaveFileRedirection", false))
|
if (configIni.getBool("CPKREDIR", "EnableSaveFileRedirection", false))
|
||||||
{
|
{
|
||||||
std::string saveFilePathU8 = configIni.getString("CPKREDIR", "SaveFileFallback", std::string());
|
std::string saveFilePathU8 = configIni.getString("CPKREDIR", "SaveFileFallback", "");
|
||||||
if (!saveFilePathU8.empty())
|
if (!saveFilePathU8.empty())
|
||||||
ModLoader::s_saveFilePath = std::u8string_view((const char8_t*)saveFilePathU8.c_str());
|
ModLoader::s_saveFilePath = std::u8string_view((const char8_t*)saveFilePathU8.c_str());
|
||||||
else
|
else
|
||||||
|
|
@ -181,6 +184,7 @@ void ModLoader::Init()
|
||||||
|
|
||||||
if (!modSaveFilePathU8.empty())
|
if (!modSaveFilePathU8.empty())
|
||||||
{
|
{
|
||||||
|
std::replace(modSaveFilePathU8.begin(), modSaveFilePathU8.end(), '\\', '/');
|
||||||
ModLoader::s_saveFilePath = modDirectoryPath / std::u8string_view((const char8_t*)modSaveFilePathU8.c_str());
|
ModLoader::s_saveFilePath = modDirectoryPath / std::u8string_view((const char8_t*)modSaveFilePathU8.c_str());
|
||||||
foundModSaveFilePath = true;
|
foundModSaveFilePath = true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue