osu/osu.Game/Screens/Select/MatchSongSelect.cs

39 lines
1.0 KiB
C#
Raw Normal View History

// 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 09:19:50 +00:00
using System;
2018-12-25 08:17:51 +00:00
using Humanizer;
2019-01-23 11:52:00 +00:00
using osu.Framework.Screens;
using osu.Game.Online.Multiplayer;
2018-12-10 10:20:41 +00:00
using osu.Game.Screens.Multi;
2018-04-13 09:19:50 +00:00
namespace osu.Game.Screens.Select
{
2018-12-26 11:05:57 +00:00
public class MatchSongSelect : SongSelect, IMultiplayerSubScreen
2018-04-13 09:19:50 +00:00
{
public Action<PlaylistItem> Selected;
public string ShortTitle => "song selection";
2018-12-25 08:17:51 +00:00
public override string Title => ShortTitle.Humanize();
protected override bool OnStart()
2018-04-13 09:19:50 +00:00
{
var item = new PlaylistItem
{
Beatmap = Beatmap.Value.BeatmapInfo,
Ruleset = Ruleset.Value,
RulesetID = Ruleset.Value.ID ?? 0
};
item.RequiredMods.AddRange(SelectedMods.Value);
Selected?.Invoke(item);
2019-01-23 11:52:00 +00:00
if (this.IsCurrentScreen())
this.Exit();
2018-04-13 09:19:50 +00:00
return true;
}
}
}