コード例 #1
0
ファイル: SongLoader.cs プロジェクト: nyamimi/LegacyCore
        private void StandardLevelListViewControllerOnDidSelectLevelEvent(StandardLevelListViewController arg1, IStandardLevel level)
        {
            var customLevel = level as CustomLevel;

            if (customLevel == null)
            {
                return;
            }

            if (customLevel.audioClip != TemporaryAudioClip || customLevel.AudioClipLoading)
            {
                return;
            }

            var levels = arg1.GetPrivateField <IStandardLevel[]>("_levels").ToList();

            Action callback = delegate
            {
                arg1.SetPrivateField("_selectedLevel", null);
                arg1.HandleLevelSelectionDidChange(levels.IndexOf(customLevel), true);
            };

            customLevel.FixBPMAndGetNoteJumpMovementSpeed();
            StartCoroutine(LoadAudio(
                               "file:///" + customLevel.customSongInfo.path + "/" + customLevel.customSongInfo.GetAudioPath(), customLevel,
                               callback));
        }
コード例 #2
0
        private List <IStandardLevel> SongsForDifficulty()
        {
            var levels = listViewController.GetPrivateField <IStandardLevel[]>("_levels").Where(x => x.HasDifficultyInRange(minDiff, maxDiff));

            if (excludeStandard)
            {
                levels = levels.Where(x => x.levelID.Length > 32);
            }
            return(levels.ToList());
        }
コード例 #3
0
        public void SceneManagerOnActiveSceneChanged(Scene arg0, Scene scene)
        {
            if (isMenuScene(scene))
            {
                flowController           = Resources.FindObjectsOfTypeAll <StandardLevelSelectionFlowCoordinator>().FirstOrDefault();
                navController            = flowController.GetPrivateField <StandardLevelSelectionNavigationController>("_levelSelectionNavigationController");
                listViewController       = flowController.GetPrivateField <StandardLevelListViewController>("_levelListViewController");
                difficultyViewController = flowController.GetPrivateField <StandardLevelDifficultyViewController>("_levelDifficultyViewController");
                listTableView            = listViewController.GetPrivateField <StandardLevelListTableView>("_levelListTableView");
                tableView            = listTableView.GetPrivateField <TableView>("_tableView");
                detailViewController = flowController.GetPrivateField <StandardLevelDetailViewController>("_levelDetailViewController");
                player = Resources.FindObjectsOfTypeAll <SongPreviewPlayer>().FirstOrDefault();

                FixDiffOrder();
                CreatUI();
                CreateRandomButton();
            }
            else
            {
                isShowing = false;
            }
        }
コード例 #4
0
 private void Awake()
 {
     try
     {
         _mainMenuViewController             = Resources.FindObjectsOfTypeAll <MainMenuViewController>().First();
         _soloModeSelectionViewController    = Resources.FindObjectsOfTypeAll <SoloModeSelectionViewController>().First();
         _levelSelectionFlowCoordinator      = Resources.FindObjectsOfTypeAll <StandardLevelSelectionFlowCoordinator>().First();
         _levelSelectionNavigationController = _levelSelectionFlowCoordinator.GetPrivateField <StandardLevelSelectionNavigationController>("_levelSelectionNavigationController");
         _levelDetailViewController          = _levelSelectionFlowCoordinator.GetPrivateField <StandardLevelDetailViewController>("_levelDetailViewController");
         _levelDifficultyViewController      = _levelSelectionFlowCoordinator.GetPrivateField <StandardLevelDifficultyViewController>("_levelDifficultyViewController");
         _levelListViewController            = _levelSelectionFlowCoordinator.GetPrivateField <StandardLevelListViewController>("_levelListViewController");
         listTableView = _levelListViewController.GetPrivateField <StandardLevelListTableView>("_levelListTableView");
         tableView     = listTableView.GetPrivateField <TableView>("_tableView");
         GetBeatSaberIcons();
         AddModMenuButton();
         leaderboardHooks = new LeaderboardsModelHooks();
         leaderboardHooks.StartHooking();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message + "\n" + ex.StackTrace);
     }
 }