Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Artifacts Of Might v0.5.0
ArtifactsOfMight/ArtifactsOfMight.dll
Decompiled 5 months 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.IO; 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.Assets; using ArtifactsOfMight.DraftArtifact.Game; using ArtifactsOfMight.Loadout; using ArtifactsOfMight.Loadout.Corruption; using ArtifactsOfMight.Loadout.Draft; using ArtifactsOfMight.Logger; 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 HG; 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.5.0.0")] [assembly: AssemblyInformationalVersion("0.5.0+1bc6f9f97f4d1f6fbdb6c31c1bea18ddb9585e1f")] [assembly: AssemblyProduct("ArtifactsOfMight")] [assembly: AssemblyTitle("ArtifactsOfMight")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.5.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } 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.5.0")] public class ArtifactsOfMight : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnClientConnect <>9__9_0; public static Func<Type, bool> <>9__12_0; internal void <Awake>b__9_0(orig_OnClientConnect s, NetworkManagerSystemSteam u, NetworkConnection t) { Log.Info("Bypass OnClientConnect"); } internal bool <RegisterArtifacts>b__12_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.5.0"; public List<ArtifactBase> Artifacts = new List<ArtifactBase>(); public static PluginInfo PluginInfo { get; private set; } public void Awake() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_006d: 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_0078: Expected O, but got Unknown Log.Init(((BaseUnityPlugin)this).Logger); ScoppedLogger.Init(((BaseUnityPlugin)this).Logger); EnableScopedLoggers(); Log.Info("Initializing via Awake"); PluginInfo = ((BaseUnityPlugin)this).Info; RegisterAssetBundles(); CharacterSelectController.Awake += new hook_Awake(HookupUIDepsOnCharacterSelectAwake); if (DebugSettings.LOCAL_NETWORK_TEST) { Log.Warning("In Network Test Mode, gonna do the thing to the System Steam"); object obj = <>c.<>9__9_0; if (obj == null) { hook_OnClientConnect val = delegate { Log.Info("Bypass OnClientConnect"); }; <>c.<>9__9_0 = val; obj = (object)val; } NetworkManagerSystemSteam.OnClientConnect += (hook_OnClientConnect)obj; } RegisterArtifacts(); } private void EnableScopedLoggers() { ScoppedLogger.Only("ArtifactsOfMight.Artifacts"); } private void RegisterAssetBundles() { ArtifactsOfMightAsset.Init(); } 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 HookupUIDepsOnCharacterSelectAwake(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."); } } public void OnEnable() { NetworkingAPI.RegisterMessageType<LoadoutSyncMsg>(); NetworkingAPI.RegisterMessageType<RequestLoadoutSyncMsg>(); ScoppedLogger.LogEnabledScopes(); } 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_00df: 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_00eb: 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_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0215: 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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: 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) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0200: 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(new UniquePickup(PickupCatalog.FindPickupIndex(itemDef.itemIndex)), transform.position, transform.forward * 20f, false); } } 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(new UniquePickup(PickupCatalog.FindPickupIndex(itemDef2.itemIndex)), transform2.position, transform2.forward * 20f, false); } } 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, pickup = new UniquePickup(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); } } internal static class BuildInfo { public const string Version = "0.5.0"; } 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; LogRect("SafeArea", SafeArea); LogRect("Root", val2); LogRect("BG", val4); 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 BuildDraftPickerRootStructureFull() { 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 GameObject BuildDraftManagerCorrectly() { return BuildDraftPickerRootStructureFull(); } 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) 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)) { Scene activeScene = SceneManager.GetActiveScene(); string name = ((Scene)(ref activeScene)).name; if (name != "lobby") { Log.Warning("DraftPickerToggleDuringLobby in scene " + name); return; } Log.Info("DraftPickerToggle Respond F7"); if ((Object)(object)testDraftMObject == (Object)null) { Log.Info("DraftPickerToggle TestDraftManagerFlow"); testDraftMObject = BuildDraftManagerCorrectly(); 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", 20)); } if (Input.GetKeyDown((KeyCode)289)) { ItemCatalogDumper.ParseAndLog(); } } 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 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; } 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 = new List<ItemPickerSquareController>(); public Action<PickupDef> OnSquareClicked; public void SetSquares(List<ItemPickerSquareController> squareControllers) { Log.Info($"Setting {squareControllers.Count} squares"); this.squareControllers = squareControllers; foreach (ItemPickerSquareController squareController in squareControllers) { squareController.OnSquareClicked = (Action<PickupDef>)Delegate.Combine(squareController.OnSquareClicked, new Action<PickupDef>(ForwardSquareClicked)); } } public void RefreshSquares() { foreach (ItemPickerSquareController squareController in squareControllers) { squareController.RefreshSquare(); } } private void ForwardSquareClicked(PickupDef def) { OnSquareClicked?.Invoke(def); } } 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; private static readonly ScoppedLogger.Scoped LOGGER = ScoppedLogger.For<ItemPickerSquareController>(); 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() { LOGGER.Info("Click on: " + pickupDef.nameToken, "HandleOnClick"); 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 result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown GameObject gameObject = ((Component)parentRect).gameObject; GameObject val = new GameObject("UnselectedOverlay", new Type[2] { typeof(RectTransform), typeof(Image) }) { 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_HARD_OVERLAY; ((Graphic)component).raycastTarget = false; return val; } private static GameObject CreateHoverOverlay(RectTransform parentRect, Color outlineColor) { //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 result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00b6: 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_00cc: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown GameObject gameObject = ((Component)parentRect).gameObject; GameObject val = new GameObject("HoverOverlay", new Type[2] { typeof(RectTransform), typeof(Image) }) { 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.anchoredPosition = new Vector2(HOVER_OUTLINE_ANCHOR_OFFSET, 0f - HOVER_OUTLINE_ANCHOR_OFFSET); val2.offsetMin = new Vector2(0f, 0f - HOVER_OUTLINE_PAD_LARGE); val2.offsetMax = new Vector2(HOVER_OUTLINE_PAD_LARGE, 0f); Image component = val.GetComponent<Image>(); component.sprite = Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/UI/texUIHighlightBoxOutlineThick.png").WaitForCompletion(); component.type = (Type)1; ((Graphic)component).color = outlineColor; ((Graphic)component).raycastTarget = false; ((Behaviour)component).enabled = false; return val; } public static Sprite MakePlaceholderSprite(Color c) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_001c: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0051: 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) Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); val.SetPixels((Color[])(object)new Color[4] { c, c, c, c }); val.Apply(); return Sprite.Create(val, new Rect(0f, 0f, 2f, 2f), new Vector2(0.5f, 0.5f), 2f); } private static RectTransform AddBadge(RectTransform parent, Sprite sprite, Vector2 size, BadgeAnchor where, Vector2 margin) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0051: 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_0084: 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_008a: 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_00a6: 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_00cd: 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_00d1: 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_00f9: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_013f: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0155: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Badge", new Type[2] { typeof(RectTransform), typeof(Image) }); val.layer = ((Component)parent).gameObject.layer; RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent((Transform)(object)parent, false); val2.sizeDelta = size; Vector2 val3 = default(Vector2); Vector2 val4; Vector2 zero = default(Vector2); switch (where) { case BadgeAnchor.Center: ((Vector2)(ref val3))..ctor(0.5f, 0.5f); val4 = val3; zero = Vector2.zero; break; case BadgeAnchor.TL: ((Vector2)(ref val3))..ctor(0f, 1f); val4 = val3; ((Vector2)(ref zero))..ctor(margin.x, 0f - margin.y); break; case BadgeAnchor.TR: ((Vector2)(ref val3))..ctor(1f, 1f); val4 = val3; ((Vector2)(ref zero))..ctor(0f - margin.x, 0f - margin.y); break; case BadgeAnchor.BL: ((Vector2)(ref val3))..ctor(0f, 0f); val4 = val3; ((Vector2)(ref zero))..ctor(margin.x, margin.y); break; default: ((Vector2)(ref val3))..ctor(1f, 0f); val4 = val3; ((Vector2)(ref zero))..ctor(0f - margin.x, margin.y); break; } Vector2 anchorMin = (val2.anchorMax = val4); val2.anchorMin = anchorMin; val2.pivot = val3; val2.anchoredPosition = zero; Image component = val.GetComponent<Image>(); component.sprite = sprite; component.preserveAspect = true; ((Graphic)component).raycastTarget = false; val.transform.SetAsLastSibling(); return val2; } private static Color GetTooltipHeaderColor(DraftItemTier draftItemTier) { //IL_001c: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) return (Color)(draftItemTier switch { DraftItemTier.White => ColorPalette.HeaderWhite, DraftItemTier.Green => ColorPalette.HeaderGreen, DraftItemTier.Red => ColorPalette.HeaderRed, DraftItemTier.Yellow => ColorPalette.HeaderYellow, DraftItemTier.Purple => ColorPalette.HeaderPurple, _ => Color.cyan, }); } private static Sprite GetSpriteForTier(DraftItemTier draftItemTier) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_006d: 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_0080: 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) return (Sprite)(draftItemTier switch { DraftItemTier.White => Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/texTier1BGIcon.png").WaitForCompletion(), DraftItemTier.Green => Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/texTier2BGIcon.png").WaitForCompletion(), DraftItemTier.Red => Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/texTier3BGIcon.png").WaitForCompletion(), DraftItemTier.Yellow => Addressables.LoadAssetAsync<Sprite>((object)"RoR2/Base/Common/texBossBGIcon.png").WaitForCompletion(), DraftItemTier.Purple => Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/Common/IconBackgroundTextures/texVoidBGIcon.png").WaitForCompletion(), _ => Addressables.LoadAssetAsync<Sprite>((object)"RoR2/DLC1/Common/IconBackgroundTextures/texLunarBGIcon.png").WaitForCompletion(), }); } } public static class ItemPickerTabControlsFactory { private static bool SHOW_DEBUG_COLORS; public static DraftTabControls CreateTabControls(string componentName, RectTransform parentRectTransform, DraftItemTier itemTier) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0041: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_00be: 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_00c4: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(componentName, new Type[2] { typeof(RectTransform), typeof(DraftTabControls) }); RectTransform component = val.GetComponent<RectTransform>(); ((Transform)component).SetParent((Transform)(object)parentRectTransform, false); component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(0.5f, 1f); component.offsetMin = new Vector2(0f, -32f); component.offsetMax = new Vector2(0f, 0f); if (SHOW_DEBUG_COLORS) { Image obj = val.AddComponent<Image>(); ((Graphic)obj).raycastTarget = false; Color color = ColorPalette.FromRGB(51, 99, 66); ((Graphic)obj).color = color; } HorizontalLayoutGroup obj2 = val.AddComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)obj2).spacing = 12f; ((HorizontalOrVerticalLayoutGroup)obj2).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)obj2).childForceExpandHeight = false; ((HorizontalOrVerticalLayoutGroup)obj2).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)obj2).childForceExpandWidth = false; ((LayoutGroup)obj2).childAlignment = (TextAnchor)3; ((LayoutGroup)obj2).padding = new RectOffset(12, 12, 8, 8); DraftTabControls component2 = val.GetComponent<DraftTabControls>(); CreateRestrictionGroup(componentName + "_RestrictionGroup", component, component2); CreateSelectionGroup(componentName + "_SelectionGroup", component, component2); CreateSpacer(componentName + "_Spacer", component); CreateGridOptionsGroup(componentName + "_Options", component, component2, itemTier); return component2; } private static RectTransform MakeRowGroup(string name, RectTransform parent) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: 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_004c: Expected O, but got Unknown //IL_0054: 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) GameObject val = new GameObject(name, new Type[4] { typeof(RectTransform), typeof(HorizontalLayoutGroup), typeof(ContentSizeFitter), typeof(LayoutElement) }); RectTransform val2 = (RectTransform)val.transform; ((Transform)val2).SetParent((Transform)(object)parent, false); HorizontalLayoutGroup component = val.GetComponent<HorizontalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)component).spacing = 8f; ((LayoutGroup)component).childAlignment = (TextAnchor)3; ((HorizontalOrVerticalLayoutGroup)component).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)component).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)component).childForceExpandWidth = false; ((HorizontalOrVerticalLayoutGroup)component).childForceExpandHeight = false; ContentSizeFitter component2 = val.GetComponent<ContentSizeFitter>(); component2.horizontalFit = (FitMode)2; component2.verticalFit = (FitMode)1; LayoutElement component3 = val.GetComponent<LayoutElement>(); component3.flexibleWidth = 0f; component3.minHeight = 28f; return val2; } private static GameObject CreateRestrictionGroup(string groupName, RectTransform controlsBarRT, DraftTabControls pickerTabControls) { RectTransform val = MakeRowGroup(groupName, controlsBarRT); GameObject gameObject = ((Component)val).gameObject; ((Component)val).GetComponent<RectTransform>(); CreateLabel(groupName + "_LimitLabel", val, "Limit: ", 24); CreateItemCountControls(groupName + "_Counts", val, pickerTabControls); return gameObject; } private static GameObject CreateSelectionGroup(string groupName, RectTransform controlsBarRT, DraftTabControls pickerTabControls) { RectTransform val = MakeRowGroup(groupName, controlsBarRT); GameObject gameObject = ((Component)val).gameObject; TextMeshProUGUI component = CreateLabel(groupName + "_SelectLabel", val, "Selected: 0/0", 24).GetComponent<TextMeshProUGUI>(); pickerTabControls.BindItemSelectionElements(component); return gameObject; } private static GameObject CreateLabel(string objectName, RectTransform parentRT, string labelText, int fontSize = 22) { //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_003a: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown GameObject val = new GameObject(objectName, new Type[3] { typeof(RectTransform), typeof(TextMeshProUGUI), typeof(LayoutElement) }); FactoryUtils.ParentToRectTransform(val, parentRT); RectTransform component = val.GetComponent<RectTransform>(); component.anchorMin = new Vector2(0f, 0f); component.anchorMax = new Vector2(1f, 0f); component.sizeDelta = new Vector2(0f, 22f); TextMeshProUGUI component2 = val.GetComponent<