mirror of
https://github.com/NotAKidoS/NAK_CVR_Mods.git
synced 2025-09-02 06:19:22 +00:00
AvatarQueueSystemTweaks: Initial release
This commit is contained in:
parent
472e5a0b63
commit
46b84107c3
6 changed files with 235 additions and 0 deletions
42
AvatarQueueSystemTweaks/Main.cs
Normal file
42
AvatarQueueSystemTweaks/Main.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using MelonLoader;
|
||||
using NAK.AvatarQueueSystemTweaks.Patches;
|
||||
|
||||
namespace NAK.AvatarQueueSystemTweaks;
|
||||
|
||||
public class AvatarQueueSystemTweaksMod : MelonMod
|
||||
{
|
||||
public static readonly MelonPreferences_Category Category =
|
||||
MelonPreferences.CreateCategory(nameof(AvatarQueueSystemTweaks));
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryPrioritizeSelf =
|
||||
Category.CreateEntry("prioritize_self", true, "Prioritize Self", description: "Prioritize loading of your own avatar over others.");
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryPrioritizeFriends =
|
||||
Category.CreateEntry("prioritize_friends", true, "Prioritize Friends", description: "Prioritize loading of friends avatars over others.");
|
||||
|
||||
public static readonly MelonPreferences_Entry<bool> EntryLoadByDistance =
|
||||
Category.CreateEntry("load_by_distance", true, "Load By Distance", description: "Prioritize loading of avatars by distance.");
|
||||
|
||||
// public static readonly MelonPreferences_Entry<bool> EntryChokeInstantiation =
|
||||
// Category.CreateEntry("choke_instantiation", false, "Choke Instantiation",
|
||||
// description: "Chokes the instantiation queue by waiting 0.2s");
|
||||
|
||||
public override void OnInitializeMelon()
|
||||
{
|
||||
//ApplyPatches(typeof(CVRObjectLoaderPatches));
|
||||
ApplyPatches(typeof(AvatarQueueSystemPatches));
|
||||
}
|
||||
|
||||
private void ApplyPatches(Type type)
|
||||
{
|
||||
try
|
||||
{
|
||||
HarmonyInstance.PatchAll(type);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LoggerInstance.Msg($"Failed while patching {type.Name}!");
|
||||
LoggerInstance.Error(e);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue