mirror of
https://github.com/izzy2lost/WeeU.git
synced 2026-07-06 00:19:59 -07:00
Add support for non portable mode (#356)
This commit is contained in:
@@ -180,12 +180,12 @@ void gameProfile_load()
|
||||
|
||||
bool GameProfile::Load(uint64_t title_id)
|
||||
{
|
||||
auto gameProfilePath = ActiveSettings::GetPath("gameProfiles/{:016x}.ini", title_id);
|
||||
auto gameProfilePath = ActiveSettings::GetConfigPath("gameProfiles/{:016x}.ini", title_id);
|
||||
|
||||
std::optional<std::vector<uint8>> profileContents = FileStream::LoadIntoMemory(gameProfilePath);
|
||||
if (!profileContents)
|
||||
{
|
||||
gameProfilePath = ActiveSettings::GetPath("gameProfiles/default/{:016x}.ini", title_id);
|
||||
gameProfilePath = ActiveSettings::GetDataPath("gameProfiles/default/{:016x}.ini", title_id);
|
||||
profileContents = FileStream::LoadIntoMemory(gameProfilePath);
|
||||
if (!profileContents)
|
||||
return false;
|
||||
@@ -276,7 +276,12 @@ bool GameProfile::Load(uint64_t title_id)
|
||||
|
||||
void GameProfile::Save(uint64_t title_id)
|
||||
{
|
||||
auto gameProfilePath = ActiveSettings::GetPath("gameProfiles/{:016x}.ini", title_id);
|
||||
auto gameProfileDir = ActiveSettings::GetConfigPath("gameProfiles");
|
||||
if (std::error_code ex_ec; !fs::exists(gameProfileDir, ex_ec) && !ex_ec) {
|
||||
std::error_code cr_ec;
|
||||
fs::create_directories(gameProfileDir, cr_ec);
|
||||
}
|
||||
auto gameProfilePath = gameProfileDir / fmt::format("{:016x}.ini", title_id);
|
||||
FileStream* fs = FileStream::createFile2(gameProfilePath);
|
||||
if (!fs)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user