I’m trying to save the changes I make to the FullscreenMode key in GameUserSettings.ini
The changes are applied and the value is written into the GameUserSettings.ini but I can’t seem to overwrite the value once it’s set. In the DefaultGameUserSettings.ini I have FullscreenMode=2, in the GameUserSettings.ini I have FullscreenMode=0.
I’m following Rama’s Guide. This is what I got:
static FString GetIni(FString WhatIni)
{
FString s = "";
if (WhatIni == "GGameIni") s = GGameIni;
if (WhatIni == "GScalabilityIni") s = GScalabilityIni;
if (WhatIni == "GEngineIni") s = GEngineIni;
if (WhatIni == "GGameUserSettingsIni") s = GGameUserSettingsIni;
return s;
}
/***/
UFUNCTION(BlueprintCallable, Category = Config)
static void SaveStringToConfig (FString Section, FString RootDir, FString WhatText, FString WhatIni)
{
if (!GConfig) return;
//~~
FString TargetIni = GetIni(WhatIni);
//String
GConfig->SetString(*Section, *RootDir, *WhatText, TargetIni);
//ConfigCacheIni.h
//void Flush( bool Read, const FString& Filename=TEXT("") );
GConfig->Flush(false, TargetIni);
}
I also tried it with GConfig->SetInt(…) but it made no difference. Any idea what I’m doing wrong?