Skip to content

Commit

Permalink
fix: save settings
Browse files Browse the repository at this point in the history
  • Loading branch information
doodlum committed Nov 20, 2024
1 parent 84d1753 commit b804f4d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Utils/GameSetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,11 +365,18 @@ namespace Util
strcpy_s(subKeyBackup, 260, ini->subKey);
strcpy_s(ini->subKey, 260, CS_SETTINGS_PATH.data());

auto iniPref = RE::INIPrefSettingCollection::GetSingleton();

char subKeyPrefBackup[0x104];
strcpy_s(subKeyPrefBackup, 260, iniPref->subKey);
strcpy_s(iniPref->subKey, 260, CS_SETTINGS_PATH.data());

// Initialize collections
std::vector<std::pair<RE::INISettingCollection*, std::string>> iniCollections = {
{ ini, "INISettingCollection" },
{ RE::INIPrefSettingCollection::GetSingleton(), "INIPrefSettingCollection" }
{ iniPref, "INIPrefSettingCollection" }
};

auto gameSettingCollection = RE::GameSettingCollection::GetSingleton();

// Single iteration for settings
Expand Down Expand Up @@ -404,6 +411,7 @@ namespace Util
}
}
strcpy_s(ini->subKey, 260, subKeyBackup);
strcpy_s(iniPref->subKey, 260, subKeyPrefBackup);
}

void LoadGameSettings(const std::map<std::string, GameSetting>& settingsMap)
Expand Down

0 comments on commit b804f4d

Please sign in to comment.