using System.Collections.Generic;
using System.Reflection;
using System.Reflection.Emit;
using HarmonyLib;
using NitroxModel.Helper;
namespace NitroxPatcher.Patches.Persistent;
///
/// Remove the option for PDA pause
///
public sealed partial class uGUI_OptionsPanel_AddAccessibilityTab_Patch : NitroxPatch, IPersistentPatch
{
private static readonly MethodInfo TARGET_METHOD = Reflect.Method((uGUI_OptionsPanel t) => t.AddAccessibilityTab());
///
/// Simply removes following line
/// AddToggleOption(num, "PDAPause" ...
///
public static IEnumerable Transpiler(IEnumerable instructions)
{
return new CodeMatcher(instructions).MatchStartForward([
new(OpCodes.Ldarg_0),
new(OpCodes.Ldloc_0),
new(OpCodes.Ldstr, "PDAPause")
])
.RemoveInstructions(10)
.InstructionEnumeration();
}
}