mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 16:32:54 +08:00
Added constants for delay value
This commit is contained in:
parent
06fffc499b
commit
d05ffdf120
@ -120,7 +120,7 @@ namespace osu.Game.Tests.Visual.Ranking
|
||||
}
|
||||
}
|
||||
},
|
||||
new AccuracyCircle(score, true)
|
||||
new AccuracyCircle(score)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
@ -37,6 +37,11 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
/// </summary>
|
||||
public const double ACCURACY_TRANSFORM_DURATION = 3000;
|
||||
|
||||
/// <summary>
|
||||
/// Delay before the default applause sound is played to match the <see cref="rankText"/> timing
|
||||
/// </summary>
|
||||
public const double APPLAUSE_DELAY = 1440;
|
||||
|
||||
/// <summary>
|
||||
/// Delay after <see cref="ACCURACY_TRANSFORM_DURATION"/> for the rank text (A/B/C/D/S/SS) to appear.
|
||||
/// </summary>
|
||||
@ -79,7 +84,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy
|
||||
private Container<RankBadge> badges;
|
||||
private RankText rankText;
|
||||
|
||||
public AccuracyCircle(ScoreInfo score, bool withFlair)
|
||||
public AccuracyCircle(ScoreInfo score)
|
||||
{
|
||||
this.score = score;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ namespace osu.Game.Screens.Ranking.Expanded
|
||||
Margin = new MarginPadding { Top = 40 },
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Height = 230,
|
||||
Child = new AccuracyCircle(score, withFlair)
|
||||
Child = new AccuracyCircle(score)
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
@ -198,7 +198,7 @@ namespace osu.Game.Screens.Ranking
|
||||
|
||||
using (BeginDelayedSequence(AccuracyCircle.ACCURACY_TRANSFORM_DELAY + AccuracyCircle.TEXT_APPEAR_DELAY, true))
|
||||
{
|
||||
this.Delay(-1000).Schedule(() => applauseSound?.Play());
|
||||
this.Delay(ScorePanel.RESIZE_DURATION + ScorePanel.TOP_LAYER_EXPAND_DELAY - AccuracyCircle.APPLAUSE_DELAY).Schedule(() => applauseSound?.Play());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,12 +54,12 @@ namespace osu.Game.Screens.Ranking
|
||||
/// <summary>
|
||||
/// Duration for the panel to resize into its expanded/contracted size.
|
||||
/// </summary>
|
||||
private const double resize_duration = 200;
|
||||
public const double RESIZE_DURATION = 200;
|
||||
|
||||
/// <summary>
|
||||
/// Delay after <see cref="resize_duration"/> before the top layer is expanded.
|
||||
/// Delay after <see cref="RESIZE_DURATION"/> before the top layer is expanded.
|
||||
/// </summary>
|
||||
private const double top_layer_expand_delay = 100;
|
||||
public const double TOP_LAYER_EXPAND_DELAY = 100;
|
||||
|
||||
/// <summary>
|
||||
/// Duration for the top layer expansion.
|
||||
@ -208,8 +208,8 @@ namespace osu.Game.Screens.Ranking
|
||||
case PanelState.Expanded:
|
||||
Size = new Vector2(EXPANDED_WIDTH, expanded_height);
|
||||
|
||||
topLayerBackground.FadeColour(expanded_top_layer_colour, resize_duration, Easing.OutQuint);
|
||||
middleLayerBackground.FadeColour(expanded_middle_layer_colour, resize_duration, Easing.OutQuint);
|
||||
topLayerBackground.FadeColour(expanded_top_layer_colour, RESIZE_DURATION, Easing.OutQuint);
|
||||
middleLayerBackground.FadeColour(expanded_middle_layer_colour, RESIZE_DURATION, Easing.OutQuint);
|
||||
|
||||
topLayerContentContainer.Add(topLayerContent = new ExpandedPanelTopContent(Score.User).With(d => d.Alpha = 0));
|
||||
middleLayerContentContainer.Add(middleLayerContent = new ExpandedPanelMiddleContent(Score, displayWithFlair).With(d => d.Alpha = 0));
|
||||
@ -221,20 +221,20 @@ namespace osu.Game.Screens.Ranking
|
||||
case PanelState.Contracted:
|
||||
Size = new Vector2(CONTRACTED_WIDTH, contracted_height);
|
||||
|
||||
topLayerBackground.FadeColour(contracted_top_layer_colour, resize_duration, Easing.OutQuint);
|
||||
middleLayerBackground.FadeColour(contracted_middle_layer_colour, resize_duration, Easing.OutQuint);
|
||||
topLayerBackground.FadeColour(contracted_top_layer_colour, RESIZE_DURATION, Easing.OutQuint);
|
||||
middleLayerBackground.FadeColour(contracted_middle_layer_colour, RESIZE_DURATION, Easing.OutQuint);
|
||||
|
||||
topLayerContentContainer.Add(topLayerContent = new ContractedPanelTopContent(Score).With(d => d.Alpha = 0));
|
||||
middleLayerContentContainer.Add(middleLayerContent = new ContractedPanelMiddleContent(Score).With(d => d.Alpha = 0));
|
||||
break;
|
||||
}
|
||||
|
||||
content.ResizeTo(Size, resize_duration, Easing.OutQuint);
|
||||
content.ResizeTo(Size, RESIZE_DURATION, Easing.OutQuint);
|
||||
|
||||
bool topLayerExpanded = topLayerContainer.Y < 0;
|
||||
|
||||
// If the top layer was already expanded, then we don't need to wait for the resize and can instead transform immediately. This looks better when changing the panel state.
|
||||
using (BeginDelayedSequence(topLayerExpanded ? 0 : resize_duration + top_layer_expand_delay, true))
|
||||
using (BeginDelayedSequence(topLayerExpanded ? 0 : RESIZE_DURATION + TOP_LAYER_EXPAND_DELAY, true))
|
||||
{
|
||||
topLayerContainer.FadeIn();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user