1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-26 16:12:54 +08:00

Merge pull request #20740 from peppy/player-loader-improvements

Improve transition visuals of player load sequence
This commit is contained in:
Dan Balasescu 2022-10-19 13:12:49 +09:00 committed by GitHub
commit 31f499a950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 27 deletions

View File

@ -244,7 +244,10 @@ namespace osu.Game.Tests.Visual.Background
public void TestResumeFromPlayer() public void TestResumeFromPlayer()
{ {
performFullSetup(); performFullSetup();
AddStep("Move mouse to Visual Settings", () => InputManager.MoveMouseTo(playerLoader.VisualSettingsPos)); AddStep("Move mouse to Visual Settings location", () => InputManager.MoveMouseTo(playerLoader.ScreenSpaceDrawQuad.TopRight
+ new Vector2(-playerLoader.VisualSettingsPos.ScreenSpaceDrawQuad.Width,
playerLoader.VisualSettingsPos.ScreenSpaceDrawQuad.Height / 2
)));
AddStep("Resume PlayerLoader", () => player.Restart()); AddStep("Resume PlayerLoader", () => player.Restart());
AddUntilStep("Screen is dimmed and blur applied", () => songSelect.IsBackgroundDimmed() && songSelect.IsUserBlurApplied()); AddUntilStep("Screen is dimmed and blur applied", () => songSelect.IsBackgroundDimmed() && songSelect.IsUserBlurApplied());
AddStep("Move mouse to center of screen", () => InputManager.MoveMouseTo(playerLoader.ScreenPos)); AddStep("Move mouse to center of screen", () => InputManager.MoveMouseTo(playerLoader.ScreenPos));

View File

@ -40,8 +40,6 @@ namespace osu.Game.Overlays
Anchor = Anchor.TopCentre, Anchor = Anchor.TopCentre,
Direction = FillDirection.Vertical, Direction = FillDirection.Vertical,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
AutoSizeDuration = transition_duration,
AutoSizeEasing = Easing.OutQuint,
AutoSizeAxes = Axes.Y, AutoSizeAxes = Axes.Y,
Padding = new MarginPadding { Horizontal = 10, Top = 5, Bottom = 10 }, Padding = new MarginPadding { Horizontal = 10, Top = 5, Bottom = 10 },
Spacing = new Vector2(0, 15), Spacing = new Vector2(0, 15),

View File

@ -64,6 +64,8 @@ namespace osu.Game.Screens.Play
protected Task? DisposalTask { get; private set; } protected Task? DisposalTask { get; private set; }
private OsuScrollContainer settingsScroll = null!;
private bool backgroundBrightnessReduction; private bool backgroundBrightnessReduction;
private readonly BindableDouble volumeAdjustment = new BindableDouble(1); private readonly BindableDouble volumeAdjustment = new BindableDouble(1);
@ -168,30 +170,30 @@ namespace osu.Game.Screens.Play
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,
}, },
new OsuScrollContainer
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
RelativeSizeAxes = Axes.Y,
Width = SettingsToolboxGroup.CONTAINER_WIDTH + padding * 2,
Padding = new MarginPadding { Vertical = padding },
Masking = false,
Child = PlayerSettings = new FillFlowContainer<PlayerSettingsGroup>
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 20),
Padding = new MarginPadding { Horizontal = padding },
Children = new PlayerSettingsGroup[]
{
VisualSettings = new VisualSettings(),
AudioSettings = new AudioSettings(),
new InputSettings()
}
},
},
idleTracker = new IdleTracker(750),
}), }),
settingsScroll = new OsuScrollContainer
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
RelativeSizeAxes = Axes.Y,
Width = SettingsToolboxGroup.CONTAINER_WIDTH + padding * 2,
Padding = new MarginPadding { Vertical = padding },
Masking = false,
Child = PlayerSettings = new FillFlowContainer<PlayerSettingsGroup>
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 20),
Padding = new MarginPadding { Horizontal = padding },
Children = new PlayerSettingsGroup[]
{
VisualSettings = new VisualSettings(),
AudioSettings = new AudioSettings(),
new InputSettings()
}
},
},
idleTracker = new IdleTracker(750),
lowPassFilter = new AudioFilter(audio.TrackMixer), lowPassFilter = new AudioFilter(audio.TrackMixer),
highPassFilter = new AudioFilter(audio.TrackMixer, BQFType.HighPass) highPassFilter = new AudioFilter(audio.TrackMixer, BQFType.HighPass)
}; };
@ -227,6 +229,9 @@ namespace osu.Game.Screens.Play
Beatmap.Value.Track.AddAdjustment(AdjustableProperty.Volume, volumeAdjustment); Beatmap.Value.Track.AddAdjustment(AdjustableProperty.Volume, volumeAdjustment);
// Start off-screen.
settingsScroll.MoveToX(settingsScroll.DrawWidth);
content.ScaleTo(0.7f); content.ScaleTo(0.7f);
contentIn(); contentIn();
@ -316,6 +321,16 @@ namespace osu.Game.Screens.Play
content.StopTracking(); content.StopTracking();
} }
protected override void LogoSuspending(OsuLogo logo)
{
base.LogoSuspending(logo);
content.StopTracking();
logo
.FadeOut(CONTENT_OUT_DURATION / 2, Easing.OutQuint)
.ScaleTo(logo.Scale * 0.8f, CONTENT_OUT_DURATION * 2, Easing.OutQuint);
}
#endregion #endregion
protected override void Update() protected override void Update()
@ -394,6 +409,10 @@ namespace osu.Game.Screens.Play
content.FadeInFromZero(400); content.FadeInFromZero(400);
content.ScaleTo(1, 650, Easing.OutQuint).Then().Schedule(prepareNewPlayer); content.ScaleTo(1, 650, Easing.OutQuint).Then().Schedule(prepareNewPlayer);
settingsScroll.FadeInFromZero(500, Easing.Out)
.MoveToX(0, 500, Easing.OutQuint);
lowPassFilter.CutoffTo(1000, 650, Easing.OutQuint); lowPassFilter.CutoffTo(1000, 650, Easing.OutQuint);
highPassFilter.CutoffTo(300).Then().CutoffTo(0, 1250); // 1250 is to line up with the appearance of MetadataInfo (750 delay + 500 fade-in) highPassFilter.CutoffTo(300).Then().CutoffTo(0, 1250); // 1250 is to line up with the appearance of MetadataInfo (750 delay + 500 fade-in)
@ -407,6 +426,10 @@ namespace osu.Game.Screens.Play
content.ScaleTo(0.7f, CONTENT_OUT_DURATION * 2, Easing.OutQuint); content.ScaleTo(0.7f, CONTENT_OUT_DURATION * 2, Easing.OutQuint);
content.FadeOut(CONTENT_OUT_DURATION, Easing.OutQuint); content.FadeOut(CONTENT_OUT_DURATION, Easing.OutQuint);
settingsScroll.FadeOut(CONTENT_OUT_DURATION, Easing.OutQuint)
.MoveToX(settingsScroll.DrawWidth, CONTENT_OUT_DURATION * 2, Easing.OutQuint);
lowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF, CONTENT_OUT_DURATION); lowPassFilter.CutoffTo(AudioFilter.MAX_LOWPASS_CUTOFF, CONTENT_OUT_DURATION);
highPassFilter.CutoffTo(0, CONTENT_OUT_DURATION); highPassFilter.CutoffTo(0, CONTENT_OUT_DURATION);
} }
@ -435,7 +458,7 @@ namespace osu.Game.Screens.Play
ContentOut(); ContentOut();
TransformSequence<PlayerLoader> pushSequence = this.Delay(CONTENT_OUT_DURATION); TransformSequence<PlayerLoader> pushSequence = this.Delay(0);
// only show if the warning was created (i.e. the beatmap needs it) // only show if the warning was created (i.e. the beatmap needs it)
// and this is not a restart of the map (the warning expires after first load). // and this is not a restart of the map (the warning expires after first load).
@ -444,6 +467,7 @@ namespace osu.Game.Screens.Play
const double epilepsy_display_length = 3000; const double epilepsy_display_length = 3000;
pushSequence pushSequence
.Delay(CONTENT_OUT_DURATION)
.Schedule(() => epilepsyWarning.State.Value = Visibility.Visible) .Schedule(() => epilepsyWarning.State.Value = Visibility.Visible)
.TransformBindableTo(volumeAdjustment, 0.25, EpilepsyWarning.FADE_DURATION, Easing.OutQuint) .TransformBindableTo(volumeAdjustment, 0.25, EpilepsyWarning.FADE_DURATION, Easing.OutQuint)
.Delay(epilepsy_display_length) .Delay(epilepsy_display_length)