mirror of
https://github.com/ppy/osu
synced 2024-12-13 18:37:04 +00:00
Protect against a potential early call to LanguageButton.Selected
This commit is contained in:
parent
3b554140db
commit
5c6b4e498d
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user