Beispiel #1
0
        private void _simpleDialog_didFinishEvent(SimpleDialogPromptViewController sender, bool delete)
        {
            _freePlayFlowCoordinator.InvokePrivateMethod("DismissViewController", new object[] { _simpleDialog, null, false });
            if (delete)
            {
                try
                {
                    SongDownloader.Instance.DeleteSong(new Song(SongLoader.CustomLevels.First(x => x.levelID == _detailViewController.difficultyBeatmap.level.levelID)));

                    List <IBeatmapLevel> levels = _levelListViewController.GetPrivateField <IBeatmapLevel[]>("_levels").ToList();
                    int selectedIndex           = levels.IndexOf(_detailViewController.difficultyBeatmap.level);

                    if (selectedIndex > -1)
                    {
                        int removedLevels = levels.RemoveAll(x => x == _detailViewController.difficultyBeatmap.level);
                        Logger.Log("Removed " + removedLevels + " level(s) from song list!");

                        if (selectedIndex > 0)
                        {
                            selectedIndex--;
                        }

                        _levelListViewController.SetLevels(levels.ToArray());
                        TableView listTableView = _levelListViewController.GetPrivateField <LevelListTableView>("_levelListTableView").GetPrivateField <TableView>("_tableView");
                        listTableView.ScrollToRow(selectedIndex, false);
                        listTableView.SelectRow(selectedIndex, true);
                    }
                }catch (Exception e)
                {
                    Logger.Error("Unable to delete song! Exception: " + e);
                }
            }
        }
        private void StandardLevelListViewControllerOnDidSelectLevelEvent(LevelListViewController levelListViewController, IBeatmapLevel level)
        {
            var customLevel = level as CustomLevel;

            if (customLevel == null)
            {
                return;
            }

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

            var levels = levelListViewController.GetPrivateField <IBeatmapLevel[]>("_levels").ToList();

            Action callback = delegate
            {
                levelListViewController.SetPrivateField("_selectedLevel", null);
                levelListViewController.HandleLevelListTableViewDidSelectRow(null, levels.IndexOf(customLevel));
            };

            customLevel.FixBPMAndGetNoteJumpMovementSpeed();
            StartCoroutine(LoadAudio(
                               "file:///" + customLevel.customSongInfo.path + "/" + customLevel.customSongInfo.GetAudioPath(), customLevel,
                               callback));
        }
Beispiel #3
0
        public void SceneManagerOnActiveSceneChanged(Scene arg0, Scene scene)
        {
            if (isMenuScene(scene))
            {
                try
                {
                    flowCoordinator = Resources.FindObjectsOfTypeAll <MainFlowCoordinator>().FirstOrDefault();

                    mainMenuViewController = flowCoordinator.GetPrivateField <MainMenuViewController>("_mainMenuViewController");
                    //soloModeSelectionViewController =   flowCoordinator.GetPrivateField<SoloModeSelectionViewController>("_soloFreePlayFlowCoordinator");


                    soloFreePlayFlowCoordinator     = flowCoordinator.GetPrivateField <SoloFreePlayFlowCoordinator>("_soloFreePlayFlowCoordinator");
                    detailViewController            = soloFreePlayFlowCoordinator.GetPrivateField <StandardLevelDetailViewController>("_levelDetailViewController");
                    gameplaySetupViewController     = soloFreePlayFlowCoordinator.GetPrivateField <GameplaySetupViewController>("_gameplaySetupViewController");
                    practiceController              = soloFreePlayFlowCoordinator.GetPrivateField <PracticeViewController>("_practiceViewController");
                    beatmapDifficultyViewController = soloFreePlayFlowCoordinator.GetPrivateField <BeatmapDifficultyViewController>("_beatmapDifficultyViewControllerViewController");
                    listViewController              = soloFreePlayFlowCoordinator.GetPrivateField <LevelListViewController>("_levelListViewController");

                    levelListView = listViewController.GetPrivateField <LevelListTableView>("_levelListTableView");
                    tableView     = levelListView.GetPrivateField <TableView>("_tableView");

                    gameScenesManager = Resources.FindObjectsOfTypeAll <GameScenesManager>().FirstOrDefault();

                    standardLevelReturnToMenu = Resources.FindObjectsOfTypeAll <StandardLevelReturnToMenuController>().FirstOrDefault();
                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                }
            }
            if (isGameScene(scene))
            {
                if (autoPlay)
                {
                }
            }

            Console.WriteLine(scene.name);
        }