* Fix for games where patching Cursor methods fails.
* Added backup attempt for loading Cursor module if not present.
* HashSet collections are now supported by CacheList
* try/catch for loading Mod Config
This commit is contained in:
sinaioutlander
2020-09-11 18:53:17 +10:00
parent 835a81765e
commit 8d648fec43
20 changed files with 292 additions and 167 deletions

View File

@ -3,6 +3,8 @@ using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.IO;
using MelonLoader;
using UnhollowerBaseLib;
using UnhollowerRuntimeLib;
using UnityEngine;
@ -122,6 +124,23 @@ namespace Explorer
return list.ToArray();
}
public static bool LoadModule(string module)
{
var path = $@"MelonLoader\Managed\{module}";
if (!File.Exists(path)) return false;
try
{
Assembly.Load(File.ReadAllBytes(path));
return true;
}
catch (Exception e)
{
MelonLogger.Log(e.GetType() + ", " + e.Message);
return false;
}
}
public static string ExceptionToString(Exception e)
{
if (IsFailedGeneric(e))