示例#1
0
        IEnumerator SelectAndLoadSong(IStandardLevel level)
        {
            AddToQueue(level);

            var diff = minDiff;
            IStandardLevelDifficultyBeatmap difficultyLevel = null;

            do
            {
                diff            = (LevelDifficulty)UnityEngine.Random.Range((int)minDiff, (int)maxDiff + 1);
                difficultyLevel = level.GetDifficultyLevel(diff);
            } while (difficultyLevel == null);

            if (autoPlay)
            {
                // Fade screen away to not spoil song
                var gameSceneManager = Resources.FindObjectsOfTypeAll <GameScenesManager>().FirstOrDefault();
                gameSceneManager.HandleExecutorTransitionDidStart(0.7f);

                //var fade = Resources.FindObjectsOfTypeAll<FadeOutOnGameEvent>().FirstOrDefault();
                //fade.HandleGameEvent(0.7f);
                // Turn preview down
                player.volume = 0;
                yield return(new WaitForSeconds(1.0f));
            }

            int row = listTableView.RowNumberForLevelID(level.levelID);

            tableView.SelectRow(row, true);
            tableView.ScrollToRow(row, false);

            difficultyViewController.SetDifficultyLevels(level.difficultyBeatmaps, difficultyLevel);

            var gameplayMode    = detailViewController.gameplayMode;
            var gameplayOptions = detailViewController.gameplayOptions;

            detailViewController.SetContent(difficultyLevel, gameplayMode);

            if (autoPlay)
            {
                detailViewController.PlayButtonPressed();

                if (gameplayMode.IsSolo() && !gameplayOptions.validForScoreUse)
                {
                    var prompt = flowController.GetPrivateField <SimpleDialogPromptViewController>("_simpleDialogPromptViewController");
                    yield return(new WaitForSeconds(0.1f));

                    flowController.HandleSimpleDialogPromptViewControllerDidFinish(prompt, true);
                }
            }
        }
 private void HandleDifficultyViewControllerDidSelectDifficulty(
     StandardLevelDifficultyViewController viewController,
     IStandardLevelDifficultyBeatmap difficultyLevel)
 {
     if (!_levelDetailViewController.isInViewControllerHierarchy)
     {
         _levelDetailViewController.Init(
             _customLevel.GetDifficultyLevel(_levelDifficultyViewController.selectedDifficultyLevel.difficulty),
             GameplayMode.SoloStandard, StandardLevelDetailViewController.LeftPanelViewControllerType.HowToPlay);
         _levelRequestNavigationController.PushViewController(_levelDetailViewController,
                                                              viewController.isRebuildingHierarchy);
     }
     else
     {
         _levelDetailViewController.SetContent(
             _customLevel.GetDifficultyLevel(_levelDifficultyViewController.selectedDifficultyLevel.difficulty),
             GameplayMode.SoloStandard);
     }
 }
        public static string GetLeaderboardID(IStandardLevelDifficultyBeatmap difficultyLevel, GameplayMode gameplayMode)
        {
            CheckForHiddenBlocks();
            string text = "Unknown";

            switch (difficultyLevel.difficulty)
            {
            case LevelDifficulty.Easy:
                text = "Easy";
                break;

            case LevelDifficulty.Normal:
                text = "Normal";
                break;

            case LevelDifficulty.Hard:
                text = "Hard";
                break;

            case LevelDifficulty.Expert:
                text = "Expert";
                break;

            case LevelDifficulty.ExpertPlus:
                text = "ExpertPlus";
                break;
            }
            string text2 = "Unknown";

            switch (gameplayMode)
            {
            case GameplayMode.SoloStandard:
                text2 = "SoloStandard";
                break;

            case GameplayMode.SoloOneSaber:
                text2 = "SoloOneSaber";
                break;

            case GameplayMode.SoloNoArrows:
                text2 = "SoloNoArrows";
                break;

            case GameplayMode.PartyStandard:
                text2 = "PartyStandard";
                break;
            }
            string leaderboardID = string.Concat(new string[]
            {
                difficultyLevel.level.levelID,
                "_",
                text,
                "_",
                text2
            });

            if (isHDMod)
            {
                leaderboardID += "HD";
            }
            if (Plugin.IsDarthModeOn && Plugin.NoArrowRandLv == 0)
            {
                leaderboardID += "DM";
                if (Plugin.IsOneHanded)
                {
                    leaderboardID += "OH";
                }
            }
            return(leaderboardID);
        }