mirror of
https://github.com/ppy/osu.git
synced 2024-12-17 00:23:22 +08:00
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
// 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.
|
|
|
|
using osu.Framework.Allocation;
|
|
using osu.Framework.Bindables;
|
|
using osu.Framework.Graphics;
|
|
using osu.Game.Beatmaps;
|
|
using osu.Game.Beatmaps.Legacy;
|
|
using osu.Game.Tournament.Components;
|
|
using osu.Game.Tournament.IPC;
|
|
|
|
namespace osu.Game.Tournament.Screens
|
|
{
|
|
public abstract class BeatmapInfoScreen : TournamentScreen
|
|
{
|
|
protected readonly SongBar SongBar;
|
|
|
|
protected BeatmapInfoScreen()
|
|
{
|
|
AddInternal(SongBar = new SongBar
|
|
{
|
|
Anchor = Anchor.BottomRight,
|
|
Origin = Anchor.BottomRight,
|
|
});
|
|
}
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(MatchIPCInfo ipc)
|
|
{
|
|
ipc.Beatmap.BindValueChanged(beatmapChanged, true);
|
|
ipc.Mods.BindValueChanged(modsChanged, true);
|
|
}
|
|
|
|
private void modsChanged(ValueChangedEvent<LegacyMods> mods)
|
|
{
|
|
SongBar.Mods = mods.NewValue;
|
|
}
|
|
|
|
private void beatmapChanged(ValueChangedEvent<BeatmapInfo> beatmap)
|
|
{
|
|
SongBar.FadeInFromZero(300, Easing.OutQuint);
|
|
SongBar.Beatmap = beatmap.NewValue;
|
|
}
|
|
}
|
|
}
|