1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 06:57:39 +08:00

Fix panel x positions getting weird duration relayouts

Also adjust the transitions a bit to feel better.
This commit is contained in:
Dean Herbert 2020-12-18 17:19:36 +09:00
parent 4cf013c005
commit e82986b763

View File

@ -67,11 +67,7 @@ namespace osu.Game.Screens.Play.HUD
User = user;
this.trackedPlayer = trackedPlayer;
AutoSizeAxes = Axes.X;
Height = panel_height;
Anchor = Anchor.TopRight;
Origin = Anchor.TopRight;
Size = new Vector2(extended_width, panel_height);
}
protected override void LoadComplete()
@ -82,23 +78,25 @@ namespace osu.Game.Screens.Play.HUD
FinishTransforms(true);
}
private const double transition_duration = 500;
private void updateColour()
{
if (scorePosition == 1)
{
mainFillContainer.ResizeWidthTo(extended_width, 200, Easing.OutQuint);
mainFillContainer.ResizeWidthTo(extended_width, transition_duration, Easing.OutElastic);
panelColour = Color4Extensions.FromHex("7fcc33");
textColour = Color4.White;
}
else if (trackedPlayer)
{
mainFillContainer.ResizeWidthTo(extended_width, 200, Easing.OutQuint);
mainFillContainer.ResizeWidthTo(extended_width, transition_duration, Easing.OutElastic);
panelColour = Color4Extensions.FromHex("ffd966");
textColour = Color4Extensions.FromHex("2e576b");
}
else
{
mainFillContainer.ResizeWidthTo(regular_width, 200, Easing.OutQuint);
mainFillContainer.ResizeWidthTo(regular_width, transition_duration, Easing.OutElastic);
panelColour = Color4Extensions.FromHex("3399cc");
textColour = Color4.White;
}
@ -108,8 +106,8 @@ namespace osu.Game.Screens.Play.HUD
{
set
{
mainFillContainer.FadeColour(value, 200, Easing.OutQuint);
centralFill.FadeColour(value, 200, Easing.OutQuint);
mainFillContainer.FadeColour(value, transition_duration, Easing.OutQuint);
centralFill.FadeColour(value, transition_duration, Easing.OutQuint);
}
}