[NAK_CVR_Mods] Unfucked for 2026r182

This commit is contained in:
NotAKid 2026-06-18 22:20:56 -05:00
parent c13dc8375a
commit 281403d68b
209 changed files with 3936 additions and 1122 deletions

View file

@ -15,11 +15,24 @@ public class CustomSpawnPointMod : MelonMod
SpawnPointManager.Init();
HarmonyInstance.Patch( // listen for world details page request
typeof(ViewManager).GetMethod(nameof(ViewManager.RequestWorldDetailsPage)),
new HarmonyMethod(typeof(CustomSpawnPointMod).GetMethod(nameof(OnRequestWorldDetailsPage),
HarmonyInstance.Patch(
typeof(ViewManager).GetMethod(nameof(ViewManager.Start),
BindingFlags.NonPublic | BindingFlags.Instance),
postfix: new HarmonyMethod(typeof(CustomSpawnPointMod).GetMethod(nameof(OnViewManagerStart),
BindingFlags.NonPublic | BindingFlags.Static))
);
HarmonyInstance.Patch( // listen for world details page request
typeof(ViewManager).GetMethod(nameof(ViewManager.RequestWorldDetailsPage),
BindingFlags.Public | BindingFlags.Instance),
postfix: new HarmonyMethod(typeof(CustomSpawnPointMod).GetMethod(nameof(OnRequestWorldDetailsPage),
BindingFlags.NonPublic | BindingFlags.Static))
);
}
private static void OnViewManagerStart()
{
SpawnPointManager.OnViewManagerStart();
}
private static void OnRequestWorldDetailsPage(string worldId)

View file

@ -4,11 +4,11 @@ Replaces the unused Images button in the World Details page with a button to set
---
Here is the block of text where I tell you this mod is not affiliated with or endorsed by ABI.
https://documentation.abinteractive.net/official/legal/tos/#7-modding-our-games
Here is the block of text where I tell you this mod is not affiliated with or endorsed by ChilloutVR.
https://docs.chilloutvr.net/official/legal/tos/#6-modding-our-game
> This mod is an independent creation not affiliated with, supported by, or approved by Alpha Blend Interactive.
> This mod is an independent creation not affiliated with, supported by, or approved by ChilloutVR.
> Use of this mod is done so at the user's own risk and the creator cannot be held responsible for any issues arising from its use.
> To the best of my knowledge, I have adhered to the Modding Guidelines established by Alpha Blend Interactive.
> To the best of my knowledge, I have adhered to the Modding Guidelines established by ChilloutVR.

View file

@ -31,39 +31,35 @@ internal static class SpawnPointManager
internal static void Init()
{
LoadSpawnpoints();
CVRGameEventSystem.World.OnLoad.AddListener(OnWorldLoaded);
CVRGameEventSystem.World.OnUnload.AddListener(OnWorldUnloaded);
MelonLoader.MelonCoroutines.Start(WaitMainMenuUi());
}
LoadSpawnpoints();
CVRGameEventSystem.World.OnLoad.AddListener(OnWorldLoaded);
CVRGameEventSystem.World.OnUnload.AddListener(OnWorldUnloaded);
CVRGameEventSystem.Initialization.OnPlayerSetupStart.AddListener(OnPlayerSetupStart);
}
private static System.Collections.IEnumerator WaitMainMenuUi()
private static void OnPlayerSetupStart()
{
while (ViewManager.Instance == null)
yield return null;
while (ViewManager.Instance.cohtmlView == null)
yield return null;
while (ViewManager.Instance.cohtmlView.Listener == null)
yield return null;
// create our custom spawn point object
GameObject customSpawnPointObject = new("[CustomSpawnPoint]");
Object.DontDestroyOnLoad(customSpawnPointObject);
ViewManager.Instance.OnUiConfirm.AddListener(OnClearSpawnpointConfirm);
ViewManager.Instance.cohtmlView.Listener.FinishLoad += (_) =>
{
ViewManager.Instance.cohtmlView.View._view.ExecuteScript(spawnpointJs);
};
ViewManager.Instance.cohtmlView.Listener.ReadyForBindings += () =>
{
// listen for setting the spawn point on our custom button
ViewManager.Instance.cohtmlView.View.BindCall("NAKCallSetSpawnpoint", SetSpawnPoint);
};
// create our custom spawn point object
GameObject customSpawnPointObject = new("[CustomSpawnPoint]");
Object.DontDestroyOnLoad(customSpawnPointObject);
// add to array so we can easily replace worlds spawn points
customSpawnPointsArray = new[] { customSpawnPointObject };
}
// add to array so we can easily replace worlds spawn points
customSpawnPointsArray = new[] { customSpawnPointObject };
}
internal static void OnViewManagerStart()
{
ViewManager.Instance.OnUiConfirm.AddListener(OnClearSpawnpointConfirm);
ViewManager.Instance.cohtmlView.Listener.FinishLoad += (_) =>
{
ViewManager.Instance.cohtmlView.View._view.ExecuteScript(spawnpointJs);
};
ViewManager.Instance.cohtmlView.Listener.ReadyForBindings += () =>
{
// listen for setting the spawn point on our custom button
ViewManager.Instance.cohtmlView.View.BindCall("NAKCallSetSpawnpoint", SetSpawnPoint);
};
}
#endregion Initialization