I’m using UE4.27.2.
I’m designing an options menu and I’d like to use DefaultGameUserSettings to store default values for each option.
First question: How would I add my own custom parameters to the default ini file? I assumed using UPROPERTY(config) would do the trick, but that only adds it to “GameuserSettings.ini”.
Second, what is the best approach to resetting options? Is there a way to overwrite the values in GameUserSettings.ini with the values in DefaultGameUserSettings.ini? If not, then is there a way to read options from the default file one-by-one? I’ve experimented with this:
FString defaultGameUserSettings = "../../../Project/Config/DefaultGameUserSettings.ini";
LoadConfig(GetClass(), *defaultGameUserSettings);
GConfig->GetFloat(*defaultGameUserSettings, TEXT("MasterVolume"), MasterVolume, defaultGameUserSettings);
However, this doesn’t work, as MasterVolume isn’t being assigned the value I set in the default ini.
Any ideas?