Config Saving/Loading Broken in UE 5.5
Context
Project: Plugin Sync Tool and Module Creator
Engine Version: 5.5
Error
When exiting the editor and reopening it, saved config variables in custom configs are not loaded correctly.
Cause
In Unreal Engine 5.5, the config system was modified and it broke some of the expected behaviour.
Fix
Manually load the config into memory BEFORE calling LoadConfig() on our object.
void UOS_PST_Settings::LoadFromConfig()
{
#if ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 5
//The config system is broken in 5.5, so we have to manually load the config into memory BEFORE calling LoadConfig() on our object
FString ConfigPath = FPaths::ConvertRelativePathToFull(FPaths::Combine(FPaths::ProjectSavedDir(), TEXT("Config"), FPlatformProperties::PlatformName(), TEXT("OseroSuiteEditorSettings.ini")));
// Attempt to load the config file
GConfig->LoadFile(ConfigPath);
#endif
LoadConfig();
//...
}
void UOS_PST_Settings::SaveToConfig()
{
//...
SaveConfig();
}
Last updated