mirror of https://github.com/ppy/osu
Actually use bindables rather than stick things in `Update()`
This commit is contained in:
parent
4f57a67ea4
commit
9f4e48dde7
|
@ -98,6 +98,7 @@ protected override void LoadComplete()
|
|||
Interactive.BindValueChanged(_ => bar.Interactive = Interactive.Value, true);
|
||||
ShowGraph.BindValueChanged(_ => updateGraphVisibility(), true);
|
||||
ShowTime.BindValueChanged(_ => info.FadeTo(ShowTime.Value ? 1 : 0, 200, Easing.In), true);
|
||||
AccentColour.BindValueChanged(_ => Colour = AccentColour.Value, true);
|
||||
}
|
||||
|
||||
protected override void UpdateObjects(IEnumerable<HitObject> objects)
|
||||
|
@ -118,7 +119,6 @@ protected override void Update()
|
|||
base.Update();
|
||||
content.Height = bar.Height + bar_height + info.Height;
|
||||
graphContainer.Height = bar.Height;
|
||||
Colour = AccentColour.Value;
|
||||
}
|
||||
|
||||
protected override void UpdateProgress(double progress, bool isIntro)
|
||||
|
|
|
@ -90,6 +90,7 @@ protected override void LoadComplete()
|
|||
Interactive.BindValueChanged(_ => updateBarVisibility(), true);
|
||||
ShowGraph.BindValueChanged(_ => updateGraphVisibility(), true);
|
||||
ShowTime.BindValueChanged(_ => updateTimeVisibility(), true);
|
||||
AccentColour.BindValueChanged(_ => Colour = AccentColour.Value, true);
|
||||
|
||||
base.LoadComplete();
|
||||
}
|
||||
|
@ -118,8 +119,6 @@ protected override void Update()
|
|||
|
||||
if (!Precision.AlmostEquals(Height, newHeight, 5f))
|
||||
content.Height = newHeight;
|
||||
|
||||
Colour = AccentColour.Value;
|
||||
}
|
||||
|
||||
private void updateBarVisibility()
|
||||
|
|
|
@ -46,12 +46,18 @@ public BoxElement()
|
|||
Masking = true;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
AccentColour.BindValueChanged(_ => Colour = AccentColour.Value, true);
|
||||
}
|
||||
|
||||
protected override void Update()
|
||||
{
|
||||
base.Update();
|
||||
|
||||
base.CornerRadius = CornerRadius.Value * Math.Min(DrawWidth, DrawHeight);
|
||||
Colour = AccentColour.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue