mirror of
https://github.com/ppy/osu
synced 2025-01-02 12:22:13 +00:00
Adjust argon song progress bar's background fill to always display
This commit is contained in:
parent
84670d4c90
commit
855185ca85
@ -95,7 +95,6 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
private void updateGraphVisibility()
|
private void updateGraphVisibility()
|
||||||
{
|
{
|
||||||
graph.FadeTo(ShowGraph.Value ? 1 : 0, 200, Easing.In);
|
graph.FadeTo(ShowGraph.Value ? 1 : 0, 200, Easing.In);
|
||||||
bar.ShowBackground = !ShowGraph.Value;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
|
@ -14,7 +14,6 @@ using osu.Framework.Threading;
|
|||||||
using osu.Framework.Utils;
|
using osu.Framework.Utils;
|
||||||
using osu.Game.Graphics;
|
using osu.Game.Graphics;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
|
||||||
|
|
||||||
namespace osu.Game.Screens.Play.HUD
|
namespace osu.Game.Screens.Play.HUD
|
||||||
{
|
{
|
||||||
@ -32,18 +31,8 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
private readonly Box background;
|
private readonly Box background;
|
||||||
|
|
||||||
private readonly BindableBool showBackground = new BindableBool();
|
|
||||||
|
|
||||||
private readonly ColourInfo mainColour;
|
private readonly ColourInfo mainColour;
|
||||||
private readonly ColourInfo mainColourDarkened;
|
|
||||||
private ColourInfo catchUpColour;
|
private ColourInfo catchUpColour;
|
||||||
private ColourInfo catchUpColourDarkened;
|
|
||||||
|
|
||||||
public bool ShowBackground
|
|
||||||
{
|
|
||||||
get => showBackground.Value;
|
|
||||||
set => showBackground.Value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double StartTime
|
public double StartTime
|
||||||
{
|
{
|
||||||
@ -95,7 +84,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.Both,
|
RelativeSizeAxes = Axes.Both,
|
||||||
Alpha = 0,
|
Alpha = 0,
|
||||||
Colour = Colour4.White.Darken(1 + 1 / 4f)
|
Colour = OsuColour.Gray(0.2f),
|
||||||
},
|
},
|
||||||
catchupBar = new RoundedBar
|
catchupBar = new RoundedBar
|
||||||
{
|
{
|
||||||
@ -112,12 +101,10 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
Origin = Anchor.BottomLeft,
|
Origin = Anchor.BottomLeft,
|
||||||
CornerRadius = 5,
|
CornerRadius = 5,
|
||||||
AccentColour = mainColour = Color4.White,
|
AccentColour = mainColour = OsuColour.Gray(0.9f),
|
||||||
RelativeSizeAxes = Axes.Both
|
RelativeSizeAxes = Axes.Both
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
mainColourDarkened = Colour4.White.Darken(1 / 3f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupAlternateValue()
|
private void setupAlternateValue()
|
||||||
@ -141,16 +128,15 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(OsuColour colours)
|
private void load(OsuColour colours)
|
||||||
{
|
{
|
||||||
catchUpColour = colours.BlueLight;
|
catchUpColour = colours.BlueDark;
|
||||||
catchUpColourDarkened = colours.BlueDark;
|
|
||||||
|
|
||||||
showBackground.BindValueChanged(_ => updateBackground(), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateBackground()
|
protected override void LoadComplete()
|
||||||
{
|
{
|
||||||
background.FadeTo(showBackground.Value ? 1 / 4f : 0, 200, Easing.In);
|
base.LoadComplete();
|
||||||
playfieldBar.TransformTo(nameof(playfieldBar.AccentColour), ShowBackground ? mainColour : mainColourDarkened, 200, Easing.In);
|
|
||||||
|
background.FadeTo(0.3f, 200, Easing.In);
|
||||||
|
playfieldBar.TransformTo(nameof(playfieldBar.AccentColour), mainColour, 200, Easing.In);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnHover(HoverEvent e)
|
protected override bool OnHover(HoverEvent e)
|
||||||
@ -190,8 +176,8 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
catchupBar.AccentColour = Interpolation.ValueAt(
|
catchupBar.AccentColour = Interpolation.ValueAt(
|
||||||
Math.Min(timeDelta, colour_transition_threshold),
|
Math.Min(timeDelta, colour_transition_threshold),
|
||||||
ShowBackground ? mainColour : mainColourDarkened,
|
mainColour,
|
||||||
ShowBackground ? catchUpColour : catchUpColourDarkened,
|
catchUpColour,
|
||||||
0, colour_transition_threshold,
|
0, colour_transition_threshold,
|
||||||
Easing.OutQuint);
|
Easing.OutQuint);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user