Skip to content

Commit

Permalink
mesh splitter compatibility patch
Browse files Browse the repository at this point in the history
  • Loading branch information
katycat5e committed Feb 4, 2025
1 parent c7307c4 commit d1fbc83
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions SkinManagerMod/Patches/LocoMeshSplitterPatches.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Reflection;

namespace SkinManagerMod.Patches
{
[HarmonyPatch]
internal static class LocoMeshSplitterPatches
{
private static Type _paintSetupClass = AccessTools.TypeByName("LocoMeshSplitter.MeshLoaders.TrainCarPaintSetup");

public static bool Prepare()
{
return (_paintSetupClass is not null);
}

public static IEnumerable<MethodBase> TargetMethods()
{
if (_paintSetupClass is not null)
{
var methods = AccessTools.GetDeclaredMethods(_paintSetupClass);
foreach (var method in methods)
{
yield return method;
}
}
}

[HarmonyPrefix]
public static bool SkipMethod()
{
return false;
}
}
}

0 comments on commit d1fbc83

Please sign in to comment.