Hi,
I’m trying to change the resolution :
First I call RequestResolutionChange and it changes the resolution
Then I wait on the user telling me “it works” or “revert” (after 10 seconds it will revert anyway)
Now when the resolution is confirmed with ConfirmVideoMode BUT the GetLastConfirmedScreenResolution doesn’t have the new resolution so I can’t use it to set and save the correct resolution.
This is my code :
void UTestCopyModelGameInstance::TryResolutionChange(int32 weight, int32 height, EWindowModeEnum fullscreenMode)
{
GetGameUserSettings()->RequestResolutionChange(weight, height, EWindowMode::Type(fullscreenMode),false);
}
void UTestCopyModelGameInstance::ConfirmVideoMode(bool bIsConfirmed)
{
UGameUserSettings* settings = GetGameUserSettings();
if (bIsConfirmed)
{
settings->ConfirmVideoMode();
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, FString::Printf(TEXT("res %d x %d"), settings->GetScreenResolution().X, settings->GetScreenResolution().Y));
GEngine->AddOnScreenDebugMessage(-1, 15.0f, FColor::Red, FString::Printf(TEXT("res confirm %d x %d"), settings->GetLastConfirmedScreenResolution().X, settings->GetLastConfirmedScreenResolution().Y));
settings->SetScreenResolution(settings->GetLastConfirmedScreenResolution());
settings->SetFullscreenMode(settings->GetLastConfirmedFullscreenMode());
//settings->ApplySettings(false);
Scalability::SaveState(GGameUserSettingsIni);
settings->SaveSettings();
}
else
{
settings->RevertVideoMode();
settings->ApplyResolutionSettings(false);
}
}
What should I do ?
rXp