Hello. I have a class which is located in plugin module
UCLASS(Config=Game, DefaultConfig)
class UVRENDERPASSSETTINGS_API UUVRenderPassSettings : public UObject
{
GENERATED_BODY()
public:
/**
* Enable or disable UV render pass.
* When disabled, no UV rendering will occur and the render pass will be completely inactive.
*/
UPROPERTY(EditAnywhere, Config, Category="Render Pass")
bool bEnabled = false;
And plugin module registers settings for editor:
if (ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings"))
{
SettingsModule->RegisterSettings(
"Project", "Plugins", "UVRenderPass",
NSLOCTEXT("UVRenderPass", "SettingsName", "UV Render Pass"),
NSLOCTEXT("UVRenderPass", "SettingsDescription", "Configure the UV Render Pass plugin."),
GetMutableDefault<UUVRenderPassSettings>()
);
}
When i edit UVRenderPassSettings settings in editor it saves changes in DefaultGame.ini fine.
But if i remove DefaultConfig from class, changes are not saving anywhere.
I wanted to reach the next behaviour:
- I have a class with default settings defined in DefaultGame.ini
- If i change settings in editor it saves in Saved/Config/Windows/Game.ini
But it does not happen but was expected to be happen (as other classes works so)
I have tried to force SaveConfig() like so:
auto Setting = SettingsModule->RegisterSettings(
"Project", "Plugins", "UVRenderPass",
NSLOCTEXT("UVRenderPass", "SettingsName", "UV Render Pass"),
NSLOCTEXT("UVRenderPass", "SettingsDescription", "Configure the UV Render Pass plugin."),
GetMutableDefault<UUVRenderPassSettings>()
);
Setting->OnModified().BindLambda([Setting]() -> bool
{
Setting->GetSettingsObject()->SaveConfig();
return true;
});
And it did not worked too. Game.ini was not saved in Saved/Config/Windows/Game.ini with overrided parameters.
Can you please check what am i doing wrong or missing.