mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-12-19 14:32:19 +00:00
Look for mod loader .ini file in config folder.
This commit is contained in:
parent
a397a90551
commit
d6c2884f2e
1 changed files with 11 additions and 3 deletions
|
|
@ -5,6 +5,7 @@
|
||||||
#include <cpu/guest_stack_var.h>
|
#include <cpu/guest_stack_var.h>
|
||||||
#include <kernel/function.h>
|
#include <kernel/function.h>
|
||||||
#include <kernel/heap.h>
|
#include <kernel/heap.h>
|
||||||
|
#include <user/paths.h>
|
||||||
#include <xxHashMap.h>
|
#include <xxHashMap.h>
|
||||||
|
|
||||||
enum class ModType
|
enum class ModType
|
||||||
|
|
@ -89,9 +90,16 @@ std::vector<std::filesystem::path>* ModLoader::GetIncludeDirectories(size_t modI
|
||||||
|
|
||||||
void ModLoader::Init()
|
void ModLoader::Init()
|
||||||
{
|
{
|
||||||
|
std::filesystem::path userPath = GetUserPath();
|
||||||
|
|
||||||
IniFile configIni;
|
IniFile configIni;
|
||||||
if (!configIni.read("cpkredir.ini"))
|
if (!configIni.read(userPath / "cpkredir.ini"))
|
||||||
|
{
|
||||||
|
configIni = {};
|
||||||
|
|
||||||
|
if (!configIni.read(GAME_INSTALL_DIRECTORY "/cpkredir.ini"))
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!configIni.getBool("CPKREDIR", "Enabled", true))
|
if (!configIni.getBool("CPKREDIR", "Enabled", true))
|
||||||
return;
|
return;
|
||||||
|
|
@ -102,7 +110,7 @@ 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 = "mlsave/SYS-DATA";
|
ModLoader::s_saveFilePath = userPath / "mlsave/SYS-DATA";
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string modsDbIniFilePathU8 = configIni.getString("CPKREDIR", "ModsDbIni", "");
|
std::string modsDbIniFilePathU8 = configIni.getString("CPKREDIR", "ModsDbIni", "");
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue