From f27e325526cc458ac903bad6aaae32dc27b93b53 Mon Sep 17 00:00:00 2001 From: Aaro Varis Date: Mon, 10 Mar 2025 03:58:08 +0200 Subject: [PATCH] . --- BoneSync/BoneSync.csproj | 1 + BoneSync/Patching/SceneManagerPatches.cs | 26 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 BoneSync/Patching/SceneManagerPatches.cs diff --git a/BoneSync/BoneSync.csproj b/BoneSync/BoneSync.csproj index 26d93f2..a6e520a 100644 --- a/BoneSync/BoneSync.csproj +++ b/BoneSync/BoneSync.csproj @@ -112,6 +112,7 @@ + diff --git a/BoneSync/Patching/SceneManagerPatches.cs b/BoneSync/Patching/SceneManagerPatches.cs new file mode 100644 index 0000000..c90c4e8 --- /dev/null +++ b/BoneSync/Patching/SceneManagerPatches.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using HarmonyLib; +using MelonLoader; +using StressLevelZero.Utilities; + +namespace BoneSync.Patching +{ + [HarmonyPatch(typeof(BoneworksSceneManager))] + internal class SceneManagerPatches + { + [HarmonyPatch(nameof(BoneworksSceneManager.LoadScene)), HarmonyPostfix] + private static void LoadScenePrefix(BoneworksSceneManager __instance, int sceneBuildIndex) + { + MelonLogger.Msg("LoadScenePrefix: " + sceneBuildIndex); + if (!BoneSync.IsConnected) return; + if (BoneSync.lobby.IsHost) + { + MelonLogger.Msg("Host is loading scene, sending message to clients..."); + } + } + } +}