1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-20 00:52:56 +08:00

Timeshift -> Playlists at a code level

This commit is contained in:
Dean Herbert 2020-12-25 13:11:21 +09:00
parent 4e21bd0108
commit a1384942b1
27 changed files with 93 additions and 93 deletions

View File

@ -11,7 +11,7 @@ using osu.Game.Graphics.Sprites;
using osu.Game.Graphics.UserInterface; using osu.Game.Graphics.UserInterface;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi; using osu.Game.Screens.Multi;
using osu.Game.Screens.Multi.Timeshift; using osu.Game.Screens.Multi.Playlists;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer
{ {
@ -109,7 +109,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddUntilStep("error not displayed", () => !settings.ErrorText.IsPresent); AddUntilStep("error not displayed", () => !settings.ErrorText.IsPresent);
} }
private class TestRoomSettings : TimeshiftMatchSettingsOverlay private class TestRoomSettings : PlaylistsMatchSettingsOverlay
{ {
public TriangleButton ApplyButton => ((MatchSettings)Settings).ApplyButton; public TriangleButton ApplyButton => ((MatchSettings)Settings).ApplyButton;

View File

@ -4,7 +4,7 @@
using NUnit.Framework; using NUnit.Framework;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Screens.Multi.Timeshift; using osu.Game.Screens.Multi.Playlists;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer
{ {
@ -18,7 +18,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
public TestSceneMultiScreen() public TestSceneMultiScreen()
{ {
var multi = new TimeshiftMultiplayer(); var multi = new PlaylistsMultiplayer();
AddStep("show", () => LoadScreen(multi)); AddStep("show", () => LoadScreen(multi));
AddUntilStep("wait for loaded", () => multi.IsLoaded); AddUntilStep("wait for loaded", () => multi.IsLoaded);

View File

@ -6,11 +6,11 @@ using osu.Game.Screens.Multi.Lounge.Components;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer
{ {
public class TestSceneTimeshiftFilterControl : OsuTestScene public class TestScenePlaylistsFilterControl : OsuTestScene
{ {
public TestSceneTimeshiftFilterControl() public TestScenePlaylistsFilterControl()
{ {
Child = new TimeshiftFilterControl Child = new PlaylistsFilterControl
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,

View File

@ -10,11 +10,11 @@ using osu.Framework.Testing;
using osu.Game.Graphics.Containers; using osu.Game.Graphics.Containers;
using osu.Game.Screens.Multi.Lounge; using osu.Game.Screens.Multi.Lounge;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.Multi.Lounge.Components;
using osu.Game.Screens.Multi.Timeshift; using osu.Game.Screens.Multi.Playlists;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer
{ {
public class TestSceneTimeshiftLoungeSubScreen : RoomManagerTestScene public class TestScenePlaylistsLoungeSubScreen : RoomManagerTestScene
{ {
private LoungeSubScreen loungeScreen; private LoungeSubScreen loungeScreen;
@ -27,7 +27,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
{ {
base.SetUpSteps(); base.SetUpSteps();
AddStep("push screen", () => LoadScreen(loungeScreen = new TimeshiftLoungeSubScreen AddStep("push screen", () => LoadScreen(loungeScreen = new PlaylistsLoungeSubScreen
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,

View File

@ -8,7 +8,7 @@ using osu.Game.Users;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer
{ {
public class TestSceneTimeshiftParticipantsList : MultiplayerTestScene public class TestScenePlaylistsParticipantsList : MultiplayerTestScene
{ {
[SetUp] [SetUp]
public new void Setup() => Schedule(() => public new void Setup() => Schedule(() =>

View File

@ -26,7 +26,7 @@ using osu.Game.Users;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer
{ {
public class TestSceneTimeshiftResultsScreen : ScreenTestScene public class TestScenePlaylistsResultsScreen : ScreenTestScene
{ {
private const int scores_per_result = 10; private const int scores_per_result = 10;
@ -360,7 +360,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
}; };
} }
private class TestResultsScreen : TimeshiftResultsScreen private class TestResultsScreen : PlaylistsResultsScreen
{ {
public new LoadingSpinner LeftSpinner => base.LeftSpinner; public new LoadingSpinner LeftSpinner => base.LeftSpinner;
public new LoadingSpinner CentreSpinner => base.CentreSpinner; public new LoadingSpinner CentreSpinner => base.CentreSpinner;

View File

@ -17,14 +17,14 @@ using osu.Game.Rulesets;
using osu.Game.Rulesets.Osu; using osu.Game.Rulesets.Osu;
using osu.Game.Screens.Multi; using osu.Game.Screens.Multi;
using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.Multi.Match.Components;
using osu.Game.Screens.Multi.Timeshift; using osu.Game.Screens.Multi.Playlists;
using osu.Game.Tests.Beatmaps; using osu.Game.Tests.Beatmaps;
using osu.Game.Users; using osu.Game.Users;
using osuTK.Input; using osuTK.Input;
namespace osu.Game.Tests.Visual.Multiplayer namespace osu.Game.Tests.Visual.Multiplayer
{ {
public class TestSceneTimeshiftRoomSubScreen : MultiplayerTestScene public class TestScenePlaylistsRoomSubScreen : MultiplayerTestScene
{ {
protected override bool UseOnlineAPI => true; protected override bool UseOnlineAPI => true;
@ -34,7 +34,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
private BeatmapManager manager; private BeatmapManager manager;
private RulesetStore rulesets; private RulesetStore rulesets;
private TestTimeshiftRoomSubScreen match; private TestPlaylistsRoomSubScreen match;
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(GameHost host, AudioManager audio) private void load(GameHost host, AudioManager audio)
@ -48,7 +48,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
[SetUpSteps] [SetUpSteps]
public void SetupSteps() public void SetupSteps()
{ {
AddStep("load match", () => LoadScreen(match = new TestTimeshiftRoomSubScreen(Room))); AddStep("load match", () => LoadScreen(match = new TestPlaylistsRoomSubScreen(Room)));
AddUntilStep("wait for load", () => match.IsCurrentScreen()); AddUntilStep("wait for load", () => match.IsCurrentScreen());
} }
@ -120,7 +120,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddStep("create room", () => AddStep("create room", () =>
{ {
InputManager.MoveMouseTo(match.ChildrenOfType<TimeshiftMatchSettingsOverlay.CreateRoomButton>().Single()); InputManager.MoveMouseTo(match.ChildrenOfType<PlaylistsMatchSettingsOverlay.CreateRoomButton>().Single());
InputManager.Click(MouseButton.Left); InputManager.Click(MouseButton.Left);
}); });
@ -131,13 +131,13 @@ namespace osu.Game.Tests.Visual.Multiplayer
AddAssert("match has original beatmap", () => match.Beatmap.Value.Beatmap.BeatmapInfo.BaseDifficulty.CircleSize != 1); AddAssert("match has original beatmap", () => match.Beatmap.Value.Beatmap.BeatmapInfo.BaseDifficulty.CircleSize != 1);
} }
private class TestTimeshiftRoomSubScreen : TimeshiftRoomSubScreen private class TestPlaylistsRoomSubScreen : PlaylistsRoomSubScreen
{ {
public new Bindable<PlaylistItem> SelectedItem => base.SelectedItem; public new Bindable<PlaylistItem> SelectedItem => base.SelectedItem;
public new Bindable<WorkingBeatmap> Beatmap => base.Beatmap; public new Bindable<WorkingBeatmap> Beatmap => base.Beatmap;
public TestTimeshiftRoomSubScreen(Room room) public TestPlaylistsRoomSubScreen(Room room)
: base(room) : base(room)
{ {
} }

View File

@ -11,7 +11,7 @@ using osu.Game.Beatmaps;
using osu.Game.Overlays; using osu.Game.Overlays;
using osu.Game.Overlays.Mods; using osu.Game.Overlays.Mods;
using osu.Game.Overlays.Toolbar; using osu.Game.Overlays.Toolbar;
using osu.Game.Screens.Multi.Timeshift; using osu.Game.Screens.Multi.Playlists;
using osu.Game.Screens.Play; using osu.Game.Screens.Play;
using osu.Game.Screens.Select; using osu.Game.Screens.Select;
using osu.Game.Screens.Select.Options; using osu.Game.Screens.Select.Options;
@ -108,14 +108,14 @@ namespace osu.Game.Tests.Visual.Navigation
[Test] [Test]
public void TestExitMultiWithEscape() public void TestExitMultiWithEscape()
{ {
PushAndConfirm(() => new TimeshiftMultiplayer()); PushAndConfirm(() => new PlaylistsMultiplayer());
exitViaEscapeAndConfirm(); exitViaEscapeAndConfirm();
} }
[Test] [Test]
public void TestExitMultiWithBackButton() public void TestExitMultiWithBackButton()
{ {
PushAndConfirm(() => new TimeshiftMultiplayer()); PushAndConfirm(() => new PlaylistsMultiplayer());
exitViaBackButtonAndConfirm(); exitViaBackButtonAndConfirm();
} }

View File

@ -8,9 +8,9 @@ using osuTK;
namespace osu.Game.Online.Multiplayer.GameTypes namespace osu.Game.Online.Multiplayer.GameTypes
{ {
public class GameTypeTimeshift : GameType public class GameTypePlaylists : GameType
{ {
public override string Name => "Timeshift"; public override string Name => "Playlists";
public override Drawable GetIcon(OsuColour colours, float size) => new SpriteIcon public override Drawable GetIcon(OsuColour colours, float size) => new SpriteIcon
{ {

View File

@ -66,7 +66,7 @@ namespace osu.Game.Online.Multiplayer
[Cached] [Cached]
[JsonIgnore] [JsonIgnore]
public readonly Bindable<GameType> Type = new Bindable<GameType>(new GameTypeTimeshift()); public readonly Bindable<GameType> Type = new Bindable<GameType>(new GameTypePlaylists());
[Cached] [Cached]
[JsonIgnore] [JsonIgnore]

View File

@ -43,7 +43,7 @@ namespace osu.Game.Screens.Menu
public Action OnSolo; public Action OnSolo;
public Action OnSettings; public Action OnSettings;
public Action OnMultiplayer; public Action OnMultiplayer;
public Action OnTimeshift; public Action OnPlaylists;
public const float BUTTON_WIDTH = 140f; public const float BUTTON_WIDTH = 140f;
public const float WEDGE_WIDTH = 20; public const float WEDGE_WIDTH = 20;
@ -125,7 +125,7 @@ namespace osu.Game.Screens.Menu
{ {
buttonsPlay.Add(new Button(@"solo", @"button-solo-select", FontAwesome.Solid.User, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P)); buttonsPlay.Add(new Button(@"solo", @"button-solo-select", FontAwesome.Solid.User, new Color4(102, 68, 204, 255), () => OnSolo?.Invoke(), WEDGE_WIDTH, Key.P));
buttonsPlay.Add(new Button(@"multi", @"button-generic-select", FontAwesome.Solid.Users, new Color4(94, 63, 186, 255), onMultiplayer, 0, Key.M)); buttonsPlay.Add(new Button(@"multi", @"button-generic-select", FontAwesome.Solid.Users, new Color4(94, 63, 186, 255), onMultiplayer, 0, Key.M));
buttonsPlay.Add(new Button(@"playlists", @"button-generic-select", OsuIcon.Charts, new Color4(94, 63, 186, 255), onTimeshift, 0, Key.L)); buttonsPlay.Add(new Button(@"playlists", @"button-generic-select", OsuIcon.Charts, new Color4(94, 63, 186, 255), onPlaylists, 0, Key.L));
buttonsPlay.ForEach(b => b.VisibleState = ButtonSystemState.Play); buttonsPlay.ForEach(b => b.VisibleState = ButtonSystemState.Play);
buttonsTopLevel.Add(new Button(@"play", @"button-play-select", OsuIcon.Logo, new Color4(102, 68, 204, 255), () => State = ButtonSystemState.Play, WEDGE_WIDTH, Key.P)); buttonsTopLevel.Add(new Button(@"play", @"button-play-select", OsuIcon.Logo, new Color4(102, 68, 204, 255), () => State = ButtonSystemState.Play, WEDGE_WIDTH, Key.P));
@ -175,7 +175,7 @@ namespace osu.Game.Screens.Menu
OnMultiplayer?.Invoke(); OnMultiplayer?.Invoke();
} }
private void onTimeshift() private void onPlaylists()
{ {
if (!api.IsLoggedIn) if (!api.IsLoggedIn)
{ {
@ -193,7 +193,7 @@ namespace osu.Game.Screens.Menu
return; return;
} }
OnTimeshift?.Invoke(); OnPlaylists?.Invoke();
} }
private void updateIdleState(bool isIdle) private void updateIdleState(bool isIdle)

View File

@ -18,7 +18,7 @@ using osu.Game.Overlays;
using osu.Game.Screens.Backgrounds; using osu.Game.Screens.Backgrounds;
using osu.Game.Screens.Edit; using osu.Game.Screens.Edit;
using osu.Game.Screens.Multi.RealtimeMultiplayer; using osu.Game.Screens.Multi.RealtimeMultiplayer;
using osu.Game.Screens.Multi.Timeshift; using osu.Game.Screens.Multi.Playlists;
using osu.Game.Screens.Select; using osu.Game.Screens.Select;
namespace osu.Game.Screens.Menu namespace osu.Game.Screens.Menu
@ -106,7 +106,7 @@ namespace osu.Game.Screens.Menu
}, },
OnSolo = onSolo, OnSolo = onSolo,
OnMultiplayer = () => this.Push(new RealtimeMultiplayer()), OnMultiplayer = () => this.Push(new RealtimeMultiplayer()),
OnTimeshift = () => this.Push(new TimeshiftMultiplayer()), OnPlaylists = () => this.Push(new PlaylistsMultiplayer()),
OnExit = confirmAndExit, OnExit = confirmAndExit,
} }
} }

View File

@ -7,13 +7,13 @@ using osu.Game.Graphics.UserInterface;
namespace osu.Game.Screens.Multi.Lounge.Components namespace osu.Game.Screens.Multi.Lounge.Components
{ {
public class TimeshiftFilterControl : FilterControl public class PlaylistsFilterControl : FilterControl
{ {
private readonly Dropdown<TimeshiftCategory> dropdown; private readonly Dropdown<PlaylistsCategory> dropdown;
public TimeshiftFilterControl() public PlaylistsFilterControl()
{ {
AddInternal(dropdown = new SlimEnumDropdown<TimeshiftCategory> AddInternal(dropdown = new SlimEnumDropdown<PlaylistsCategory>
{ {
Anchor = Anchor.BottomRight, Anchor = Anchor.BottomRight,
Origin = Anchor.TopRight, Origin = Anchor.TopRight,
@ -37,11 +37,11 @@ namespace osu.Game.Screens.Multi.Lounge.Components
switch (dropdown.Current.Value) switch (dropdown.Current.Value)
{ {
case TimeshiftCategory.Normal: case PlaylistsCategory.Normal:
criteria.Category = "normal"; criteria.Category = "normal";
break; break;
case TimeshiftCategory.Spotlight: case PlaylistsCategory.Spotlight:
criteria.Category = "spotlight"; criteria.Category = "spotlight";
break; break;
} }
@ -49,7 +49,7 @@ namespace osu.Game.Screens.Multi.Lounge.Components
return criteria; return criteria;
} }
private enum TimeshiftCategory private enum PlaylistsCategory
{ {
Any, Any,
Normal, Normal,

View File

@ -10,7 +10,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Timeshift; using osu.Game.Screens.Multi.Playlists;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Match.Components namespace osu.Game.Screens.Multi.Match.Components
@ -32,7 +32,7 @@ namespace osu.Game.Screens.Multi.Match.Components
InternalChildren = new[] InternalChildren = new[]
{ {
background = new Box { RelativeSizeAxes = Axes.Both }, background = new Box { RelativeSizeAxes = Axes.Both },
new TimeshiftReadyButton new PlaylistsReadyButton
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre, Origin = Anchor.Centre,

View File

@ -33,7 +33,7 @@ namespace osu.Game.Screens.Multi.Match.Components
AddItem(new GameTypeVersus()); AddItem(new GameTypeVersus());
AddItem(new GameTypeTagTeam()); AddItem(new GameTypeTagTeam());
AddItem(new GameTypeTeamVersus()); AddItem(new GameTypeTeamVersus());
AddItem(new GameTypeTimeshift()); AddItem(new GameTypePlaylists());
} }
private class GameTypePickerItem : DisableableTabItem private class GameTypePickerItem : DisableableTabItem

View File

@ -20,7 +20,7 @@ using osu.Game.Screens.Ranking;
namespace osu.Game.Screens.Multi.Play namespace osu.Game.Screens.Multi.Play
{ {
public class TimeshiftPlayer : Player public class PlaylistsPlayer : Player
{ {
public Action Exited; public Action Exited;
@ -37,7 +37,7 @@ namespace osu.Game.Screens.Multi.Play
[Resolved] [Resolved]
private IBindable<RulesetInfo> ruleset { get; set; } private IBindable<RulesetInfo> ruleset { get; set; }
public TimeshiftPlayer(PlaylistItem playlistItem, PlayerConfiguration configuration = null) public PlaylistsPlayer(PlaylistItem playlistItem, PlayerConfiguration configuration = null)
: base(configuration) : base(configuration)
{ {
PlaylistItem = playlistItem; PlaylistItem = playlistItem;
@ -50,7 +50,7 @@ namespace osu.Game.Screens.Multi.Play
bool failed = false; bool failed = false;
// Sanity checks to ensure that TimeshiftPlayer matches the settings for the current PlaylistItem // Sanity checks to ensure that PlaylistsPlayer matches the settings for the current PlaylistItem
if (Beatmap.Value.BeatmapInfo.OnlineBeatmapID != PlaylistItem.Beatmap.Value.OnlineBeatmapID) if (Beatmap.Value.BeatmapInfo.OnlineBeatmapID != PlaylistItem.Beatmap.Value.OnlineBeatmapID)
throw new InvalidOperationException("Current Beatmap does not match PlaylistItem's Beatmap"); throw new InvalidOperationException("Current Beatmap does not match PlaylistItem's Beatmap");
@ -94,7 +94,7 @@ namespace osu.Game.Screens.Multi.Play
protected override ResultsScreen CreateResults(ScoreInfo score) protected override ResultsScreen CreateResults(ScoreInfo score)
{ {
Debug.Assert(RoomId.Value != null); Debug.Assert(RoomId.Value != null);
return new TimeshiftResultsScreen(score, RoomId.Value.Value, PlaylistItem, true); return new PlaylistsResultsScreen(score, RoomId.Value.Value, PlaylistItem, true);
} }
protected override Score CreateScore() protected override Score CreateScore()

View File

@ -4,9 +4,9 @@
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.Multi.Match.Components;
namespace osu.Game.Screens.Multi.Timeshift namespace osu.Game.Screens.Multi.Playlists
{ {
public class CreateTimeshiftRoomButton : PurpleTriangleButton public class CreatePlaylistsRoomButton : PurpleTriangleButton
{ {
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()

View File

@ -6,12 +6,12 @@ using osu.Game.Screens.Multi.Lounge;
using osu.Game.Screens.Multi.Lounge.Components; using osu.Game.Screens.Multi.Lounge.Components;
using osu.Game.Screens.Multi.Match; using osu.Game.Screens.Multi.Match;
namespace osu.Game.Screens.Multi.Timeshift namespace osu.Game.Screens.Multi.Playlists
{ {
public class TimeshiftLoungeSubScreen : LoungeSubScreen public class PlaylistsLoungeSubScreen : LoungeSubScreen
{ {
protected override FilterControl CreateFilterControl() => new TimeshiftFilterControl(); protected override FilterControl CreateFilterControl() => new PlaylistsFilterControl();
protected override RoomSubScreen CreateRoomSubScreen(Room room) => new TimeshiftRoomSubScreen(room); protected override RoomSubScreen CreateRoomSubScreen(Room room) => new PlaylistsRoomSubScreen(room);
} }
} }

View File

@ -19,9 +19,9 @@ using osu.Game.Overlays;
using osu.Game.Screens.Multi.Match.Components; using osu.Game.Screens.Multi.Match.Components;
using osuTK; using osuTK;
namespace osu.Game.Screens.Multi.Timeshift namespace osu.Game.Screens.Multi.Playlists
{ {
public class TimeshiftMatchSettingsOverlay : MatchSettingsOverlay public class PlaylistsMatchSettingsOverlay : MatchSettingsOverlay
{ {
public Action EditPlaylist; public Action EditPlaylist;

View File

@ -9,41 +9,41 @@ using osu.Game.Screens.Multi.Components;
using osu.Game.Screens.Multi.Lounge; using osu.Game.Screens.Multi.Lounge;
using osu.Game.Screens.Multi.Match; using osu.Game.Screens.Multi.Match;
namespace osu.Game.Screens.Multi.Timeshift namespace osu.Game.Screens.Multi.Playlists
{ {
public class TimeshiftMultiplayer : Multiplayer public class PlaylistsMultiplayer : Multiplayer
{ {
protected override void UpdatePollingRate(bool isIdle) protected override void UpdatePollingRate(bool isIdle)
{ {
var timeshiftManager = (TimeshiftRoomManager)RoomManager; var playlistsManager = (PlaylistsRoomManager)RoomManager;
if (!this.IsCurrentScreen()) if (!this.IsCurrentScreen())
{ {
timeshiftManager.TimeBetweenListingPolls.Value = 0; playlistsManager.TimeBetweenListingPolls.Value = 0;
timeshiftManager.TimeBetweenSelectionPolls.Value = 0; playlistsManager.TimeBetweenSelectionPolls.Value = 0;
} }
else else
{ {
switch (CurrentSubScreen) switch (CurrentSubScreen)
{ {
case LoungeSubScreen _: case LoungeSubScreen _:
timeshiftManager.TimeBetweenListingPolls.Value = isIdle ? 120000 : 15000; playlistsManager.TimeBetweenListingPolls.Value = isIdle ? 120000 : 15000;
timeshiftManager.TimeBetweenSelectionPolls.Value = isIdle ? 120000 : 15000; playlistsManager.TimeBetweenSelectionPolls.Value = isIdle ? 120000 : 15000;
break; break;
case RoomSubScreen _: case RoomSubScreen _:
timeshiftManager.TimeBetweenListingPolls.Value = 0; playlistsManager.TimeBetweenListingPolls.Value = 0;
timeshiftManager.TimeBetweenSelectionPolls.Value = isIdle ? 30000 : 5000; playlistsManager.TimeBetweenSelectionPolls.Value = isIdle ? 30000 : 5000;
break; break;
default: default:
timeshiftManager.TimeBetweenListingPolls.Value = 0; playlistsManager.TimeBetweenListingPolls.Value = 0;
timeshiftManager.TimeBetweenSelectionPolls.Value = 0; playlistsManager.TimeBetweenSelectionPolls.Value = 0;
break; break;
} }
} }
Logger.Log($"Polling adjusted (listing: {timeshiftManager.TimeBetweenListingPolls.Value}, selection: {timeshiftManager.TimeBetweenSelectionPolls.Value})"); Logger.Log($"Polling adjusted (listing: {playlistsManager.TimeBetweenListingPolls.Value}, selection: {playlistsManager.TimeBetweenSelectionPolls.Value})");
} }
protected override Room CreateNewRoom() protected override Room CreateNewRoom()
@ -53,10 +53,10 @@ namespace osu.Game.Screens.Multi.Timeshift
protected override string ScreenTitle => "Playlists"; protected override string ScreenTitle => "Playlists";
protected override RoomManager CreateRoomManager() => new TimeshiftRoomManager(); protected override RoomManager CreateRoomManager() => new PlaylistsRoomManager();
protected override LoungeSubScreen CreateLounge() => new TimeshiftLoungeSubScreen(); protected override LoungeSubScreen CreateLounge() => new PlaylistsLoungeSubScreen();
protected override OsuButton CreateNewMultiplayerGameButton() => new CreateTimeshiftRoomButton(); protected override OsuButton CreateNewMultiplayerGameButton() => new CreatePlaylistsRoomButton();
} }
} }

View File

@ -8,14 +8,14 @@ using osu.Game.Graphics;
using osu.Game.Online.Multiplayer; using osu.Game.Online.Multiplayer;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.Multi.Components;
namespace osu.Game.Screens.Multi.Timeshift namespace osu.Game.Screens.Multi.Playlists
{ {
public class TimeshiftReadyButton : ReadyButton public class PlaylistsReadyButton : ReadyButton
{ {
[Resolved(typeof(Room), nameof(Room.EndDate))] [Resolved(typeof(Room), nameof(Room.EndDate))]
private Bindable<DateTimeOffset?> endDate { get; set; } private Bindable<DateTimeOffset?> endDate { get; set; }
public TimeshiftReadyButton() public PlaylistsReadyButton()
{ {
Text = "Start"; Text = "Start";
} }

View File

@ -5,9 +5,9 @@ using System.Collections.Generic;
using osu.Framework.Bindables; using osu.Framework.Bindables;
using osu.Game.Screens.Multi.Components; using osu.Game.Screens.Multi.Components;
namespace osu.Game.Screens.Multi.Timeshift namespace osu.Game.Screens.Multi.Playlists
{ {
public class TimeshiftRoomManager : RoomManager public class PlaylistsRoomManager : RoomManager
{ {
public readonly Bindable<double> TimeBetweenListingPolls = new Bindable<double>(); public readonly Bindable<double> TimeBetweenListingPolls = new Bindable<double>();
public readonly Bindable<double> TimeBetweenSelectionPolls = new Bindable<double>(); public readonly Bindable<double> TimeBetweenSelectionPolls = new Bindable<double>();

View File

@ -19,9 +19,9 @@ using osu.Game.Screens.Select;
using osu.Game.Users; using osu.Game.Users;
using Footer = osu.Game.Screens.Multi.Match.Components.Footer; using Footer = osu.Game.Screens.Multi.Match.Components.Footer;
namespace osu.Game.Screens.Multi.Timeshift namespace osu.Game.Screens.Multi.Playlists
{ {
public class TimeshiftRoomSubScreen : RoomSubScreen public class PlaylistsRoomSubScreen : RoomSubScreen
{ {
public override string Title { get; } public override string Title { get; }
@ -38,7 +38,7 @@ namespace osu.Game.Screens.Multi.Timeshift
private OverlinedHeader participantsHeader; private OverlinedHeader participantsHeader;
public TimeshiftRoomSubScreen(Room room) public PlaylistsRoomSubScreen(Room room)
{ {
Title = room.RoomID.Value == null ? "New playlist" : room.Name.Value; Title = room.RoomID.Value == null ? "New playlist" : room.Name.Value;
Activity.Value = new UserActivity.InLobby(room); Activity.Value = new UserActivity.InLobby(room);
@ -126,7 +126,7 @@ namespace osu.Game.Screens.Multi.Timeshift
RequestShowResults = item => RequestShowResults = item =>
{ {
Debug.Assert(roomId.Value != null); Debug.Assert(roomId.Value != null);
multiplayer?.Push(new TimeshiftResultsScreen(null, roomId.Value.Value, item, false)); multiplayer?.Push(new PlaylistsResultsScreen(null, roomId.Value.Value, item, false));
} }
} }
}, },
@ -188,7 +188,7 @@ namespace osu.Game.Screens.Multi.Timeshift
new Dimension(GridSizeMode.AutoSize), new Dimension(GridSizeMode.AutoSize),
} }
}, },
settingsOverlay = new TimeshiftMatchSettingsOverlay settingsOverlay = new PlaylistsMatchSettingsOverlay
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
EditPlaylist = () => this.Push(new MatchSongSelect()), EditPlaylist = () => this.Push(new MatchSongSelect()),
@ -219,7 +219,7 @@ namespace osu.Game.Screens.Multi.Timeshift
}, true); }, true);
} }
private void onStart() => StartPlay(() => new TimeshiftPlayer(SelectedItem.Value) private void onStart() => StartPlay(() => new PlaylistsPlayer(SelectedItem.Value)
{ {
Exited = () => leaderboard.RefreshScores() Exited = () => leaderboard.RefreshScores()
}); });

View File

@ -17,7 +17,7 @@ using osu.Game.Screens.Ranking;
namespace osu.Game.Screens.Multi.Ranking namespace osu.Game.Screens.Multi.Ranking
{ {
public class TimeshiftResultsScreen : ResultsScreen public class PlaylistsResultsScreen : ResultsScreen
{ {
private readonly int roomId; private readonly int roomId;
private readonly PlaylistItem playlistItem; private readonly PlaylistItem playlistItem;
@ -32,7 +32,7 @@ namespace osu.Game.Screens.Multi.Ranking
[Resolved] [Resolved]
private IAPIProvider api { get; set; } private IAPIProvider api { get; set; }
public TimeshiftResultsScreen(ScoreInfo score, int roomId, PlaylistItem playlistItem, bool allowRetry, bool allowWatchingReplay = true) public PlaylistsResultsScreen(ScoreInfo score, int roomId, PlaylistItem playlistItem, bool allowRetry, bool allowWatchingReplay = true)
: base(score, allowRetry, allowWatchingReplay) : base(score, allowRetry, allowWatchingReplay)
{ {
this.roomId = roomId; this.roomId = roomId;

View File

@ -28,31 +28,31 @@ namespace osu.Game.Screens.Multi.RealtimeMultiplayer
protected override void UpdatePollingRate(bool isIdle) protected override void UpdatePollingRate(bool isIdle)
{ {
var timeshiftManager = (RealtimeRoomManager)RoomManager; var playlistsManager = (RealtimeRoomManager)RoomManager;
if (!this.IsCurrentScreen()) if (!this.IsCurrentScreen())
{ {
timeshiftManager.TimeBetweenListingPolls.Value = 0; playlistsManager.TimeBetweenListingPolls.Value = 0;
timeshiftManager.TimeBetweenSelectionPolls.Value = 0; playlistsManager.TimeBetweenSelectionPolls.Value = 0;
} }
else else
{ {
switch (CurrentSubScreen) switch (CurrentSubScreen)
{ {
case LoungeSubScreen _: case LoungeSubScreen _:
timeshiftManager.TimeBetweenListingPolls.Value = isIdle ? 120000 : 15000; playlistsManager.TimeBetweenListingPolls.Value = isIdle ? 120000 : 15000;
timeshiftManager.TimeBetweenSelectionPolls.Value = isIdle ? 120000 : 15000; playlistsManager.TimeBetweenSelectionPolls.Value = isIdle ? 120000 : 15000;
break; break;
// Don't poll inside the match or anywhere else. // Don't poll inside the match or anywhere else.
default: default:
timeshiftManager.TimeBetweenListingPolls.Value = 0; playlistsManager.TimeBetweenListingPolls.Value = 0;
timeshiftManager.TimeBetweenSelectionPolls.Value = 0; playlistsManager.TimeBetweenSelectionPolls.Value = 0;
break; break;
} }
} }
Logger.Log($"Polling adjusted (listing: {timeshiftManager.TimeBetweenListingPolls.Value}, selection: {timeshiftManager.TimeBetweenSelectionPolls.Value})"); Logger.Log($"Polling adjusted (listing: {playlistsManager.TimeBetweenListingPolls.Value}, selection: {playlistsManager.TimeBetweenSelectionPolls.Value})");
} }
protected override Room CreateNewRoom() protected override Room CreateNewRoom()

View File

@ -19,8 +19,8 @@ using osuTK;
namespace osu.Game.Screens.Multi.RealtimeMultiplayer namespace osu.Game.Screens.Multi.RealtimeMultiplayer
{ {
// Todo: The "room" part of TimeshiftPlayer should be split out into an abstract player class to be inherited instead. // Todo: The "room" part of PlaylistsPlayer should be split out into an abstract player class to be inherited instead.
public class RealtimePlayer : TimeshiftPlayer public class RealtimePlayer : PlaylistsPlayer
{ {
protected override bool PauseOnFocusLost => false; protected override bool PauseOnFocusLost => false;

View File

@ -7,7 +7,7 @@ using osu.Game.Screens.Multi.Ranking;
namespace osu.Game.Screens.Multi.RealtimeMultiplayer namespace osu.Game.Screens.Multi.RealtimeMultiplayer
{ {
public class RealtimeResultsScreen : TimeshiftResultsScreen public class RealtimeResultsScreen : PlaylistsResultsScreen
{ {
public RealtimeResultsScreen(ScoreInfo score, int roomId, PlaylistItem playlistItem) public RealtimeResultsScreen(ScoreInfo score, int roomId, PlaylistItem playlistItem)
: base(score, roomId, playlistItem, false, false) : base(score, roomId, playlistItem, false, false)