// Token: 0x06000045 RID: 69 RVA: 0x000032C4 File Offset: 0x000014C4 public Command_MultiVerb(Verb verb, MultiVerbComp multiVerb, int index) { this.defaultLabel = "Verb: " + verb.verbProps.label; this.verb = verb; this.multiVerb = multiVerb; this.index = index; }
public static void Patch_VerbTracker_GetVerbsCommands_Postfix( ref VerbTracker __instance, ref IEnumerable <Command> __result, ref KeyCode hotKey) { CompEquippable directOwner = __instance.directOwner as CompEquippable; MultiVerbComp multiVerb = (MultiVerbComp)null; if (directOwner == null || (M0)(multiVerb = (MultiVerbComp)ThingCompUtility.TryGetComp <MultiVerbComp>((Thing)((ThingComp)directOwner).parent)) == null) { return; } List <Command> commandList = new List <Command>(); int index = 0; commandList.AddRange(__result); using (List <Verb> .Enumerator enumerator = __instance.get_AllVerbs().GetEnumerator()) { while (enumerator.MoveNext()) { MechaniteForgeHarmonyPatches.Command_MultiVerb commandMultiVerb = new MechaniteForgeHarmonyPatches.Command_MultiVerb(enumerator.Current, multiVerb, index); commandList.Add((Command)commandMultiVerb); ++index; } } __result = (IEnumerable <Command>)commandList; }
public Command_MultiVerb(Verb verb, MultiVerbComp multiVerb, int index) { this.\u002Ector(); this.defaultLabel = (__Null)("Verb: " + (string)((VerbProperties)verb.verbProps).label); this.verb = verb; this.multiVerb = multiVerb; this.index = index; }
// Token: 0x06000029 RID: 41 RVA: 0x00002A08 File Offset: 0x00000C08 public static void Patch_VerbTracker_GetVerbsCommands_Postfix(ref VerbTracker __instance, ref IEnumerable <Command> __result, ref KeyCode hotKey) { CompEquippable compEquippable = __instance.directOwner as CompEquippable; MultiVerbComp multiVerb = null; bool flag = compEquippable != null && (multiVerb = compEquippable.parent.TryGetComp <MultiVerbComp>()) != null; if (flag) { List <Command> list = new List <Command>(); int num = 0; list.AddRange(__result); foreach (Verb verb in __instance.AllVerbs) { MechaniteForgeHarmonyPatches.Command_MultiVerb item = new MechaniteForgeHarmonyPatches.Command_MultiVerb(verb, multiVerb, num); list.Add(item); num++; } __result = list; } }
public static bool Patch_VerbTracker_PrimaryVerb_Prefix( ref VerbTracker __instance, ref Verb __result) { if (__instance.get_AllVerbs() == null && MechaniteForgeHarmonyPatches.VerbTracker_InitVerbs != null) { MechaniteForgeHarmonyPatches.VerbTracker_InitVerbs.Invoke((object)__instance, new object[0]); } CompEquippable directOwner = __instance.directOwner as CompEquippable; MultiVerbComp multiVerbComp = (MultiVerbComp)null; if (directOwner != null && (M0)(multiVerbComp = (MultiVerbComp)ThingCompUtility.TryGetComp <MultiVerbComp>((Thing)((ThingComp)directOwner).parent)) != null) { __result = __instance.get_AllVerbs()[multiVerbComp.currentVerbIndex]; if (__result != null) { return(false); } } return(true); }
// Token: 0x06000028 RID: 40 RVA: 0x00002978 File Offset: 0x00000B78 public static bool Patch_VerbTracker_PrimaryVerb_Prefix(ref VerbTracker __instance, ref Verb __result) { bool flag = __instance.AllVerbs == null && MechaniteForgeHarmonyPatches.VerbTracker_InitVerbs != null; if (flag) { MechaniteForgeHarmonyPatches.VerbTracker_InitVerbs.Invoke(__instance, new object[0]); } CompEquippable compEquippable = __instance.directOwner as CompEquippable; MultiVerbComp multiVerbComp = null; bool flag2 = compEquippable != null && (multiVerbComp = compEquippable.parent.TryGetComp <MultiVerbComp>()) != null; if (flag2) { __result = __instance.AllVerbs[multiVerbComp.currentVerbIndex]; bool flag3 = __result != null; if (flag3) { return(false); } } return(true); }