Decompiled source of Artifacts Of Might v0.1.5
ArtifactsOfMight/ArtifactsOfMight.dll
Decompiled 13 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using ArtifactsOfMight; using ArtifactsOfMight.Artifacts; using ArtifactsOfMight.DraftArtifact.Game; using ArtifactsOfMight.Loadout; using ArtifactsOfMight.Loadout.Corruption; using ArtifactsOfMight.Loadout.Draft; using ArtifactsOfMight.Messages; using ArtifactsOfMight.RunConfig; using ArtifactsOfMight.UI; using ArtifactsOfMight.UI.Branding.Buttons; using ArtifactsOfMight.UI.Branding.Inspection; using ArtifactsOfMight.UI.Branding.Panel; using ArtifactsOfMight.UI.Drafting; using ArtifactsOfMight.UI.Drafting.Grid; using ArtifactsOfMight.UI.Drafting.Summary; using ArtifactsOfMight.UI.Drafting.Tabs; using ArtifactsOfMight.UI.Drafting.TierTab; using ArtifactsOfMight.UI.Tooltips; using ArtifactsOfMight.UI.Utils; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using On.RoR2; using On.RoR2.Networking; using On.RoR2.UI; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using RoR2; using RoR2.Networking; using RoR2.UI; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.UIElements.Collections; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ArtifactsOfMight")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("0.1.5.0")] [assembly: AssemblyInformationalVersion("0.1.5+60aa8c9b11c7f8ca05896fd2b7077a8ef68e43ed")] [assembly: AssemblyProduct("ArtifactsOfMight")] [assembly: AssemblyTitle("ArtifactsOfMight")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.1.5.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; } } } public class DraftPickerToggleDuringLobby : MonoBehaviour { public GameObject RootObject; private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (!Input.GetKeyDown((KeyCode)284)) { return; } Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; if (name != "lobby") { Log.Warning("DraftPickerToggleDuringLobby in scene " + name); return; } Log.Info("DraftPickerToggle Respond F3"); if (!Object.op_Implicit((Object)(object)RootObject)) { Log.Warning("DraftPickerToggleDuringLobby no RootObject"); return; } bool activeSelf = RootObject.gameObject.activeSelf; RootObject.gameObject.SetActive(!activeSelf); } } namespace ArtifactsOfMight { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("AnEmortalKid.ArtifactsOfMight", "ArtifactsOfMight", "0.1.4")] public class ArtifactsOfMight : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnClientConnect <>9__5_0; public static Func<Type, bool> <>9__6_0; internal void <Awake>b__5_0(orig_OnClientConnect s, NetworkManagerSystemSteam u, NetworkConnection t) { Log.Info("Bypass OnClientConnect"); } internal bool <RegisterArtifacts>b__6_0(Type type) { if (!type.IsAbstract) { return type.IsSubclassOf(typeof(ArtifactBase)); } return false; } } public const string PluginGUID = "AnEmortalKid.ArtifactsOfMight"; public const string PluginAuthor = "AnEmortalKid"; public const string PluginName = "ArtifactsOfMight"; public const string PluginVersion = "0.1.4"; public List<ArtifactBase> Artifacts = new List<ArtifactBase>(); 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown Log.Init(((BaseUnityPlugin)this).Logger); Log.Info("Initializing via Awake"); CharacterSelectController.ClientSetReady += new hook_ClientSetReady(OnClientSetReady); CharacterSelectController.Awake += new hook_Awake(CSC_Awake); if (!DebugSettings.LOCAL_NETWORK_TEST) { return; } Log.Warning("In Network Test Mode, gonna do the thing to the System Steam"); object obj = <>c.<>9__5_0; if (obj == null) { hook_OnClientConnect val = delegate { Log.Info("Bypass OnClientConnect"); }; <>c.<>9__5_0 = val; obj = (object)val; } NetworkManagerSystemSteam.OnClientConnect += (hook_OnClientConnect)obj; } private void RegisterArtifacts() { Log.Info("Registering Artifacts"); foreach (Type item in from type in Assembly.GetExecutingAssembly().GetTypes() where !type.IsAbstract && type.IsSubclassOf(typeof(ArtifactBase)) select type) { Log.Info($"Registering artifact: {item}"); ArtifactBase artifactBase = (ArtifactBase)Activator.CreateInstance(item); if (ValidateArtifact(artifactBase, Artifacts)) { artifactBase.Init(((BaseUnityPlugin)this).Config); } } } public bool ValidateArtifact(ArtifactBase artifact, List<ArtifactBase> artifactList) { artifactList.Add(artifact); return true; } private void CSC_Awake(orig_Awake orig, CharacterSelectController self) { orig.Invoke(self); Canvas componentInChildren = ((Component)self).GetComponentInChildren<Canvas>(true); if (!Object.op_Implicit((Object)(object)componentInChildren)) { Log.Warning("No Canvas under CSC."); return; } Transform obj = ((Component)componentInChildren).transform.Find("SafeArea"); RectTransform val = (RectTransform)(object)((obj is RectTransform) ? obj : null); if (!Object.op_Implicit((Object)(object)val)) { Log.Warning("SafeArea not found."); } else if (!Object.op_Implicit((Object)(object)((Component)self).GetComponent<DraftPickerUI>())) { ((Component)self).gameObject.AddComponent<DraftPickerUI>().SafeArea = val; Log.Warning("DraftPickerUI attached to CharacterSelectController GameObject."); } } private void OnClientSetReady(orig_ClientSetReady orig, CharacterSelectController self) { orig.Invoke(self); if (NetworkClient.active) { ((MonoBehaviour)self).StartCoroutine(SendAfterDelay()); } } private IEnumerator SendAfterDelay() { yield return (object)new WaitForSecondsRealtime(0.05f); ClientLoadoutSender.SendNow(); } public void OnEnable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown PickupPickerController.OnInteractionBegin += new hook_OnInteractionBegin(PopulateOnOpen); PickupPickerController.SetOptionsServer += new hook_SetOptionsServer(OnSetOptionsServer); PickupPickerPanel.SetPickupOptions += new hook_SetPickupOptions(PreventWeirdSizeOnClientSetPickupOptions); NetworkingAPI.RegisterMessageType<LoadoutSyncMsg>(); NetworkingAPI.RegisterMessageType<RequestLoadoutSyncMsg>(); Stage.BeginServer += new hook_BeginServer(OnBeginServer); } public void OnDisable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown PickupPickerController.OnInteractionBegin -= new hook_OnInteractionBegin(PopulateOnOpen); PickupPickerController.SetOptionsServer -= new hook_SetOptionsServer(OnSetOptionsServer); PickupPickerPanel.SetPickupOptions -= new hook_SetPickupOptions(PreventWeirdSizeOnClientSetPickupOptions); } private void PreventWeirdSizeOnClientSetPickupOptions(orig_SetPickupOptions orig, PickupPickerPanel self, Option[] options) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (!NetworkClient.active || NetworkServer.active) { orig.Invoke(self, options); return; } if (LoggerSettings.LOG_CLIENT_PICKUP_OPTIONS) { Log.Info($"SetPickupOptions Invoked with {options.Length} items for client only session."); } int num = options.Length; LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); NetworkUser opener = ((firstLocalUser != null) ? firstLocalUser.currentNetworkUser : null); PlayerLoadout playerLoadout = DraftLoadout.Instance.ToPlayerLoadout(); PickupPickerController pickerController = self.pickerController; ClientPickerPanelProtection clientPickerPanelProtection = default(ClientPickerPanelProtection); if (!((Component)pickerController).TryGetComponent<ClientPickerPanelProtection>(ref clientPickerPanelProtection)) { if (LoggerSettings.LOG_CLIENT_PICKUP_OPTIONS) { Log.Debug($"Attaching picker protector to picker: {((NetworkBehaviour)self.pickerController).netId}"); } clientPickerPanelProtection = ((Component)pickerController).gameObject.AddComponent<ClientPickerPanelProtection>(); clientPickerPanelProtection.ClientExpectedLength = GetClientExpectedCount(options, opener, playerLoadout); } if (num == clientPickerPanelProtection.ClientExpectedLength) { orig.Invoke(self, options); return; } int clientExpectedLength = clientPickerPanelProtection.ClientExpectedLength; if (LoggerSettings.LOG_CLIENT_PICKUP_OPTIONS) { Log.Info($"Server sent {num} but we expected {clientExpectedLength}"); } Option[] draftOptionsForPlayer = GetDraftOptionsForPlayer(options, opener, DraftLoadout.Instance.ToPlayerLoadout()); if (LoggerSettings.LOG_CLIENT_PICKUP_OPTIONS) { Log.Info("Using client predicted set"); } orig.Invoke(self, draftOptionsForPlayer); } private void OnSetOptionsServer(orig_SetOptionsServer orig, PickupPickerController self, Option[] newOptions) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) PickerState pickerState = default(PickerState); if (NetworkServer.active && !((Component)self).TryGetComponent<PickerState>(ref pickerState)) { Log.Debug($"OnSetOptionsServer Store original options for picker:{((NetworkBehaviour)self).netId} count:{newOptions.Length}"); pickerState = ((Component)self).gameObject.AddComponent<PickerState>(); pickerState.originalOptions = newOptions.ToArray(); } orig.Invoke(self, newOptions); } private void PopulateOnOpen(orig_OnInteractionBegin orig, PickupPickerController self, Interactor interactor) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { Log.Info($"PopulateOnOpen picker:{((NetworkBehaviour)self).netId} for interactor: {((NetworkBehaviour)interactor).netId}"); NetworkUser val = ResolveUser(interactor); if ((Object)(object)val != (Object)null) { Option[] options = ServerBuildDraftOptionsFor(val, self); ApplyOptionsServer(self, options); } orig.Invoke(self, interactor); } else { Log.Info("PopulateOnOpen Client"); orig.Invoke(self, interactor); } } private void OnBeginServer(orig_BeginServer orig, Stage self) { orig.Invoke(self); bool active = NetworkServer.active; Log.Info($"OnBeginServer serverIsActive: {active}"); if (active) { Log.Info("OnBeginServer asking clients for their loadouts"); NetMessageExtensions.Send((INetMessage)(object)new RequestLoadoutSyncMsg(), (NetworkDestination)1); } } private void ApplyOptionsServer(PickupPickerController self, Option[] options) { Log.Info("ApplyOptionsServer"); self.SetOptionsServer(options); } private NetworkUser ResolveUser(Interactor interactor) { CharacterBody val = default(CharacterBody); if (((Component)interactor).TryGetComponent<CharacterBody>(ref val)) { CharacterMaster master = val.master; if (master == null) { return null; } PlayerCharacterMasterController playerCharacterMasterController = master.playerCharacterMasterController; if (playerCharacterMasterController == null) { return null; } return playerCharacterMasterController.networkUser; } return null; } private Option[] ServerBuildDraftOptionsFor(NetworkUser opener, PickupPickerController ppc) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (ServerLoadoutRegistry.TryGetFor(opener, out var loadout)) { Log.Info($"ServerBuildDraftOptionsFor: {((NetworkBehaviour)opener).netId} using loadout: {loadout}"); Option[] originalOptions = ((Component)ppc).GetComponent<PickerState>().originalOptions; return GetDraftOptionsForPlayer(originalOptions, opener, loadout); } return ppc.options; } private Option[] GetDraftOptionsForPlayer(Option[] ppcOptions, NetworkUser opener, PlayerLoadout playerLoadout) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_0151: 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_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) ItemTier itemTier = PickupCatalog.GetPickupDef(ppcOptions[0].pickupIndex).itemTier; if (LoggerSettings.LOG_BUILD_DRAFT_OPTIONS) { Log.Info($"Building options for tier: {itemTier}"); } if (!playerLoadout.byTier.TryGetValue(itemTier, out var _)) { if (LoggerSettings.LOG_BUILD_DRAFT_OPTIONS) { Log.Info($"Draft has no limit for tier: {itemTier} returning fallback"); } return ppcOptions; } TierLimit tierLimit = DictionaryExtensions.Get<ItemTier, TierLimit>((IDictionary<ItemTier, TierLimit>)playerLoadout.byTier, itemTier, default(TierLimit)); if (LoggerSettings.LOG_BUILD_DRAFT_OPTIONS) { Log.Info($"Build filter for tier: {itemTier}"); } List<Option> list = new List<Option>(); HashSet<ItemIndex> restrictedByVoid = tierLimit.restrictedByVoid; HashSet<ItemIndex> allowed = tierLimit.allowed; if (LoggerSettings.LOG_BUILD_DRAFT_OPTIONS) { Log.Info($"Tier {itemTier} allows {allowed.Count} items"); } foreach (Option val in ppcOptions) { PickupDef pickupDef = PickupCatalog.GetPickupDef(val.pickupIndex); ItemIndex itemIndex = pickupDef.itemIndex; if (allowed.Contains(itemIndex)) { list.Add(val); } else if (restrictedByVoid.Contains(itemIndex)) { if (LoggerSettings.LOG_BUILD_DRAFT_OPTIONS) { Log.Info("Checking restrict by corrupt for " + pickupDef.nameToken); } if (HasRequiredCorruptItem(opener, pickupDef)) { list.Add(val); continue; } Option val2 = default(Option); val2.pickupIndex = val.pickupIndex; val2.available = false; Option item = val2; list.Add(item); } else if (PickupPools.IsUndraftablePickup(itemIndex)) { list.Add(val); } else if (allowed.Count == 0 && CorruptionMaps.IsVoidTier(itemTier)) { Option val2 = default(Option); val2.pickupIndex = val.pickupIndex; val2.available = false; Option item2 = val2; list.Add(item2); } } if (LoggerSettings.LOG_BUILD_DRAFT_OPTIONS) { Log.Info($"Loadout filtered item count: {list.Count}"); } return list.ToArray(); } private int GetClientExpectedCount(Option[] sentOptions, NetworkUser opener, PlayerLoadout playerLoadout) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) ItemTier itemTier = PickupCatalog.GetPickupDef(sentOptions[0].pickupIndex).itemTier; Log.Info($"Predicting options for tier: {itemTier}"); if (!playerLoadout.byTier.TryGetValue(itemTier, out var value)) { Log.Info($"Draft has no limit for tier: {itemTier} assuming all items are ok"); return sentOptions.Length; } DictionaryExtensions.Get<ItemTier, TierLimit>((IDictionary<ItemTier, TierLimit>)playerLoadout.byTier, itemTier, default(TierLimit)); Log.Info($"Build predicted for tier: {itemTier}"); if (value.allowed.Count == 0) { return sentOptions.Length; } int count = value.allowed.Count; int count2 = value.restrictedByVoid.Count; return count + count2; } private static bool HasRequiredCorruptItem(NetworkUser user, PickupDef normalDef) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) if (!CorruptionMaps.HasVoidMapping(normalDef.itemIndex, out var voidIndex)) { return false; } if (DebugSettings.LOG_DRAFT_POOLS_INFO) { Log.Info($"Checking for void {voidIndex}"); } return user.master.inventory.GetItemCount(voidIndex) > 0; } private void Update() { //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) if (!DebugSettings.IS_DEV_MODE) { return; } if (Input.GetKeyDown((KeyCode)283)) { PlayerCharacterMasterController val = PlayerCharacterMasterController.instances[0]; if ((Object)(object)val != (Object)null && (Object)(object)val.master != (Object)null) { val.master.GiveMoney(50u); Log.Info($"[DraftArtifact] Gave 50 gold to {val.networkUser}"); SimpleChatMessage val2 = new SimpleChatMessage(); val2.baseToken = "<color=#e5eefc>{0}: Im a big cheating cheater</color>"; val2.paramTokens = new string[1] { ((Object)val.networkUser).name }; Chat.SendBroadcastChat((ChatMessageBase)(object)val2); } else { Log.Info("[DraftArtifact] No player master found."); } } if (Input.GetKeyDown((KeyCode)284)) { Log.Info("Tier 1 single"); Transform transform = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform; if (CorruptedItemDefs.TryGetItemDef(CorruptedItem.Needletick, out var itemDef)) { PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(itemDef.itemIndex), transform.position, transform.forward * 20f); } } if (Input.GetKeyDown((KeyCode)285)) { Log.Info("Tier 2 single"); Transform transform2 = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform; if (CorruptedItemDefs.TryGetItemDef(CorruptedItem.VoidsentFlame, out var itemDef2)) { PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(itemDef2.itemIndex), transform2.position, transform2.forward * 20f); } } if (!Input.GetKeyDown((KeyCode)286)) { return; } Log.Info("Trying to make tier2 full panel"); Transform transform3 = PlayerCharacterMasterController.instances[0].master.GetBodyObject().transform; CorruptedItem[] array = new CorruptedItem[6] { CorruptedItem.VoidsentFlame, CorruptedItem.PlasmaShrimp, CorruptedItem.Tentabauble, CorruptedItem.SingularityBand, CorruptedItem.Polylute, CorruptedItem.LysateCell }; Option[] array2 = (Option[])(object)new Option[array.Length]; for (int i = 0; i < array.Length; i++) { if (CorruptedItemDefs.TryGetItemDef(array[i], out var itemDef3)) { array2[i] = new Option { available = true, pickupIndex = PickupCatalog.FindPickupIndex(itemDef3.itemIndex) }; } } CreatePickupInfo val3 = default(CreatePickupInfo); val3.pickerOptions = array2; val3.position = transform3.position; val3.rotation = transform3.rotation; val3.artifactFlag = (PickupArtifactFlag)1; CreatePickupInfo val4 = val3; GenericPickupController.CreatePickup(ref val4); } } public static class ClientLoadoutSender { public static void SendNow() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (NetworkClient.active) { NetworkUser currentNetworkUser = LocalUserManager.GetFirstLocalUser().currentNetworkUser; NetworkInstanceId senderNetId = (Object.op_Implicit((Object)(object)currentNetworkUser) ? ((NetworkBehaviour)currentNetworkUser).netId : NetworkInstanceId.Invalid); Log.Info($"ClientLoadoutSender Sending loadout for {((NetworkBehaviour)currentNetworkUser).netId} | {((Object)currentNetworkUser).name}"); PlayerLoadout playerLoadout = DraftLoadout.Instance.ToPlayerLoadout(); Log.Info($"ClientLoadoutSender loadout: {playerLoadout}."); NetMessageExtensions.Send((INetMessage)(object)new LoadoutSyncMsg { senderNetId = senderNetId, loadout = playerLoadout }, (NetworkDestination)2); Log.Info("ClientLoadoutSender Done sending loadout"); } } } internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } public class PickerOwnerTag : MonoBehaviour { public NetworkInstanceId openerNetUserId; } [Serializable] public struct PlayerLoadout { public Dictionary<ItemTier, TierLimit> byTier; public PlayerLoadout() { byTier = new Dictionary<ItemTier, TierLimit>(); } public override string ToString() { return Summarize(this); } public static string Summarize(PlayerLoadout l) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) List<string> list = new List<string>(); foreach (KeyValuePair<ItemTier, TierLimit> item in l.byTier) { ItemTier key = item.Key; TierLimit value = item.Value; if (value.mode == TierLimitMode.Restricted) { list.Add(string.Format("{0}=[{1}]", key, string.Join(",", value.allowed))); list.Add(",restricted=[" + string.Join(",", value.restrictedByVoid) + "]"); } } return string.Join("; ", list); } } public static class ServerLoadoutRegistry { private static readonly Dictionary<NetworkInstanceId, PlayerLoadout> loadoutByUser = new Dictionary<NetworkInstanceId, PlayerLoadout>(); public static void SetFor(NetworkUser user, PlayerLoadout playerLoadout) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) loadoutByUser[((NetworkBehaviour)user).netId] = playerLoadout; Log.Info($"Stored loadout for [netId={((NetworkBehaviour)user).netId}]: {playerLoadout}"); } public static bool TryGetFor(NetworkUser user, out PlayerLoadout loadout) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)user != (Object)null && loadoutByUser.TryGetValue(((NetworkBehaviour)user).netId, out loadout)) { return true; } loadout = default(PlayerLoadout); return false; } } } namespace ArtifactsOfMight.UI { public static class ColorPalette { public static Color DarkGray = new Color(0.25f, 0.25f, 0.25f, 1f); public static readonly Color OutlineWhite = FromRGB(225, 225, 225); public static readonly Color OutlineGreen = FromRGB(142, 222, 145); public static readonly Color OutlineRed = FromRGB(230, 125, 120); public static readonly Color OutlineYellow = FromRGB(245, 230, 110); public static readonly Color OutlinePurple = FromRGB(220, 140, 195); public static Color HeaderWhite = FromRGB(99, 99, 99); public static Color HeaderGreen = FromRGB(88, 149, 89); public static Color HeaderRed = FromRGB(142, 51, 50); public static Color HeaderYellow = FromRGB(189, 180, 59); public static Color HeaderPurple = FromRGB(164, 77, 132); public static readonly Color TabHeaderWhite = new Color(0.75f, 0.75f, 0.75f); public static readonly Color TabHeaderGreen = new Color(0.36f, 0.72f, 0.38f); public static readonly Color TabHeaderRed = new Color(0.77f, 0.23f, 0.24f); public static readonly Color TabHeaderYellow = new Color(0.89f, 0.8f, 0.31f); public static readonly Color TabHeaderPurple = new Color(0.73f, 0.4f, 0.7f); public static Color GlassPaneBackgroundColor = FromRGB_AlphaPercent(24, 20, 25, 60); public static Color TooltipGlassPaneBackgroundColor = FromRGB_AlphaPercent(37, 39, 42, 76); public static Color FromRGB(int r, int g, int b, float alpha = 1f) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) return new Color((float)r / 255f, (float)g / 255f, (float)b / 255f, alpha); } public static Color FromRGB_AlphaPercent(int r, int g, int b, int a = 100) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) return new Color((float)r / 255f, (float)g / 255f, (float)b / 255f, (float)a / 100f); } public static Color WithAlpha(Color color, float newAlpha) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0019: Unknown result type (might be due to invalid IL or missing references) return new Color(color.r, color.g, color.b, newAlpha / 100f); } } public class DraftPickerUI : MonoBehaviour { public RectTransform SafeArea; private const string DraftManagerRootName = "DraftManagerRoot"; private bool gridsInitialized; private GameObject rootGameObject; private static Dictionary<DraftItemTier, GameObject> tabsByTier = new Dictionary<DraftItemTier, GameObject>(); private GameObject testDraftMObject; private GameObject testAssetGrid; private GameObject testSecondGrid; private RectTransform _glassContent; private RectTransform _glassHolder; private void Awake() { Log.Info("[DraftArtifact] PickerUI Awake"); } private void OnDestroy() { } private void OnActiveSceneChanged(Scene _, Scene newScene) { } private void OnEnable() { Log.Info("[DraftArtifact] PickerUI OnEnable"); } private void Start() { Log.Info("[DraftArtifact] PickerUI Start"); if ((Object)(object)SafeArea == (Object)null) { Log.Warning("[DraftArtifact] Safe area not exist"); } } private static void WipTabToggles(DraftItemTier desiredTier) { foreach (DraftItemTier key in tabsByTier.Keys) { tabsByTier[key].SetActive(false); } tabsByTier[desiredTier].SetActive(true); } public void ToggleVisibility() { bool activeSelf = rootGameObject.activeSelf; rootGameObject.SetActive(!activeSelf); } private GameObject BuildDraftPickerRootStructure(string name) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0034: 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_0054: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name, new Type[1] { typeof(RectTransform) }); RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent((Transform)(object)SafeArea, false); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.pivot = new Vector2(0.5f, 0.5f); val2.offsetMin = Vector2.zero; val2.offsetMax = Vector2.zero; SetLayerRecursively(val, ((Component)SafeArea).gameObject.layer); GameObject val3 = new GameObject("BG", new Type[2] { typeof(RectTransform), typeof(Image) }); RectTransform val4 = (RectTransform)val3.transform; ((Transform)val4).SetParent((Transform)(object)val2, false); val4.anchorMin = Vector2.zero; val4.anchorMax = Vector2.one; val4.pivot = new Vector2(0.5f, 0.5f); val4.offsetMin = Vector2.zero; val4.offsetMax = Vector2.zero; Image component = val3.GetComponent<Image>(); ((Graphic)component).color = new Color(1f, 0f, 0f, 0.25f); ((Graphic)component).raycastTarget = true; RectTransform rt = BuildTabsGroup(val2); LogRect("SafeArea", SafeArea); LogRect("Root", val2); LogRect("BG", val4); LogRect("TabsGroup", rt); return val; } private GameObject BuildDraftPickerRootStructureNoContents(string name) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_0034: 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_0054: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name, new Type[1] { typeof(RectTransform) }); RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent((Transform)(object)SafeArea, false); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.pivot = new Vector2(0.5f, 0.5f); val2.offsetMin = Vector2.zero; val2.offsetMax = Vector2.zero; SetLayerRecursively(val, ((Component)SafeArea).gameObject.layer); GameObject val3 = new GameObject("BG", new Type[2] { typeof(RectTransform), typeof(Image) }); RectTransform val4 = (RectTransform)val3.transform; ((Transform)val4).SetParent((Transform)(object)val2, false); val4.anchorMin = Vector2.zero; val4.anchorMax = Vector2.one; val4.pivot = new Vector2(0.5f, 0.5f); val4.offsetMin = Vector2.zero; val4.offsetMax = Vector2.zero; Image component = val3.GetComponent<Image>(); ((Graphic)component).color = new Color(0f, 0f, 1f, 0.25f); ((Graphic)component).raycastTarget = true; LogRect("SafeArea", SafeArea); LogRect("Root", val2); LogRect("BG", val4); return val; } private GameObject BuildDraftPickerRootStructureNoWorky() { return DraftManagerFactory.Create(SafeArea); } private static void SetLayerRecursively(GameObject go, int layer) { go.layer = layer; for (int i = 0; i < go.transform.childCount; i++) { SetLayerRecursively(((Component)go.transform.GetChild(i)).gameObject, layer); } } private void TestPopulateGrid() { rootGameObject = BuildDraftPickerRootStructure("DraftPickerCanvas"); rootGameObject.GetComponent<RectTransform>(); } private GameObject TestDraftManagerParenting() { return BuildDraftPickerRootStructureNoWorky(); } private GameObject BuildToolTipStructure() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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 //IL_0088: 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) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("TooltipTest", new Type[2] { typeof(RectTransform), typeof(TooltipSystem) }); FactoryUtils.ParentToRectTransform(val, SafeArea); RectTransform val2 = (RectTransform)val.transform; FactoryUtils.StretchToFillParent(val2); GameObject val3 = new GameObject("ToolTipTest_DebugBG", new Type[2] { typeof(RectTransform), typeof(Image) }); RectTransform val4 = (RectTransform)val3.transform; ((Transform)val4).SetParent((Transform)(object)val2, false); val4.anchorMin = Vector2.zero; val4.anchorMax = Vector2.one; val4.pivot = new Vector2(0.5f, 0.5f); val4.offsetMin = Vector2.zero; val4.offsetMax = Vector2.zero; Image component = val3.GetComponent<Image>(); ((Graphic)component).color = new Color(0.5f, 0f, 0.5f, 0f); ((Graphic)component).raycastTarget = false; LogRect("SafeArea", SafeArea); LogRect("Root", val2); LogRect("BG", val4); TooltipSystem component2 = val.GetComponent<TooltipSystem>(); TooltipView tooltipView = TooltipFactory.CreateTooltipView(val2); component2.Initialize(val2, tooltipView); ((Component)tooltipView).transform.SetAsLastSibling(); return val; } private GameObject SpawnOverlayProbe(RectTransform parent) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown GameObject val = new GameObject("TooltipProbe", new Type[2] { typeof(RectTransform), typeof(Image) }); RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent((Transform)(object)parent, false); val2.sizeDelta = new Vector2(220f, 80f); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0.5f, 0.5f); val2.anchorMax = val3; val2.anchorMin = val3; val2.anchoredPosition = Vector2.zero; Image component = val.GetComponent<Image>(); ((Graphic)component).color = Color.blue; ((Graphic)component).raycastTarget = false; return val; } private GameObject TestDraftManagerFlow() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("DraftManagerRoot", new Type[1] { typeof(RectTransform) }); FactoryUtils.ParentToRectTransform(val, SafeArea); RectTransform component = val.GetComponent<RectTransform>(); StretchFull(component); ((Transform)component).SetParent((Transform)(object)SafeArea, false); SetLayerRecursively(val, ((Component)SafeArea).gameObject.layer); GameObject val2 = new GameObject("BG", new Type[2] { typeof(RectTransform), typeof(Image) }); RectTransform val3 = (RectTransform)val2.transform; ((Transform)val3).SetParent((Transform)(object)component, false); val3.anchorMin = Vector2.zero; val3.anchorMax = Vector2.one; val3.pivot = new Vector2(0.5f, 0.5f); val3.offsetMin = Vector2.zero; val3.offsetMax = Vector2.zero; Image component2 = val2.GetComponent<Image>(); ((Graphic)component2).color = new Color(0f, 0f, 1f, 0.25f); ((Graphic)component2).raycastTarget = true; return val; } private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) Scene activeScene; if (Input.GetKeyDown((KeyCode)284)) { activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; if (name != "lobby") { Log.Warning("DraftPickerToggleDuringLobby in scene " + name); return; } Log.Info("DraftPickerToggle Respond F3"); if (!gridsInitialized) { Log.Info("Initializing Grids"); gridsInitialized = true; TestPopulateGrid(); return; } if (!Object.op_Implicit((Object)(object)rootGameObject)) { Log.Warning("DraftPickerToggleDuringLobby no RootObject after init"); return; } ToggleVisibility(); } if (Input.GetKeyDown((KeyCode)287)) { if (!Object.op_Implicit((Object)(object)testAssetGrid)) { testAssetGrid = AssetDebugGridFactory.BuildTestGrid(SafeArea); } else { testAssetGrid.SetActive(!testAssetGrid.activeSelf); } } if (Input.GetKeyDown((KeyCode)283)) { if (!Object.op_Implicit((Object)(object)testSecondGrid)) { testSecondGrid = AssetDebugGridFactory.BuildTestGrid(SafeArea); } else { testSecondGrid.SetActive(!testSecondGrid.activeSelf); } } if (Input.GetKeyDown((KeyCode)288)) { activeScene = SceneManager.GetActiveScene(); string name2 = ((Scene)(ref activeScene)).name; if (name2 != "lobby") { Log.Warning("DraftPickerToggleDuringLobby in scene " + name2); return; } Log.Info("DraftPickerToggle Respond F7"); if ((Object)(object)testDraftMObject == (Object)null) { Log.Info("DraftPickerToggle TestDraftManagerFlow"); testDraftMObject = TestDraftManagerParenting(); return; } if (!Object.op_Implicit((Object)(object)testDraftMObject)) { Log.Warning("DraftPickerToggleDuringLobby no TestDraftManager after init"); return; } if (testDraftMObject.activeSelf) { testDraftMObject.SetActive(false); } else { testDraftMObject.SetActive(true); } } if (Input.GetKeyDown((KeyCode)286)) { Log.Debug(HierarchyDumper.DumpActiveHierarchy("SceneHierarchy", 10)); } if (Input.GetKeyDown((KeyCode)289)) { HierarchyDumper.TryDumpAllTooltips(); } } private static void LogRect(string name, RectTransform rt) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) Rect rect = rt.rect; Debug.Log((object)$"[{name}] {((Rect)(ref rect)).width}x{((Rect)(ref rect)).height} anchors {rt.anchorMin}->{rt.anchorMax} pivot {rt.pivot}"); } private static string PathOf(Transform t) { if (!Object.op_Implicit((Object)(object)t)) { return "<null>"; } StringBuilder stringBuilder = new StringBuilder(((Object)t).name); Transform parent = t.parent; while (Object.op_Implicit((Object)(object)parent)) { stringBuilder.Insert(0, ((Object)parent).name + "/"); parent = parent.parent; } return stringBuilder.ToString(); } private static void LogTree(RectTransform rt) { //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)rt).gameObject; Log.Info("LogTree " + ((Object)((Component)rt).gameObject).name); CanvasGroup val = default(CanvasGroup); Rect rect; if (gameObject.TryGetComponent<CanvasGroup>(ref val)) { string text = $"[UI] path={PathOf((Transform)(object)rt)} active={gameObject.activeInHierarchy} layer={gameObject.layer} "; object[] array = new object[6]; rect = rt.rect; array[0] = ((Rect)(ref rect)).size.x; rect = rt.rect; array[1] = ((Rect)(ref rect)).size.y; array[2] = rt.anchorMin.x; array[3] = rt.anchorMin.y; array[4] = rt.anchorMax.x; array[5] = rt.anchorMax.y; Log.Info(text + string.Format("rect={0}x{1} anchors ({2:F2},{3:F2})->({4:F2},{5:F2}) ", array) + "cg=" + (Object.op_Implicit((Object)(object)val) ? $"a={val.alpha},int={val.interactable},blk={val.blocksRaycasts}" : "none")); } else { string text2 = $"[UI] path={PathOf((Transform)(object)rt)} active={gameObject.activeInHierarchy} layer={gameObject.layer} "; object[] array2 = new object[6]; rect = rt.rect; array2[0] = ((Rect)(ref rect)).size.x; rect = rt.rect; array2[1] = ((Rect)(ref rect)).size.y; array2[2] = rt.anchorMin.x; array2[3] = rt.anchorMin.y; array2[4] = rt.anchorMax.x; array2[5] = rt.anchorMax.y; Log.Info(text2 + string.Format("rect={0}x{1} anchors ({2:F2},{3:F2})->({4:F2},{5:F2})", array2)); } Transform parent = ((Transform)rt).parent; while (Object.op_Implicit((Object)(object)parent)) { Canvas component = ((Component)parent).GetComponent<Canvas>(); Mask component2 = ((Component)parent).GetComponent<Mask>(); RectMask2D component3 = ((Component)parent).GetComponent<RectMask2D>(); if (Object.op_Implicit((Object)(object)component) || Object.op_Implicit((Object)(object)component2) || Object.op_Implicit((Object)(object)component3)) { Debug.Log((object)$"[UI] parent {((Object)parent).name}: Canvas={(Object)(object)component != (Object)null}, Mask={(Object)(object)component2 != (Object)null}, RectMask2D={(Object)(object)component3 != (Object)null}"); } parent = parent.parent; } } private static void DumpActiveHierarchy(string title = "Lobby Dump", int maxDepth = 5) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) Scene activeScene = SceneManager.GetActiveScene(); Log.Info("Dumping: " + ((Scene)(ref activeScene)).name); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("==== " + title + ": Scene '" + ((Scene)(ref activeScene)).name + "' ===="); GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects(); for (int i = 0; i < rootGameObjects.Length; i++) { Recurse(rootGameObjects[i].transform, 0, maxDepth, stringBuilder); } Log.Info(stringBuilder.ToString()); static void Recurse(Transform t, int depth, int maxDepth, StringBuilder sb) { if (Object.op_Implicit((Object)(object)t) && ((Component)t).gameObject.activeInHierarchy && depth <= maxDepth) { Log.Info($"Recurse {t}"); RectTransform val = (RectTransform)(object)((t is RectTransform) ? t : null); string text = (Object.op_Implicit((Object)(object)val) ? " [RectTransform]" : ""); sb.AppendLine(new string(' ', depth * 2) + "• " + ((Object)t).name + text); sb.AppendLine(" Layer: $" + LayerMask.LayerToName(((Component)val).gameObject.layer)); for (int j = 0; j < t.childCount; j++) { Recurse(t.GetChild(j), depth + 1, maxDepth, sb); } } } } private static RectTransform BuildTabsGroup(RectTransform parentRectTransform) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("TabGroup", new Type[2] { typeof(RectTransform), typeof(VerticalLayoutGroup) }); RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent((Transform)(object)parentRectTransform, false); val2.sizeDelta = new Vector2(720f, 720f); VerticalLayoutGroup component = val.GetComponent<VerticalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)component).spacing = 8f; ((HorizontalOrVerticalLayoutGroup)component).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)component).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)component).childForceExpandHeight = true; ((HorizontalOrVerticalLayoutGroup)component).childForceExpandWidth = true; RectTransform obj = BuildTabsBar(); ((Transform)obj).SetParent((Transform)(object)val2, false); LayoutElement obj2 = ((Component)obj).gameObject.AddComponent<LayoutElement>(); obj2.preferredHeight = 64f; obj2.flexibleHeight = 0f; RectTransform obj3 = BuildContentArea(); ((Transform)obj3).SetParent((Transform)(object)val2, false); LayoutElement obj4 = ((Component)obj3).gameObject.AddComponent<LayoutElement>(); obj4.flexibleHeight = 1f; obj4.preferredHeight = 472f; RectTransform obj5 = BuildBottomBar(); ((Transform)obj5).SetParent((Transform)(object)val2, false); LayoutElement obj6 = ((Component)obj5).gameObject.AddComponent<LayoutElement>(); obj6.preferredHeight = 64f; obj6.flexibleHeight = 0f; return val2; } private static RectTransform BuildTabsBar() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("TabsBar", new Type[2] { typeof(RectTransform), typeof(HorizontalLayoutGroup) }); RectTransform val2 = (RectTransform)val.transform; HorizontalLayoutGroup component = val.GetComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)component).spacing = 4f; ((HorizontalOrVerticalLayoutGroup)component).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)component).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)component).childForceExpandHeight = false; ((HorizontalOrVerticalLayoutGroup)component).childForceExpandWidth = false; ((LayoutGroup)component).childAlignment = (TextAnchor)4; ((LayoutGroup)component).padding = new RectOffset(8, 8, 8, 8); DraftTabsBar draftTabsBar = val.AddComponent<DraftTabsBar>(); GameObject val3 = new GameObject("TabsBarBG", new Type[2] { typeof(RectTransform), typeof(Image) }); RectTransform val4 = (RectTransform)val3.transform; ((Transform)val4).SetParent((Transform)(object)val2, false); val4.anchorMin = Vector2.zero; val4.anchorMax = Vector2.one; val4.pivot = new Vector2(0.5f, 0.5f); val4.offsetMin = Vector2.zero; val4.offsetMax = Vector2.zero; Image component2 = val3.GetComponent<Image>(); ((Graphic)component2).color = Color.blue; ((Graphic)component2).raycastTarget = true; GameObject val5 = DraftTabsBarFactory.CreateTextButton("white", new Vector2(64f, 64f), "white", (FontStyles)0); FactoryUtils.ParentToRectTransform(val5, val2); draftTabsBar.BindButton(DraftItemTier.White, val5.GetComponent<Button>()); GameObject val6 = DraftTabsBarFactory.CreateTextButton("green", new Vector2(64f, 64f), "green", (FontStyles)0); FactoryUtils.ParentToRectTransform(val6, val2); draftTabsBar.BindButton(DraftItemTier.Green, val6.GetComponent<Button>()); draftTabsBar.OnTabButtonClicked = (Action<DraftItemTier>)Delegate.Combine(draftTabsBar.OnTabButtonClicked, new Action<DraftItemTier>(WipTabToggles)); return val2; } public static RectTransform BuildContentArea() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_004d: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) RectTransform val = (RectTransform)new GameObject("ContentArea", new Type[1] { typeof(RectTransform) }).transform; GameObject val2 = new GameObject("ContentAreaBG", new Type[2] { typeof(RectTransform), typeof(Image) }); RectTransform val3 = (RectTransform)val2.transform; ((Transform)val3).SetParent((Transform)(object)val, false); val3.anchorMin = Vector2.zero; val3.anchorMax = Vector2.one; val3.pivot = new Vector2(0.5f, 0.5f); val3.offsetMin = Vector2.zero; val3.offsetMax = Vector2.zero; Image component = val2.GetComponent<Image>(); ((Graphic)component).color = Color.yellow; ((Graphic)component).raycastTarget = true; DraftTabController draftTabController = DraftTabFactory.BuildDraftTab(val, "Whites", DraftItemTier.White); tabsByTier[DraftItemTier.White] = ((Component)draftTabController).gameObject; DraftTabController draftTabController2 = DraftTabFactory.BuildDraftTab(val, "Greens", DraftItemTier.Green); tabsByTier[DraftItemTier.Green] = ((Component)draftTabController2).gameObject; ((Component)draftTabController2).gameObject.SetActive(false); return val; } private static RectTransform BuildBottomBar() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_004d: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) RectTransform val = (RectTransform)new GameObject("BottomBar", new Type[1] { typeof(RectTransform) }).transform; GameObject val2 = new GameObject("BottomBarBG", new Type[2] { typeof(RectTransform), typeof(Image) }); RectTransform val3 = (RectTransform)val2.transform; ((Transform)val3).SetParent((Transform)(object)val, false); val3.anchorMin = Vector2.zero; val3.anchorMax = Vector2.one; val3.pivot = new Vector2(0.5f, 0.5f); val3.offsetMin = Vector2.zero; val3.offsetMax = Vector2.zero; Image component = val2.GetComponent<Image>(); ((Graphic)component).color = Color.green; ((Graphic)component).raycastTarget = true; return val; } private static void StretchFull(RectTransform rt) { //IL_0001: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_0042: Unknown result type (might be due to invalid IL or missing references) rt.anchorMin = Vector2.zero; rt.anchorMax = Vector2.one; rt.pivot = new Vector2(0.5f, 0.5f); rt.offsetMin = Vector2.zero; rt.offsetMax = Vector2.zero; rt.anchoredPosition = Vector2.zero; } private void EnsureGlassBuilt() { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)_glassHolder)) { Log.Debug("Glass built"); return; } Log.Debug("Build Test Glass"); _ = SafeArea; RectTransform component = new GameObject("TestGridPanelRoot", new Type[2] { typeof(RectTransform), typeof(Image) }).GetComponent<RectTransform>(); ((Transform)component).SetParent((Transform)(object)SafeArea, false); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.pivot = new Vector2(0.5f, 0.5f); Vector2 val2 = (component.offsetMin = (component.offsetMax = Vector2.zero)); Image component2 = ((Component)component).GetComponent<Image>(); ((Graphic)component2).color = new Color(0f, 0f, 0f, 0f); ((Graphic)component2).raycastTarget = true; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(720f, 780f); RectTransform component3 = new GameObject("PanelAnchor", new Type[1] { typeof(RectTransform) }).GetComponent<RectTransform>(); ((Transform)component3).SetParent((Transform)(object)component, false); ((Vector2)(ref val2))..ctor(0.5f, 0.5f); component3.anchorMax = val2; component3.anchorMin = val2; component3.pivot = new Vector2(0.5f, 0.5f); component3.sizeDelta = val3; component3.anchoredPosition = Vector2.zero; GlassPanelContainer glassPanelContainer = GlassPanelFactory.BuildGlassBody("anchorTest", component3, val3, shouldBlockClicks: false, new BorderOptions { Style = BorderStyle.None, Color = new Color(0.363f, 0.376f, 0.472f, 1f), RespectSpritePadding = true }); _glassHolder = glassPanelContainer.glassPanelHolder.GetComponent<RectTransform>(); component3.anchorMin = new Vector2(0f, 1f); component3.anchorMax = new Vector2(0f, 1f); component3.pivot = new Vector2(0f, 1f); component3.anchoredPosition = new Vector2(660f, -60f); } public static void PlaceCenter(RectTransform rt) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0.5f, 0.5f); rt.anchorMax = val; rt.anchorMin = val; rt.pivot = new Vector2(0.5f, 0.5f); rt.anchoredPosition = Vector2.zero; } public static Vector2 InkscapeToAnchoredTopLeft(Vector2 inkscapePos, Vector2 parentSize, Vector2 inkscapeCanvas = default(Vector2)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (inkscapeCanvas == default(Vector2)) { ((Vector2)(ref inkscapeCanvas))..ctor(1920f, 1080f); } float num = parentSize.x / inkscapeCanvas.x; float num2 = parentSize.y / inkscapeCanvas.y; return new Vector2(inkscapePos.x * num, (0f - inkscapePos.y) * num2); } public static Vector2 InkscapeCenterToAnchoredCenter(Vector2 inkscapeCenter, Vector2 parentSize, Vector2 inkscapeCanvas = default(Vector2)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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) if (inkscapeCanvas == default(Vector2)) { ((Vector2)(ref inkscapeCanvas))..ctor(1920f, 1080f); } float num = parentSize.x / inkscapeCanvas.x; float num2 = parentSize.y / inkscapeCanvas.y; float num3 = inkscapeCenter.x * num; float num4 = inkscapeCenter.y * num2; return new Vector2(num3 - parentSize.x * 0.5f, 0f - num4 + parentSize.y * 0.5f); } } public class ItemPickerGridController : MonoBehaviour { private List<ItemPickerSquareController> squareControllers; public Action<PickupDef> OnSquareClicked; public void SetSquares(List<ItemPickerSquareController> squareControllers) { this.squareControllers = squareControllers; foreach (ItemPickerSquareController squareController in squareControllers) { squareController.OnSquareClicked = (Action<PickupDef>)Delegate.Combine(squareController.OnSquareClicked, OnSquareClicked); } } public void RefreshSquares() { foreach (ItemPickerSquareController squareController in squareControllers) { squareController.RefreshSquare(); } } } public class ItemPickerSquareController : MonoBehaviour, IPointerEnterHandler, IEventSystemHandler, IPointerExitHandler { private static Color DARK_GREY = new Color(0.25f, 0.25f, 0.25f, 1f); private Image background; private Image icon; private Outline hoverOutline; private GameObject lockOverlay; private Image selectionOverlayImg; private Image dimmingOverlayImg; private Image hoverOverlayImg; private bool isSelectionOn; private PickupDef pickupDef; private Button button; public Action<PickupDef> OnSquareClicked; public void BindComponents(PickupDef pickupDef, Button button, Image background, Image icon, Outline hoverOutline = null, GameObject lockOverlay = null, Image selectionOverlayImg = null, Image dimmingOverlayImg = null, Image hoverOverlayImg = null) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown this.pickupDef = pickupDef; this.button = button; this.background = background; this.icon = icon; this.hoverOutline = hoverOutline; this.lockOverlay = lockOverlay; this.selectionOverlayImg = selectionOverlayImg; this.dimmingOverlayImg = dimmingOverlayImg; this.hoverOverlayImg = hoverOverlayImg; ((UnityEvent)this.button.onClick).AddListener(new UnityAction(HandleOnClick)); ReflectState(); } private void OnDestroy() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown ((UnityEvent)button.onClick).RemoveListener(new UnityAction(HandleOnClick)); } private void HandleOnClick() { if (DebugSettings.LOG_DRAFT_UI) { Log.Info("[DraftArtifact]ItemPickerSquareController.HandleOnClick: " + pickupDef.nameToken); } OnSquareClicked?.Invoke(pickupDef); } public void RefreshSquare() { ReflectState(); } void IPointerEnterHandler.OnPointerEnter(PointerEventData eventData) { if ((Object)(object)hoverOutline != (Object)null) { ((Behaviour)hoverOutline).enabled = true; } if ((Object)(object)hoverOverlayImg != (Object)null) { ((Behaviour)hoverOverlayImg).enabled = true; } if (!isSelectionOn && !DraftLoadout.Instance.IsLocked(pickupDef) && (Object)(object)dimmingOverlayImg != (Object)null) { ((Behaviour)dimmingOverlayImg).enabled = false; } } public void OnPointerExit(PointerEventData eventData) { if ((Object)(object)hoverOutline != (Object)null) { ((Behaviour)hoverOutline).enabled = false; } if ((Object)(object)hoverOverlayImg != (Object)null) { ((Behaviour)hoverOverlayImg).enabled = false; } if (!isSelectionOn && !DraftLoadout.Instance.IsLocked(pickupDef) && (Object)(object)dimmingOverlayImg != (Object)null) { ((Behaviour)dimmingOverlayImg).enabled = true; } } private void ReflectState() { //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) if (DraftLoadout.Instance.IsLocked(pickupDef)) { if ((Object)(object)lockOverlay != (Object)null) { lockOverlay.SetActive(true); } isSelectionOn = false; if ((Object)(object)selectionOverlayImg != (Object)null) { ((Behaviour)selectionOverlayImg).enabled = false; } return; } lockOverlay.SetActive(false); if (DraftLoadout.Instance.IsPicked(pickupDef)) { if ((Object)(object)hoverOutline != (Object)null) { ((Behaviour)hoverOutline).enabled = true; } if ((Object)(object)selectionOverlayImg != (Object)null) { ((Behaviour)selectionOverlayImg).enabled = true; } if ((Object)(object)dimmingOverlayImg != (Object)null) { ((Behaviour)dimmingOverlayImg).enabled = false; } isSelectionOn = true; return; } if ((Object)(object)dimmingOverlayImg != (Object)null) { ((Behaviour)dimmingOverlayImg).enabled = true; } else { ((Graphic)icon).color = DARK_GREY; ((Graphic)background).color = DARK_GREY; } if ((Object)(object)hoverOutline != (Object)null) { ((Behaviour)hoverOutline).enabled = false; } if ((Object)(object)selectionOverlayImg != (Object)null) { ((Behaviour)selectionOverlayImg).enabled = false; } isSelectionOn = false; } } public static class ItemPickerSquareFactory { private enum BadgeAnchor { Center, TL, TR, BL, BR } private static Color DIMMING_MID_OVERLAY = new Color(0f, 0f, 0f, 0.45f); private static Color DIMMING_HARD_OVERLAY = new Color(0.1f, 0.1f, 0.1f, 0.8f); private static float SELECT_OUTLINE_PAD = 3f; private static float HOVER_OUTLINE_PAD_LARGE = 8f; private static float HOVER_OUTLINE_ANCHOR_OFFSET = 4f; public static Transform CreateGrid(Transform parent, string name = "DraftGrid", Vector2 cellSize = default(Vector2), Vector2 spacing = default(Vector2), RectOffset padding = null) { //IL_002e: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name, new Type[3] { typeof(RectTransform), typeof(ContentSizeFitter), typeof(GridLayoutGroup) }) { layer = LayerMask.NameToLayer("UI") }; val.transform.SetParent(parent, false); RectTransform val2 = (RectTransform)val.transform; val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.pivot = new Vector2(0.5f, 0.5f); val2.offsetMin = new Vector2(48f, 96f); val2.offsetMax = new Vector2(-48f, -96f); GridLayoutGroup component = val.GetComponent<GridLayoutGroup>(); component.startCorner = (Corner)0; component.startAxis = (Axis)0; ((LayoutGroup)component).childAlignment = (TextAnchor)0; component.cellSize = cellSize; component.spacing = new Vector2(8f, 8f); component.constraint = (Constraint)1; component.constraintCount = 8; return val.transform; } public static ItemPickerSquareController CreateItemSquare(Transform parent, Vector2 size, Sprite iconSprite) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016e: 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) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ItemSquareButton", new Type[3] { typeof(RectTransform), typeof(Image), typeof(Button) }); val.layer = LayerMask.NameToLayer("UI"); val.transform.SetParent(parent, false); ((RectTransform)val.transform).sizeDelta = size; Image component = val.GetComponent<Image>(); ((Graphic)component).color = new Color(0.12f, 0.12f, 0.12f, 1f); ((Selectable)val.GetComponent<Button>()).targetGraphic = (Graphic)(object)component; GameObject val2 = new GameObject("Icon", new Type[2] { typeof(RectTransform), typeof(Image) }) { layer = val.layer }; val2.transform.SetParent(val.transform, false); RectTransform val3 = (RectTransform)val2.transform; val3.anchorMin = new Vector2(0.1f, 0.25f); val3.anchorMax = new Vector2(0.9f, 0.95f); Image component2 = val2.GetComponent<Image>(); component2.sprite = iconSprite; component2.preserveAspect = true; GameObject val4 = new GameObject("RarityStripe", new Type[2] { typeof(RectTransform), typeof(Image) }) { layer = val.layer }; val4.transform.SetParent(val.transform, false); RectTransform val5 = (RectTransform)val4.transform; val5.anchorMin = new Vector2(0f, 1f); val5.anchorMax = new Vector2(1f, 1f); val5.pivot = new Vector2(0.5f, 1f); val5.sizeDelta = new Vector2(0f, 6f); ((Graphic)val4.GetComponent<Image>()).color = Color.white * 0.85f; GameObject val6 = new GameObject("PickedOverlay", new Type[3] { typeof(RectTransform), typeof(Image), typeof(CanvasGroup) }) { layer = val.layer }; val6.transform.SetParent(val.transform, false); RectTransform val7 = (RectTransform)val6.transform; val7.anchorMin = Vector2.zero; val7.anchorMax = Vector2.one; ((Graphic)val6.GetComponent<Image>()).color = new Color(0.2f, 0.9f, 0.3f, 0.25f); CanvasGroup component3 = val6.GetComponent<CanvasGroup>(); component3.alpha = 0f; component3.blocksRaycasts = false; return val.AddComponent<ItemPickerSquareController>(); } public static GameObject TestItemSquare(RectTransform parentRectTransform, PickupDef pickupDef, Color squareOutline, Color hoverColor = default(Color)) { //IL_0001: 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_004b: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) DraftItemTier draftItemTier = DraftTierMaps.ToDraft(pickupDef.itemTier); GameObject gameObject = ((Component)parentRectTransform).gameObject; GameObject val = new GameObject("ItemSquare", new Type[3] { typeof(RectTransform), typeof(Image), typeof(Button) }); val.layer = gameObject.layer; RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent((Transform)(object)parentRectTransform, false); if (hoverColor == default(Color)) { hoverColor = squareOutline; } Image component = val.GetComponent<Image>(); Sprite spriteForTier = GetSpriteForTier(draftItemTier); ((Graphic)component).color = Color.white; component.sprite = spriteForTier; val2.offsetMin = new Vector2(2f, 2f); val2.offsetMax = new Vector2(-2f, -2f); GameObject val3 = new GameObject("Icon", new Type[2] { typeof(RectTransform), typeof(Image) }) { layer = gameObject.layer }; val3.transform.SetParent(((Component)val2).transform, false); RectTransform val4 = (RectTransform)val3.transform; val4.anchorMin = Vector2.zero; val4.anchorMax = Vector2.one; val4.pivot = new Vector2(0.5f, 0.5f); val4.offsetMin = new Vector2(8f, 8f); val4.offsetMax = new Vector2(-8f, -8f); Sprite iconSprite = pickupDef.iconSprite; Image component2 = val3.GetComponent<Image>(); component2.sprite = iconSprite; component2.preserveAspect = true; GameObject val5 = CreateDarkeningOverlay(val2); GameObject val6 = CreateHoverOverlay(val2, squareOutline); GameObject val7 = CreateSelectionOverlay(val2, squareOutline); GameObject lockOverlay = CreateLockOverlay(val2); Button component3 = val.GetComponent<Button>(); val.AddComponent<ItemPickerSquareController>().BindComponents(pickupDef, component3, component, component2, null, lockOverlay, val7.GetComponent<Image>(), val5.GetComponent<Image>(), val6.GetComponent<Image>()); TooltipTrigger tooltipTrigger = val.AddComponent<TooltipTrigger>(); tooltipTrigger.Anchor = val2; ItemDef itemDef = ItemCatalog.GetItemDef(pickupDef.itemIndex); string @string = Language.GetString(itemDef.nameToken); string string2 = Language.GetString(itemDef.descriptionToken); tooltipTrigger.Data = new TooltipData { Title = @string, Body = string2, HeaderColor = GetTooltipHeaderColor(draftItemTier) }; return val; } private static GameObject CreateLockOverlay(RectTransform parentRect) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Expected O, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)parentRect).gameObject; GameObject val = new GameObject("LockOverlay", new Type[3] { typeof(RectTransform), typeof(Image), typeof(CanvasGroup) }); val.layer = gameObject.layer; val.transform.SetParent((Transform)(object)parentRect, false); RectTransform val2 = (RectTransform)val.transform; val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.pivot = new Vector2(0.5f, 0.5f); val2.offsetMin = Vector2.zero; val2.offsetMax = Vector2.zero; Image component = val.GetComponent<Image>(); ((Graphic)component).color = DIMMING_MID_OVERLAY; ((Graphic)component).raycastTarget = false; Sprite sprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/VoidIcon_2.png").WaitForCompletion(); ((Graphic)((Component)AddBadge(val2, sprite, new Vector2(32f, 32f), BadgeAnchor.Center, Vector2.zero)).gameObject.GetComponent<Image>()).color = ColorPalette.OutlinePurple; val.transform.SetAsLastSibling(); val.SetActive(false); return val; } private static GameObject CreateHoverTint(RectTransform parentRect, Color tintColor) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_005e: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: 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) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown GameObject val = new GameObject("HoverTint", new Type[2] { typeof(RectTransform), typeof(Image) }) { layer = ((Component)parentRect).gameObject.layer }; val.transform.SetParent((Transform)(object)parentRect, false); RectTransform val2 = (RectTransform)val.transform; val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.pivot = new Vector2(0.5f, 0.5f); val2.offsetMin = Vector2.zero; val2.offsetMax = Vector2.zero; Image component = val.GetComponent<Image>(); ((Graphic)component).color = tintColor; ((Graphic)component).raycastTarget = false; component.type = (Type)1; ((Behaviour)component).enabled = false; return val; } private static GameObject CreateSelectionOverlay(RectTransform parentRect, Color outlineColor) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Expected O, but got Unknown GameObject gameObject = ((Component)parentRect).gameObject; GameObject val = new GameObject("SelectOverlay", new Type[3] { typeof(RectTransform), typeof(Image), typeof(CanvasGroup) }) { layer = gameObject.layer }; val.transform.SetParent((Transform)(object)parentRect, false); RectTransform val2 = (RectTransform)val.transform; val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.pivot = new Vector2(0.5f, 0.5f); val2.offsetMin = new Vector2(0f - SELECT_OUTLINE_PAD, 0f - SELECT_OUTLINE_PAD); val2.offsetMax = new Vector2(SELECT_OUTLINE_PAD, SELECT_OUTLINE_PAD); Image component = val.GetComponent<Image>(); component.sprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/UI/texUIHighlightBoxOutlineThickIcon.png").WaitForCompletion(); component.type = (Type)1; ((Graphic)component).color = outlineColor; ((Graphic)component).raycastTarget = false; ((Behaviour)component).enabled = false; return val; } private static GameObject CreateDarkeningOverlay(RectTransform parentRect) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown resul