Lyra In-Game Settings

I too would love to see how to build a settings menu like they have using the in editor UI tools.

I looked through pretty much every widget blueprint in the editor and couldn’t find where they were pulling the settings menu information from so I started digging in the project folder outside the engine.

It looks like the information that gets populated into the settings menu comes from here:
LyraStarterGame\Source\LyraGame\Settings\CustomSettings

So I’m guessing they did quite a bit of the menu as C++ coding. Unfortunately my coding background is in web development so I couldn’t really digest how this gets integrated into the in editor blueprints they have setup, but it’s the only place that I could actually find the ‘settings’ they have. Here’s a snippet of the code to give as example.

void ULyraSettingValueDiscrete_OverallQuality::OnInitialized()
{
	Super::OnInitialized();

	ULyraSettingsLocal* UserSettings = ULyraSettingsLocal::Get();
	const int32 MaxQualityLevel = UserSettings->GetMaxSupportedOverallQualityLevel();

	auto AddOptionIfPossible = [&](int Index, FText&& Value) { if ((MaxQualityLevel < 0) || (Index <= MaxQualityLevel)) { Options.Add(Value); }};

	AddOptionIfPossible(0, LOCTEXT("VideoQualityOverall_Low", "Low"));
	AddOptionIfPossible(1, LOCTEXT("VideoQualityOverall_Medium", "Medium"));
	AddOptionIfPossible(2, LOCTEXT("VideoQualityOverall_High", "High"));
	AddOptionIfPossible(3, LOCTEXT("VideoQualityOverall_Epic", "Epic"));

	OptionsWithCustom = Options;
	OptionsWithCustom.Add(LOCTEXT("VideoQualityOverall_Custom", "Custom"));

	const int32 LowestQualityWithFrameRateLimit = UserSettings->GetLowestQualityWithFrameRateLimit();
	if (Options.IsValidIndex(LowestQualityWithFrameRateLimit))
	{
		SetWarningRichText(FText::Format(LOCTEXT("OverallQuality_Mobile_ImpactsFramerate", "<strong>Note: Changing the Quality setting to {0} or higher might limit your framerate.</>"), Options[LowestQualityWithFrameRateLimit]));
	}
}

I definitely think that setting up an in-depth settings menu like the one in the Lyra game example would be a great tutorial for Epic to do.

2 Likes