net9 + basic splash
This commit is contained in:
@@ -4,17 +4,17 @@ using VRage.Scripting;
|
||||
|
||||
namespace CringeLauncher.Patches;
|
||||
|
||||
[HarmonyPatch]
|
||||
[HarmonyPatch(typeof(MyScriptWhitelist.MyWhitelistBatch), nameof(MyScriptWhitelist.MyWhitelistBatch.AllowMembers))]
|
||||
public static class WhitelistAllowPatch
|
||||
{
|
||||
private static MethodInfo TargetMethod()
|
||||
{
|
||||
return AccessTools.Method(AccessTools.Inner(typeof(MyScriptWhitelist), "MyWhitelistBatch"), "AllowMembers");
|
||||
}
|
||||
|
||||
private static void Prefix(ref MemberInfo[] members)
|
||||
{
|
||||
if (members.Any(b => b is null))
|
||||
members = members.Where(b => b is { }).ToArray();
|
||||
}
|
||||
|
||||
private static Exception? Finalizer(Exception __exception)
|
||||
{
|
||||
return __exception is MyWhitelistException ? null : __exception;
|
||||
}
|
||||
}
|
25
CringeLauncher/Patches/WhitelistTypeResolutionPatch.cs
Normal file
25
CringeLauncher/Patches/WhitelistTypeResolutionPatch.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System.Diagnostics;
|
||||
using System.Reflection.Emit;
|
||||
using HarmonyLib;
|
||||
using VRage.Scripting;
|
||||
|
||||
namespace CringeLauncher.Patches;
|
||||
|
||||
[HarmonyPatch(typeof(MyScriptWhitelist.Batch), nameof(MyScriptWhitelist.Batch.ResolveTypeSymbol))]
|
||||
public static class WhitelistTypeResolutionPatch
|
||||
{
|
||||
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
|
||||
{
|
||||
var call = CodeInstruction.CallClosure((MyWhitelistException ex) =>
|
||||
{
|
||||
Debug.WriteLine(ex);
|
||||
});
|
||||
|
||||
return instructions.Manipulator(i => i.opcode == OpCodes.Throw,
|
||||
i =>
|
||||
{
|
||||
i.opcode = call.opcode;
|
||||
i.operand = call.operand;
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user