Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of RealerCheatUnlocks v1.0.5
RealerCheatUnlocks.dll
Decompiled 5 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using CheatUnlocks; using HG; using HarmonyLib; using IL.RoR2.UI; using IL.RoR2.UI.LogBook; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using On; using On.RoR2.UI; using RoR2; using RoR2.Stats; using RoR2.UI; using RoR2.UI.LogBook; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("RealerCheatUnlocks")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+5191b4e9fec3eaba82d1d89265e77cf600238663")] [assembly: AssemblyProduct("RealerCheatUnlocks")] [assembly: AssemblyTitle("RealerCheatUnlocks")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace RealerCheatUnlocks { [BepInPlugin("prodzpod.RealerCheatUnlocks", "RealerCheatUnlocks", "1.0.5")] public class Main : BaseUnityPlugin { public abstract class CheatUnlocksButton : MonoBehaviour, IPointerClickHandler, IEventSystemHandler { public AchievementDef achievementDef; public UnlockableDef unlockableDef; public bool canRelock = true; public HGButton hgButton; public bool unlocked { get { UserProfile userProfile = GetUserProfile(); return userProfile != null && userProfile.HasUnlockable(unlockableDef.cachedName); } } public bool achieved { get { UserProfile userProfile = GetUserProfile(); return userProfile != null && userProfile.HasAchievement(achievementDef.identifier); } } public abstract void OnPointerClick(PointerEventData eventData); public UserProfile GetUserProfile() { LocalUser? obj = ((IEnumerable<LocalUser>)LocalUserManager.readOnlyLocalUsersList).FirstOrDefault((Func<LocalUser, bool>)((LocalUser v) => v != null)); return (obj != null) ? obj.userProfile : null; } public bool TryToggle() { UserProfile userProfile = GetUserProfile(); bool flag = achievementDef != null && !achieved; bool flag2 = (Object)(object)unlockableDef != (Object)null && !unlocked; if (flag || flag2) { Util.PlaySound("Play_UI_menuClick", ((Component)RoR2Application.instance).gameObject); if (flag) { userProfile.AddAchievement(achievementDef.identifier, true); } if (flag2) { userProfile.GrantUnlockable(unlockableDef); } return true; } if (canRelock) { Util.PlaySound("Play_UI_artifactDeselect", ((Component)RoR2Application.instance).gameObject); if (achievementDef != null) { userProfile.RevokeAchievement(achievementDef.identifier); } if ((Object)(object)unlockableDef != (Object)null) { userProfile.RevokeUnlockable(unlockableDef); userProfile.RequestEventualSave(); } return false; } return true; } } public class CheatUnlocksLoadoutButton : CheatUnlocksButton { public Sprite icon; public string title; public string body; public Color color; public UnityAction onClick; public Node viewableNode; public static Sprite lockedIcon; public override void OnPointerClick(PointerEventData eventData) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) if ((int)eventData.button != 1) { return; } TooltipProvider component = ((Component)hgButton).GetComponent<TooltipProvider>(); ViewableTag val = ((viewableNode != null) ? ((Component)hgButton).gameObject.GetComponent<ViewableTag>() : null); if (TryToggle()) { ((MPButton)hgButton).disableGamepadClick = false; ((MPButton)hgButton).disablePointerClick = false; component.titleColor = color; component.overrideTitleText = Language.GetString(title); component.overrideBodyText = Language.GetString(body); ((UnityEvent)((Button)hgButton).onClick).AddListener(onClick); if (Object.op_Implicit((Object)(object)val)) { val.viewableName = viewableNode.fullName; val.Refresh(); } ((Image)((Selectable)hgButton).targetGraphic).sprite = icon; } else { ((MPButton)hgButton).disableGamepadClick = true; ((MPButton)hgButton).disablePointerClick = true; component.titleColor = Color.gray; component.overrideTitleText = Language.GetString("UNIDENTIFIED"); component.overrideBodyText = unlockableDef.getHowToUnlockString(); ((UnityEvent)((Button)hgButton).onClick).RemoveListener(onClick); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.tagInstance)) { Object.Destroy((Object)(object)val.tagInstance); val.tagInstance = null; } ((Image)((Selectable)hgButton).targetGraphic).sprite = lockedIcon; } } } public class CheatUnlocksSurvivorButton : CheatUnlocksButton { public SurvivorIconController controller; public override void OnPointerClick(PointerEventData eventData) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)eventData.button == 1) { if (TryToggle()) { controller.survivorIsUnlocked = true; ((MPButton)hgButton).disableGamepadClick = false; ((MPButton)hgButton).disablePointerClick = false; } else { controller.survivorIsUnlocked = false; ((MPButton)hgButton).disableGamepadClick = true; ((MPButton)hgButton).disablePointerClick = true; } controller.UpdateAvailability(); controller.Rebuild(); } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func<Instruction, bool> <>9__7_2; public static Action<HGButton, Sprite, string, string, Color, UnityAction, string, Node> <>9__7_3; public static Manipulator <>9__7_0; public static hook_Rebuild <>9__7_1; internal void <Awake>b__7_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); val.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<GameObject>(x, "GetComponent") }); val.Emit(OpCodes.Dup); val.Emit(OpCodes.Ldarg, 2); val.Emit(OpCodes.Ldarg, 3); val.Emit(OpCodes.Ldarg, 4); val.Emit(OpCodes.Ldarg, 5); val.Emit(OpCodes.Ldarg, 6); val.Emit(OpCodes.Ldarg, 7); val.Emit(OpCodes.Ldarg, 8); val.EmitDelegate<Action<HGButton, Sprite, string, string, Color, UnityAction, string, Node>>((Action<HGButton, Sprite, string, string, Color, UnityAction, string, Node>)delegate(HGButton button, Sprite icon, string titleToken, string bodyToken, Color tooltipColor, UnityAction callback, string unlockableName, Node viewableNode) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (!Utility.IsNullOrWhiteSpace(unlockableName) && !((Object)(object)UnlockableCatalog.GetUnlockableDef(unlockableName) == (Object)null)) { CheatUnlocksLoadoutButton cheatUnlocksLoadoutButton = ((Component)button).gameObject.AddComponent<CheatUnlocksLoadoutButton>(); cheatUnlocksLoadoutButton.hgButton = button; cheatUnlocksLoadoutButton.unlockableDef = UnlockableCatalog.GetUnlockableDef(unlockableName); cheatUnlocksLoadoutButton.achievementDef = AchievementManager.GetAchievementDefFromUnlockable(cheatUnlocksLoadoutButton.unlockableDef.cachedName); if (viewableNode != null) { cheatUnlocksLoadoutButton.viewableNode = viewableNode; } cheatUnlocksLoadoutButton.icon = icon; cheatUnlocksLoadoutButton.title = titleToken; cheatUnlocksLoadoutButton.body = bodyToken; cheatUnlocksLoadoutButton.color = tooltipColor; cheatUnlocksLoadoutButton.onClick = callback; } }); } internal bool <Awake>b__7_2(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<GameObject>(x, "GetComponent"); } internal void <Awake>b__7_3(HGButton button, Sprite icon, string titleToken, string bodyToken, Color tooltipColor, UnityAction callback, string unlockableName, Node viewableNode) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (!Utility.IsNullOrWhiteSpace(unlockableName) && !((Object)(object)UnlockableCatalog.GetUnlockableDef(unlockableName) == (Object)null)) { CheatUnlocksLoadoutButton cheatUnlocksLoadoutButton = ((Component)button).gameObject.AddComponent<CheatUnlocksLoadoutButton>(); cheatUnlocksLoadoutButton.hgButton = button; cheatUnlocksLoadoutButton.unlockableDef = UnlockableCatalog.GetUnlockableDef(unlockableName); cheatUnlocksLoadoutButton.achievementDef = AchievementManager.GetAchievementDefFromUnlockable(cheatUnlocksLoadoutButton.unlockableDef.cachedName); if (viewableNode != null) { cheatUnlocksLoadoutButton.viewableNode = viewableNode; } cheatUnlocksLoadoutButton.icon = icon; cheatUnlocksLoadoutButton.title = titleToken; cheatUnlocksLoadoutButton.body = bodyToken; cheatUnlocksLoadoutButton.color = tooltipColor; cheatUnlocksLoadoutButton.onClick = callback; } } internal void <Awake>b__7_1(orig_Rebuild orig, SurvivorIconController self) { orig.Invoke(self); if ((Object)(object)self.survivorDef.unlockableDef == (Object)null) { if ((Object)(object)((Component)self).GetComponent<CheatUnlocksSurvivorButton>() != (Object)null) { Object.Destroy((Object)(object)((Component)self).gameObject.GetComponent<CheatUnlocksSurvivorButton>()); } return; } CheatUnlocksSurvivorButton cheatUnlocksSurvivorButton; if ((Object)(object)((Component)self).GetComponent<CheatUnlocksSurvivorButton>() == (Object)null) { cheatUnlocksSurvivorButton = ((Component)self).gameObject.AddComponent<CheatUnlocksSurvivorButton>(); cheatUnlocksSurvivorButton.hgButton = self.hgButton; cheatUnlocksSurvivorButton.controller = self; } else { cheatUnlocksSurvivorButton = ((Component)self).gameObject.GetComponent<CheatUnlocksSurvivorButton>(); } cheatUnlocksSurvivorButton.unlockableDef = self.survivorDef.unlockableDef; cheatUnlocksSurvivorButton.achievementDef = AchievementManager.GetAchievementDefFromUnlockable(cheatUnlocksSurvivorButton.unlockableDef.cachedName); } } public const string PluginGUID = "prodzpod.RealerCheatUnlocks"; public const string PluginAuthor = "prodzpod"; public const string PluginName = "RealerCheatUnlocks"; public const string PluginVersion = "1.0.5"; public static ManualLogSource Log; public static PluginInfo pluginInfo; public static Harmony Harmony; public void Awake() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown pluginInfo = ((BaseUnityPlugin)this).Info; Log = ((BaseUnityPlugin)this).Logger; Harmony = new Harmony("prodzpod.RealerCheatUnlocks"); CheatUnlocksLoadoutButton.lockedIcon = LegacyResourcesAPI.Load<Sprite>("Textures/MiscIcons/texUnlockIcon"); CheatUnlocksPlugin.Awake(); object obj = <>c.<>9__7_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) ILCursor val3 = new ILCursor(il); val3.GotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<GameObject>(x, "GetComponent") }); val3.Emit(OpCodes.Dup); val3.Emit(OpCodes.Ldarg, 2); val3.Emit(OpCodes.Ldarg, 3); val3.Emit(OpCodes.Ldarg, 4); val3.Emit(OpCodes.Ldarg, 5); val3.Emit(OpCodes.Ldarg, 6); val3.Emit(OpCodes.Ldarg, 7); val3.Emit(OpCodes.Ldarg, 8); val3.EmitDelegate<Action<HGButton, Sprite, string, string, Color, UnityAction, string, Node>>((Action<HGButton, Sprite, string, string, Color, UnityAction, string, Node>)delegate(HGButton button, Sprite icon, string titleToken, string bodyToken, Color tooltipColor, UnityAction callback, string unlockableName, Node viewableNode) { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if (!Utility.IsNullOrWhiteSpace(unlockableName) && !((Object)(object)UnlockableCatalog.GetUnlockableDef(unlockableName) == (Object)null)) { CheatUnlocksLoadoutButton cheatUnlocksLoadoutButton = ((Component)button).gameObject.AddComponent<CheatUnlocksLoadoutButton>(); cheatUnlocksLoadoutButton.hgButton = button; cheatUnlocksLoadoutButton.unlockableDef = UnlockableCatalog.GetUnlockableDef(unlockableName); cheatUnlocksLoadoutButton.achievementDef = AchievementManager.GetAchievementDefFromUnlockable(cheatUnlocksLoadoutButton.unlockableDef.cachedName); if (viewableNode != null) { cheatUnlocksLoadoutButton.viewableNode = viewableNode; } cheatUnlocksLoadoutButton.icon = icon; cheatUnlocksLoadoutButton.title = titleToken; cheatUnlocksLoadoutButton.body = bodyToken; cheatUnlocksLoadoutButton.color = tooltipColor; cheatUnlocksLoadoutButton.onClick = callback; } }); }; <>c.<>9__7_0 = val; obj = (object)val; } Row.AddButton += (Manipulator)obj; object obj2 = <>c.<>9__7_1; if (obj2 == null) { hook_Rebuild val2 = delegate(orig_Rebuild orig, SurvivorIconController self) { orig.Invoke(self); if ((Object)(object)self.survivorDef.unlockableDef == (Object)null) { if ((Object)(object)((Component)self).GetComponent<CheatUnlocksSurvivorButton>() != (Object)null) { Object.Destroy((Object)(object)((Component)self).gameObject.GetComponent<CheatUnlocksSurvivorButton>()); } } else { CheatUnlocksSurvivorButton cheatUnlocksSurvivorButton; if ((Object)(object)((Component)self).GetComponent<CheatUnlocksSurvivorButton>() == (Object)null) { cheatUnlocksSurvivorButton = ((Component)self).gameObject.AddComponent<CheatUnlocksSurvivorButton>(); cheatUnlocksSurvivorButton.hgButton = self.hgButton; cheatUnlocksSurvivorButton.controller = self; } else { cheatUnlocksSurvivorButton = ((Component)self).gameObject.GetComponent<CheatUnlocksSurvivorButton>(); } cheatUnlocksSurvivorButton.unlockableDef = self.survivorDef.unlockableDef; cheatUnlocksSurvivorButton.achievementDef = AchievementManager.GetAchievementDefFromUnlockable(cheatUnlocksSurvivorButton.unlockableDef.cachedName); } }; <>c.<>9__7_1 = val2; obj2 = (object)val2; } SurvivorIconController.Rebuild += (hook_Rebuild)obj2; } } } namespace CheatUnlocks { public class CheatUnlocksPlugin : BaseUnityPlugin { public class CheatUnlocksLogbookButton : MonoBehaviour, IPointerClickHandler, IEventSystemHandler { public Entry entry; public LogBookController logbookController; public string achievementName; public PickupIndex pickupIndex = PickupIndex.none; public UnlockableDef unlockableDef; public PerBodyStatDef perBodyStatDef; public BodyIndex bodyIndex = (BodyIndex)(-1); public UnityAction entryOnClick; public bool canRelock = true; public HGButton hgButton; public bool hgButtonDisableGamepadClick; public bool hgButtonDisablePointerClick; public Image hgButtonImageOnInteractable; public Action<GameObject, EntryStatus> initializeGraphics = InitializeGraphicsDefault; public static void InitializeGraphicsDefault(GameObject buttonObject, EntryStatus entryStatus) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Invalid comparison between Unknown and I4 ChildLocator component = buttonObject.GetComponent<ChildLocator>(); RawImage val = null; if (Object.op_Implicit((Object)(object)component)) { val = ((Component)component.FindChild("BG")).GetComponent<RawImage>(); } if (Object.op_Implicit((Object)(object)val)) { if (entryStatus - 4 <= 1) { ((Behaviour)val).enabled = true; } } } public static void InitializeGraphicsChallenge(GameObject buttonObject, EntryStatus entryStatus) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected I4, but got Unknown ChildLocator component = buttonObject.GetComponent<ChildLocator>(); switch (entryStatus - 2) { case 0: ((Component)component.FindChild("HasBeenUnlocked")).gameObject.SetActive(false); break; case 1: ((Component)component.FindChild("HasBeenUnlocked")).gameObject.SetActive(false); ((Component)component.FindChild("CantBeAchieved")).gameObject.SetActive(false); break; case 2: ((Component)component.FindChild("CantBeAchieved")).gameObject.SetActive(false); break; case 3: ((Component)component.FindChild("CantBeAchieved")).gameObject.SetActive(false); break; } } public void Start() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Expected O, but got Unknown entryOnClick = (UnityAction)delegate { if (entry != null && Object.op_Implicit((Object)(object)logbookController)) { logbookController.ViewEntry(entry); } }; } public void OnPointerClick(PointerEventData eventData) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Invalid comparison between Unknown and I4 //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) if ((int)eventData.button != 1) { return; } UserProfile val = logbookController.LookUpUserProfile(); bool flag = !string.IsNullOrEmpty(achievementName); bool flag2 = flag && val.HasAchievement(achievementName); bool flag3 = Object.op_Implicit((Object)(object)unlockableDef); bool flag4 = flag3 && val.HasUnlockable(unlockableDef); bool flag5 = pickupIndex != PickupIndex.none; bool flag6 = perBodyStatDef != null; if ((flag && !flag2) || (flag3 && !flag4)) { Util.PlaySound("Play_UI_menuClick", ((Component)RoR2Application.instance).gameObject); if (flag && !flag2) { foreach (AchievementNotificationPanel instances in AchievementNotificationPanel.instancesList) { Object.Destroy((Object)(object)((Component)instances).gameObject); } val.AddAchievement(achievementName, true); } if (flag3 && !flag4) { val.GrantUnlockable(unlockableDef); } } else if (flag5 && !val.HasDiscoveredPickup(pickupIndex)) { val.SetPickupDiscovered(pickupIndex, true); Util.PlaySound("Play_UI_menuClick", ((Component)RoR2Application.instance).gameObject); } else if (flag6 && val.statSheet.GetStatValueULong(perBodyStatDef.FindStatDef(bodyIndex)) == 0) { val.statSheet.PushStatValue(perBodyStatDef, bodyIndex, 1uL); Util.PlaySound("Play_UI_menuClick", ((Component)RoR2Application.instance).gameObject); } else if (canRelock) { if (flag && flag2) { foreach (AchievementNotificationPanel instances2 in AchievementNotificationPanel.instancesList) { Object.Destroy((Object)(object)((Component)instances2).gameObject); } val.RevokeAchievement(achievementName); } if (flag3 && flag4) { val.RevokeUnlockable(unlockableDef); val.RequestEventualSave(); } if (flag5) { val.SetPickupDiscovered(pickupIndex, false); val.RequestEventualSave(); } if (entry.viewableNode != null) { ViewableTag component = ((Component)hgButton).gameObject.GetComponent<ViewableTag>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.tagInstance)) { Object.Destroy((Object)(object)component.tagInstance); component.tagInstance = null; } } Util.PlaySound("Play_UI_artifactDeselect", ((Component)RoR2Application.instance).gameObject); } EntryStatus status = entry.GetStatus(val); TooltipContent tooltipContent = entry.GetTooltipContent(val, status); entry.category.initializeElementGraphics?.Invoke(((Component)hgButton).gameObject, entry, status, val); if (initializeGraphics != null) { initializeGraphics(((Component)hgButton).gameObject, status); } if ((int)status >= 4) { ((UnityEvent)((Button)hgButton).onClick).AddListener(entryOnClick); ((MPButton)hgButton).disableGamepadClick = hgButtonDisableGamepadClick; ((MPButton)hgButton).disablePointerClick = hgButtonDisablePointerClick; hgButton.imageOnInteractable = hgButtonImageOnInteractable; } else { ((UnityEvent)((Button)hgButton).onClick).RemoveListener(entryOnClick); ((MPButton)hgButton).disableGamepadClick = true; ((MPButton)hgButton).disablePointerClick = true; hgButton.imageOnInteractable = null; } Color titleColor = tooltipContent.titleColor; titleColor.a = 0.2f; hgButton.hoverToken = Language.GetStringFormatted("LOGBOOK_HOVER_DESCRIPTION_FORMAT", new object[3] { ((TooltipContent)(ref tooltipContent)).GetTitleText(), ((TooltipContent)(ref tooltipContent)).GetBodyText(), ColorUtility.ToHtmlStringRGBA(titleColor) }); } } public class CheatUnlocksEclipseButton : MonoBehaviour, IPointerClickHandler, IEventSystemHandler { public LocalUser localUser; public SurvivorDef survivorDef; public EclipseDifficultyMedalDisplay medalDisplay; public void OnEnable() { InstanceTracker.Add<CheatUnlocksEclipseButton>(this); } public void OnDisable() { InstanceTracker.Remove<CheatUnlocksEclipseButton>(this); } public void SetEclipseLevelUnlocked(bool unlock) { UnlockableDef safe = ListUtils.GetSafe<UnlockableDef>(EclipseRun.GetEclipseLevelUnlockablesForSurvivor(survivorDef), medalDisplay.eclipseLevel - EclipseRun.minUnlockableEclipseLevel + 1); if (unlock) { localUser.userProfile.GrantUnlockable(safe); bool flag = true; foreach (SurvivorDef orderedSurvivorDef in SurvivorCatalog.orderedSurvivorDefs) { if (medalDisplay.ShouldDisplaySurvivor(orderedSurvivorDef, localUser)) { int localUserSurvivorCompletedEclipseLevel = EclipseRun.GetLocalUserSurvivorCompletedEclipseLevel(localUser, orderedSurvivorDef); if (localUserSurvivorCompletedEclipseLevel < medalDisplay.eclipseLevel) { flag = false; break; } } } if (Object.op_Implicit((Object)(object)medalDisplay.iconImage)) { medalDisplay.iconImage.sprite = (flag ? medalDisplay.completeSprite : medalDisplay.incompleteSprite); } } else { localUser.userProfile.RevokeUnlockable(safe); localUser.userProfile.RequestEventualSave(); if (Object.op_Implicit((Object)(object)medalDisplay.iconImage)) { medalDisplay.iconImage.sprite = medalDisplay.unearnedSprite; } } } public void OnPointerClick(PointerEventData eventData) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)eventData.button != 1) { return; } UnlockableDef safe = ListUtils.GetSafe<UnlockableDef>(EclipseRun.GetEclipseLevelUnlockablesForSurvivor(survivorDef), medalDisplay.eclipseLevel - EclipseRun.minUnlockableEclipseLevel + 1); if (!Object.op_Implicit((Object)(object)safe)) { return; } if (!localUser.userProfile.HasUnlockable(safe)) { foreach (CheatUnlocksEclipseButton item in from x in InstanceTracker.GetInstancesList<CheatUnlocksEclipseButton>() where (Object)(object)x.survivorDef == (Object)(object)survivorDef && x.medalDisplay.eclipseLevel <= medalDisplay.eclipseLevel select x) { item.SetEclipseLevelUnlocked(unlock: true); } Util.PlaySound("Play_UI_menuClick", ((Component)RoR2Application.instance).gameObject); Util.PlaySound("Play_UI_achievementUnlock", ((Component)RoR2Application.instance).gameObject); return; } foreach (CheatUnlocksEclipseButton item2 in from x in InstanceTracker.GetInstancesList<CheatUnlocksEclipseButton>() where (Object)(object)x.survivorDef == (Object)(object)survivorDef && x.medalDisplay.eclipseLevel >= medalDisplay.eclipseLevel select x) { item2.SetEclipseLevelUnlocked(unlock: false); } Util.PlaySound("Play_UI_artifactDeselect", ((Component)RoR2Application.instance).gameObject); } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func<Instruction, bool> <>9__0_4; public static Func<Instruction, bool> <>9__0_5; public static Func<Instruction, bool> <>9__0_8; public static Func<Instruction, bool> <>9__0_10; public static Func<Instruction, bool> <>9__0_11; public static Action<HGButton, Entry, LogBookController> <>9__0_2; public static Manipulator <>9__0_0; public static hook_Refresh <>9__0_1; internal void <Awake>b__0_0(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0(); ILCursor val = new ILCursor(il); CS$<>8__locals0.hgButtonPos = -1; CS$<>8__locals0.entryDisplayClassPos = -1; CS$<>8__locals0.entryFieldRef = null; int num = default(int); if (!val.TryGotoNext(new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref CS$<>8__locals0.hgButtonPos), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchStfld<HGButton>(x, "updateTextOnHover") }) || !val.TryGotoNext(new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref CS$<>8__locals0.entryDisplayClassPos), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref CS$<>8__locals0.entryFieldRef), (Instruction x) => ILPatternMatchingExt.MatchLdfld<Entry>(x, "viewableNode") }) || !val.TryGotoPrev((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, CS$<>8__locals0.hgButtonPos), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Selectable>(x, "set_interactable") })) { return; } val.Emit(OpCodes.Ldloc, CS$<>8__locals0.hgButtonPos); val.Emit(OpCodes.Ldloc, CS$<>8__locals0.entryDisplayClassPos); val.Emit(OpCodes.Ldfld, CS$<>8__locals0.entryFieldRef); val.Emit(OpCodes.Ldarg, 0); val.EmitDelegate<Action<HGButton, Entry, LogBookController>>((Action<HGButton, Entry, LogBookController>)delegate(HGButton button, Entry entry, LogBookController logbookController) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Invalid comparison between Unknown and I4 //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Invalid comparison between Unknown and I4 //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Expected O, but got Unknown //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Expected O, but got Unknown //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass0_1 <>c__DisplayClass0_ = default(<>c__DisplayClass0_1); <>c__DisplayClass0_.button = button; <>c__DisplayClass0_.entry = entry; <>c__DisplayClass0_.logbookController = logbookController; switch (<>c__DisplayClass0_.entry.category.nameToken) { case "LOGBOOK_CATEGORY_ACHIEVEMENTS": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton3 = <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_); cheatUnlocksLogbookButton3.achievementName = ((AchievementDef)<>c__DisplayClass0_.entry.extraData).identifier; cheatUnlocksLogbookButton3.unlockableDef = UnlockableCatalog.GetUnlockableDef(((AchievementDef)<>c__DisplayClass0_.entry.extraData).unlockableRewardIdentifier); cheatUnlocksLogbookButton3.initializeGraphics = CheatUnlocksLogbookButton.InitializeGraphicsChallenge; break; } case "LOGBOOK_CATEGORY_ITEMANDEQUIPMENT": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton5 = <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_); cheatUnlocksLogbookButton5.pickupIndex = (PickupIndex)<>c__DisplayClass0_.entry.extraData; PickupDef pickupDef = PickupCatalog.GetPickupDef(cheatUnlocksLogbookButton5.pickupIndex); ItemIndex itemIndex = pickupDef.itemIndex; EquipmentIndex equipmentIndex = pickupDef.equipmentIndex; if ((int)itemIndex != -1) { <>c__DisplayClass0_2 CS$<>8__locals3 = new <>c__DisplayClass0_2 { itemDef = ItemCatalog.GetItemDef(itemIndex) }; if (Object.op_Implicit((Object)(object)CS$<>8__locals3.itemDef) && Object.op_Implicit((Object)(object)CS$<>8__locals3.itemDef.unlockableDef)) { AchievementDef val7 = ((IEnumerable<AchievementDef>)(object)AchievementManager.allAchievementDefs).FirstOrDefault((Func<AchievementDef, bool>)((AchievementDef x) => x.unlockableRewardIdentifier == CS$<>8__locals3.itemDef.unlockableDef.cachedName)); if (val7 != null) { cheatUnlocksLogbookButton5.achievementName = val7.identifier; } cheatUnlocksLogbookButton5.unlockableDef = CS$<>8__locals3.itemDef.unlockableDef; } } else if ((int)equipmentIndex != -1) { <>c__DisplayClass0_3 CS$<>8__locals1 = new <>c__DisplayClass0_3 { equipmentDef = EquipmentCatalog.GetEquipmentDef(equipmentIndex) }; if (Object.op_Implicit((Object)(object)CS$<>8__locals1.equipmentDef) && Object.op_Implicit((Object)(object)CS$<>8__locals1.equipmentDef.unlockableDef)) { AchievementDef val8 = ((IEnumerable<AchievementDef>)(object)AchievementManager.allAchievementDefs).FirstOrDefault((Func<AchievementDef, bool>)((AchievementDef x) => x.unlockableRewardIdentifier == CS$<>8__locals1.equipmentDef.unlockableDef.cachedName)); if (val8 != null) { cheatUnlocksLogbookButton5.achievementName = val8.identifier; } cheatUnlocksLogbookButton5.unlockableDef = CS$<>8__locals1.equipmentDef.unlockableDef; } } break; } case "LOGBOOK_CATEGORY_MONSTER": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton4 = <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_); CharacterBody val6 = (CharacterBody)<>c__DisplayClass0_.entry.extraData; DeathRewards component = ((Component)val6).GetComponent<DeathRewards>(); if (Object.op_Implicit((Object)(object)component)) { cheatUnlocksLogbookButton4.unlockableDef = component.logUnlockableDef; } cheatUnlocksLogbookButton4.perBodyStatDef = PerBodyStatDef.killsAgainst; cheatUnlocksLogbookButton4.bodyIndex = val6.bodyIndex; break; } case "LOGBOOK_CATEGORY_DRONE": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton2 = <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_); CharacterBody val5 = (CharacterBody)<>c__DisplayClass0_.entry.extraData; cheatUnlocksLogbookButton2.pickupIndex = PickupCatalog.FindPickupIndex(DroneCatalog.FindDroneDefFromBody(((Component)val5).gameObject).droneIndex); cheatUnlocksLogbookButton2.bodyIndex = val5.bodyIndex; break; } case "LOGBOOK_CATEGORY_STAGE": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton6 = <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_); UnlockableDef unlockableLogFromBaseSceneName = SceneCatalog.GetUnlockableLogFromBaseSceneName(((SceneDef)<>c__DisplayClass0_.entry.extraData).baseSceneName); if (Object.op_Implicit((Object)(object)unlockableLogFromBaseSceneName)) { cheatUnlocksLogbookButton6.unlockableDef = unlockableLogFromBaseSceneName; } break; } case "LOGBOOK_CATEGORY_SURVIVOR": { <>c__DisplayClass0_4 CS$<>8__locals2 = new <>c__DisplayClass0_4(); CheatUnlocksLogbookButton cheatUnlocksLogbookButton = <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_); CharacterBody val2 = (CharacterBody)<>c__DisplayClass0_.entry.extraData; SurvivorDef val3 = SurvivorCatalog.FindSurvivorDefFromBody(((Component)val2).gameObject); CS$<>8__locals2.unlockableDef = val3.unlockableDef; if (Object.op_Implicit((Object)(object)CS$<>8__locals2.unlockableDef)) { AchievementDef val4 = ((IEnumerable<AchievementDef>)(object)AchievementManager.allAchievementDefs).FirstOrDefault((Func<AchievementDef, bool>)((AchievementDef x) => x.unlockableRewardIdentifier == CS$<>8__locals2.unlockableDef.cachedName)); if (val4 != null) { cheatUnlocksLogbookButton.achievementName = val4.identifier; } cheatUnlocksLogbookButton.unlockableDef = CS$<>8__locals2.unlockableDef; } cheatUnlocksLogbookButton.perBodyStatDef = PerBodyStatDef.totalWins; cheatUnlocksLogbookButton.bodyIndex = val2.bodyIndex; break; } } }); } internal bool <Awake>b__0_4(Instruction x) { int num = default(int); return ILPatternMatchingExt.MatchLdcI4(x, ref num); } internal bool <Awake>b__0_5(Instruction x) { return ILPatternMatchingExt.MatchStfld<HGButton>(x, "updateTextOnHover"); } internal bool <Awake>b__0_8(Instruction x) { return ILPatternMatchingExt.MatchLdfld<Entry>(x, "viewableNode"); } internal bool <Awake>b__0_10(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 1); } internal bool <Awake>b__0_11(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<Selectable>(x, "set_interactable"); } internal void <Awake>b__0_2(HGButton button, Entry entry, LogBookController logbookController) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Invalid comparison between Unknown and I4 //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Invalid comparison between Unknown and I4 //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Expected O, but got Unknown //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Expected O, but got Unknown //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass0_1 <>c__DisplayClass0_ = default(<>c__DisplayClass0_1); <>c__DisplayClass0_.button = button; <>c__DisplayClass0_.entry = entry; <>c__DisplayClass0_.logbookController = logbookController; switch (<>c__DisplayClass0_.entry.category.nameToken) { case "LOGBOOK_CATEGORY_ACHIEVEMENTS": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton3 = <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_); cheatUnlocksLogbookButton3.achievementName = ((AchievementDef)<>c__DisplayClass0_.entry.extraData).identifier; cheatUnlocksLogbookButton3.unlockableDef = UnlockableCatalog.GetUnlockableDef(((AchievementDef)<>c__DisplayClass0_.entry.extraData).unlockableRewardIdentifier); cheatUnlocksLogbookButton3.initializeGraphics = CheatUnlocksLogbookButton.InitializeGraphicsChallenge; break; } case "LOGBOOK_CATEGORY_ITEMANDEQUIPMENT": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton5 = <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_); cheatUnlocksLogbookButton5.pickupIndex = (PickupIndex)<>c__DisplayClass0_.entry.extraData; PickupDef pickupDef = PickupCatalog.GetPickupDef(cheatUnlocksLogbookButton5.pickupIndex); ItemIndex itemIndex = pickupDef.itemIndex; EquipmentIndex equipmentIndex = pickupDef.equipmentIndex; if ((int)itemIndex != -1) { <>c__DisplayClass0_2 CS$<>8__locals2 = new <>c__DisplayClass0_2 { itemDef = ItemCatalog.GetItemDef(itemIndex) }; if (Object.op_Implicit((Object)(object)CS$<>8__locals2.itemDef) && Object.op_Implicit((Object)(object)CS$<>8__locals2.itemDef.unlockableDef)) { AchievementDef val6 = ((IEnumerable<AchievementDef>)(object)AchievementManager.allAchievementDefs).FirstOrDefault((Func<AchievementDef, bool>)((AchievementDef x) => x.unlockableRewardIdentifier == CS$<>8__locals2.itemDef.unlockableDef.cachedName)); if (val6 != null) { cheatUnlocksLogbookButton5.achievementName = val6.identifier; } cheatUnlocksLogbookButton5.unlockableDef = CS$<>8__locals2.itemDef.unlockableDef; } } else { if ((int)equipmentIndex == -1) { break; } <>c__DisplayClass0_3 CS$<>8__locals0 = new <>c__DisplayClass0_3 { equipmentDef = EquipmentCatalog.GetEquipmentDef(equipmentIndex) }; if (Object.op_Implicit((Object)(object)CS$<>8__locals0.equipmentDef) && Object.op_Implicit((Object)(object)CS$<>8__locals0.equipmentDef.unlockableDef)) { AchievementDef val7 = ((IEnumerable<AchievementDef>)(object)AchievementManager.allAchievementDefs).FirstOrDefault((Func<AchievementDef, bool>)((AchievementDef x) => x.unlockableRewardIdentifier == CS$<>8__locals0.equipmentDef.unlockableDef.cachedName)); if (val7 != null) { cheatUnlocksLogbookButton5.achievementName = val7.identifier; } cheatUnlocksLogbookButton5.unlockableDef = CS$<>8__locals0.equipmentDef.unlockableDef; } } break; } case "LOGBOOK_CATEGORY_MONSTER": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton4 = <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_); CharacterBody val5 = (CharacterBody)<>c__DisplayClass0_.entry.extraData; DeathRewards component = ((Component)val5).GetComponent<DeathRewards>(); if (Object.op_Implicit((Object)(object)component)) { cheatUnlocksLogbookButton4.unlockableDef = component.logUnlockableDef; } cheatUnlocksLogbookButton4.perBodyStatDef = PerBodyStatDef.killsAgainst; cheatUnlocksLogbookButton4.bodyIndex = val5.bodyIndex; break; } case "LOGBOOK_CATEGORY_DRONE": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton2 = <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_); CharacterBody val4 = (CharacterBody)<>c__DisplayClass0_.entry.extraData; cheatUnlocksLogbookButton2.pickupIndex = PickupCatalog.FindPickupIndex(DroneCatalog.FindDroneDefFromBody(((Component)val4).gameObject).droneIndex); cheatUnlocksLogbookButton2.bodyIndex = val4.bodyIndex; break; } case "LOGBOOK_CATEGORY_STAGE": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton6 = <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_); UnlockableDef unlockableLogFromBaseSceneName = SceneCatalog.GetUnlockableLogFromBaseSceneName(((SceneDef)<>c__DisplayClass0_.entry.extraData).baseSceneName); if (Object.op_Implicit((Object)(object)unlockableLogFromBaseSceneName)) { cheatUnlocksLogbookButton6.unlockableDef = unlockableLogFromBaseSceneName; } break; } case "LOGBOOK_CATEGORY_SURVIVOR": { <>c__DisplayClass0_4 CS$<>8__locals1 = new <>c__DisplayClass0_4(); CheatUnlocksLogbookButton cheatUnlocksLogbookButton = <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_); CharacterBody val = (CharacterBody)<>c__DisplayClass0_.entry.extraData; SurvivorDef val2 = SurvivorCatalog.FindSurvivorDefFromBody(((Component)val).gameObject); CS$<>8__locals1.unlockableDef = val2.unlockableDef; if (Object.op_Implicit((Object)(object)CS$<>8__locals1.unlockableDef)) { AchievementDef val3 = ((IEnumerable<AchievementDef>)(object)AchievementManager.allAchievementDefs).FirstOrDefault((Func<AchievementDef, bool>)((AchievementDef x) => x.unlockableRewardIdentifier == CS$<>8__locals1.unlockableDef.cachedName)); if (val3 != null) { cheatUnlocksLogbookButton.achievementName = val3.identifier; } cheatUnlocksLogbookButton.unlockableDef = CS$<>8__locals1.unlockableDef; } cheatUnlocksLogbookButton.perBodyStatDef = PerBodyStatDef.totalWins; cheatUnlocksLogbookButton.bodyIndex = val.bodyIndex; break; } } } internal void <Awake>b__0_1(orig_Refresh orig, EclipseDifficultyMedalDisplay self) { orig.Invoke(self); CheatUnlocksEclipseButton cheatUnlocksEclipseButton = ((Component)self).GetComponent<CheatUnlocksEclipseButton>(); if (!Object.op_Implicit((Object)(object)cheatUnlocksEclipseButton)) { cheatUnlocksEclipseButton = ((Component)self).gameObject.AddComponent<CheatUnlocksEclipseButton>(); } cheatUnlocksEclipseButton.medalDisplay = self; cheatUnlocksEclipseButton.localUser = LocalUserManager.GetFirstLocalUser(); cheatUnlocksEclipseButton.survivorDef = ((cheatUnlocksEclipseButton.localUser != null) ? cheatUnlocksEclipseButton.localUser.userProfile.GetSurvivorPreference() : null); } } [CompilerGenerated] private sealed class <>c__DisplayClass0_0 { public int hgButtonPos; public int entryDisplayClassPos; public FieldReference entryFieldRef; internal bool <Awake>b__3(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, ref hgButtonPos); } internal bool <Awake>b__6(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, ref entryDisplayClassPos); } internal bool <Awake>b__7(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, ref entryFieldRef); } internal bool <Awake>b__9(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, hgButtonPos); } } [StructLayout(LayoutKind.Auto)] [CompilerGenerated] private struct <>c__DisplayClass0_1 { public HGButton button; public Entry entry; public LogBookController logbookController; } [CompilerGenerated] private sealed class <>c__DisplayClass0_2 { public ItemDef itemDef; internal bool <Awake>b__13(AchievementDef x) { return x.unlockableRewardIdentifier == itemDef.unlockableDef.cachedName; } } [CompilerGenerated] private sealed class <>c__DisplayClass0_3 { public EquipmentDef equipmentDef; internal bool <Awake>b__14(AchievementDef x) { return x.unlockableRewardIdentifier == equipmentDef.unlockableDef.cachedName; } } [CompilerGenerated] private sealed class <>c__DisplayClass0_4 { public UnlockableDef unlockableDef; internal bool <Awake>b__15(AchievementDef x) { return x.unlockableRewardIdentifier == unlockableDef.cachedName; } } public static void Awake() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown object obj = <>c.<>9__0_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) ILCursor val3 = new ILCursor(il); int hgButtonPos = -1; int entryDisplayClassPos = -1; FieldReference entryFieldRef = null; int num = default(int); if (val3.TryGotoNext(new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref hgButtonPos), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, ref num), (Instruction x) => ILPatternMatchingExt.MatchStfld<HGButton>(x, "updateTextOnHover") }) && val3.TryGotoNext(new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref entryDisplayClassPos), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref entryFieldRef), (Instruction x) => ILPatternMatchingExt.MatchLdfld<Entry>(x, "viewableNode") }) && val3.TryGotoPrev((MoveType)2, new Func<Instruction, bool>[3] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, hgButtonPos), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<Selectable>(x, "set_interactable") })) { val3.Emit(OpCodes.Ldloc, hgButtonPos); val3.Emit(OpCodes.Ldloc, entryDisplayClassPos); val3.Emit(OpCodes.Ldfld, entryFieldRef); val3.Emit(OpCodes.Ldarg, 0); val3.EmitDelegate<Action<HGButton, Entry, LogBookController>>((Action<HGButton, Entry, LogBookController>)delegate(HGButton button, Entry entry, LogBookController logbookController) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Invalid comparison between Unknown and I4 //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Invalid comparison between Unknown and I4 //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Expected O, but got Unknown //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Expected O, but got Unknown //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Expected O, but got Unknown //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) switch (entry.category.nameToken) { case "LOGBOOK_CATEGORY_ACHIEVEMENTS": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton3 = MakeCheatButton(); cheatUnlocksLogbookButton3.achievementName = ((AchievementDef)entry.extraData).identifier; cheatUnlocksLogbookButton3.unlockableDef = UnlockableCatalog.GetUnlockableDef(((AchievementDef)entry.extraData).unlockableRewardIdentifier); cheatUnlocksLogbookButton3.initializeGraphics = CheatUnlocksLogbookButton.InitializeGraphicsChallenge; break; } case "LOGBOOK_CATEGORY_ITEMANDEQUIPMENT": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton5 = MakeCheatButton(); cheatUnlocksLogbookButton5.pickupIndex = (PickupIndex)entry.extraData; PickupDef pickupDef = PickupCatalog.GetPickupDef(cheatUnlocksLogbookButton5.pickupIndex); ItemIndex itemIndex = pickupDef.itemIndex; EquipmentIndex equipmentIndex = pickupDef.equipmentIndex; if ((int)itemIndex != -1) { ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex); if (Object.op_Implicit((Object)(object)itemDef) && Object.op_Implicit((Object)(object)itemDef.unlockableDef)) { AchievementDef val9 = ((IEnumerable<AchievementDef>)(object)AchievementManager.allAchievementDefs).FirstOrDefault((Func<AchievementDef, bool>)((AchievementDef x) => x.unlockableRewardIdentifier == itemDef.unlockableDef.cachedName)); if (val9 != null) { cheatUnlocksLogbookButton5.achievementName = val9.identifier; } cheatUnlocksLogbookButton5.unlockableDef = itemDef.unlockableDef; } } else if ((int)equipmentIndex != -1) { EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(equipmentIndex); if (Object.op_Implicit((Object)(object)equipmentDef) && Object.op_Implicit((Object)(object)equipmentDef.unlockableDef)) { AchievementDef val10 = ((IEnumerable<AchievementDef>)(object)AchievementManager.allAchievementDefs).FirstOrDefault((Func<AchievementDef, bool>)((AchievementDef x) => x.unlockableRewardIdentifier == equipmentDef.unlockableDef.cachedName)); if (val10 != null) { cheatUnlocksLogbookButton5.achievementName = val10.identifier; } cheatUnlocksLogbookButton5.unlockableDef = equipmentDef.unlockableDef; } } break; } case "LOGBOOK_CATEGORY_MONSTER": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton4 = MakeCheatButton(); CharacterBody val8 = (CharacterBody)entry.extraData; DeathRewards component = ((Component)val8).GetComponent<DeathRewards>(); if (Object.op_Implicit((Object)(object)component)) { cheatUnlocksLogbookButton4.unlockableDef = component.logUnlockableDef; } cheatUnlocksLogbookButton4.perBodyStatDef = PerBodyStatDef.killsAgainst; cheatUnlocksLogbookButton4.bodyIndex = val8.bodyIndex; break; } case "LOGBOOK_CATEGORY_DRONE": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton2 = MakeCheatButton(); CharacterBody val7 = (CharacterBody)entry.extraData; cheatUnlocksLogbookButton2.pickupIndex = PickupCatalog.FindPickupIndex(DroneCatalog.FindDroneDefFromBody(((Component)val7).gameObject).droneIndex); cheatUnlocksLogbookButton2.bodyIndex = val7.bodyIndex; break; } case "LOGBOOK_CATEGORY_STAGE": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton6 = MakeCheatButton(); UnlockableDef unlockableLogFromBaseSceneName = SceneCatalog.GetUnlockableLogFromBaseSceneName(((SceneDef)entry.extraData).baseSceneName); if (Object.op_Implicit((Object)(object)unlockableLogFromBaseSceneName)) { cheatUnlocksLogbookButton6.unlockableDef = unlockableLogFromBaseSceneName; } break; } case "LOGBOOK_CATEGORY_SURVIVOR": { CheatUnlocksLogbookButton cheatUnlocksLogbookButton = MakeCheatButton(); CharacterBody val4 = (CharacterBody)entry.extraData; SurvivorDef val5 = SurvivorCatalog.FindSurvivorDefFromBody(((Component)val4).gameObject); UnlockableDef unlockableDef = val5.unlockableDef; if (Object.op_Implicit((Object)(object)unlockableDef)) { AchievementDef val6 = ((IEnumerable<AchievementDef>)(object)AchievementManager.allAchievementDefs).FirstOrDefault((Func<AchievementDef, bool>)((AchievementDef x) => x.unlockableRewardIdentifier == unlockableDef.cachedName)); if (val6 != null) { cheatUnlocksLogbookButton.achievementName = val6.identifier; } cheatUnlocksLogbookButton.unlockableDef = unlockableDef; } cheatUnlocksLogbookButton.perBodyStatDef = PerBodyStatDef.totalWins; cheatUnlocksLogbookButton.bodyIndex = val4.bodyIndex; break; } } CheatUnlocksLogbookButton MakeCheatButton() { CheatUnlocksLogbookButton cheatUnlocksLogbookButton7 = ((Component)button).gameObject.AddComponent<CheatUnlocksLogbookButton>(); cheatUnlocksLogbookButton7.entry = entry; cheatUnlocksLogbookButton7.logbookController = logbookController; cheatUnlocksLogbookButton7.hgButton = button; cheatUnlocksLogbookButton7.hgButtonDisableGamepadClick = ((MPButton)button).disableGamepadClick; cheatUnlocksLogbookButton7.hgButtonDisablePointerClick = ((MPButton)button).disablePointerClick; cheatUnlocksLogbookButton7.hgButtonImageOnInteractable = button.imageOnInteractable; return cheatUnlocksLogbookButton7; } }); } }; <>c.<>9__0_0 = val; obj = (object)val; } LogBookController.BuildEntriesPage += (Manipulator)obj; object obj2 = <>c.<>9__0_1; if (obj2 == null) { hook_Refresh val2 = delegate(orig_Refresh orig, EclipseDifficultyMedalDisplay self) { orig.Invoke(self); CheatUnlocksEclipseButton cheatUnlocksEclipseButton = ((Component)self).GetComponent<CheatUnlocksEclipseButton>(); if (!Object.op_Implicit((Object)(object)cheatUnlocksEclipseButton)) { cheatUnlocksEclipseButton = ((Component)self).gameObject.AddComponent<CheatUnlocksEclipseButton>(); } cheatUnlocksEclipseButton.medalDisplay = self; cheatUnlocksEclipseButton.localUser = LocalUserManager.GetFirstLocalUser(); cheatUnlocksEclipseButton.survivorDef = ((cheatUnlocksEclipseButton.localUser != null) ? cheatUnlocksEclipseButton.localUser.userProfile.GetSurvivorPreference() : null); }; <>c.<>9__0_1 = val2; obj2 = (object)val2; } EclipseDifficultyMedalDisplay.Refresh += (hook_Refresh)obj2; } [CompilerGenerated] internal static CheatUnlocksLogbookButton <Awake>g__MakeCheatButton|0_12(ref <>c__DisplayClass0_1 P_0) { CheatUnlocksLogbookButton cheatUnlocksLogbookButton = ((Component)P_0.button).gameObject.AddComponent<CheatUnlocksLogbookButton>(); cheatUnlocksLogbookButton.entry = P_0.entry; cheatUnlocksLogbookButton.logbookController = P_0.logbookController; cheatUnlocksLogbookButton.hgButton = P_0.button; cheatUnlocksLogbookButton.hgButtonDisableGamepadClick = ((MPButton)P_0.button).disableGamepadClick; cheatUnlocksLogbookButton.hgButtonDisablePointerClick = ((MPButton)P_0.button).disablePointerClick; cheatUnlocksLogbookButton.hgButtonImageOnInteractable = P_0.button.imageOnInteractable; return cheatUnlocksLogbookButton; } } }