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