From 75c624f9636dc0a0e6692a8c1341688971ce977f Mon Sep 17 00:00:00 2001 From: Ibodan <-> Date: Sat, 22 Dec 2018 22:00:18 +0900 Subject: [PATCH 01/98] swapping sabers is triggerred with swap colors switch in player settings --- CustomSaber/SaberScript.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CustomSaber/SaberScript.cs b/CustomSaber/SaberScript.cs index 223d1d7..0f39706 100644 --- a/CustomSaber/SaberScript.cs +++ b/CustomSaber/SaberScript.cs @@ -291,7 +291,11 @@ private IEnumerator WaitForSabers(GameObject saberRoot) CustomTrail[] trails; - if (saber.saberType == Saber.SaberType.SaberB) + Saber.SaberType[] typeForHands = new Saber.SaberType[] { Saber.SaberType.SaberB, Saber.SaberType.SaberA }; + var playerDataModel = Resources.FindObjectsOfTypeAll().FirstOrDefault(); + if (playerDataModel && playerDataModel.currentLocalPlayer.playerSpecificSettings.swapColors) typeForHands = typeForHands.Reverse().ToArray(); + + if (saber.saberType == typeForHands[0]) { if (saberRoot == null) { } else @@ -306,7 +310,7 @@ private IEnumerator WaitForSabers(GameObject saberRoot) trail.Init(saber); } } - else if (saber.saberType == Saber.SaberType.SaberA) + else if (saber.saberType == typeForHands[1]) { if (saberRoot == null) { } else From 65c0532d92c8e4ec163c11b866c65383bca99327 Mon Sep 17 00:00:00 2001 From: Kyle1413 Date: Fri, 15 Mar 2019 10:43:04 -0400 Subject: [PATCH 02/98] Update For Beat Saber 0.13.0 --- CustomSaber/CustomSaber.csproj | 7 ++-- CustomSaber/Plugin.cs | 2 +- CustomSaber/SaberScript.cs | 14 +++----- CustomSaber/UI/SaberListViewController.cs | 39 +++++++++++++++++------ 4 files changed, 41 insertions(+), 21 deletions(-) diff --git a/CustomSaber/CustomSaber.csproj b/CustomSaber/CustomSaber.csproj index f79b0ba..1ef4fba 100644 --- a/CustomSaber/CustomSaber.csproj +++ b/CustomSaber/CustomSaber.csproj @@ -47,6 +47,9 @@ C:\Program Files (x86)\Steam\steamapps\common\Beat Saber\Plugins\BeatSaberCustomUI.dll + + C:\Program Files (x86)\Steam\steamapps\common\Beat Saber\Plugins\BS_Utils.dll + C:\Program Files (x86)\Steam\steamapps\common\Beat Saber\Plugins\CustomColors.dll @@ -75,8 +78,8 @@ - - C:\Program Files (x86)\Steam\steamapps\common\Beat Saber\Beat Saber_Data\Managed\TextMeshPro-1.0.55.2017.1.0b12.dll + + C:\Program Files (x86)\Steam\steamapps\common\Beat Saber\Beat Saber_Data\Managed\Unity.TextMeshPro.dll C:\Program Files (x86)\Steam\steamapps\common\Beat Saber\Beat Saber_Data\Managed\UnityEngine.dll diff --git a/CustomSaber/Plugin.cs b/CustomSaber/Plugin.cs index ad6d1e4..50cda76 100644 --- a/CustomSaber/Plugin.cs +++ b/CustomSaber/Plugin.cs @@ -79,7 +79,7 @@ private void SceneManagerOnActiveSceneChanged(Scene arg0, Scene scene) SaberScript.LoadAssets(); } - if (scene.name == "Menu") + if (scene.name == "MenuCore") { if (_currentSaber != null) { diff --git a/CustomSaber/SaberScript.cs b/CustomSaber/SaberScript.cs index 0f39706..a1794c5 100644 --- a/CustomSaber/SaberScript.cs +++ b/CustomSaber/SaberScript.cs @@ -90,14 +90,10 @@ private void Start() Restart(); } - StandardLevelSceneSetup GetGameSceneSetup() + BS_Utils.Gameplay.LevelData GetGameSceneSetup() { - StandardLevelSceneSetup s = GameObject.FindObjectOfType(); - if (s == null) - { - s = UnityEngine.Resources.FindObjectsOfTypeAll().FirstOrDefault(); - } - return s; + + return BS_Utils.Plugin.LevelData; } private void AddEvents() @@ -182,8 +178,8 @@ private void AddEvents() try { - StandardLevelSceneSetup mgs = GetGameSceneSetup(); - BeatmapData beatmapData = mgs.standardLevelSceneSetupData.difficultyBeatmap.beatmapData; + BS_Utils.Gameplay.LevelData mgs = GetGameSceneSetup(); + BeatmapData beatmapData = mgs.GameplayCoreSceneSetupData.difficultyBeatmap.beatmapData; BeatmapLineData[] beatmapLinesData = beatmapData.beatmapLinesData; float LastTime = 0.0f; diff --git a/CustomSaber/UI/SaberListViewController.cs b/CustomSaber/UI/SaberListViewController.cs index 468f68c..c66cf4d 100644 --- a/CustomSaber/UI/SaberListViewController.cs +++ b/CustomSaber/UI/SaberListViewController.cs @@ -81,7 +81,7 @@ protected override void DidActivate(bool firstActivation, ActivationType type) _sabersTableView.SetPrivateField("_isInitialized", false); _sabersTableView.dataSource = this; - _sabersTableView.didSelectRowEvent += _sabersTableView_DidSelectRowEvent; + _sabersTableView.didSelectCellWithIdxEvent += _sabersTableView_DidSelectRowEvent; _pageUpButton = Instantiate(Resources.FindObjectsOfTypeAll