2019-01-24 16:43:03 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-12-26 21:16:35 +08:00
|
|
|
|
using System;
|
2019-04-08 17:32:05 +08:00
|
|
|
|
using System.Collections.Generic;
|
2019-03-20 15:54:42 +08:00
|
|
|
|
using System.Linq;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2019-03-20 18:35:40 +08:00
|
|
|
|
using osu.Framework.Input;
|
2018-05-09 22:31:52 +08:00
|
|
|
|
using osu.Framework.Localisation;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Framework.Screens;
|
2018-05-09 22:31:52 +08:00
|
|
|
|
using osu.Framework.Threading;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
|
using osu.Game.Graphics;
|
2019-03-22 18:01:32 +08:00
|
|
|
|
using osu.Game.Graphics.Containers;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2018-08-02 18:47:50 +08:00
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
2019-04-08 17:32:05 +08:00
|
|
|
|
using osu.Game.Rulesets.Mods;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Screens.Menu;
|
2019-01-26 17:14:45 +08:00
|
|
|
|
using osu.Game.Screens.Play.HUD;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Screens.Play.PlayerSettings;
|
2019-04-13 19:18:44 +08:00
|
|
|
|
using osu.Game.Users;
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
|
|
|
|
using osuTK.Graphics;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play
|
|
|
|
|
{
|
|
|
|
|
public class PlayerLoader : ScreenWithBeatmapBackground
|
|
|
|
|
{
|
2019-03-14 15:09:17 +08:00
|
|
|
|
protected const float BACKGROUND_BLUR = 15;
|
2019-03-13 15:47:03 +08:00
|
|
|
|
|
2018-12-26 21:16:35 +08:00
|
|
|
|
private readonly Func<Player> createPlayer;
|
2018-08-02 17:16:36 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
private Player player;
|
|
|
|
|
|
2019-04-05 11:02:47 +08:00
|
|
|
|
private LogoTrackingContainer content;
|
2019-01-24 18:55:42 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
private BeatmapMetadataDisplay info;
|
|
|
|
|
|
2018-05-21 21:53:50 +08:00
|
|
|
|
private bool hideOverlays;
|
2019-01-28 14:41:54 +08:00
|
|
|
|
public override bool HideOverlaysOnEnter => hideOverlays;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-06-12 15:33:15 +08:00
|
|
|
|
protected override UserActivity InitialActivity => null; //shows the previous screen status
|
2019-04-13 19:18:44 +08:00
|
|
|
|
|
2019-02-01 14:42:15 +08:00
|
|
|
|
public override bool DisallowExternalBeatmapRulesetChanges => true;
|
|
|
|
|
|
2019-04-25 13:15:07 +08:00
|
|
|
|
protected override bool PlayResumeSound => false;
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
private Task loadTask;
|
|
|
|
|
|
2019-03-20 18:35:40 +08:00
|
|
|
|
private InputManager inputManager;
|
|
|
|
|
|
2018-12-26 21:16:35 +08:00
|
|
|
|
public PlayerLoader(Func<Player> createPlayer)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-12-26 21:16:35 +08:00
|
|
|
|
this.createPlayer = createPlayer;
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-12-26 21:16:35 +08:00
|
|
|
|
private void restartRequested()
|
|
|
|
|
{
|
|
|
|
|
hideOverlays = true;
|
|
|
|
|
ValidForResume = true;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load()
|
|
|
|
|
{
|
2019-04-05 11:02:47 +08:00
|
|
|
|
InternalChild = (content = new LogoTrackingContainer
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
2019-01-24 18:55:42 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
2019-04-05 11:02:47 +08:00
|
|
|
|
}).WithChildren(new Drawable[]
|
2019-03-27 17:11:12 +08:00
|
|
|
|
{
|
2019-04-17 16:17:33 +08:00
|
|
|
|
info = new BeatmapMetadataDisplay(Beatmap.Value, Mods.Value, content.LogoFacade)
|
2018-05-09 22:31:52 +08:00
|
|
|
|
{
|
2019-03-27 17:11:12 +08:00
|
|
|
|
Alpha = 0,
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
},
|
|
|
|
|
new FillFlowContainer<PlayerSettingsGroup>
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopRight,
|
|
|
|
|
Origin = Anchor.TopRight,
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
|
Spacing = new Vector2(0, 20),
|
|
|
|
|
Margin = new MarginPadding(25),
|
|
|
|
|
Children = new PlayerSettingsGroup[]
|
2019-01-24 18:55:42 +08:00
|
|
|
|
{
|
2019-03-27 17:11:12 +08:00
|
|
|
|
VisualSettings = new VisualSettings(),
|
|
|
|
|
new InputSettings()
|
2019-01-24 18:55:42 +08:00
|
|
|
|
}
|
2018-05-09 22:31:52 +08:00
|
|
|
|
}
|
2019-04-05 11:02:47 +08:00
|
|
|
|
});
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2018-12-26 21:16:35 +08:00
|
|
|
|
loadNewPlayer();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-08-02 18:47:50 +08:00
|
|
|
|
private void playerLoaded(Player player) => info.Loading = false;
|
|
|
|
|
|
2019-01-23 19:52:00 +08:00
|
|
|
|
public override void OnResuming(IScreen last)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
base.OnResuming(last);
|
|
|
|
|
|
|
|
|
|
contentIn();
|
|
|
|
|
|
2018-08-02 18:47:50 +08:00
|
|
|
|
info.Loading = true;
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
//we will only be resumed if the player has requested a re-run (see ValidForResume setting above)
|
2018-12-26 21:16:35 +08:00
|
|
|
|
loadNewPlayer();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
this.Delay(400).Schedule(pushWhenLoaded);
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-26 21:16:35 +08:00
|
|
|
|
private void loadNewPlayer()
|
|
|
|
|
{
|
|
|
|
|
var restartCount = player?.RestartCount + 1 ?? 0;
|
|
|
|
|
|
|
|
|
|
player = createPlayer();
|
|
|
|
|
player.RestartCount = restartCount;
|
|
|
|
|
player.RestartRequested = restartRequested;
|
|
|
|
|
|
|
|
|
|
loadTask = LoadComponentAsync(player, playerLoaded);
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
private void contentIn()
|
|
|
|
|
{
|
2019-01-24 18:55:42 +08:00
|
|
|
|
content.ScaleTo(1, 650, Easing.OutQuint);
|
|
|
|
|
content.FadeInFromZero(400);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void contentOut()
|
|
|
|
|
{
|
2019-04-04 10:28:36 +08:00
|
|
|
|
// Ensure the logo is no longer tracking before we scale the content
|
2019-04-08 14:24:09 +08:00
|
|
|
|
content.StopTracking();
|
2019-03-28 15:29:35 +08:00
|
|
|
|
|
2019-01-24 18:55:42 +08:00
|
|
|
|
content.ScaleTo(0.7f, 300, Easing.InQuint);
|
|
|
|
|
content.FadeOut(250);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-01-23 19:52:00 +08:00
|
|
|
|
public override void OnEntering(IScreen last)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
base.OnEntering(last);
|
|
|
|
|
|
2019-01-24 18:55:42 +08:00
|
|
|
|
content.ScaleTo(0.7f);
|
2019-03-13 15:47:03 +08:00
|
|
|
|
Background?.FadeColour(Color4.White, 800, Easing.OutQuint);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
contentIn();
|
|
|
|
|
|
|
|
|
|
info.Delay(750).FadeIn(500);
|
|
|
|
|
this.Delay(1800).Schedule(pushWhenLoaded);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LogoArriving(OsuLogo logo, bool resuming)
|
|
|
|
|
{
|
|
|
|
|
base.LogoArriving(logo, resuming);
|
|
|
|
|
|
2019-03-22 19:01:58 +08:00
|
|
|
|
const double duration = 300;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-03-28 15:09:42 +08:00
|
|
|
|
if (!resuming)
|
|
|
|
|
{
|
|
|
|
|
logo.MoveTo(new Vector2(0.5f), duration, Easing.In);
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-22 19:01:58 +08:00
|
|
|
|
logo.ScaleTo(new Vector2(0.15f), duration, Easing.In);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
logo.FadeIn(350);
|
|
|
|
|
|
2019-04-24 15:20:51 +08:00
|
|
|
|
Scheduler.AddDelayed(() =>
|
|
|
|
|
{
|
|
|
|
|
if (this.IsCurrentScreen())
|
|
|
|
|
content.StartTracking(logo, resuming ? 0 : 500, Easing.InOutExpo);
|
|
|
|
|
}, resuming ? 0 : 500);
|
2019-03-26 16:18:35 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LogoExiting(OsuLogo logo)
|
|
|
|
|
{
|
|
|
|
|
base.LogoExiting(logo);
|
2019-04-08 14:24:09 +08:00
|
|
|
|
content.StopTracking();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-03-20 18:42:39 +08:00
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
inputManager = GetContainingInputManager();
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
private ScheduledDelegate pushDebounce;
|
2019-02-21 14:24:26 +08:00
|
|
|
|
protected VisualSettings VisualSettings;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-03-26 09:48:29 +08:00
|
|
|
|
// Here because IsHovered will not update unless we do so.
|
2019-03-20 18:59:54 +08:00
|
|
|
|
public override bool HandlePositionalInput => true;
|
|
|
|
|
|
2018-08-01 15:20:29 +08:00
|
|
|
|
private bool readyForPush => player.LoadState == LoadState.Ready && IsHovered && GetContainingInputManager()?.DraggedDrawable == null;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
private void pushWhenLoaded()
|
|
|
|
|
{
|
2019-01-23 19:52:00 +08:00
|
|
|
|
if (!this.IsCurrentScreen()) return;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (!readyForPush)
|
|
|
|
|
{
|
|
|
|
|
// as the pushDebounce below has a delay, we need to keep checking and cancel a future debounce
|
|
|
|
|
// if we become unready for push during the delay.
|
|
|
|
|
cancelLoad();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (pushDebounce != null)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
pushDebounce = Scheduler.AddDelayed(() =>
|
|
|
|
|
{
|
|
|
|
|
contentOut();
|
|
|
|
|
|
|
|
|
|
this.Delay(250).Schedule(() =>
|
|
|
|
|
{
|
2019-01-23 19:52:00 +08:00
|
|
|
|
if (!this.IsCurrentScreen()) return;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
loadTask = null;
|
|
|
|
|
|
2018-04-20 15:52:15 +08:00
|
|
|
|
//By default, we want to load the player and never be returned to.
|
|
|
|
|
//Note that this may change if the player we load requested a re-run.
|
|
|
|
|
ValidForResume = false;
|
|
|
|
|
|
2018-04-20 16:30:27 +08:00
|
|
|
|
if (player.LoadedBeatmapSuccessfully)
|
2019-01-23 19:52:00 +08:00
|
|
|
|
this.Push(player);
|
2018-04-20 16:30:27 +08:00
|
|
|
|
else
|
2019-01-23 19:52:00 +08:00
|
|
|
|
this.Exit();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
});
|
|
|
|
|
}, 500);
|
|
|
|
|
}
|
|
|
|
|
finally
|
|
|
|
|
{
|
|
|
|
|
Schedule(pushWhenLoaded);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void cancelLoad()
|
|
|
|
|
{
|
|
|
|
|
pushDebounce?.Cancel();
|
|
|
|
|
pushDebounce = null;
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-23 19:52:00 +08:00
|
|
|
|
public override void OnSuspending(IScreen next)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-06-25 16:22:10 +08:00
|
|
|
|
BackgroundBrightnessReduction = false;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
base.OnSuspending(next);
|
|
|
|
|
cancelLoad();
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-23 19:52:00 +08:00
|
|
|
|
public override bool OnExiting(IScreen next)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-01-24 18:55:42 +08:00
|
|
|
|
content.ScaleTo(0.7f, 150, Easing.InQuint);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
this.FadeOut(150);
|
|
|
|
|
cancelLoad();
|
2019-02-18 15:00:59 +08:00
|
|
|
|
|
2019-03-20 13:17:35 +08:00
|
|
|
|
Background.EnableUserDim.Value = false;
|
2019-06-25 16:22:10 +08:00
|
|
|
|
BackgroundBrightnessReduction = false;
|
2019-02-20 16:20:45 +08:00
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
return base.OnExiting(next);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void Dispose(bool isDisposing)
|
|
|
|
|
{
|
|
|
|
|
base.Dispose(isDisposing);
|
|
|
|
|
|
2018-05-30 14:47:31 +08:00
|
|
|
|
if (isDisposing)
|
|
|
|
|
{
|
|
|
|
|
// if the player never got pushed, we should explicitly dispose it.
|
|
|
|
|
loadTask?.ContinueWith(_ => player.Dispose());
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2019-06-25 16:22:10 +08:00
|
|
|
|
private bool backgroundBrightnessReduction;
|
|
|
|
|
|
|
|
|
|
protected bool BackgroundBrightnessReduction
|
|
|
|
|
{
|
|
|
|
|
get => backgroundBrightnessReduction;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value == backgroundBrightnessReduction)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
backgroundBrightnessReduction = value;
|
|
|
|
|
|
|
|
|
|
Background.FadeColour(OsuColour.Gray(backgroundBrightnessReduction ? 0.8f : 1), 200);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-03-20 15:50:47 +08:00
|
|
|
|
protected override void Update()
|
|
|
|
|
{
|
|
|
|
|
base.Update();
|
|
|
|
|
|
|
|
|
|
if (!this.IsCurrentScreen())
|
|
|
|
|
return;
|
|
|
|
|
|
2019-03-20 18:41:20 +08:00
|
|
|
|
// We need to perform this check here rather than in OnHover as any number of children of VisualSettings
|
|
|
|
|
// may also be handling the hover events.
|
2019-03-20 18:35:40 +08:00
|
|
|
|
if (inputManager.HoveredDrawables.Contains(VisualSettings))
|
2019-03-20 15:50:47 +08:00
|
|
|
|
{
|
|
|
|
|
// Preview user-defined background dim and blur when hovered on the visual settings panel.
|
|
|
|
|
Background.EnableUserDim.Value = true;
|
|
|
|
|
Background.BlurAmount.Value = 0;
|
2019-06-25 16:22:10 +08:00
|
|
|
|
|
|
|
|
|
BackgroundBrightnessReduction = false;
|
2019-03-20 15:50:47 +08:00
|
|
|
|
}
|
2019-03-20 15:54:42 +08:00
|
|
|
|
else
|
2019-03-20 15:50:47 +08:00
|
|
|
|
{
|
|
|
|
|
// Returns background dim and blur to the values specified by PlayerLoader.
|
|
|
|
|
Background.EnableUserDim.Value = false;
|
|
|
|
|
Background.BlurAmount.Value = BACKGROUND_BLUR;
|
2019-06-25 16:22:10 +08:00
|
|
|
|
|
|
|
|
|
BackgroundBrightnessReduction = true;
|
2019-03-20 15:50:47 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-04-13 17:19:50 +08:00
|
|
|
|
private class BeatmapMetadataDisplay : Container
|
|
|
|
|
{
|
|
|
|
|
private class MetadataLine : Container
|
|
|
|
|
{
|
|
|
|
|
public MetadataLine(string left, string right)
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopRight,
|
|
|
|
|
Margin = new MarginPadding { Right = 5 },
|
2018-08-02 17:16:36 +08:00
|
|
|
|
Colour = OsuColour.Gray(0.8f),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Text = left,
|
|
|
|
|
},
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopLeft,
|
|
|
|
|
Margin = new MarginPadding { Left = 5 },
|
|
|
|
|
Text = string.IsNullOrEmpty(right) ? @"-" : right,
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private readonly WorkingBeatmap beatmap;
|
2019-04-10 16:13:12 +08:00
|
|
|
|
private readonly IReadOnlyList<Mod> mods;
|
2019-04-05 11:02:47 +08:00
|
|
|
|
private readonly Drawable facade;
|
2018-08-02 18:47:50 +08:00
|
|
|
|
private LoadingAnimation loading;
|
|
|
|
|
private Sprite backgroundSprite;
|
2019-01-26 17:14:45 +08:00
|
|
|
|
|
2018-08-02 18:47:50 +08:00
|
|
|
|
public bool Loading
|
|
|
|
|
{
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (value)
|
|
|
|
|
{
|
|
|
|
|
loading.Show();
|
|
|
|
|
backgroundSprite.FadeColour(OsuColour.Gray(0.5f), 400, Easing.OutQuint);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
loading.Hide();
|
|
|
|
|
backgroundSprite.FadeColour(Color4.White, 400, Easing.OutQuint);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2019-04-17 16:17:33 +08:00
|
|
|
|
public BeatmapMetadataDisplay(WorkingBeatmap beatmap, IReadOnlyList<Mod> mods, Drawable facade)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
this.beatmap = beatmap;
|
2019-04-08 17:32:05 +08:00
|
|
|
|
this.mods = mods;
|
2019-03-27 10:32:26 +08:00
|
|
|
|
this.facade = facade;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2018-09-19 13:07:46 +08:00
|
|
|
|
private void load()
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-03-05 16:58:27 +08:00
|
|
|
|
var metadata = beatmap.BeatmapInfo?.Metadata ?? new BeatmapMetadata();
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
Children = new Drawable[]
|
|
|
|
|
{
|
|
|
|
|
new FillFlowContainer
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Direction = FillDirection.Vertical,
|
2019-04-05 11:02:47 +08:00
|
|
|
|
Children = new[]
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2019-04-17 16:24:09 +08:00
|
|
|
|
facade.With(d =>
|
|
|
|
|
{
|
|
|
|
|
d.Anchor = Anchor.TopCentre;
|
|
|
|
|
d.Origin = Anchor.TopCentre;
|
|
|
|
|
}),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
2018-09-19 13:07:46 +08:00
|
|
|
|
Text = new LocalisedString((metadata.TitleUnicode, metadata.Title)),
|
2019-02-20 15:52:36 +08:00
|
|
|
|
Font = OsuFont.GetFont(size: 36, italics: true),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
2019-03-28 14:40:58 +08:00
|
|
|
|
Margin = new MarginPadding { Top = 15 },
|
2018-04-13 17:19:50 +08:00
|
|
|
|
},
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
2018-09-19 13:07:46 +08:00
|
|
|
|
Text = new LocalisedString((metadata.ArtistUnicode, metadata.Artist)),
|
2019-02-20 15:52:36 +08:00
|
|
|
|
Font = OsuFont.GetFont(size: 26, italics: true),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
},
|
|
|
|
|
new Container
|
|
|
|
|
{
|
|
|
|
|
Size = new Vector2(300, 60),
|
|
|
|
|
Margin = new MarginPadding(10),
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
CornerRadius = 10,
|
|
|
|
|
Masking = true,
|
2018-08-02 18:47:50 +08:00
|
|
|
|
Children = new Drawable[]
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
2018-08-02 18:47:50 +08:00
|
|
|
|
backgroundSprite = new Sprite
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
Texture = beatmap?.Background,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
FillMode = FillMode.Fill,
|
|
|
|
|
},
|
2018-08-02 18:47:50 +08:00
|
|
|
|
loading = new LoadingAnimation { Scale = new Vector2(1.3f) }
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Text = beatmap?.BeatmapInfo?.Version,
|
2019-02-20 15:52:36 +08:00
|
|
|
|
Font = OsuFont.GetFont(size: 26, italics: true),
|
2018-04-13 17:19:50 +08:00
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Margin = new MarginPadding
|
|
|
|
|
{
|
|
|
|
|
Bottom = 40
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
new MetadataLine("Source", metadata.Source)
|
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
},
|
|
|
|
|
new MetadataLine("Mapper", metadata.AuthorString)
|
|
|
|
|
{
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
},
|
2019-03-05 16:58:05 +08:00
|
|
|
|
new ModDisplay
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Margin = new MarginPadding { Top = 20 },
|
2019-04-08 17:32:05 +08:00
|
|
|
|
Current = { Value = mods }
|
2019-03-05 16:58:05 +08:00
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
};
|
2018-08-02 18:47:50 +08:00
|
|
|
|
|
|
|
|
|
Loading = true;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|