mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 03:33:29 +08:00
tip-fix
This commit is contained in:
@@ -69,14 +69,15 @@ public class PersistPatch : PatchImpl<PersistPatch>
|
||||
{
|
||||
var matcher = new CodeMatcher(instructions, generator);
|
||||
matcher.MatchForward(false,
|
||||
new CodeMatch(OpCodes.Ldloc_2),
|
||||
new CodeMatch(ci => ci.opcode == OpCodes.Ldloc || ci.opcode == OpCodes.Ldloc_S),
|
||||
new CodeMatch(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Component), nameof(Component.gameObject))),
|
||||
new CodeMatch(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(GameObject), nameof(GameObject.activeSelf)))
|
||||
);
|
||||
var ldLocOpr = matcher.Operand;
|
||||
var labels = matcher.Labels;
|
||||
matcher.Labels = null;
|
||||
matcher.Insert(
|
||||
new CodeInstruction(OpCodes.Ldloc_2).WithLabels(labels),
|
||||
new CodeInstruction(OpCodes.Ldloc_S, ldLocOpr).WithLabels(labels),
|
||||
new CodeInstruction(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Component), nameof(Component.transform))),
|
||||
new CodeInstruction(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Transform), nameof(Transform.parent))),
|
||||
new CodeInstruction(OpCodes.Callvirt, AccessTools.PropertyGetter(typeof(Transform), nameof(Transform.parent))),
|
||||
|
||||
@@ -273,7 +273,7 @@ public class UXAssist : BaseUnityPlugin, IModCanSave
|
||||
var src = mainMenu.newGameButton;
|
||||
var parent = src.transform.parent;
|
||||
var btn = Instantiate(src, parent);
|
||||
btn.name = "button-cheatenabler-config";
|
||||
btn.name = "button-uxassist-config";
|
||||
var l = btn.text.GetComponent<Localizer>();
|
||||
if (l != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user