Assign to field and move to load complete

This commit is contained in:
iiSaLMaN 2019-09-27 08:15:24 +03:00
parent 7904f77cd5
commit 2670a23e6f
1 changed files with 8 additions and 6 deletions

View File

@ -60,21 +60,23 @@ public HoldForMenuButton()
AutoSizeAxes = Axes.Both;
}
[BackgroundDependencyLoader]
private void load(OsuConfigManager config)
[Resolved]
private OsuConfigManager config { get; set; }
private Bindable<int> activationDelay;
protected override void LoadComplete()
{
var activationDelay = config.GetBindable<int>(OsuSetting.UIHoldActivationDelay).GetBoundCopy();
activationDelay = config.GetBindable<int>(OsuSetting.UIHoldActivationDelay);
activationDelay.BindValueChanged(v =>
{
text.Text = v.NewValue > 0
? "hold for menu"
: "press for menu";
}, true);
}
protected override void LoadComplete()
{
text.FadeInFromZero(500, Easing.OutQuint).Delay(1500).FadeOut(500, Easing.OutQuint);
base.LoadComplete();
}