コード例 #1
0
ファイル: SelectScreen.cs プロジェクト: Abriel14/Quaver
        /// <summary>
        /// </summary>
        public SelectScreen()
        {
            // Go to the import screen if we've imported a map not on the select screen
            if (MapsetImporter.Queue.Count > 0 ||
                MapDatabaseCache.LoadedMapsFromOtherGames != ConfigManager.AutoLoadOsuBeatmaps.Value ||
                QuaverSettingsDatabaseCache.OutdatedMaps.Count != 0)
            {
                Exit(() => new ImportingScreen());
                return;
            }

            // Grab the mapsets available to the user according to their previous search term.
            AvailableMapsets = MapsetHelper.SearchMapsets(MapManager.Mapsets, PreviousSearchTerm);

            // If no mapsets were found, just default to all of them.
            if (AvailableMapsets.Count == 0)
            {
                AvailableMapsets = MapManager.Mapsets;
            }

            AvailableMapsets = MapsetHelper.OrderMapsetsByConfigValue(AvailableMapsets);

            Logger.Debug($"There are currently: {AvailableMapsets.Count} available mapsets to play in select.",
                         LogType.Runtime);

            DiscordHelper.Presence.Details = "Selecting a song";
            DiscordHelper.Presence.State   = "In the menus";
            DiscordRpc.UpdatePresence(ref DiscordHelper.Presence);


            ConfigManager.AutoLoadOsuBeatmaps.ValueChanged += OnAutoLoadOsuBeatmapsChanged;
            View = new SelectScreenView(this);
        }
コード例 #2
0
        /// <summary>
        /// </summary>
        public SelectScreen(MultiplayerScreen screen = null)
        {
            MultiplayerScreen = screen;

            // Go to the import screen if we've imported a map not on the select screen
            if (MapsetImporter.Queue.Count > 0 || QuaverSettingsDatabaseCache.OutdatedMaps.Count != 0 || MapDatabaseCache.MapsToUpdate.Count != 0)
            {
                Exit(() => new ImportingScreen());
                return;
            }

            // Grab the mapsets available to the user according to their previous search term.
            AvailableMapsets = MapsetHelper.SearchMapsets(MapManager.Mapsets, PreviousSearchTerm);

            // If no mapsets were found, just default to all of them.
            if (AvailableMapsets.Count == 0)
            {
                AvailableMapsets = MapManager.Mapsets;
            }

            AvailableMapsets = MapsetHelper.OrderMapsetsByConfigValue(AvailableMapsets);

            Logger.Debug($"There are currently: {AvailableMapsets.Count} available mapsets to play in select.",
                         LogType.Runtime);

            if (OnlineManager.CurrentGame == null)
            {
                DiscordHelper.Presence.Details = "Selecting a song";
                DiscordHelper.Presence.State   = "In the menus";
                DiscordRpc.UpdatePresence(ref DiscordHelper.Presence);
            }
            else
            {
                OnlineManager.Client?.SetGameCurrentlySelectingMap(true);
            }

            ConfigManager.AutoLoadOsuBeatmaps.ValueChanged      += OnAutoLoadOsuBeatmapsChanged;
            ConfigManager.DisplayFailedLocalScores.ValueChanged += OnDisplayFailedScoresChanged;

            var game   = GameBase.Game as QuaverGame;
            var cursor = game?.GlobalUserInterface.Cursor;

            cursor.Alpha = 1;

            // Let spectators know that we're selecting a new song
            if (OnlineManager.IsBeingSpectated)
            {
                OnlineManager.Client?.SendReplaySpectatorFrames(SpectatorClientStatus.SelectingSong, -1, new List <ReplayFrame>());
            }

            View = new SelectScreenView(this);
        }