1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 15:33:05 +08:00

Remove ILive remnants

This commit is contained in:
Dean Herbert 2022-01-26 15:12:01 +09:00
parent ba46827ac0
commit 9532454e2a
4 changed files with 17 additions and 17 deletions

View File

@ -19,11 +19,11 @@ namespace osu.Game.Tests.Visual.UserInterface
{ {
public class TestScenePlaylistOverlay : OsuManualInputManagerTestScene public class TestScenePlaylistOverlay : OsuManualInputManagerTestScene
{ {
private readonly BindableList<ILive<BeatmapSetInfo>> beatmapSets = new BindableList<ILive<BeatmapSetInfo>>(); private readonly BindableList<Live<BeatmapSetInfo>> beatmapSets = new BindableList<Live<BeatmapSetInfo>>();
private PlaylistOverlay playlistOverlay; private PlaylistOverlay playlistOverlay;
private ILive<BeatmapSetInfo> first; private Live<BeatmapSetInfo> first;
[SetUp] [SetUp]
public void Setup() => Schedule(() => public void Setup() => Schedule(() =>
@ -61,7 +61,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("hold 1st item handle", () => AddStep("hold 1st item handle", () =>
{ {
var handle = this.ChildrenOfType<OsuRearrangeableListItem<ILive<BeatmapSetInfo>>.PlaylistItemHandle>().First(); var handle = this.ChildrenOfType<OsuRearrangeableListItem<Live<BeatmapSetInfo>>.PlaylistItemHandle>().First();
InputManager.MoveMouseTo(handle.ScreenSpaceDrawQuad.Centre); InputManager.MoveMouseTo(handle.ScreenSpaceDrawQuad.Centre);
InputManager.PressButton(MouseButton.Left); InputManager.PressButton(MouseButton.Left);
}); });

View File

@ -13,11 +13,11 @@ using osuTK;
namespace osu.Game.Overlays.Music namespace osu.Game.Overlays.Music
{ {
public class Playlist : OsuRearrangeableListContainer<ILive<BeatmapSetInfo>> public class Playlist : OsuRearrangeableListContainer<Live<BeatmapSetInfo>>
{ {
public Action<ILive<BeatmapSetInfo>> RequestSelection; public Action<Live<BeatmapSetInfo>> RequestSelection;
public readonly Bindable<ILive<BeatmapSetInfo>> SelectedSet = new Bindable<ILive<BeatmapSetInfo>>(); public readonly Bindable<Live<BeatmapSetInfo>> SelectedSet = new Bindable<Live<BeatmapSetInfo>>();
public new MarginPadding Padding public new MarginPadding Padding
{ {
@ -27,7 +27,7 @@ namespace osu.Game.Overlays.Music
public void Filter(FilterCriteria criteria) public void Filter(FilterCriteria criteria)
{ {
var items = (SearchContainer<RearrangeableListItem<ILive<BeatmapSetInfo>>>)ListContainer; var items = (SearchContainer<RearrangeableListItem<Live<BeatmapSetInfo>>>)ListContainer;
foreach (var item in items.OfType<PlaylistItem>()) foreach (var item in items.OfType<PlaylistItem>())
item.InSelectedCollection = criteria.Collection?.Beatmaps.Any(b => item.Model.ID == b.BeatmapSet?.ID) ?? true; item.InSelectedCollection = criteria.Collection?.Beatmaps.Any(b => item.Model.ID == b.BeatmapSet?.ID) ?? true;
@ -35,15 +35,15 @@ namespace osu.Game.Overlays.Music
items.SearchTerm = criteria.SearchText; items.SearchTerm = criteria.SearchText;
} }
public ILive<BeatmapSetInfo> FirstVisibleSet => Items.FirstOrDefault(i => ((PlaylistItem)ItemMap[i]).MatchingFilter); public Live<BeatmapSetInfo> FirstVisibleSet => Items.FirstOrDefault(i => ((PlaylistItem)ItemMap[i]).MatchingFilter);
protected override OsuRearrangeableListItem<ILive<BeatmapSetInfo>> CreateOsuDrawable(ILive<BeatmapSetInfo> item) => new PlaylistItem(item) protected override OsuRearrangeableListItem<Live<BeatmapSetInfo>> CreateOsuDrawable(Live<BeatmapSetInfo> item) => new PlaylistItem(item)
{ {
SelectedSet = { BindTarget = SelectedSet }, SelectedSet = { BindTarget = SelectedSet },
RequestSelection = set => RequestSelection?.Invoke(set) RequestSelection = set => RequestSelection?.Invoke(set)
}; };
protected override FillFlowContainer<RearrangeableListItem<ILive<BeatmapSetInfo>>> CreateListFillFlowContainer() => new SearchContainer<RearrangeableListItem<ILive<BeatmapSetInfo>>> protected override FillFlowContainer<RearrangeableListItem<Live<BeatmapSetInfo>>> CreateListFillFlowContainer() => new SearchContainer<RearrangeableListItem<Live<BeatmapSetInfo>>>
{ {
Spacing = new Vector2(0, 3), Spacing = new Vector2(0, 3),
LayoutDuration = 200, LayoutDuration = 200,

View File

@ -17,11 +17,11 @@ using osuTK.Graphics;
namespace osu.Game.Overlays.Music namespace osu.Game.Overlays.Music
{ {
public class PlaylistItem : OsuRearrangeableListItem<ILive<BeatmapSetInfo>>, IFilterable public class PlaylistItem : OsuRearrangeableListItem<Live<BeatmapSetInfo>>, IFilterable
{ {
public readonly Bindable<ILive<BeatmapSetInfo>> SelectedSet = new Bindable<ILive<BeatmapSetInfo>>(); public readonly Bindable<Live<BeatmapSetInfo>> SelectedSet = new Bindable<Live<BeatmapSetInfo>>();
public Action<ILive<BeatmapSetInfo>> RequestSelection; public Action<Live<BeatmapSetInfo>> RequestSelection;
private TextFlowContainer text; private TextFlowContainer text;
private ITextPart titlePart; private ITextPart titlePart;
@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Music
[Resolved] [Resolved]
private OsuColour colours { get; set; } private OsuColour colours { get; set; }
public PlaylistItem(ILive<BeatmapSetInfo> item) public PlaylistItem(Live<BeatmapSetInfo> item)
: base(item) : base(item)
{ {
Padding = new MarginPadding { Left = 5 }; Padding = new MarginPadding { Left = 5 };

View File

@ -24,9 +24,9 @@ namespace osu.Game.Overlays.Music
private const float transition_duration = 600; private const float transition_duration = 600;
private const float playlist_height = 510; private const float playlist_height = 510;
public IBindableList<ILive<BeatmapSetInfo>> BeatmapSets => beatmapSets; public IBindableList<Live<BeatmapSetInfo>> BeatmapSets => beatmapSets;
private readonly BindableList<ILive<BeatmapSetInfo>> beatmapSets = new BindableList<ILive<BeatmapSetInfo>>(); private readonly BindableList<Live<BeatmapSetInfo>> beatmapSets = new BindableList<Live<BeatmapSetInfo>>();
private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>(); private readonly Bindable<WorkingBeatmap> beatmap = new Bindable<WorkingBeatmap>();
@ -144,7 +144,7 @@ namespace osu.Game.Overlays.Music
this.FadeOut(transition_duration); this.FadeOut(transition_duration);
} }
private void itemSelected(ILive<BeatmapSetInfo> beatmapSet) private void itemSelected(Live<BeatmapSetInfo> beatmapSet)
{ {
beatmapSet.PerformRead(set => beatmapSet.PerformRead(set =>
{ {