mirror of
https://github.com/ppy/osu
synced 2025-01-18 20:10:49 +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 = frameworkConfig.GetBindable<string>(FrameworkSetting.Locale);
|
||||||
frameworkLocale.BindValueChanged(locale =>
|
frameworkLocale.BindValueChanged(locale =>
|
||||||
{
|
{
|
||||||
if (!LanguageExtensions.TryParseCultureCode(frameworkLocale.Value, out var language))
|
if (!LanguageExtensions.TryParseCultureCode(locale.NewValue, out var language))
|
||||||
language = Language.en;
|
language = Language.en;
|
||||||
|
|
||||||
foreach (var c in Children.OfType<LanguageButton>())
|
foreach (var c in Children.OfType<LanguageButton>())
|
||||||
@ -110,7 +110,8 @@ namespace osu.Game.Overlays.FirstRunSetup
|
|||||||
|
|
||||||
selected = value;
|
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)
|
protected override bool OnHover(HoverEvent e)
|
||||||
{
|
{
|
||||||
if (!selected)
|
if (!selected)
|
||||||
|
Loading…
Reference in New Issue
Block a user