From 4dc3ee0b8efb8ba8c8993f9c855243e640d350db Mon Sep 17 00:00:00 2001 From: Auros Nexus <41306347+Auros@users.noreply.github.com> Date: Mon, 22 May 2023 02:41:37 -0400 Subject: [PATCH] Skippable saber model pre-init --- SiraUtil/Interfaces/IPreSaberModelInit.cs | 3 ++- SiraUtil/Sabers/SaberModelProvider.cs | 6 +++--- SiraUtil/manifest.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/SiraUtil/Interfaces/IPreSaberModelInit.cs b/SiraUtil/Interfaces/IPreSaberModelInit.cs index bd5d2f8..0059ad1 100644 --- a/SiraUtil/Interfaces/IPreSaberModelInit.cs +++ b/SiraUtil/Interfaces/IPreSaberModelInit.cs @@ -12,6 +12,7 @@ public interface IPreSaberModelInit /// /// The parent of the saber model. /// The saber component associated with the current model. - void PreInit(Transform parent, Saber saber); + /// Do you want the original Init to run? + bool PreInit(Transform parent, Saber saber); } } \ No newline at end of file diff --git a/SiraUtil/Sabers/SaberModelProvider.cs b/SiraUtil/Sabers/SaberModelProvider.cs index d3419c2..fc6841f 100644 --- a/SiraUtil/Sabers/SaberModelProvider.cs +++ b/SiraUtil/Sabers/SaberModelProvider.cs @@ -172,13 +172,13 @@ private void DefaultSaberPrefabSwap(ref SaberModelContainer __instance, ref Sabe [AffinityPrefix] [AffinityPatch(typeof(SaberModelController), nameof(SaberModelController.Init))] - private void PreInit(ref SaberModelController __instance, Transform parent, Saber saber) + private bool PreInit(ref SaberModelController __instance, Transform parent, Saber saber) { var runner = __instance.GetComponent(); if (runner == null) - return; + return true; - runner.PreInit(parent, saber); + return runner.PreInit(parent, saber); } diff --git a/SiraUtil/manifest.json b/SiraUtil/manifest.json index f0e75c3..9fb843c 100644 --- a/SiraUtil/manifest.json +++ b/SiraUtil/manifest.json @@ -3,7 +3,7 @@ "id": "SiraUtil", "name": "SiraUtil", "author": "Auros", - "version": "3.1.3-dev.2", + "version": "3.1.3-dev.3", "icon": "SiraUtil.Resources.logo.png", "description": "A powerful utility mod which expands the capabilities and provides more tools to Beat Saber modders.", "gameVersion": "1.29.4",