mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-12-22 07:52:18 +00:00
Treat save file paths in mod loader INIs as save folders. (#230)
This commit is contained in:
parent
9289ee5e02
commit
4691fe2e5a
1 changed files with 12 additions and 5 deletions
|
|
@ -90,7 +90,7 @@ std::vector<std::filesystem::path>* ModLoader::GetIncludeDirectories(size_t modI
|
||||||
|
|
||||||
void ModLoader::Init()
|
void ModLoader::Init()
|
||||||
{
|
{
|
||||||
std::filesystem::path userPath = GetUserPath();
|
const std::filesystem::path& userPath = GetUserPath();
|
||||||
|
|
||||||
IniFile configIni;
|
IniFile configIni;
|
||||||
if (!configIni.read(userPath / "cpkredir.ini"))
|
if (!configIni.read(userPath / "cpkredir.ini"))
|
||||||
|
|
@ -110,7 +110,9 @@ void ModLoader::Init()
|
||||||
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
|
||||||
ModLoader::s_saveFilePath = userPath / "mlsave/SYS-DATA";
|
ModLoader::s_saveFilePath = userPath / "mlsave";
|
||||||
|
|
||||||
|
ModLoader::s_saveFilePath /= "SYS-DATA";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string modsDbIniFilePathU8 = configIni.getString("CPKREDIR", "ModsDbIni", "");
|
std::string modsDbIniFilePathU8 = configIni.getString("CPKREDIR", "ModsDbIni", "");
|
||||||
|
|
@ -187,15 +189,20 @@ void ModLoader::Init()
|
||||||
modSaveFilePathU8 = modIni.getString("Main", "SaveFile", std::string());
|
modSaveFilePathU8 = modIni.getString("Main", "SaveFile", std::string());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!mod.includeDirs.empty())
|
|
||||||
g_mods.emplace_back(std::move(mod));
|
|
||||||
|
|
||||||
if (!modSaveFilePathU8.empty())
|
if (!modSaveFilePathU8.empty())
|
||||||
{
|
{
|
||||||
std::replace(modSaveFilePathU8.begin(), modSaveFilePathU8.end(), '\\', '/');
|
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());
|
||||||
|
|
||||||
|
// Save file paths in HMM mods are treated as folders.
|
||||||
|
if (mod.type == ModType::HMM)
|
||||||
|
ModLoader::s_saveFilePath /= "SYS-DATA";
|
||||||
|
|
||||||
foundModSaveFilePath = true;
|
foundModSaveFilePath = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!mod.includeDirs.empty())
|
||||||
|
g_mods.emplace_back(std::move(mod));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue