private static int Initialize() { AppDomain curDomain = AppDomain.CurrentDomain; Fixes.UnhandledException.Install(curDomain); Fixes.ServerCertificateValidation.Install(); MelonUtils.Setup(curDomain); Assertions.LemonAssertMapping.Setup(); MelonHandler.Setup(); if (!MonoLibrary.Setup() || !MonoResolveManager.Setup()) { return(1); } HarmonyInstance = new HarmonyLib.Harmony(BuildInfo.Name); Fixes.ForcedCultureInfo.Install(); Fixes.InstancePatchFix.Install(); Fixes.ProcessFix.Install(); PatchShield.Install(); MelonPreferences.Load(); MelonLaunchOptions.Load(); bHaptics.Load(); MelonCompatibilityLayer.Setup(); MelonCompatibilityLayer.SetupModules(MelonCompatibilityLayer.SetupType.OnPreInitialization); MelonHandler.LoadPlugins(); MelonHandler.OnPreInitialization(); return(0); }
public static void RegisterCategory(string name, string displayText) => MelonPreferences.CreateCategory(name, displayText);
public static string GetCategoryDisplayName(string key) => MelonPreferences.GetCategory(key)?.DisplayName;
public static void SaveConfig() => MelonPreferences.Save();
public static void RegisterFloat(string section, string name, float defaultValue, string displayText = null, bool hideFromList = false) => MelonPreferences.CreateEntry(section, name, defaultValue, displayText, hideFromList);
public static bool HasKey(string section, string name) => MelonPreferences.HasEntry(section, name);
public static void SetFloat(string section, string name, float value) => MelonPreferences.SetEntryValue(section, name, value);
public static float GetFloat(string section, string name) => MelonPreferences.GetEntryValue <float>(section, name);
public static int GetInt(string section, string name) => MelonPreferences.GetEntryValue <int>(section, name);
public static void SetBool(string section, string name, bool value) => MelonPreferences.SetEntryValue(section, name, value);
public static bool GetBool(string section, string name) => MelonPreferences.GetEntryValue <bool>(section, name);