2020-12-18 15:15:41 +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.
|
|
|
|
|
|
|
|
using osu.Framework.Logging;
|
|
|
|
using osu.Framework.Screens;
|
2020-12-23 21:02:37 +00:00
|
|
|
using osu.Game.Graphics.UserInterface;
|
2020-12-25 04:38:11 +00:00
|
|
|
using osu.Game.Online.Rooms;
|
2020-12-20 08:42:23 +00:00
|
|
|
using osu.Game.Screens.Multi.Components;
|
2020-12-18 15:15:41 +00:00
|
|
|
using osu.Game.Screens.Multi.Lounge;
|
|
|
|
using osu.Game.Screens.Multi.Match;
|
|
|
|
|
2020-12-25 04:11:21 +00:00
|
|
|
namespace osu.Game.Screens.Multi.Playlists
|
2020-12-18 15:15:41 +00:00
|
|
|
{
|
2020-12-25 14:45:44 +00:00
|
|
|
public class Playlists : MultiplayerScreen
|
2020-12-18 15:15:41 +00:00
|
|
|
{
|
|
|
|
protected override void UpdatePollingRate(bool isIdle)
|
|
|
|
{
|
2020-12-25 04:11:21 +00:00
|
|
|
var playlistsManager = (PlaylistsRoomManager)RoomManager;
|
2020-12-18 15:15:41 +00:00
|
|
|
|
|
|
|
if (!this.IsCurrentScreen())
|
|
|
|
{
|
2020-12-25 04:11:21 +00:00
|
|
|
playlistsManager.TimeBetweenListingPolls.Value = 0;
|
|
|
|
playlistsManager.TimeBetweenSelectionPolls.Value = 0;
|
2020-12-18 15:15:41 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
switch (CurrentSubScreen)
|
|
|
|
{
|
|
|
|
case LoungeSubScreen _:
|
2020-12-25 04:11:21 +00:00
|
|
|
playlistsManager.TimeBetweenListingPolls.Value = isIdle ? 120000 : 15000;
|
|
|
|
playlistsManager.TimeBetweenSelectionPolls.Value = isIdle ? 120000 : 15000;
|
2020-12-18 15:15:41 +00:00
|
|
|
break;
|
|
|
|
|
2020-12-20 14:40:19 +00:00
|
|
|
case RoomSubScreen _:
|
2020-12-25 04:11:21 +00:00
|
|
|
playlistsManager.TimeBetweenListingPolls.Value = 0;
|
|
|
|
playlistsManager.TimeBetweenSelectionPolls.Value = isIdle ? 30000 : 5000;
|
2020-12-18 15:15:41 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2020-12-25 04:11:21 +00:00
|
|
|
playlistsManager.TimeBetweenListingPolls.Value = 0;
|
|
|
|
playlistsManager.TimeBetweenSelectionPolls.Value = 0;
|
2020-12-18 15:15:41 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-25 04:11:21 +00:00
|
|
|
Logger.Log($"Polling adjusted (listing: {playlistsManager.TimeBetweenListingPolls.Value}, selection: {playlistsManager.TimeBetweenSelectionPolls.Value})");
|
2020-12-18 15:15:41 +00:00
|
|
|
}
|
|
|
|
|
2020-12-24 12:59:10 +00:00
|
|
|
protected override Room CreateNewRoom()
|
|
|
|
{
|
|
|
|
return new Room { Name = { Value = $"{API.LocalUser}'s awesome playlist" } };
|
|
|
|
}
|
|
|
|
|
2020-12-24 15:18:35 +00:00
|
|
|
protected override string ScreenTitle => "Playlists";
|
|
|
|
|
2020-12-25 04:11:21 +00:00
|
|
|
protected override RoomManager CreateRoomManager() => new PlaylistsRoomManager();
|
2020-12-20 14:36:56 +00:00
|
|
|
|
2020-12-25 04:11:21 +00:00
|
|
|
protected override LoungeSubScreen CreateLounge() => new PlaylistsLoungeSubScreen();
|
2020-12-23 21:02:37 +00:00
|
|
|
|
2020-12-25 04:11:21 +00:00
|
|
|
protected override OsuButton CreateNewMultiplayerGameButton() => new CreatePlaylistsRoomButton();
|
2020-12-18 15:15:41 +00:00
|
|
|
}
|
|
|
|
}
|