using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using CollectionWeaver.Core; using EnhancedPrefabLoader.API; using EnhancedPrefabLoader.API.Assets; using EnhancedPrefabLoader.API.Behaviors; using EnhancedPrefabLoader.API.Events; using EnhancedPrefabLoader.API.Extensions; using EnhancedPrefabLoader.API.InternalBridges; using EnhancedPrefabLoader.API.Models; using EnhancedPrefabLoader.API.Registry; using EnhancedPrefabLoader.API.Services; using EnhancedPrefabLoader.API.UI; using EnhancedPrefabLoader.Core; using EnhancedPrefabLoader.Core.Assets; using EnhancedPrefabLoader.Core.Cards; using EnhancedPrefabLoader.Core.Cards.ExpGenerators; using EnhancedPrefabLoader.Core.Cards.PriceGenerators; using EnhancedPrefabLoader.Core.Components; using EnhancedPrefabLoader.Core.Events; using EnhancedPrefabLoader.Core.Extensions; using EnhancedPrefabLoader.Core.ExternalBridges; using EnhancedPrefabLoader.Core.LoadingPipeline; using EnhancedPrefabLoader.Core.LoadingPipeline.Processors; using EnhancedPrefabLoader.Core.LoadingPipeline.Validators; using EnhancedPrefabLoader.Core.Models.Runtime; using EnhancedPrefabLoader.Core.Models.SaveData; using EnhancedPrefabLoader.Core.Packs.PackGenerators; using EnhancedPrefabLoader.Core.Properties; using EnhancedPrefabLoader.Core.Registry; using EnhancedPrefabLoader.Core.Saves; using EnhancedPrefabLoader.Core.Services; using EnhancedPrefabLoader.Core.Services.Internal; using EnhancedPrefabLoader.Core.Shops; using EnhancedPrefabLoader.Core.Trading; using EnhancedPrefabLoader.Core.Uninstall; using EnhancedPrefabLoader.Core.Utils; using EnhancedPrefabLoader.Shared.Enums; using EnhancedPrefabLoader.Shared.Extensions; using EnhancedPrefabLoader.Shared.Helpers; using EnhancedPrefabLoader.Shared.Models; using HarmonyLib; using I2.Loc; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Newtonsoft.Json.Serialization; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("EnhancedPrefabLoader")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("6.0.1.0")] [assembly: AssemblyInformationalVersion("6.0.1+cd7431ddc1ec5aac5b27bb4a89a6104e570aad10")] [assembly: AssemblyProduct("Enhanced Prefab Loader")] [assembly: AssemblyTitle("EnhancedPrefabLoader")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("6.0.1.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] [CompilerGenerated] internal sealed class <>z__ReadOnlyArray : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { int ICollection.Count => _items.Length; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => _items.Length; T IReadOnlyList.this[int index] => _items[index]; int ICollection.Count => _items.Length; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyArray(T[] items) { _items = items; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { ((ICollection)_items).CopyTo(array, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return ((IList)_items).Contains(value); } int IList.IndexOf(object value) { return ((IList)_items).IndexOf(value); } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return ((ICollection)_items).Contains(item); } void ICollection.CopyTo(T[] array, int arrayIndex) { ((ICollection)_items).CopyTo(array, arrayIndex); } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return ((IList)_items).IndexOf(item); } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } [CompilerGenerated] internal sealed class <>z__ReadOnlyList : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { int ICollection.Count => _items.Count; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => _items.Count; T IReadOnlyList.this[int index] => _items[index]; int ICollection.Count => _items.Count; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { return _items[index]; } set { throw new NotSupportedException(); } } public <>z__ReadOnlyList(List items) { _items = items; } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.CopyTo(Array array, int index) { ((ICollection)_items).CopyTo(array, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return ((IList)_items).Contains(value); } int IList.IndexOf(object value) { return ((IList)_items).IndexOf(value); } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)_items).GetEnumerator(); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return _items.Contains(item); } void ICollection.CopyTo(T[] array, int arrayIndex) { _items.CopyTo(array, arrayIndex); } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { return _items.IndexOf(item); } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } [CompilerGenerated] internal sealed class <>z__ReadOnlySingleElementList : IEnumerable, ICollection, IList, IEnumerable, IReadOnlyCollection, IReadOnlyList, ICollection, IList { private sealed class Enumerator : IDisposable, IEnumerator, IEnumerator { object IEnumerator.Current => _item; T IEnumerator.Current => _item; public Enumerator(T item) { _item = item; } bool IEnumerator.MoveNext() { if (!_moveNextCalled) { return _moveNextCalled = true; } return false; } void IEnumerator.Reset() { _moveNextCalled = false; } void IDisposable.Dispose() { } } int ICollection.Count => 1; bool ICollection.IsSynchronized => false; object ICollection.SyncRoot => this; object IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } bool IList.IsFixedSize => true; bool IList.IsReadOnly => true; int IReadOnlyCollection.Count => 1; T IReadOnlyList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } } int ICollection.Count => 1; bool ICollection.IsReadOnly => true; T IList.this[int index] { get { if (index != 0) { throw new IndexOutOfRangeException(); } return _item; } set { throw new NotSupportedException(); } } public <>z__ReadOnlySingleElementList(T item) { _item = item; } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.CopyTo(Array array, int index) { array.SetValue(_item, index); } int IList.Add(object value) { throw new NotSupportedException(); } void IList.Clear() { throw new NotSupportedException(); } bool IList.Contains(object value) { return EqualityComparer.Default.Equals(_item, (T)value); } int IList.IndexOf(object value) { if (!EqualityComparer.Default.Equals(_item, (T)value)) { return -1; } return 0; } void IList.Insert(int index, object value) { throw new NotSupportedException(); } void IList.Remove(object value) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } IEnumerator IEnumerable.GetEnumerator() { return new Enumerator(_item); } void ICollection.Add(T item) { throw new NotSupportedException(); } void ICollection.Clear() { throw new NotSupportedException(); } bool ICollection.Contains(T item) { return EqualityComparer.Default.Equals(_item, item); } void ICollection.CopyTo(T[] array, int arrayIndex) { array[arrayIndex] = _item; } bool ICollection.Remove(T item) { throw new NotSupportedException(); } int IList.IndexOf(T item) { if (!EqualityComparer.Default.Equals(_item, item)) { return -1; } return 0; } void IList.Insert(int index, T item) { throw new NotSupportedException(); } void IList.RemoveAt(int index) { throw new NotSupportedException(); } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 sealed class ConfigurationManagerAttributes { public delegate void CustomHotkeyDrawerFunc(ConfigEntryBase setting, ref bool isCurrentlyAcceptingInput); public bool? ShowRangeAsPercent; public Action CustomDrawer; public CustomHotkeyDrawerFunc CustomHotkeyDrawer; public bool? Browsable; public string Category; public object DefaultValue; public bool? HideDefaultButton; public bool? HideSettingName; public string Description; public string DispName; public int? Order; public bool? ReadOnly; public bool? IsAdvanced; public Func ObjToStr; public Func StrToObj; } namespace EnhancedPrefabLoader { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("EnhancedPrefabLoader", "Enhanced Prefab Loader", "6.0.1")] public class Plugin : BaseUnityPlugin { private readonly Harmony harmony = new Harmony("EnhancedPrefabLoader"); private readonly BundleMaintenanceService maintenanceService = new BundleMaintenanceService(); internal static Plugin Instance { get; private set; } public Plugin() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown Instance = this; } private void Awake() { EplRuntimeData.Config.Initialize(((BaseUnityPlugin)this).Config); ModLogger.Initialize(((BaseUnityPlugin)this).Logger); Epl.RegisterApi((IEplApi)(object)new EplApi()); InterceptorRegistry.RegisterFromAssembly(Assembly.GetExecutingAssembly()); StreamingAssetsBridge.AssetLoadBridge = (IAssetLoadBridge)(object)EplRuntimeData.Services.StreamingAssetService; StreamingAssetsBridge.AssetRefTracker = (IAssetRefTracker)(object)EplRuntimeData.Services.StreamingAssetService; EplRuntimeData.Events.OnInventoryBaseAwake += delegate { EplRuntimeData.Services.ShopInventoryManager.PopulateAllShopInventories(); }; SceneManager.sceneLoaded += OnSceneLoad; harmony.PatchAll(); ModLogger.Info("Plugin Enhanced Prefab Loader v:6.0.1 by GhostNarwhal is loaded!", "Awake", "D:\\Projects\\EnhancedPrefabLoader\\EnhancedPrefabLoader.Core\\Plugin.cs"); } private void Update() { //IL_0012: 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) if (!EplRuntimeData.IsBundleLoadingComplete) { return; } KeyboardShortcut value = EplRuntimeData.Config.PriceResetHotkey.Value; if (!((KeyboardShortcut)(ref value)).IsDown()) { return; } ModLogger.Info("Force price reset triggered for all bundles", "Update", "D:\\Projects\\EnhancedPrefabLoader\\EnhancedPrefabLoader.Core\\Plugin.cs"); foreach (string key in EplRuntimeData.Assets.BundleRegistry.BundleInfo.Keys) { maintenanceService.ResetPricesFor(key); } ModLogger.Info("Price reset complete", "Update", "D:\\Projects\\EnhancedPrefabLoader\\EnhancedPrefabLoader.Core\\Plugin.cs"); } private void OnDestroy() { harmony.UnpatchSelf(); ModLogger.Info("Plugin Enhanced Prefab Loader is unloaded!", "OnDestroy", "D:\\Projects\\EnhancedPrefabLoader\\EnhancedPrefabLoader.Core\\Plugin.cs"); } private void OnSceneLoad(Scene scene, LoadSceneMode _) { if (((Scene)(ref scene)).name == "Title") { EplRuntimeData.Services.SaveDataManager.ResetAllSaveData(); EplRuntimeData.Services.ShopService.ResetUIState(); EplRuntimeData.Services.WorkerPackOpenerScreenService.IsLoaded = false; EplRuntimeData.Services.CardExpansionSelectService.IsLoaded = false; EplRuntimeData.Services.CardRaritySelectService.IsLoaded = false; EplRuntimeData.Services.CollectionBinderService.IsLoaded = false; return; } EplRuntimeData.Services.ShopService.CreateAndRegisterCustomShops(); EplRuntimeData.Services.StreamingAssetService.StartCleanupCoroutine(); if (!(((Scene)(ref scene)).name == "Start")) { return; } CardFanRandomizer[] array = Resources.FindObjectsOfTypeAll(); foreach (CardFanRandomizer val in array) { string text = ((Object)((Component)val).transform).name; for (Transform parent = ((Component)val).transform.parent; parent != null; parent = parent.parent) { text = ((Object)parent).name + "/" + text; } ModLogger.Info($"CardFanRandomizer on: {text} (active: {((Component)val).gameObject.activeInHierarchy})", "OnSceneLoad", "D:\\Projects\\EnhancedPrefabLoader\\EnhancedPrefabLoader.Core\\Plugin.cs"); } } } } namespace EnhancedPrefabLoader.Shared.Services { public class BundleDiscoveryService { public List DiscoverBundles(string basePath) { return Directory.EnumerateDirectories(basePath, "*_prefabloader", new EnumerationOptions { RecurseSubdirectories = true, MatchCasing = MatchCasing.CaseInsensitive }).ToList().SelectMany((string d) => Directory.GetFiles(d, "*.json", SearchOption.AllDirectories)) .ToList(); } } } namespace EnhancedPrefabLoader.Shared.Models { public class BundleDescriptor { public string BundleId { get; set; } = string.Empty; public string Name { get; set; } = string.Empty; public List Assemblies { get; set; } = new List(); public List CustomShops { get; set; } = new List(); public List Items { get; set; } = new List(); public List Prefabs { get; set; } = new List(); public List CardExpansions { get; set; } = new List(); public List Furniture => Prefabs.Where((PrefabInfo p) => p.AddItemToFurnitureShop).ToList(); public List Deco => Prefabs.Where((PrefabInfo p) => p.IsDecoObject || p.IsDecoFloorTexture || p.IsDecoCeilingTexture || p.IsDecoWallTexture).ToList(); public HashSet PrefabNames { get { HashSet hashSet = new HashSet(); foreach (string item in (from p in Prefabs?.Where((PrefabInfo p) => !string.IsNullOrWhiteSpace(p.PrefabName)) select p.PrefabName) ?? Array.Empty()) { hashSet.Add(item); } return hashSet; } } public HashSet MeshNames { get { HashSet hashSet = new HashSet(); foreach (string item in (from i in Items?.Where((ItemInfo i) => !string.IsNullOrWhiteSpace(i.Mesh)) select i.Mesh) ?? Array.Empty()) { hashSet.Add(item); } return hashSet; } } public HashSet MaterialNames { get { HashSet hashSet = new HashSet(); foreach (string item in (from i in Items?.Where((ItemInfo i) => !string.IsNullOrWhiteSpace(i.Material)) select i.Material) ?? Array.Empty()) { hashSet.Add(item); } return hashSet; } } } public class CardExpansionInfo { public string Name { get; set; } = string.Empty; public string MenuCategory { get; set; } = string.Empty; public string CardExpansion { get; set; } = string.Empty; [JsonProperty("CardbackSprite")] public string Cardback { get; set; } = string.Empty; public string FoilMask { get; set; } = string.Empty; public bool HasRandomFoils { get; set; } public float FoilChance { get; set; } public List Rarities { get; set; } = new List(); public List Cards { get; set; } = new List(); public string CardPriceStrategy { get; set; } = string.Empty; public float DefaultBorderMultiplierBase { get; set; } = 3.15f; public float DefaultFoilMultiplier { get; set; } = 2.9f; public float RarityDrivenFloor { get; set; } = 4f; public float RarityDrivenStepSize { get; set; } = 1026f; public float RarityDrivenBorderMultiplierBase { get; set; } = 1.15f; public float RarityDrivenFoilMultiplier { get; set; } = 1.4f; public int TradeUnlockLevel { get; set; } public List PlayCardMaterials { get; set; } = new List(); public bool IsValid { get; set; } = true; } public class CardExpansionMetadata { public string ExpansionName { get; set; } = string.Empty; public int CardCount { get; set; } } public class CardInfo { public string Name { get; set; } = string.Empty; public string ElementType { get; set; } = string.Empty; public string Rarity { get; set; } = string.Empty; public int CardNumber { get; set; } public string Sprite { get; set; } = string.Empty; public string BorderType { get; set; } = string.Empty; public bool IsFoil { get; set; } public string FoilMask { get; set; } = string.Empty; public string Cardback { get; set; } = string.Empty; } [Serializable] public struct ColorData { public float R { get; set; } public float G { get; set; } public float B { get; set; } public float A { get; set; } } public class CustomShopInfo { public string PhoneAppId { get; set; } = string.Empty; public string AppDisplayName { get; set; } = string.Empty; public string AppIcon { get; set; } = string.Empty; public string AppInnerBGImage { get; set; } = string.Empty; public string AppOuterBGImage { get; set; } = string.Empty; public string SiteLogo { get; set; } = string.Empty; public string SiteHeader { get; set; } = string.Empty; public string SiteBackground { get; set; } = string.Empty; public bool IsValid { get; internal set; } = true; } public class ItemInfo { public string Name { get; set; } = string.Empty; public string ItemCategory { get; set; } = string.Empty; public string SpriteName { get; set; } = string.Empty; public float BaseCost { get; set; } public bool AddItemAsAccessory { get; set; } public bool AddItemAsFigurine { get; set; } public bool AddItemAsBoardGame { get; set; } public string PhoneAppId { get; set; } = string.Empty; public string ItemType { get; set; } = string.Empty; public bool UsesBaseGameMesh { get; set; } public string MeshToUse { get; set; } = string.Empty; public string Mesh { get; set; } = string.Empty; public string MeshSecondary { get; set; } = string.Empty; public string Material { get; set; } = string.Empty; public string MaterialSecondary { get; set; } = string.Empty; public List MaterialList { get; set; } = new List(); [JsonProperty("IsBigBox")] public bool HasBigBox { get; set; } public bool HasSmallBox { get; set; } [JsonProperty("HideTillUnlocked")] public bool BigBoxHideTillUnlocked { get; set; } public bool SmallBoxHideTillUnlocked { get; set; } [JsonProperty("LicensePrice")] public float BigBoxLicensePrice { get; set; } public float SmallBoxLicensePrice { get; set; } [JsonProperty("LicenseLevelRequirement")] public int BigBoxLicenseLevelRequirement { get; set; } public int SmallBoxLicenseLevelRequirement { get; set; } [JsonProperty("IgnoreDoubleImage")] public bool BigBoxIgnoreDoubleImage { get; set; } public bool SmallBoxIgnoreDoubleImage { get; set; } public float MinMarketPricePercent { get; set; } public float MaxMarketPricePercent { get; set; } public string FollowItemPrice { get; set; } = string.Empty; public bool AutoSetBoxPrice { get; set; } public bool IsTallItem { get; set; } public float InBoxOffsetY { get; set; } public float InBoxOffsetScale { get; set; } public Vector3Data ItemDeminsion { get; set; } public Vector3Data CollidorPosOffset { get; set; } public Vector3Data ColliderScale { get; set; } public List PriceAffectedBy { get; set; } = new List(); public bool IsSprayCan { get; set; } public bool IsCardPack { get; set; } public bool IsCardBox { get; set; } public bool IsBulkBox { get; set; } public int MinValue { get; set; } public string CardExpansion { get; set; } = string.Empty; public bool CanHaveDuplicates { get; set; } public bool CanHaveGodPacks { get; set; } public string PackGenerationStrategy { get; set; } = string.Empty; public Dictionary NormalWeights { get; set; } = new Dictionary(); public Dictionary GodWeights { get; set; } = new Dictionary(); public Dictionary> SlotWeights { get; set; } = new Dictionary>(); [Obsolete("Use NormalWeights, GodWeights, and SlotWeights instead. This field exists for backwards compatibility with older descriptors.")] public List GenerationWeights { get; set; } = new List(); public string SpawnsPackType { get; set; } = string.Empty; public string PackType { get; set; } = string.Empty; public float GodPackPercentage { get; set; } public bool IsValid { get; set; } = true; } public class ModManifest { public string ModId { get; set; } = string.Empty; public string Name { get; set; } = string.Empty; public string Directory { get; set; } = string.Empty; public string BundlePath { get; set; } = string.Empty; public string JsonPath { get; set; } = string.Empty; public bool IsValid { get; set; } = true; public bool IsLoaded { get; set; } = true; public List Errors { get; set; } = new List(); public int ItemCount { get; set; } public int FurnitureCount { get; set; } public int CustomShopCount { get; set; } public int DecoCount { get; set; } public List CardExpansions { get; set; } = new List(); } public class PrefabInfo { public string Name { get; set; } = string.Empty; public string PrefabName { get; set; } = string.Empty; public string SpriteName { get; set; } = string.Empty; public float Price { get; set; } public int LevelRequirement { get; set; } public bool AddItemToFurnitureShop { get; set; } public string Description { get; set; } = string.Empty; public string ObjectType { get; set; } public List VideoClips { get; set; } = new List(); public float DecoBonus { get; set; } public bool IsDecoWallTexture { get; set; } public bool IsDecoFloorTexture { get; set; } public bool IsDecoCeilingTexture { get; set; } public bool IsDecoObject { get; set; } public string DecoObject { get; set; } = string.Empty; public string DecoType { get; set; } = string.Empty; public string Texture { get; set; } = string.Empty; public string RoughnessMap { get; set; } = string.Empty; public string NormalMap { get; set; } = string.Empty; public float Smoothness { get; set; } public ColorData Color { get; set; } public bool IsValid { get; set; } = true; } public class RarityWeightInfo { public string Rarity { get; set; } = string.Empty; [Obsolete("Use SlotWeights instead. This field exists for backwards compatibility with older descriptors.")] public string GuaranteedSlots { get; set; } = string.Empty; public float NormalWeight { get; set; } public float GodPackWeight { get; set; } } [Serializable] public struct Vector3Data { public float X { get; set; } public float Y { get; set; } public float Z { get; set; } } public class VideoClipInfo { public string Name { get; set; } = string.Empty; public string VideoPlayerName { get; set; } = string.Empty; } } namespace EnhancedPrefabLoader.Shared.Helpers { public static class FileHelper { public static List GetAllJsonFilesIn(string basePath, string folderPattern) { return Directory.EnumerateDirectories(basePath, folderPattern, new EnumerationOptions { RecurseSubdirectories = true, MatchCasing = MatchCasing.CaseInsensitive }).SelectMany((string d) => Directory.GetFiles(d, "*.json", SearchOption.AllDirectories)).ToList(); } } public static class ModIdGenerator { public static string GenerateFromDirectory(string directory) { DirectoryInfo directoryInfo = new DirectoryInfo(Path.GetDirectoryName(directory)); string fullName = directoryInfo.FullName; string name = directoryInfo.Name; using SHA1 sHA = SHA1.Create(); string text = BitConverter.ToString(sHA.ComputeHash(Encoding.UTF8.GetBytes(fullName.ToLowerInvariant()))).Replace("-", "").Substring(0, 8); return name + "_" + text; } } } namespace EnhancedPrefabLoader.Shared.Extensions { public static class DictionaryExtensions { public static TValue GetOrDefault(this Dictionary dict, TKey key) { if (!dict.TryGetValue(key, out TValue value)) { return default(TValue); } return value; } public static TValue GetOrAdd(this Dictionary dict, TKey key, Func factory) { if (!dict.TryGetValue(key, out TValue value)) { value = (dict[key] = factory(key)); } return value; } public static void MergeAdd(this Dictionary dict, IEnumerable<(TKey key, int amount)> items) { foreach (var item3 in items) { TKey item = item3.key; int item2 = item3.amount; dict[item] = dict.GetOrAdd(item, (TKey _) => 0) + item2; } } public static void AddRange(this Dictionary dict, IEnumerable> items) { foreach (KeyValuePair item in items) { dict[item.Key] = item.Value; } } } public static class ListExtensions { public static List Shuffle(this List list) where T : class { for (int num = list.Count - 1; num > 0; num--) { int num2 = Random.Range(0, num + 1); int index = num; int index2 = num2; T value = list[num2]; T value2 = list[num]; list[index] = value; list[index2] = value2; } return list; } public static List SwapAndRemove(this List list, int index) { int num = list.Count - 1; if (index != num) { int index2 = num; T value = list[num]; T value2 = list[index]; list[index] = value; list[index2] = value2; } list.RemoveAt(num); return list; } } } namespace EnhancedPrefabLoader.Shared.Enums { [Flags] public enum ItemFlags : byte { None = 0, BoardGame = 1, Accessory = 2, Figurine = 4, TCG = 8 } } namespace EnhancedPrefabLoader.Core { internal class BundleManager { internal class BundleHandle { [CompilerGenerated] private sealed class d__12 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public BundleHandle <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { int num = <>1__state; BundleHandle bundleHandle = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; if (bundleHandle.IsLoaded) { return false; } if (bundleHandle.isLoading) { break; } bundleHandle.isLoading = true; if (bundleHandle.loadRequest != null) { <>2__current = bundleHandle.loadRequest; <>1__state = 1; return true; } goto IL_00a2; case 1: <>1__state = -1; bundleHandle.assetBundle = bundleHandle.loadRequest.assetBundle; bundleHandle.loadRequest = null; bundleHandle.IsLoaded = bundleHandle.assetBundle != null; bundleHandle.HasError = bundleHandle.assetBundle == null; goto IL_00a2; case 2: { <>1__state = -1; break; } IL_00a2: bundleHandle.isLoading = false; break; } if (bundleHandle.isLoading) { ModLogger.Debug("Waiting for another coroutine to finish loading bundle.", "WaitForLoadAsync", "D:\\Projects\\EnhancedPrefabLoader\\EnhancedPrefabLoader.Core\\BundleManager.cs"); <>2__current = null; <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private AssetBundle? assetBundle; private AssetBundleCreateRequest? loadRequest; private bool isLoading; public bool HasError { get; private set; } public bool IsLoaded { get; private set; } public static BundleHandle Create(string bundlePath) { string bundleName = Path.GetFileNameWithoutExtension(bundlePath); AssetBundle val = AssetBundle.GetAllLoadedAssetBundles().FirstOrDefault((Func)((AssetBundle b) => ((Object)b).name == bundleName)); if (val != null) { ModLogger.Debug("Bundle '" + bundleName + "' already loaded externally, reusing.", "Create", "D:\\Projects\\EnhancedPrefabLoader\\EnhancedPrefabLoader.Core\\BundleManager.cs"); return new BundleHandle { assetBundle = val, IsLoaded = true }; } return new BundleHandle { loadRequest = AssetBundle.LoadFromFileAsync(bundlePath) }; } [IteratorStateMachine(typeof(d__12))] internal IEnumerator WaitForLoadAsync() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { <>4__this = this }; } internal AssetBundleRequest? LoadAssetAsync(string assetName) where T : Object { if (!string.IsNullOrEmpty(assetName)) { AssetBundle? obj = assetBundle; if (obj == null) { return null; } return obj.LoadAssetAsync(assetName); } return null; } internal AssetBundleRequest? LoadAssetAsync(string assetName, Type type) { if (!string.IsNullOrEmpty(assetName)) { AssetBundle? obj = assetBundle; if (obj == null) { return null; } return obj.LoadAssetAsync(assetName, type); } return null; } internal AssetBundleRequest? LoadAllAsync() where T : Object { AssetBundle? obj = assetBundle; if (obj == null) { return null; } return obj.LoadAllAssetsAsync(); } } private readonly Dictionary bundleHandles = new Dictionary(); internal BundleHandle GetOrOpen(string bundlePath) { if (bundleHandles.TryGetValue(bundlePath, out BundleHandle value)) { if (!value.HasError) { return value; } bundleHandles.Remove(bundlePath); } value = BundleHandle.Create(bundlePath); bundleHandles[bundlePath] = value; return value; } } internal class EplApi : IEplApi { public bool IsBundleLoadingComplete => EplRuntimeData.IsBundleLoadingComplete; public IBundleRegistry BundleRegistry => (IBundleRegistry)(object)EplRuntimeData.Assets.BundleRegistry; public IEplAssets Assets => (IEplAssets)(object)EplRuntimeData.Assets; public IEplServices Services => (IEplServices)(object)EplRuntimeData.Services; public IEplEvents Events => (IEplEvents)(object)EplRuntimeData.Events; } internal class EplCaches { internal Dictionary CardBackMaterials { get; } = new Dictionary(); internal Material? OriginalCardBackMaterial { get; set; } internal Dictionary> PlayTableExpansionCache { get; } = new Dictionary>(); } internal class EplConfig { internal bool ExcludeBaseGameCardsFromTrade { get; private set; } internal bool SparkleFoilEnabled { get; private set; } internal bool UseCustomExpForBase { get; private set; } internal bool DisableBaseGamePlayCards { get; private set; } internal ConfigEntry PriceResetHotkey { get; private set; } internal ConfigEntry MinimumLogLevelEntry { get; private set; } internal ConfigEntry CollectionBinderSpacingXEntry { get; private set; } internal ConfigEntry CollectionBinderSpacingYEntry { get; private set; } internal ConfigEntry CollectionBinderButtonSizeEntry { get; private set; } internal ConfigEntry CardExpansionSelectSpacingXEntry { get; private set; } internal ConfigEntry CardExpansionSelectSpacingYEntry { get; private set; } internal ConfigEntry CardExpansionSelectButtonSizeEntry { get; private set; } internal ConfigEntry RaritySelectSpacingXEntry { get; private set; } internal ConfigEntry RaritySelectSpacingYEntry { get; private set; } internal ConfigEntry RaritySelectButtonSizeEntry { get; private set; } internal void Initialize(ConfigFile config) { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_020f: Unknown result type (might be due to invalid IL or missing references) ConfigEntry excludeBaseGame = config.Bind("Trading", "ExcludeBaseGameCardsFromTrade", false, "When enabled, base-game expansions (Tetramon, Destiny, Ghost) will not appear in customer card trade/sell selection."); ExcludeBaseGameCardsFromTrade = excludeBaseGame.Value; excludeBaseGame.SettingChanged += delegate { ExcludeBaseGameCardsFromTrade = excludeBaseGame.Value; }; ConfigEntry sparkleFoil = config.Bind("CardUI", "Sparkle Foil Enabled", true, "When enabled, foil cards display the sparkle glitter effect."); SparkleFoilEnabled = sparkleFoil.Value; sparkleFoil.SettingChanged += delegate { SparkleFoilEnabled = sparkleFoil.Value; }; CollectionBinderSpacingXEntry = config.Bind("CollectionBinderUI", "ExpansionSpacingX", 30f, (ConfigDescription)null); CollectionBinderSpacingYEntry = config.Bind("CollectionBinderUI", "ExpansionSpacingY", -45f, (ConfigDescription)null); CollectionBinderButtonSizeEntry = config.Bind("CollectionBinderUI", "ExpansionButtonSize", new Vector2(325f, 184.5f), (ConfigDescription)null); CardExpansionSelectSpacingXEntry = config.Bind("UI", "ExpansionSpacingX", 30f, (ConfigDescription)null); CardExpansionSelectSpacingYEntry = config.Bind("UI", "ExpansionSpacingY", -45f, (ConfigDescription)null); CardExpansionSelectButtonSizeEntry = config.Bind("UI", "ExpansionButtonSize", new Vector2(325f, 184.5f), (ConfigDescription)null); RaritySelectSpacingXEntry = config.Bind("UI", "RaritySpacingX", 30f, (ConfigDescription)null); RaritySelectSpacingYEntry = config.Bind("UI", "RaritySpacingY", -45f, (ConfigDescription)null); RaritySelectButtonSizeEntry = config.Bind("UI", "RarityButtonSize", new Vector2(325f, 184.5f), (ConfigDescription)null); ConfigEntry useCustomExp = config.Bind("GamePlay", "UseCustomExpForBase", false, "When enabled, base-game card expansions will use the EPL experience formula instead of the vanilla formula."); UseCustomExpForBase = useCustomExp.Value; useCustomExp.SettingChanged += delegate { UseCustomExpForBase = useCustomExp.Value; }; PriceResetHotkey = config.Bind("Hotkeys", "Force Price Reset", new KeyboardShortcut((KeyCode)114, (KeyCode[])(object)new KeyCode[1] { (KeyCode)304 }), "Press to reset all item and card prices for every loaded bundle."); MinimumLogLevelEntry = config.Bind("Logging", "Minimum log level to log", LogLevel.None, (ConfigDescription)null); ConfigEntry disableBaseCards = config.Bind("PlayTable", "DisableBaseGamePlayCards", false, "When enabled, base game card textures will not appear on play tables. If no mod expansion textures are available, this setting is ignored."); DisableBaseGamePlayCards = disableBaseCards.Value; disableBaseCards.SettingChanged += delegate { DisableBaseGamePlayCards = disableBaseCards.Value; }; } } internal static class EplRuntimeData { internal static bool IsBundleLoadingComplete { get; set; } internal static BundleAssetTracker BundleAssetTracker { get; set; } = new BundleAssetTracker(); internal static List Assemblies { get; private set; } = new List(); internal static EplCaches Caches { get; private set; } = new EplCaches(); internal static EplConfig Config { get; private set; } = new EplConfig(); internal static EplEvents Events { get; private set; } = new EplEvents(); internal static EplAssets Assets { get; private set; } = new EplAssets(new BundleRegistry(BundleAssetTracker)); internal static EplServices Services { get; private set; } = new EplServices(new SaveDataService(BundleAssetTracker)); } public enum LogLevel { Debug, Info, Warning, Error, None } public static class ModLogger { private static ManualLogSource logger; private static LogLevel logLevel; public static void Initialize(ManualLogSource logger) { ModLogger.logger = logger; logLevel = EplRuntimeData.Config.MinimumLogLevelEntry.Value; EplRuntimeData.Config.MinimumLogLevelEntry.SettingChanged += delegate { logLevel = EplRuntimeData.Config.MinimumLogLevelEntry.Value; }; } public static void Debug(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "") { if (logLevel <= LogLevel.Debug) { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath); logger.LogDebug((object)("[" + fileNameWithoutExtension + "." + memberName + "]: " + message)); } } public static void Info(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "") { if (logLevel <= LogLevel.Info) { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath); logger.LogInfo((object)("[" + fileNameWithoutExtension + "." + memberName + "]: " + message)); } } public static void Warning(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "") { if (logLevel <= LogLevel.Warning) { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath); logger.LogWarning((object)("[" + fileNameWithoutExtension + "." + memberName + "]: " + message)); } } public static void Error(string message, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "") { if (logLevel <= LogLevel.Error) { string fileNameWithoutExtension = Path.GetFileNameWithoutExtension(filePath); logger.LogError((object)("[" + fileNameWithoutExtension + "." + memberName + "]: " + message)); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "EnhancedPrefabLoader"; public const string PLUGIN_NAME = "Enhanced Prefab Loader"; public const string PLUGIN_VERSION = "6.0.1"; } } namespace EnhancedPrefabLoader.Core.Utils { public static class EplConstants { public const string EplDirectoryDescriptor = "*_prefabloader"; } internal static class ItemTypeResolver { private static EItemType[]? sortedModKeys; internal static EItemType Resolve(int index) { if (index >= 129) { if (index < 200000) { return GetSortedModKeys()[index - 129]; } return (EItemType)index; } return (EItemType)index; } internal static EItemType[] GetSortedModKeys() { return sortedModKeys ?? (sortedModKeys = EplRuntimeData.Assets.ItemLibrary.ItemData.Keys.OrderBy((EItemType k) => (int)k).ToArray()); } internal static void InvalidateCache() { sortedModKeys = null; } } public static class RandomUtils { public static T Weighted(Dictionary weights) { float num = 0f; foreach (KeyValuePair weight in weights) { num += weight.Value; } float num2 = Random.value * num; foreach (KeyValuePair weight2 in weights) { num2 -= weight2.Value; if (num2 <= 0f) { return weight2.Key; } } return weights.Last().Key; } } } namespace EnhancedPrefabLoader.Core.Uninstall { internal class CardRemovalStrategy : IAssetRemovalStrategy { [CompilerGenerated] private HashSet P; private Dictionary removedCards; public CardRemovalStrategy(HashSet cardExpansions) { P = cardExpansions; removedCards = new Dictionary(); base..ctor(); } public RemovalResult RemoveAssets() { removedCards = new Dictionary(); RemoveFromCardShelves(); RemoveFromBinder(); RemoveFromBulkDonationBoxes(); RemoveFromCardStorageShelves(); RemoveFromCardPackageBoxes(); return RemovalResult.Success(removedCards.Values.Sum(), removedCards.Sum>((KeyValuePair kvp) => CPlayerData.GetCardMarketPrice(kvp.Key) * (float)kvp.Value)); } private void RemoveFromCardShelves() { //IL_0073: 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) foreach (InteractableCardCompartment item in CSingleton.Instance.m_CardShelfList.SelectMany((CardShelf cs) => cs.m_CardCompartmentList)) { if (item.m_StoredCardList.Count == 0) { continue; } CardData cardData = item.m_StoredCardList[0].m_Card3dUI.m_CardUI.m_CardData; if (!P.Contains(cardData.expansionType)) { continue; } foreach (InteractableCardPriceTag interactablePriceTag in item.m_InteractablePriceTagList) { interactablePriceTag.SetPriceChecked(false); } item.m_StoredCardList[0].SetIsDisplayedOnShelf(false); item.m_StoredCardList[0].SetTargetRotation(Quaternion.identity); item.m_StoredCardList.RemoveAt(0); item.SetPriceTagCardData((CardData)null); item.SetPriceTagVisibility(false); if (item.m_CardShelf?.m_ElectronicCardListener != null) { item.m_CardShelf.m_ElectronicCardListener.UpdateCardUI((CardData)null); } removedCards[cardData] = removedCards.GetValueOrDefault(cardData) + 1; } } private void RemoveFromBinder() { //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_00b0: Unknown result type (might be due to invalid IL or missing references) foreach (CardData item in CPlayerData.m_GradedCardInventoryList.Where((CompactCardDataAmount c) => P.Contains(c.expansionType)).Select((Func)CPlayerData.GetGradedCardData).ToList()) { CPlayerData.RemoveGradedCard(item, false); removedCards[item] = removedCards.GetValueOrDefault(item) + 1; } CardExpansionLibrary cardExpansionLibrary = EplRuntimeData.Assets.CardExpansionLibrary; foreach (ECardExpansionType item2 in P) { if (!cardExpansionLibrary.CardExpansionData.TryGetValue(item2, out ModCardExpansionData value)) { continue; } foreach (KeyValuePair card in value.Cards) { card.Deconstruct(out var _, out var value2); CardData val = value2; int cardAmount = CPlayerData.GetCardAmount(val); if (cardAmount > 0) { CPlayerData.ReduceCard(val, cardAmount); removedCards[val] = removedCards.GetValueOrDefault(val) + cardAmount; } } } } private void RemoveFromBulkDonationBoxes() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) foreach (List item in CSingleton.Instance.m_BulkDonationBoxList.Select((InteractableBulkDonationBox b) => b.m_CompactCardDataAmountList)) { foreach (CompactCardDataAmount item2 in item.Where((CompactCardDataAmount c) => P.Contains(c.expansionType))) { CardData cardData = CPlayerData.GetCardData(item2.cardSaveIndex, item2.expansionType, item2.isDestiny); removedCards[cardData] = removedCards.GetValueOrDefault(cardData) + item2.amount; } item.RemoveAll((CompactCardDataAmount c) => P.Contains(c.expansionType)); } } private void RemoveFromCardStorageShelves() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) foreach (List item in CSingleton.Instance.m_CardStorageShelfList.Select((InteractableCardStorageShelf b) => b.m_CompactCardDataAmountList)) { foreach (CompactCardDataAmount item2 in item.Where((CompactCardDataAmount c) => P.Contains(c.expansionType))) { CardData cardData = CPlayerData.GetCardData(item2.cardSaveIndex, item2.expansionType, item2.isDestiny); removedCards[cardData] = removedCards.GetValueOrDefault(cardData) + item2.amount; } item.RemoveAll((CompactCardDataAmount c) => P.Contains(c.expansionType)); } } private void RemoveFromCardPackageBoxes() { List list = new List(); foreach (InteractablePackagingBox_Card spawnedPackageBox in CSingleton.Instance.m_SpawnedPackageBoxCardList) { spawnedPackageBox.m_StoredCardList.RemoveAll(delegate(InteractableCard3d i) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) CardData cardData = i.m_Card3dUI.m_CardUI.m_CardData; if (P.Contains(cardData.expansionType)) { removedCards[cardData] = removedCards.GetValueOrDefault(cardData) + 1; spawnedPackageBox.m_StoredCardDataList.Remove(cardData); ((InteractableObject)i).OnDestroyed(); return true; } return false; }); if (spawnedPackageBox.m_StoredCardList.Count == 0) { list.Add(spawnedPackageBox); } } foreach (InteractablePackagingBox_Card item in list) { CSingleton.Instance.m_SpawnedPackageBoxCardList.Remove(item); ((InteractableObject)item).OnDestroyed(); } } } internal class DecoRemovalStrategy : IAssetRemovalStrategy { [CompilerGenerated] private HashSet P; [CompilerGenerated] private string P; public DecoRemovalStrategy(HashSet decoTypes, string bundleId) { P = decoTypes; P = bundleId; base..ctor(); } public RemovalResult RemoveAssets() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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) float totalValue = 0f; int totalDecoCount = 0; foreach (EDecoObject item in P) { if (EplRuntimeData.Services.SaveDataManager.TryGetSaveData(item, out DecoSaveData data)) { totalDecoCount += data.ItemCount; totalValue += InventoryBase.GetItemDecoPurchaseData(item).price * (float)data.ItemCount; data.Reset(); } } ResetTextureSaveData((DecoFlags)3, EplRuntimeData.Assets.DecoLibrary.firstInsertedCeilingTexture, CSingleton.Instance.m_ObjectData_SO.m_CeilingDecoDataList, ref totalDecoCount, ref totalValue); ResetTextureSaveData((DecoFlags)1, EplRuntimeData.Assets.DecoLibrary.firstInsertedFloorTexture, CSingleton.Instance.m_ObjectData_SO.m_FloorDecoDataList, ref totalDecoCount, ref totalValue); ResetTextureSaveData((DecoFlags)2, EplRuntimeData.Assets.DecoLibrary.firstInsertedWallTexture, CSingleton.Instance.m_ObjectData_SO.m_WallDecoDataList, ref totalDecoCount, ref totalValue); return RemovalResult.Success(totalDecoCount, totalValue); } private void ResetTextureSaveData(DecoFlags category, int? firstInsertedIndex, List decoDataList, ref int totalDecoCount, ref float totalValue) { if (!firstInsertedIndex.HasValue) { return; } string category2 = ((object)(DecoFlags)(ref category)).ToString(); BundleAssetTracker bundleAssetTracker = EplRuntimeData.BundleAssetTracker; SaveDataService saveDataManager = EplRuntimeData.Services.SaveDataManager; for (int i = firstInsertedIndex.Value; i < decoDataList.Count; i++) { string name = decoDataList[i].name; if (!(bundleAssetTracker.GetBundleIdFor(category2, name) != P) && saveDataManager.TryGetSaveData(category2, name, out DecoSaveData data)) { totalDecoCount += data.ItemCount; totalValue += decoDataList[i].price * (float)data.ItemCount; data.Reset(); } } } } internal interface IAssetRemovalStrategy { RemovalResult RemoveAssets(); } internal class InteractableObjectRemovalStrategy : IAssetRemovalStrategy { [CompilerGenerated] private HashSet P; [CompilerGenerated] private HashSet P; private readonly Dictionary itemsToRestock; public InteractableObjectRemovalStrategy(HashSet furnitures, HashSet decos) { P = furnitures; P = decos; itemsToRestock = new Dictionary(); base..ctor(); } public RemovalResult RemoveAssets() { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) itemsToRestock.Clear(); int num = 0; float num2 = 0f; List list = (from Transform t in (IEnumerable)CSingleton.Instance.m_ShelfParentGrp select ((Component)t).GetComponent() into i where i != null && (P.Contains(i.m_ObjectType) || P.Contains(i.m_DecoObjectType)) select i).ToList(); FurnitureLibrary furnitureLibrary = EplRuntimeData.Assets.FurnitureLibrary; foreach (InteractableObject item in list) { InteractableDecoration val = (InteractableDecoration)(object)((item is InteractableDecoration) ? item : null); if (val == null) { InteractableBulkDonationBox val2 = (InteractableBulkDonationBox)(object)((item is InteractableBulkDonationBox) ? item : null); if (val2 == null) { InteractableCardStorageShelf val3 = (InteractableCardStorageShelf)(object)((item is InteractableCardStorageShelf) ? item : null); if (val3 == null) { CardShelf val4 = (CardShelf)(object)((item is CardShelf) ? item : null); if (val4 == null) { InteractableWorkbench val5 = (InteractableWorkbench)(object)((item is InteractableWorkbench) ? item : null); if (val5 == null) { Shelf val6 = (Shelf)(object)((item is Shelf) ? item : null); if (val6 == null) { WarehouseShelf val7 = (WarehouseShelf)(object)((item is WarehouseShelf) ? item : null); if (val7 != null) { EmptyWarehouseShelf(val7); num2 += furnitureLibrary.FurnitureData[((InteractableObject)val7).m_ObjectType].BaseFurniturePurchaseData.price; } else { num2 += furnitureLibrary.FurnitureData[item.m_ObjectType].BaseFurniturePurchaseData.price; } } else { EmptyShelf(val6); num2 += furnitureLibrary.FurnitureData[((InteractableObject)val6).m_ObjectType].BaseFurniturePurchaseData.price; } } else { EmptyWorkbench(val5); num2 += furnitureLibrary.FurnitureData[((InteractableObject)val5).m_ObjectType].BaseFurniturePurchaseData.price; } } else { EmptyCardShelf(val4); num2 += furnitureLibrary.FurnitureData[((InteractableObject)val4).m_ObjectType].BaseFurniturePurchaseData.price; } } else { EmptyCardStorageShelf(val3); num2 += furnitureLibrary.FurnitureData[((InteractableObject)val3).m_ObjectType].BaseFurniturePurchaseData.price; } } else { EmptyBulkDonationBox(val2); num2 += furnitureLibrary.FurnitureData[((InteractableObject)val2).m_ObjectType].BaseFurniturePurchaseData.price; } } else { num2 += InventoryBase.GetItemDecoPurchaseData(((InteractableObject)val).m_DecoObjectType).price; } if (item.m_IsBoxedUp) { ((InteractableObject)item.m_InteractablePackagingBox_Shelf).OnDestroyed(); } else { item.OnDestroyed(); } num++; } RestockItems(); return RemovalResult.Success(num, num2); } private void EmptyWarehouseShelf(WarehouseShelf warehouseShelf) { //IL_0064: 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) foreach (ShelfCompartment item in from p in warehouseShelf.m_StorageCompartmentList.SelectMany((InteractableStorageCompartment s) => s.m_ShelfCompartment.m_InteractablePackagingBoxList) select p.m_ItemCompartment) { itemsToRestock[item.m_ItemType] = itemsToRestock.GetValueOrDefault(item.m_ItemType) + item.m_StoredItemList.Count; } } private void EmptyShelf(Shelf shelf) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) foreach (ShelfCompartment itemCompartment in ((InteractableObject)shelf).m_ItemCompartmentList) { itemsToRestock[itemCompartment.m_ItemType] = itemsToRestock.GetValueOrDefault(itemCompartment.m_ItemType) + itemCompartment.m_StoredItemList.Count; } } private void EmptyWorkbench(InteractableWorkbench interactableWorkbench) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) foreach (Item storedItem in interactableWorkbench.m_StoredItemList) { itemsToRestock[storedItem.m_ItemType] = itemsToRestock.GetValueOrDefault(storedItem.m_ItemType) + 1; } } private static void EmptyCardShelf(CardShelf cardShelf) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) foreach (InteractableCardCompartment item in cardShelf.m_CardCompartmentList.Where((InteractableCardCompartment c) => c.m_StoredCardList.Count > 0)) { foreach (InteractableCardPriceTag interactablePriceTag in item.m_InteractablePriceTagList) { interactablePriceTag.SetPriceChecked(false); } CardData cardData = item.m_StoredCardList[0].m_Card3dUI.m_CardUI.m_CardData; item.m_StoredCardList[0].SetIsDisplayedOnShelf(false); item.m_StoredCardList[0].SetTargetRotation(Quaternion.identity); item.m_StoredCardList.RemoveAt(0); item.SetPriceTagCardData((CardData)null); item.SetPriceTagVisibility(false); if (item.m_CardShelf?.m_ElectronicCardListener != null) { item.m_CardShelf.m_ElectronicCardListener.UpdateCardUI((CardData)null); } CPlayerData.AddCard(cardData, 1); } } private static void EmptyCardStorageShelf(InteractableCardStorageShelf interactableCardStorageShelf) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) foreach (CompactCardDataAmount compactCardDataAmount in interactableCardStorageShelf.m_CompactCardDataAmountList) { CPlayerData.AddCard(CPlayerData.GetCardData(compactCardDataAmount.cardSaveIndex, compactCardDataAmount.expansionType, compactCardDataAmount.isDestiny), compactCardDataAmount.amount); } interactableCardStorageShelf.m_CompactCardDataAmountList.Clear(); } private static void EmptyBulkDonationBox(InteractableBulkDonationBox interactableBulkDonationBox) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) foreach (CompactCardDataAmount compactCardDataAmount in interactableBulkDonationBox.m_CompactCardDataAmountList) { CPlayerData.AddCard(CPlayerData.GetCardData(compactCardDataAmount.cardSaveIndex, compactCardDataAmount.expansionType, compactCardDataAmount.isDestiny), compactCardDataAmount.amount); } interactableBulkDonationBox.m_CompactCardDataAmountList.Clear(); } private void RestockItems() { //IL_0021: 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_0050: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair item in itemsToRestock) { item.Deconstruct(out var key, out var value); EItemType val = key; int num; int num2 = (num = value); int maxItemCountInBox = RestockManager.GetMaxItemCountInBox(val, true); int num3 = Mathf.CeilToInt((float)num2 / (float)maxItemCountInBox); for (int i = 0; i < num3; i++) { int num4 = ((num >= maxItemCountInBox) ? maxItemCountInBox : num); RestockManager.SpawnPackageBoxItem(val, num4, true); num -= num4; } } } } internal class ItemRemovalStrategy : IAssetRemovalStrategy { [CompilerGenerated] private HashSet P; private List removedItems; public ItemRemovalStrategy(HashSet items) { P = items; removedItems = new List(); base..ctor(); } public RemovalResult RemoveAssets() { removedItems = new List(); RemoveFromShelves(); RemoveFromPackagingBoxes(); float totalValue = removedItems.Select((Item i) => RestockManager.GetItemMarketPrice(i.m_ItemType)).Sum(); foreach (Item removedItem in removedItems) { CSingleton.Instance.m_ItemList.Remove(removedItem); Object.Destroy((Object)(object)removedItem); } return RemovalResult.Success(removedItems.Count, totalValue); } private void RemoveFromPackagingBoxes() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) foreach (InteractablePackagingBox_Item item in RestockManager.GetItemPackagingBoxList().ToList()) { if (!P.Contains(item.m_ItemType) && !P.Contains(item.m_ItemCompartment.m_ItemType)) { continue; } if (item.m_IsStored) { item.m_BoxStoredCompartment.RemoveBox(item); if (item.m_BoxStoredCompartment.m_ItemAmount == 0) { item.m_BoxStoredCompartment.RemoveLabel(false); } } removedItems.AddRange(item.m_ItemCompartment.m_StoredItemList); EmptyItemCompartment(item.m_ItemCompartment); ((InteractableObject)item).OnDestroyed(); } } private void RemoveFromShelves() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) foreach (ShelfCompartment item in CSingleton.Instance.m_ShelfList.SelectMany((Shelf s) => ((InteractableObject)s).m_ItemCompartmentList)) { if (P.Contains(item.m_ItemType) && item.m_ItemAmount != 0) { removedItems.AddRange(item.m_StoredItemList); EmptyItemCompartment(item); } } } private static void EmptyItemCompartment(ShelfCompartment itemCompartment) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) itemCompartment.m_StoredItemList.Clear(); itemCompartment.m_ItemAmount = 0; itemCompartment.m_ItemType = (EItemType)(-1); itemCompartment.RemoveLabel(false); } } internal class RemovalResult { internal bool IsSuccess { get; private set; } internal int AssetsRemoved { get; private set; } internal float TotalValue { get; private set; } internal string ErrorMessage { get; private set; } = string.Empty; private RemovalResult() { } internal static RemovalResult Success(int assetsRemoved, float totalValue) { return new RemovalResult { IsSuccess = true, AssetsRemoved = assetsRemoved, TotalValue = totalValue }; } internal static RemovalResult Failure(string msg) { return new RemovalResult { IsSuccess = false, ErrorMessage = msg }; } internal static RemovalResult Empty() { return new RemovalResult { IsSuccess = true }; } internal void Merge(RemovalResult other) { IsSuccess = IsSuccess && other.IsSuccess; AssetsRemoved += other.AssetsRemoved; TotalValue += other.TotalValue; } } } namespace EnhancedPrefabLoader.Core.Trading { public class CardTradeManager { private readonly CardSelectionService cardSelectionService = new CardSelectionService(); private readonly CardTradePricingService cardTradePricingService = new CardTradePricingService(); private readonly CardTradeUIManager cardTradeUIManager = new CardTradeUIManager(); public void SetCustomer(CustomerTradeCardScreen screen, Customer customer, CustomerTradeData customerTradeData) { CSingleton.Instance.m_IsPlayerTrading = true; screen.m_CurrentCustomer = customer; screen.m_HasAccepted = false; screen.m_IsTrading = customerTradeData?.m_IsTrading ?? (Random.Range(0, 100) < Math.Min(40, CPlayerData.m_ShopLevel)); screen.m_CardData_L = (CardData)((customerTradeData != null) ? ((object)customerTradeData.m_CardData_L) : ((object)cardSelectionService.SelectRandomCard())); if (screen.m_IsTrading) { SetupTradeMode(screen, customerTradeData); } else { SetupSellMode(screen, customerTradeData); } cardTradeUIManager.UpdateUI(screen); } private void SetupTradeMode(CustomerTradeCardScreen screen, CustomerTradeData customerTradeData) { screen.m_CardData_R = (CardData)((customerTradeData != null) ? ((object)customerTradeData.m_CardData_R) : ((object)cardSelectionService.SelectPlayerCard(screen.m_CardData_L, customerTradeData))); if (screen.m_CardData_R == null) { screen.m_IsTrading = false; SetupSellMode(screen, customerTradeData); } } private void SetupSellMode(CustomerTradeCardScreen screen, CustomerTradeData customerTradeData) { cardTradePricingService.CalculateAskingPrice(screen, screen.m_CardData_L, customerTradeData); if (customerTradeData != null) { screen.m_PriceSet = customerTradeData.m_PriceSet; screen.m_LastPriceSet = customerTradeData.m_LastPriceSet; } else { screen.OnInputTextUpdated("0"); } } } public class CardTradePricingService { private static readonly (float threshold, float minBonus, float maxBonus)[] PriceTiers = new(float, float, float)[9] { (10f, 0f, 0.03f), (20f, 0f, 0.04f), (100f, 0.01f, 0.05f), (300f, 0.01f, 0.06f), (500f, 0.01f, 0.08f), (1000f, 0.01f, 0.1f), (2000f, 0.02f, 0.11f), (5000f, 0.03f, 0.12f), (8000f, 0.03f, 0.12f) }; public void CalculateAskingPrice(CustomerTradeCardScreen screen, CardData customerCard, CustomerTradeData customerTradeData) { screen.m_SellCardMarketPrice = CPlayerData.GetCardMarketPrice(customerCard); if (customerTradeData != null) { screen.m_SellCardAskPrice = customerTradeData.m_SellCardAskPrice; screen.m_MaxDeclineCount = customerTradeData.m_MaxDeclineCount; screen.m_DeclineCount = customerTradeData.m_DeclineCount; } else { screen.m_SellCardAskPrice = CalculateInitialAskingPrice(screen.m_SellCardMarketPrice); screen.m_MaxDeclineCount = Random.Range(0, 5); screen.m_DeclineCount = 0; } } private float CalculateInitialAskingPrice(float marketPrice) { float num = Random.Range(0.7f, 1.2f); (float, float, float)[] priceTiers = PriceTiers; for (int i = 0; i < priceTiers.Length; i++) { (float, float, float) tuple = priceTiers[i]; if (marketPrice > tuple.Item1) { num += Random.Range(tuple.Item2, tuple.Item3); } } return num * marketPrice; } } public class CardTradeUIManager { public void UpdateUI(CustomerTradeCardScreen screen) { SetTradingScreenText(screen); UpdateScreenGrpVisibility(screen); SetPriceTexts(screen); UpdateCardDisplays(screen); UpdateButtonVisibility(screen); } private void SetTradingScreenText(CustomerTradeCardScreen screen) { List list = (screen.m_IsTrading ? screen.m_CustomerTradeCardTextList : screen.m_CustomerSellCardTextList); ((TMP_Text)screen.m_CustomerTopText).text = LocalizationManager.GetTranslation("CustomerTrade/" + list[Random.Range(0, list.Count)], true, 0, true, false, (GameObject)null, (string)null, true); screen.m_CustomerTopTextAnim.Rewind(); screen.m_CustomerTopTextAnim.Play(); } private void UpdateScreenGrpVisibility(CustomerTradeCardScreen screen) { screen.m_CustomerTradingText.SetActive(screen.m_IsTrading); screen.m_CustomerSellingText.SetActive(!screen.m_IsTrading); screen.m_TradeGrp_R.SetActive(screen.m_IsTrading); screen.m_SellGrp_R.SetActive(!screen.m_IsTrading); } private void SetPriceTexts(CustomerTradeCardScreen screen) { string translation = LocalizationManager.GetTranslation("Market Price", true, 0, true, false, (GameObject)null, (string)null, true); string priceString = GameInstance.GetPriceString(CPlayerData.GetCardMarketPrice(screen.m_CardData_L), false, true, false, "F2"); string translation2 = LocalizationManager.GetTranslation("Ask Price", true, 0, true, false, (GameObject)null, (string)null, true); string priceString2 = GameInstance.GetPriceString(screen.m_SellCardAskPrice, false, true, false, "F2"); if (screen.m_IsTrading) { ((TMP_Text)screen.m_MarketPrice_L).text = translation + " : " + priceString; return; } ((TMP_Text)screen.m_MarketPrice_L).text = translation2 + " : " + priceString2 + "\n" + translation + " : " + priceString; screen.m_CardUI_Buying.SetCardUI(screen.m_CardData_L); } private void UpdateButtonVisibility(CustomerTradeCardScreen screen) { screen.m_AcceptBtn.SetActive(true); screen.m_CancelBtn.SetActive(true); screen.m_LetMeThinkBtn.SetActive(true); screen.m_DoneBtn.SetActive(false); } private void UpdateCardDisplays(CustomerTradeCardScreen screen) { screen.m_IsNewUI.SetActive(CPlayerData.GetCardAmount(screen.m_CardData_L) == 0); screen.m_CardUI_L.SetCardUI(screen.m_CardData_L); screen.m_CardUI_Album_L.SetCardUI(screen.m_CardData_L); ((TMP_Text)screen.m_AlbumCardCount_L).text = GetCardCountText(screen.m_CardData_L); if (screen.m_IsTrading && screen.m_CardData_R != null) { screen.m_CardUI_R.SetCardUI(screen.m_CardData_R); screen.m_CardUI_Album.SetCardUI(screen.m_CardData_R); ((TMP_Text)screen.m_AlbumCardCount).text = GetCardCountText(screen.m_CardData_R); float cardMarketPrice = CPlayerData.GetCardMarketPrice(screen.m_CardData_R); string translation = LocalizationManager.GetTranslation("Market Price", true, 0, true, false, (GameObject)null, (string)null, true); ((TMP_Text)screen.m_MarketPrice_R).text = translation + " : " + GameInstance.GetPriceString(cardMarketPrice, false, true, false, "F2"); } } private string GetCardCountText(CardData card) { if (card.cardGrade <= 0) { return "X" + CPlayerData.GetCardAmount(card); } if (!CPlayerData.HasGradedCardInAlbum(card)) { return "X0"; } return "X1"; } } } namespace EnhancedPrefabLoader.Core.TODO { public static class Globals { public static class CardUI { public static readonly HashSet TransformsToCache = new HashSet { "MonsterMask", "CenterFrameMask", "Image", "CardBG", "DescriptionText", "PlayEffectText", "PlayEffectBG", "EvoText", "EvoPreviousStageIcon", "EvoNameText", "EvoBasicIcon", "EvoBorder", "CompanyText", "ArtistText", "StatGrp", "EvoBG", "StatText_1", "StatText_2", "StatText_3", "StatText_4", "NameTextGrp", "NumberTextGrp", "FirstEditionTextGrp", "CardBorder", "FoilGrp", "GlowMask", "CameraFoilShine (1)", "CameraFoilShine_Glitter", "RarityImage", "RarityText", "FirstEditionText", "NumberText", "NameText", "EvoBasicText", "CardFront" }; public const string CardMask = "CardMask"; } public static class Config { public static class UI { public static class CollectionBinder { public const string Category = "CollectionBinderUI"; } public const string Category = "UI"; public const string ExpansionSpacingX = "ExpansionSpacingX"; public const string ExpansionSpacingY = "ExpansionSpacingY"; public const string ExpansionButtonSize = "ExpansionButtonSize"; public const string RarityButtonSize = "RarityButtonSize"; public const string RaritySpacingX = "RaritySpacingX"; public const string RaritySpacingY = "RaritySpacingY"; } public static class GamePlay { public const string Category = "GamePlay"; public const string UseCustomExpForBase = "UseCustomExpForBase"; } } public static class CacheKeys { public const string ModID = "ModID"; public const string ModdedCardUI = "ModdedCardUI"; public const string CardBacks = "CardBacks"; public const string OriginalCardBack = "OriginalCardBack"; public const string TransformStateCache = "TransformStateCache"; } public static class DirectoryPatterns { public static readonly string SaveDirectory = Application.persistentDataPath + "/PrefabLoader"; public const string PrefabLoader = "*_prefabloader"; public const string FilePrefix = "file:///"; } public static class Materials { public const string ColorProperty = "_Color"; public static readonly Color DefaultColor = new Color(0.885f, 0.885f, 0.885f, 1f); } } } namespace EnhancedPrefabLoader.Core.Shops { internal class CustomShopScreen : RestockItemScreen, ICustomShopScreen { private TextMeshProUGUI? pageUrl; private Image? pageLogo; private Image? pageHeader; private Image? pageBackground; private Color originalHeaderColor; private Color originalBackgroundColor; private string displayName = string.Empty; private readonly List pageUrls = new List(3) { "cards", "accessories", "figurines" }; private List> pageItems = new List>(); private int currentPageIndex; public override void Awake() { //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Expected O, but got Unknown //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Expected O, but got Unknown //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Expected O, but got Unknown //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Expected O, but got Unknown //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Expected O, but got Unknown //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Expected O, but got Unknown //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Expected O, but got Unknown //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Expected O, but got Unknown //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Expected O, but got Unknown //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Expected O, but got Unknown //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Expected O, but got Unknown //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Expected O, but got Unknown //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Expected O, but got Unknown //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Expected O, but got Unknown //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0426: Expected O, but got Unknown //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Expected O, but got Unknown ((UIScreenBase)this).m_ScreenGroup = ((Component)((Component)this).transform.Find("ScreenGrp")).gameObject; ref RectTransform animGrp = ref ((GenericSliderScreen)this).m_AnimGrp; Transform obj = ((UIScreenBase)this).m_ScreenGroup.transform.Find("AnimGrp"); animGrp = (RectTransform)(object)((obj is RectTransform) ? obj : null); ((GenericSliderScreen)this).m_VerticalLayoutGrp = ((Transform)((GenericSliderScreen)this).m_AnimGrp).Find("WebsiteContent_Grp/ScrollerGrp"); ((GenericSliderScreen)this).m_VerticalLayout = ((Component)((GenericSliderScreen)this).m_VerticalLayoutGrp).GetComponent(); ((GenericSliderScreen)this).m_SliderGrp = ((Component)((GenericSliderScreen)this).m_VerticalLayoutGrp).gameObject; ((GenericSliderScreen)this).m_ScrollEndComparer = ((Component)((Transform)((GenericSliderScreen)this).m_AnimGrp).Find("ScrollEndComparer")).gameObject; ((GenericSliderScreen)this).m_ScrollEndPos = ((Component)((Transform)((GenericSliderScreen)this).m_AnimGrp).Find("ScrollEnd")).gameObject; Transform obj2 = ((Component)this).transform.parent.Find("RestockItemAddToCartScreen"); base.m_RestockItemAddToCartScreen = ((obj2 != null) ? ((Component)obj2).GetComponent() : null); Transform obj3 = ((Component)this).transform.parent.Find("RestockItemCheckoutScreen"); base.m_RestockItemCheckoutScreen = ((obj3 != null) ? ((Component)obj3).GetComponent() : null); base.m_SortUIScreen = ((Component)((Transform)((GenericSliderScreen)this).m_AnimGrp).Find("SortingUIScreen")).GetComponent(); base.m_RestockItemPanelUIList = new List(); base.m_PageButtonHighlightList = new List(4) { ((Component)((Transform)((GenericSliderScreen)this).m_AnimGrp).Find("WebsiteTopBar/PackBtn/AnimGrp/BGBarGrp/BGBlack")).gameObject, ((Component)((Transform)((GenericSliderScreen)this).m_AnimGrp).Find("WebsiteTopBar/AccessoriesBtn/AnimGrp/BGBarGrp/BGBlack")).gameObject, ((Component)((Transform)((GenericSliderScreen)this).m_AnimGrp).Find("WebsiteTopBar/FigurineBtn/AnimGrp/BGBarGrp/BGBlack")).gameObject, ((Component)((Transform)((GenericSliderScreen)this).m_AnimGrp).Find("WebsiteTopBar/AllBtn/AnimGrp/BGBarGrp/BGBlack")).gameObject }; base.m_SortBtnList = (from Transform t in (IEnumerable)((Component)base.m_SortUIScreen).transform.Find("Screen_Grp/AnimGrp/Mask/UIGroup") select ((Component)t).GetComponent()).ToList(); Transform val = ((Transform)((GenericSliderScreen)this).m_AnimGrp).Find("WebsiteTopBar"); Transform obj4 = val.Find("TotalPriceBG/TotalPrice"); base.m_TotalCostText = ((obj4 != null) ? ((Component)obj4).GetComponent() : null); base.m_CartNotification = ((Component)val.Find("NotificationGrp")).gameObject; Transform obj5 = base.m_CartNotification.transform.Find("NotificationText"); base.m_TotalCartItemCountText = ((obj5 != null) ? ((Component)obj5).GetComponent() : null); Button component = ((Component)val.Find("CheckoutBtn/BtnRaycast")).GetComponent