osu/osu.Game.Tournament/Screens/BeatmapInfoScreen.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.4 KiB
C#
Raw Normal View History

2019-03-04 04:24:19 +00: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-11-06 10:23:03 +00:00
2022-06-17 07:37:17 +00:00
#nullable disable
2018-11-06 10:23:03 +00:00
using osu.Framework.Allocation;
2019-03-02 04:40:43 +00:00
using osu.Framework.Bindables;
2018-11-06 10:23:03 +00:00
using osu.Framework.Graphics;
using osu.Game.Beatmaps.Legacy;
using osu.Game.Tournament.Components;
2018-11-07 16:23:00 +00:00
using osu.Game.Tournament.IPC;
using osu.Game.Tournament.Models;
2018-11-06 10:23:03 +00:00
namespace osu.Game.Tournament.Screens
{
public abstract partial class BeatmapInfoScreen : TournamentMatchScreen
2018-11-06 10:23:03 +00:00
{
protected readonly SongBar SongBar;
protected BeatmapInfoScreen()
{
AddInternal(SongBar = new SongBar
2018-11-06 10:23:03 +00:00
{
2018-11-10 16:29:42 +00:00
Anchor = Anchor.BottomRight,
Origin = Anchor.BottomRight,
Depth = float.MinValue,
2018-11-06 10:23:03 +00:00
});
}
[BackgroundDependencyLoader]
2018-11-15 12:28:42 +00:00
private void load(MatchIPCInfo ipc)
2018-11-06 10:23:03 +00:00
{
2018-11-07 16:23:00 +00:00
ipc.Beatmap.BindValueChanged(beatmapChanged, true);
ipc.Mods.BindValueChanged(modsChanged, true);
2018-11-06 10:23:03 +00:00
}
2019-03-02 04:40:43 +00:00
private void modsChanged(ValueChangedEvent<LegacyMods> mods)
2018-11-06 10:23:03 +00:00
{
2019-03-02 04:40:43 +00:00
SongBar.Mods = mods.NewValue;
2018-11-06 10:23:03 +00:00
}
private void beatmapChanged(ValueChangedEvent<TournamentBeatmap> beatmap)
2018-11-06 10:23:03 +00:00
{
2018-11-07 16:23:00 +00:00
SongBar.FadeInFromZero(300, Easing.OutQuint);
SongBar.Beatmap = beatmap.NewValue;
2018-11-06 10:23:03 +00:00
}
}
}