2018-11-06 18:23:03 +08:00
|
|
|
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Beatmaps.Legacy;
|
|
|
|
using osu.Game.Tournament.Components;
|
2018-11-08 00:23:00 +08:00
|
|
|
using osu.Game.Tournament.IPC;
|
2018-11-06 18:23:03 +08:00
|
|
|
|
|
|
|
namespace osu.Game.Tournament.Screens
|
|
|
|
{
|
2018-11-11 00:39:02 +08:00
|
|
|
public abstract class BeatmapInfoScreen : TournamentScreen
|
2018-11-06 18:23:03 +08:00
|
|
|
{
|
|
|
|
protected readonly SongBar SongBar;
|
|
|
|
|
|
|
|
protected BeatmapInfoScreen()
|
|
|
|
{
|
|
|
|
Add(SongBar = new SongBar
|
|
|
|
{
|
2018-11-11 00:29:42 +08:00
|
|
|
Anchor = Anchor.BottomRight,
|
|
|
|
Origin = Anchor.BottomRight,
|
2018-11-06 18:23:03 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2018-11-15 20:28:42 +08:00
|
|
|
private void load(MatchIPCInfo ipc)
|
2018-11-06 18:23:03 +08:00
|
|
|
{
|
2018-11-08 00:23:00 +08:00
|
|
|
ipc.Beatmap.BindValueChanged(beatmapChanged, true);
|
|
|
|
ipc.Mods.BindValueChanged(modsChanged, true);
|
2018-11-06 18:23:03 +08:00
|
|
|
}
|
|
|
|
|
2018-11-08 00:23:00 +08:00
|
|
|
private void modsChanged(LegacyMods mods)
|
2018-11-06 18:23:03 +08:00
|
|
|
{
|
2018-11-08 00:23:00 +08:00
|
|
|
SongBar.Mods = mods;
|
2018-11-06 18:23:03 +08:00
|
|
|
}
|
|
|
|
|
2018-11-08 00:23:00 +08:00
|
|
|
private void beatmapChanged(BeatmapInfo beatmap)
|
2018-11-06 18:23:03 +08:00
|
|
|
{
|
2018-11-08 00:23:00 +08:00
|
|
|
SongBar.FadeInFromZero(300, Easing.OutQuint);
|
|
|
|
SongBar.Beatmap = beatmap;
|
2018-11-06 18:23:03 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|