net9 + basic splash

This commit is contained in:
zznty
2024-12-30 03:10:47 +07:00
parent 5af1c51be8
commit 7e9813d2a7
22 changed files with 257 additions and 1985 deletions

View File

@@ -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;
}
}

View 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;
});
}
}