mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
CustomSpawnPoint: initial release
This commit is contained in:
parent
46b84107c3
commit
e35cfa4bcd
7 changed files with 378 additions and 0 deletions
29
CustomSpawnPoint/Main.cs
Normal file
29
CustomSpawnPoint/Main.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System.Reflection;
|
||||
using ABI_RC.Core.InteractionSystem;
|
||||
using HarmonyLib;
|
||||
using MelonLoader;
|
||||
|
||||
namespace NAK.CustomSpawnPoint;
|
||||
|
||||
public class CustomSpawnPointMod : MelonMod
|
||||
{
|
||||
internal static MelonLogger.Instance Logger;
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
Logger = LoggerInstance;
|
||||
|
||||
SpawnPointManager.Init();
|
||||
|
||||
HarmonyInstance.Patch( // listen for world details page request
|
||||
typeof(ViewManager).GetMethod(nameof(ViewManager.RequestWorldDetailsPage)),
|
||||
new HarmonyMethod(typeof(CustomSpawnPointMod).GetMethod(nameof(OnRequestWorldDetailsPage),
|
||||
BindingFlags.NonPublic | BindingFlags.Static))
|
||||
);
|
||||
}
|
||||
|
||||
private static void OnRequestWorldDetailsPage(string worldId)
|
||||
{
|
||||
SpawnPointManager.OnRequestWorldDetailsPage(worldId);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue