I’ve created a plugin (!). The plugin contains three modules: an editor module, an actor component and a setting class. The editor module allows the configuration of the settings.
Every instance of the actor component query the setting class to get their default settings at runtime.
I use “RegisterSettings” so the properties are also available through the “Project Settings” menu.
Problem is I would like to save the current state of the settings to the final packaged app.
If your Settings UObject is declared inside of your GAME_MODULE, then the settings is always saved to the final packaged app.
To read the settings saved within Editor panels, you get the Settings UOBjects default object and read its values in game:
const auto &Settings = GetMutableDefault<MyPluginSettings>();
Settings->ReadThisVar;
I’ve added IMPLEMENT_GAME_MODULE to both MyPluginSettings module and my actor component module. Same issue. GetMutableDefault<MyPluginSettings>() returns default value even if they were set from the editor before.
I don’t know if that matter but I call GetMutableDefault<MyPluginSettings>() from my actor component.
Maybe I don’t use the setting class correctly then.
To write my settings I use
GConfig->SetBool(TEXT("/Script/coreDSSettings.coreDSSettings"), TEXT(“DisableWord”), mDisableWord ? 1 : 0, GGameUserSettingsIni);
GConfig->Flush(false, GGameUserSettingsIni);
I also tried but when using that approach, settings are not saved at all (even from the Editor)