Protect against a potential early call to LanguageButton.Selected

This commit is contained in:
Dean Herbert 2022-07-14 14:31:59 +09:00
parent 3b554140db
commit 5c6b4e498d

View File

@ -79,7 +79,7 @@ namespace osu.Game.Overlays.FirstRunSetup
frameworkLocale = frameworkConfig.GetBindable<string>(FrameworkSetting.Locale);
frameworkLocale.BindValueChanged(locale =>
{
if (!LanguageExtensions.TryParseCultureCode(frameworkLocale.Value, out var language))
if (!LanguageExtensions.TryParseCultureCode(locale.NewValue, out var language))
language = Language.en;
foreach (var c in Children.OfType<LanguageButton>())
@ -110,7 +110,8 @@ namespace osu.Game.Overlays.FirstRunSetup
selected = value;
updateState();
if (IsLoaded)
updateState();
}
}
@ -144,6 +145,12 @@ namespace osu.Game.Overlays.FirstRunSetup
};
}
protected override void LoadComplete()
{
base.LoadComplete();
updateState();
}
protected override bool OnHover(HoverEvent e)
{
if (!selected)