From accc555ec907f8b6a8a56e41d2642be60c276ba5 Mon Sep 17 00:00:00 2001 From: Andrew Faulkner Date: Sun, 19 Aug 2018 18:37:48 +1000 Subject: [PATCH] Updated for Beat Saber 0.11.2 --- README.md | 1 + RandomSong/RandomSongManager.cs | 19 ++++++++++++------- RandomSong/UIHelper.cs | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4fac8f9..5bf3703 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ If the Random button is disabled, you have no songs in the current shown list th # Changes 1.2 +Updated for Beat Saber 0.11.2 Added Autoplay option Fixed No Fail and No Obstacles diff --git a/RandomSong/RandomSongManager.cs b/RandomSong/RandomSongManager.cs index 1a6bc08..0e9686e 100644 --- a/RandomSong/RandomSongManager.cs +++ b/RandomSong/RandomSongManager.cs @@ -97,7 +97,6 @@ public void SceneManagerOnActiveSceneChanged(Scene arg0, Scene scene) difficultyViewController = flowController.GetPrivateField("_levelDifficultyViewController"); listTableView = listViewController.GetPrivateField("_levelListTableView"); tableView = listTableView.GetPrivateField("_tableView"); - //tableView.didSelectRowEvent += didSelectRowEvent; detailViewController = flowController.GetPrivateField("_levelDetailViewController"); player = Resources.FindObjectsOfTypeAll().FirstOrDefault(); @@ -338,8 +337,11 @@ IEnumerator SelectAndLoadSong(IStandardLevel level) if (autoPlay) { // Fade screen away to not spoil song - var fade = Resources.FindObjectsOfTypeAll().FirstOrDefault(); - fade.HandleGameEvent(0.7f); + var gameSceneManager = Resources.FindObjectsOfTypeAll().FirstOrDefault(); + gameSceneManager.HandleExecutorTransitionDidStart(0.7f); + + //var fade = Resources.FindObjectsOfTypeAll().FirstOrDefault(); + //fade.HandleGameEvent(0.7f); // Turn preview down player.volume = 0; yield return new WaitForSeconds(1.0f); @@ -378,18 +380,21 @@ private void PlayRandomSong() } } - public static void LogComponents(Transform t, string prefix) + public static void LogComponents(Transform t, string prefix = "=", bool includeScipts = false) { Console.WriteLine(prefix + ">" + t.name); - foreach (var comp in t.GetComponents()) + if (includeScipts) { - Console.WriteLine(prefix + "-->" + comp.GetType()); + foreach (var comp in t.GetComponents()) + { + Console.WriteLine(prefix + "-->" + comp.GetType()); + } } foreach (Transform child in t) { - LogComponents(child, prefix + "="); + LogComponents(child, prefix + "=", includeScipts); } } } diff --git a/RandomSong/UIHelper.cs b/RandomSong/UIHelper.cs index 7f7ff4e..0355d72 100644 --- a/RandomSong/UIHelper.cs +++ b/RandomSong/UIHelper.cs @@ -39,7 +39,7 @@ private void Awake() public static Button CreateUIButton(RectTransform parent, string buttonTemplate) { Button btn = Instantiate(Resources.FindObjectsOfTypeAll