Decompiled source of Seasonality v3.4.8
Seasonality.dll
Decompiled 2 weeks 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.Concurrent; using System.Collections.Generic; using System.Collections.ObjectModel; using System.ComponentModel; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.IO.Compression; using System.Linq; using System.Linq.Expressions; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Serialization; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using Seasonality.Behaviors; using Seasonality.DataTypes; using Seasonality.Helpers; using Seasonality.Managers; using Seasonality.Seasons; using Seasonality.Textures; using ServerSync; using TMPro; using UnityEngine; using UnityEngine.UI; using YamlDotNet.Core; using YamlDotNet.Core.Events; using YamlDotNet.Core.Tokens; using YamlDotNet.Helpers; using YamlDotNet.Serialization; using YamlDotNet.Serialization.BufferedDeserialization; using YamlDotNet.Serialization.BufferedDeserialization.TypeDiscriminators; using YamlDotNet.Serialization.Callbacks; using YamlDotNet.Serialization.Converters; using YamlDotNet.Serialization.EventEmitters; using YamlDotNet.Serialization.NamingConventions; using YamlDotNet.Serialization.NodeDeserializers; using YamlDotNet.Serialization.NodeTypeResolvers; using YamlDotNet.Serialization.ObjectFactories; using YamlDotNet.Serialization.ObjectGraphTraversalStrategies; using YamlDotNet.Serialization.ObjectGraphVisitors; using YamlDotNet.Serialization.Schemas; using YamlDotNet.Serialization.TypeInspectors; using YamlDotNet.Serialization.TypeResolvers; using YamlDotNet.Serialization.Utilities; using YamlDotNet.Serialization.ValueDeserializers; [assembly: AssemblyFileVersion("3.4.8")] [assembly: Guid("E0E2F92E-557C-4A05-9D89-AA92A0BD75C4")] [assembly: ComVisible(false)] [assembly: AssemblyTrademark("")] [assembly: AssemblyCopyright("Copyright © 2022")] [assembly: AssemblyProduct("Seasonality")] [assembly: AssemblyCompany("RustyMods")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyDescription("")] [assembly: AssemblyTitle("Seasonality")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("3.4.8.0")] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [<93c32149-e18f-4594-ab3d-90a4e08aa318>Embedded] internal sealed class <93c32149-e18f-4594-ab3d-90a4e08aa318>EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [<93c32149-e18f-4594-ab3d-90a4e08aa318>Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class <df619281-0965-447f-950e-d7d6b4f32a5c>NullableAttribute : Attribute { public readonly byte[] NullableFlags; public <df619281-0965-447f-950e-d7d6b4f32a5c>NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public <df619281-0965-447f-950e-d7d6b4f32a5c>NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [<93c32149-e18f-4594-ab3d-90a4e08aa318>Embedded] [CompilerGenerated] internal sealed class <3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContextAttribute : Attribute { public readonly byte Flag; public <3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace Seasonality { [BepInPlugin("RustyMods.Seasonality", "Seasonality", "3.4.8")] [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(0)] [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(1)] public class SeasonalityPlugin : BaseUnityPlugin { [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] public enum Toggle { On = 1, Off = 0 } [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] public enum Season { Spring, Summer, Fall, Winter } [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] public class ConfigurationManagerAttributes { [UsedImplicitly] public int? Order = null; [UsedImplicitly] public bool? Browsable = null; [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] [UsedImplicitly] public string Category = null; [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 2, 1 })] [UsedImplicitly] public Action<ConfigEntryBase> CustomDrawer = null; } internal const string ModName = "Seasonality"; internal const string ModVersion = "3.4.8"; internal const string Author = "RustyMods"; private const string ModGUID = "RustyMods.Seasonality"; private static readonly string ConfigFileName = "RustyMods.Seasonality.cfg"; private static readonly string ConfigFileFullPath; internal static string ConnectionError; private readonly Harmony _harmony = new Harmony("RustyMods.Seasonality"); public static readonly ManualLogSource SeasonalityLogger; public static readonly ConfigSync ConfigSync; public static SeasonalityPlugin _plugin; private static AssetBundle Assets; public static Material FrozenWaterMat; public void Awake() { _plugin = this; TextureManager.ReadCustomTextures(); Assets = GetAssetBundle("snowmaterialbundle"); FrozenWaterMat = Assets.LoadAsset<Material>("BallSnow04"); Configurations.Init(); Localizer.Load(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); _harmony.PatchAll(executingAssembly); SetupWatcher(); } public void Update() { float deltaTime = Time.deltaTime; SeasonTimer.CheckSeasonTransition(deltaTime); SeasonManager.UpdateSeasonEffects(deltaTime); MaterialReplacer.UpdateInAshlands(deltaTime); } private void OnDestroy() { ((BaseUnityPlugin)this).Config.Save(); } private static AssetBundle GetAssetBundle(string fileName) { Assembly executingAssembly = Assembly.GetExecutingAssembly(); string name = executingAssembly.GetManifestResourceNames().Single([<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] (string str) => str.EndsWith(fileName)); using Stream stream = executingAssembly.GetManifestResourceStream(name); return AssetBundle.LoadFromStream(stream); } private void SetupWatcher() { FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, ConfigFileName); fileSystemWatcher.Changed += ReadConfigValues; fileSystemWatcher.Created += ReadConfigValues; fileSystemWatcher.Renamed += ReadConfigValues; fileSystemWatcher.IncludeSubdirectories = true; fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject; fileSystemWatcher.EnableRaisingEvents = true; } private void ReadConfigValues(object sender, FileSystemEventArgs e) { if (!File.Exists(ConfigFileFullPath)) { return; } try { SeasonalityLogger.LogDebug((object)"ReadConfigValues called"); ((BaseUnityPlugin)this).Config.Reload(); } catch { SeasonalityLogger.LogError((object)("There was an issue loading your " + ConfigFileName)); SeasonalityLogger.LogError((object)"Please check your config entries for spelling and format!"); } } public ConfigEntry<T> config<[<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] T>(string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown ConfigDescription val = new ConfigDescription(description.Description + (synchronizedSetting ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags); ConfigEntry<T> val2 = ((BaseUnityPlugin)this).Config.Bind<T>(group, name, value, val); SyncedConfigEntry<T> syncedConfigEntry = ConfigSync.AddConfigEntry<T>(val2); syncedConfigEntry.SynchronizedConfig = synchronizedSetting; return val2; } public ConfigEntry<T> config<[<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] T>(string group, string name, T value, string description, bool synchronizedSetting = true) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown return config(group, name, value, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting); } static SeasonalityPlugin() { string configPath = Paths.ConfigPath; char directorySeparatorChar = Path.DirectorySeparatorChar; ConfigFileFullPath = configPath + directorySeparatorChar + ConfigFileName; ConnectionError = ""; SeasonalityLogger = Logger.CreateLogSource("Seasonality"); ConfigSync = new ConfigSync("RustyMods.Seasonality") { DisplayName = "Seasonality", CurrentVersion = "3.4.8", MinimumRequiredVersion = "3.4.8" }; _plugin = null; Assets = null; FrozenWaterMat = null; } } [HarmonyPatch(typeof(ZNet), "OnNewConnection")] public static class RegisterAndCheckVersion { [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(1)] private static void Prefix(ZNetPeer peer, ref ZNet __instance) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown SeasonalityPlugin.SeasonalityLogger.LogDebug((object)"Registering version RPC handler"); peer.m_rpc.Register<ZPackage>("Seasonality_VersionCheck", (Action<ZRpc, ZPackage>)RpcHandlers.RPC_Seasonality_Version); SeasonalityPlugin.SeasonalityLogger.LogInfo((object)"Invoking version check"); ZPackage val = new ZPackage(); val.Write("3.4.8"); val.Write(RpcHandlers.ComputeHashForMod().Replace("-", "")); peer.m_rpc.Invoke("Seasonality_VersionCheck", new object[1] { val }); } } [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(1)] [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(0)] [HarmonyPatch(typeof(ZNet), "RPC_PeerInfo")] public static class VerifyClient { private static bool Prefix(ZRpc rpc, ZPackage pkg, ref ZNet __instance) { if (!__instance.IsServer() || RpcHandlers.ValidatedPeers.Contains(rpc)) { return true; } return true; } private static void Postfix(ZNet __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown ZRoutedRpc.instance.InvokeRoutedRPC(ZRoutedRpc.instance.GetServerPeerID(), "SeasonalityRequestAdminSync", new object[1] { (object)new ZPackage() }); } } [HarmonyPatch(typeof(FejdStartup), "ShowConnectError")] public class ShowConnectionError { [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(1)] private static void Postfix(FejdStartup __instance) { if (__instance.m_connectionFailedPanel.activeSelf) { __instance.m_connectionFailedError.fontSizeMax = 25f; __instance.m_connectionFailedError.fontSizeMin = 15f; TMP_Text connectionFailedError = __instance.m_connectionFailedError; connectionFailedError.text = connectionFailedError.text + "\n" + SeasonalityPlugin.ConnectionError; } } } [HarmonyPatch(typeof(ZNet), "Disconnect")] public static class RemoveDisconnectedPeerFromVerified { [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(1)] private static void Prefix(ZNetPeer peer, ref ZNet __instance) { if (__instance.IsServer()) { SeasonalityPlugin.SeasonalityLogger.LogInfo((object)("Peer (" + peer.m_rpc.m_socket.GetHostName() + ") disconnected, removing from validated list")); RpcHandlers.ValidatedPeers.Remove(peer.m_rpc); } } } [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(0)] [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(1)] public static class RpcHandlers { public static readonly List<ZRpc> ValidatedPeers = new List<ZRpc>(); public static void RPC_Seasonality_Version(ZRpc rpc, ZPackage pkg) { string text = pkg.ReadString(); string text2 = pkg.ReadString(); string text3 = ComputeHashForMod().Replace("-", ""); SeasonalityPlugin.SeasonalityLogger.LogInfo((object)("Version check, local: 3.4.8, remote: " + text)); if (text2 != text3 || text != "3.4.8") { SeasonalityPlugin.ConnectionError = "Seasonality Installed: 3.4.8 " + text3 + "\n Needed: " + text + " " + text2; if (ZNet.instance.IsServer()) { SeasonalityPlugin.SeasonalityLogger.LogWarning((object)("Peer (" + rpc.m_socket.GetHostName() + ") has incompatible version")); } } else if (!ZNet.instance.IsServer()) { SeasonalityPlugin.SeasonalityLogger.LogInfo((object)"Received same version from server!"); SeasonTimer.ValidServer = true; } else { SeasonalityPlugin.SeasonalityLogger.LogInfo((object)("Adding peer (" + rpc.m_socket.GetHostName() + ") to validated list")); ValidatedPeers.Add(rpc); } } public static string ComputeHashForMod() { using SHA256 sHA = SHA256.Create(); byte[] array = sHA.ComputeHash(File.ReadAllBytes(Assembly.GetExecutingAssembly().Location)); StringBuilder stringBuilder = new StringBuilder(); byte[] array2 = array; foreach (byte b in array2) { stringBuilder.Append(b.ToString("X2")); } return stringBuilder.ToString(); } } } namespace Seasonality.Textures { public static class Directories { public enum PickableDirectories { None, Mushroom, MushroomYellow, MushroomBlue, JotunPuff, Magecap, Raspberry, Blueberry, Dandelion, Barley, Flax, Carrot, Turnip, Onion, CarrotSeed, TurnipSeed, OnionSeed, Branches, Flint, Rock, BoneRemains, SurtlingCore, BlackCore, Thistle } public enum VegDirectories { Beech, BeechSmall, Birch, Bushes, Oak, Pine, PineParticles, FirSmall, FirDead, FirDeadParticles, Fir, FirParticles, YggaShoot, SwampTrees, PlainsBush, Shrub, ShrubParticles, Rock, MeadowGrass, MeadowGrassShort, PlainsGrass, BlackForestGrass, BlackForestGrassAlt, SwampGrass, MistlandsGrass, PlainsFlowers, Ormbunke, Vass, Vines, WaterLilies, RockPlant, Clutter, CloudberryBush, YggdrasilSkyTree, None } public enum PieceDirectories { None, Straw, DarkWood, GoblinVillage } public enum CreatureDirectories { None, Gull, Serpent, Deer, Boar, Piggy, Neck, Greydwarf, GreydwarfShaman, Troll, Skeleton, Leech, Wraith, Blob, Oozer, Wolf, WolfCub, Lox, LoxCalf, Deathsquito, Goblin, GoblinBrute, GoblinShaman, Hare, Seeker, SeekerSoldier, SeekerBrood, Gjall, Tick } public enum ArmorDirectories { None, Rags, Leather, Troll, Bronze, Iron, Wolf, Padded, Carapace, Mage } } [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(1)] [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(0)] public static class HDConfigurations { [Serializable] [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(0)] public class HDConfiguration { public TextureSettings defaultSettings = new TextureSettings { TextureFormat = (TextureFormat)12, TextureFilter = (FilterMode)2 }; public TextureSettings GrassSettings = new TextureSettings { TextureFormat = (TextureFormat)10, TextureFilter = (FilterMode)0 }; public TextureSettings CreatureSettings = new TextureSettings { TextureFormat = (TextureFormat)25, TextureFilter = (FilterMode)0 }; public TextureSettings PieceSettings = new TextureSettings { TextureFormat = (TextureFormat)25, TextureFilter = (FilterMode)0 }; public TextureSettings PickableSettings = new TextureSettings { TextureFormat = (TextureFormat)25, TextureFilter = (FilterMode)0 }; public TextureSettings ArmorSettings = new TextureSettings { TextureFormat = (TextureFormat)25, TextureFilter = (FilterMode)0 }; } [Serializable] [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] public class TextureSettings { public TextureFormat TextureFormat; public FilterMode TextureFilter; } private static readonly string SeasonalityFolderPath; private static readonly string HDConfigFilePath; public static HDConfiguration HdConfigurations; public static void InitHDConfigurations() { if (!File.Exists(HDConfigFilePath)) { ISerializer serializer = new SerializerBuilder().Build(); string contents = serializer.Serialize(new HDConfiguration()); File.WriteAllText(HDConfigFilePath, contents); } ReadHDConfigs(); } private static void ReadHDConfigs() { IDeserializer deserializer = new DeserializerBuilder().Build(); HDConfiguration hdConfigurations = deserializer.Deserialize<HDConfiguration>(File.ReadAllText(HDConfigFilePath)); HdConfigurations = hdConfigurations; } static HDConfigurations() { string configPath = Paths.ConfigPath; char directorySeparatorChar = Path.DirectorySeparatorChar; SeasonalityFolderPath = configPath + directorySeparatorChar + "Seasonality"; string seasonalityFolderPath = SeasonalityFolderPath; directorySeparatorChar = Path.DirectorySeparatorChar; HDConfigFilePath = seasonalityFolderPath + directorySeparatorChar + "HDConfiguration.yml"; HdConfigurations = new HDConfiguration(); } } [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(2)] [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(0)] public static class SpriteManager { public static readonly Sprite ValknutIcon = RegisterSprite("valknutIcon.png"); public static readonly Sprite SpringIcon = RegisterSprite("spring_icon.png"); public static readonly Sprite SummerIcon = RegisterSprite("summer_icon.png"); public static readonly Sprite FallIcon = RegisterSprite("fall_icon.png"); public static readonly Sprite WinterIcon = RegisterSprite("winter_icon.png"); [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(1)] [return: <df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] private static Sprite RegisterSprite(string fileName, string folderName = "icons") { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_007e: 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) Assembly executingAssembly = Assembly.GetExecutingAssembly(); string name = "Seasonality." + folderName + "." + fileName; using Stream stream = executingAssembly.GetManifestResourceStream(name); if (stream == null) { return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2); Sprite val2 = (ImageConversion.LoadImage(val, array) ? Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), Vector2.zero) : null); if ((Object)(object)val2 != (Object)null) { ((Object)val2).name = fileName; } return val2; } } [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(0)] [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(1)] public static class TextureManager { public static bool HDPackLoaded; [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] public static readonly Texture Pillar_Snow = RegisterTexture("pillar_snow_d2.png"); [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 1, 2 })] public static readonly Dictionary<Directories.VegDirectories, Dictionary<string, Texture>> CustomRegisteredTextures = new Dictionary<Directories.VegDirectories, Dictionary<string, Texture>>(); [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 1, 2 })] public static readonly Dictionary<Directories.CreatureDirectories, Dictionary<string, Texture>> CustomRegisteredCreatureTex = new Dictionary<Directories.CreatureDirectories, Dictionary<string, Texture>>(); [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 1, 2 })] public static readonly Dictionary<Directories.PieceDirectories, Dictionary<string, Texture>> CustomRegisteredPieceTextures = new Dictionary<Directories.PieceDirectories, Dictionary<string, Texture>>(); [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 1, 2 })] public static readonly Dictionary<Directories.PickableDirectories, Dictionary<string, Texture>> CustomRegisteredPickableTex = new Dictionary<Directories.PickableDirectories, Dictionary<string, Texture>>(); [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 1, 2 })] public static readonly Dictionary<Directories.ArmorDirectories, Dictionary<string, Texture>> CustomRegisteredArmorTex = new Dictionary<Directories.ArmorDirectories, Dictionary<string, Texture>>(); [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 1, 1, 1, 1, 2 })] public static readonly Dictionary<string, Dictionary<string, Dictionary<string, Texture>>> RegisteredCustomTextures = new Dictionary<string, Dictionary<string, Dictionary<string, Texture>>>(); [return: <df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] private static Texture RegisterTexture(string fileName, string folderName = "assets") { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown Assembly executingAssembly = Assembly.GetExecutingAssembly(); string name = "Seasonality." + folderName + "." + fileName; using Stream stream = executingAssembly.GetManifestResourceStream(name); if (stream == null) { return null; } byte[] array = new byte[stream.Length]; stream.Read(array, 0, array.Length); Texture2D val = new Texture2D(2, 2); ((Object)val).name = fileName.Replace(".png", string.Empty); return (Texture)(object)(ImageConversion.LoadImage(val, array) ? val : null); } [return: <df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] private static Texture RegisterCustomTexture(string filePath, TextureFormat format, FilterMode filter, int aniso = 1, int mipMapBias = 0, TextureWrapMode wrap = 0, bool isBark = false) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (!File.Exists(filePath)) { return null; } byte[] array = File.ReadAllBytes(filePath); Texture2D val = new Texture2D(4, 4, format, true, false) { filterMode = filter }; if (isBark) { ((Texture)val).anisoLevel = aniso; ((Texture)val).mipMapBias = mipMapBias; ((Texture)val).wrapMode = wrap; } if (ImageConversion.LoadImage(val, array)) { ((Object)val).name = filePath; return (Texture)(object)val; } return null; } private static void ReadVegDirectories() { //IL_00ba: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got I4 //IL_00bf->IL00bf: Incompatible stack types: O vs I4 //IL_00b0->IL00bf: Incompatible stack types: I4 vs O //IL_00b0->IL00bf: Incompatible stack types: O vs I4 foreach (Directories.VegDirectories value in Enum.GetValues(typeof(Directories.VegDirectories))) { if (value == Directories.VegDirectories.None) { continue; } string text = value.ToString(); string vegTexturePath = SeasonPaths.VegTexturePath; char directorySeparatorChar = Path.DirectorySeparatorChar; if (!Directory.Exists(vegTexturePath + directorySeparatorChar + text)) { string vegTexturePath2 = SeasonPaths.VegTexturePath; directorySeparatorChar = Path.DirectorySeparatorChar; Directory.CreateDirectory(vegTexturePath2 + directorySeparatorChar + text); } Directories.VegDirectories vegDirectories2 = value; Directories.VegDirectories vegDirectories3 = vegDirectories2; if ((uint)(vegDirectories3 - 20) <= 3u) { object obj = text; obj = SeasonPaths.VegTexturePath; int num; if (HDPackLoaded) { obj = HDConfigurations.HdConfigurations.GrassSettings.TextureFormat; num = (int)obj; } else { num = 10; obj = num; num = (int)obj; } num = (HDPackLoaded ? ((int)HDConfigurations.HdConfigurations.GrassSettings.TextureFilter) : 0); Dictionary<string, Texture> customTextures = GetCustomTextures((string)num, (string)obj, (TextureFormat)obj, (FilterMode)num); if (customTextures.Count != 0) { CustomRegisteredTextures.Add(value, customTextures); } } else { Dictionary<string, Texture> dictionary = (HDPackLoaded ? GetCustomTextures(text, SeasonPaths.VegTexturePath, HDConfigurations.HdConfigurations.defaultSettings.TextureFormat, HDConfigurations.HdConfigurations.defaultSettings.TextureFilter) : GetCustomTextures(text, SeasonPaths.VegTexturePath, (TextureFormat)12, (FilterMode)2)); if (dictionary.Count != 0) { CustomRegisteredTextures.Add(value, dictionary); } } } } private static void ReadCreatureDirectories() { //IL_00b5: 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) foreach (Directories.CreatureDirectories value in Enum.GetValues(typeof(Directories.CreatureDirectories))) { if (value != 0) { string text = value.ToString(); string creatureTexPath = SeasonPaths.creatureTexPath; char directorySeparatorChar = Path.DirectorySeparatorChar; if (!Directory.Exists(creatureTexPath + directorySeparatorChar + text)) { string creatureTexPath2 = SeasonPaths.creatureTexPath; directorySeparatorChar = Path.DirectorySeparatorChar; Directory.CreateDirectory(creatureTexPath2 + directorySeparatorChar + text); } Dictionary<string, Texture> dictionary = (HDPackLoaded ? GetCustomTextures(text, SeasonPaths.creatureTexPath, HDConfigurations.HdConfigurations.CreatureSettings.TextureFormat, HDConfigurations.HdConfigurations.CreatureSettings.TextureFilter) : GetCustomTextures(text, SeasonPaths.creatureTexPath, (TextureFormat)25, (FilterMode)0)); if (dictionary.Count != 0) { CustomRegisteredCreatureTex.Add(value, dictionary); } } } } private static void ReadPieceDirectories() { //IL_00b5: 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) foreach (Directories.PieceDirectories value in Enum.GetValues(typeof(Directories.PieceDirectories))) { if (value != 0) { string text = value.ToString(); string pieceTexPath = SeasonPaths.PieceTexPath; char directorySeparatorChar = Path.DirectorySeparatorChar; if (!Directory.Exists(pieceTexPath + directorySeparatorChar + text)) { string pieceTexPath2 = SeasonPaths.PieceTexPath; directorySeparatorChar = Path.DirectorySeparatorChar; Directory.CreateDirectory(pieceTexPath2 + directorySeparatorChar + text); } Dictionary<string, Texture> dictionary = (HDPackLoaded ? GetCustomTextures(text, SeasonPaths.PieceTexPath, HDConfigurations.HdConfigurations.PieceSettings.TextureFormat, HDConfigurations.HdConfigurations.PieceSettings.TextureFilter) : GetCustomTextures(text, SeasonPaths.PieceTexPath, (TextureFormat)25, (FilterMode)0)); if (dictionary.Count != 0) { CustomRegisteredPieceTextures.Add(value, dictionary); } } } } private static void ReadPickableDirectories() { //IL_00b5: 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) foreach (Directories.PickableDirectories value in Enum.GetValues(typeof(Directories.PickableDirectories))) { if (value != 0) { string text = value.ToString(); string pickableTexturePath = SeasonPaths.PickableTexturePath; char directorySeparatorChar = Path.DirectorySeparatorChar; if (!Directory.Exists(pickableTexturePath + directorySeparatorChar + text)) { string pickableTexturePath2 = SeasonPaths.PickableTexturePath; directorySeparatorChar = Path.DirectorySeparatorChar; Directory.CreateDirectory(pickableTexturePath2 + directorySeparatorChar + text); } Dictionary<string, Texture> dictionary = (HDPackLoaded ? GetCustomTextures(text, SeasonPaths.PickableTexturePath, HDConfigurations.HdConfigurations.PickableSettings.TextureFormat, HDConfigurations.HdConfigurations.PickableSettings.TextureFilter) : GetCustomTextures(text, SeasonPaths.PickableTexturePath, (TextureFormat)25, (FilterMode)0)); if (dictionary.Count != 0) { CustomRegisteredPickableTex.Add(value, dictionary); } } } } private static void ReadArmorDirectories() { //IL_00b5: 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) foreach (Directories.ArmorDirectories value in Enum.GetValues(typeof(Directories.ArmorDirectories))) { if (value != 0) { string text = value.ToString(); string armorTexPath = SeasonPaths.ArmorTexPath; char directorySeparatorChar = Path.DirectorySeparatorChar; if (!Directory.Exists(armorTexPath + directorySeparatorChar + text)) { string armorTexPath2 = SeasonPaths.ArmorTexPath; directorySeparatorChar = Path.DirectorySeparatorChar; Directory.CreateDirectory(armorTexPath2 + directorySeparatorChar + text); } Dictionary<string, Texture> dictionary = (HDPackLoaded ? GetCustomTextures(text, SeasonPaths.ArmorTexPath, HDConfigurations.HdConfigurations.ArmorSettings.TextureFormat, HDConfigurations.HdConfigurations.ArmorSettings.TextureFilter) : GetCustomTextures(text, SeasonPaths.ArmorTexPath, (TextureFormat)25, (FilterMode)0)); if (dictionary.Count != 0) { CustomRegisteredArmorTex.Add(value, dictionary); } } } } public static void ReadCustomTextures() { if (!Directory.Exists(SeasonPaths.folderPath)) { Directory.CreateDirectory(SeasonPaths.folderPath); } if (!Directory.Exists(SeasonPaths.VegTexturePath)) { Directory.CreateDirectory(SeasonPaths.VegTexturePath); } string folderPath = SeasonPaths.folderPath; char directorySeparatorChar = Path.DirectorySeparatorChar; if (File.Exists(folderPath + directorySeparatorChar + "WillyBachHD.md")) { SeasonalityPlugin.SeasonalityLogger.LogInfo((object)"Willybach HD loaded"); HDPackLoaded = true; HDConfigurations.InitHDConfigurations(); } ReadVegDirectories(); ReadCreatureDirectories(); ReadPieceDirectories(); ReadPickableDirectories(); ReadArmorDirectories(); ReadCustoms(); } private static void ReadCustoms() { if (!Directory.Exists(SeasonPaths.CustomTexPath)) { Directory.CreateDirectory(SeasonPaths.CustomTexPath); } string[] directories = Directory.GetDirectories(SeasonPaths.CustomTexPath); string[] array = directories; foreach (string path in array) { string fileName = Path.GetFileName(path); string[] files = Directory.GetFiles(path, "*.png"); if (files.Length == 0) { continue; } Dictionary<string, Dictionary<string, Texture>> dictionary = new Dictionary<string, Dictionary<string, Texture>>(); string[] array2 = files; foreach (string text in array2) { string text2 = Path.GetFileName(text).Replace(".png", string.Empty); string[] array3 = text2.Split(new char[1] { '@' }); if (array3.Length != 2) { continue; } string key = array3[0]; string text3 = array3[1]; Texture val = RegisterCustomTexture(text, (TextureFormat)10, (FilterMode)0, 1, 0, (TextureWrapMode)0); if (!((Object)(object)val == (Object)null)) { ((Object)val).name = text2; if (dictionary.ContainsKey(key)) { dictionary[key][text3] = val; } else { dictionary[key] = new Dictionary<string, Texture> { [text3] = val }; } SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Registered: " + fileName + "/" + text2 + ".png")); } } RegisteredCustomTextures[fileName] = dictionary; } } private static void GetTexture([<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 2 })] Dictionary<string, Texture> textureMap, SeasonalityPlugin.Season season, string path, string type, TextureFormat textureFormat, FilterMode filterMode) { //IL_00c1: 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) string[] obj = new string[6] { path, null, null, null, null, null }; char directorySeparatorChar = Path.DirectorySeparatorChar; obj[1] = directorySeparatorChar.ToString(); obj[2] = type; directorySeparatorChar = Path.DirectorySeparatorChar; obj[3] = directorySeparatorChar.ToString(); obj[4] = season.ToString().ToLower(); obj[5] = ".png"; string text = string.Concat(obj); string text2 = type + "/" + season.ToString().ToLower() + ".png compressed as " + ((object)(TextureFormat)(ref textureFormat)).ToString() + ", filter " + ((object)(FilterMode)(ref filterMode)).ToString(); if (File.Exists(text)) { Texture val = RegisterCustomTexture(text, textureFormat, filterMode, 1, 0, (TextureWrapMode)0); if (!Object.op_Implicit((Object)(object)val)) { SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Failed: " + text2)); return; } textureMap.Add(season.ToString(), val); SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Registered: " + text2)); } } private static void GetBark([<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 2 })] Dictionary<string, Texture> textureMap, SeasonalityPlugin.Season season, string path, string type, TextureFormat textureFormat, FilterMode filterMode) { //IL_00c1: 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) string[] obj = new string[6] { path, null, null, null, null, null }; char directorySeparatorChar = Path.DirectorySeparatorChar; obj[1] = directorySeparatorChar.ToString(); obj[2] = type; directorySeparatorChar = Path.DirectorySeparatorChar; obj[3] = directorySeparatorChar.ToString(); obj[4] = season.ToString().ToLower(); obj[5] = "_bark.png"; string text = string.Concat(obj); string text2 = type + "/" + season.ToString().ToLower() + "_bark.png compressed as " + ((object)(TextureFormat)(ref textureFormat)).ToString() + ", filter " + ((object)(FilterMode)(ref filterMode)).ToString(); if (File.Exists(text)) { Texture val = RegisterCustomTexture(text, textureFormat, filterMode, 1, 0, (TextureWrapMode)0, isBark: true); if (!Object.op_Implicit((Object)(object)val)) { SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Failed: " + text2)); return; } textureMap.Add(season.ToString() + "_bark", val); SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Registered: " + text2)); } } private static void GetNormal([<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 2 })] Dictionary<string, Texture> textureMap, SeasonalityPlugin.Season season, string path, string type, TextureFormat textureFormat, FilterMode filterMode) { //IL_00c1: 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) string[] obj = new string[6] { path, null, null, null, null, null }; char directorySeparatorChar = Path.DirectorySeparatorChar; obj[1] = directorySeparatorChar.ToString(); obj[2] = type; directorySeparatorChar = Path.DirectorySeparatorChar; obj[3] = directorySeparatorChar.ToString(); obj[4] = season.ToString().ToLower(); obj[5] = "_normal.png"; string text = string.Concat(obj); string text2 = type + "/" + season.ToString().ToLower() + "_normal.png compressed as " + ((object)(TextureFormat)(ref textureFormat)).ToString() + ", filter " + ((object)(FilterMode)(ref filterMode)).ToString(); if (File.Exists(text)) { Texture val = RegisterCustomTexture(text, textureFormat, filterMode, 1, 0, (TextureWrapMode)0, isBark: true); if (!Object.op_Implicit((Object)(object)val)) { SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Failed: " + text2)); return; } textureMap.Add(season.ToString() + "_normal", val); SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Registered: " + text2)); } } private static void GetWorn([<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 2 })] Dictionary<string, Texture> textureMap, SeasonalityPlugin.Season season, string path, string type, TextureFormat textureFormat, FilterMode filterMode) { //IL_00bb: 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) string[] obj = new string[6] { path, null, null, null, null, null }; char directorySeparatorChar = Path.DirectorySeparatorChar; obj[1] = directorySeparatorChar.ToString(); obj[2] = type; directorySeparatorChar = Path.DirectorySeparatorChar; obj[3] = directorySeparatorChar.ToString(); obj[4] = season.ToString().ToLower(); obj[5] = "_worn.png"; string text = string.Concat(obj); string text2 = type + "/" + season.ToString().ToLower() + "_worn.png compressed as " + ((object)(TextureFormat)(ref textureFormat)).ToString() + ", filter " + ((object)(FilterMode)(ref filterMode)).ToString(); if (File.Exists(text)) { Texture val = RegisterCustomTexture(text, textureFormat, filterMode, 1, 0, (TextureWrapMode)0, isBark: true); if (!Object.op_Implicit((Object)(object)val)) { SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Failed: " + text2)); return; } textureMap.Add(season.ToString() + "_worn", val); SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Registered: " + text2)); } } private static void GetCorner([<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 2 })] Dictionary<string, Texture> textureMap, SeasonalityPlugin.Season season, string path, string type, TextureFormat textureFormat, FilterMode filterMode) { //IL_00bb: 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) string[] obj = new string[6] { path, null, null, null, null, null }; char directorySeparatorChar = Path.DirectorySeparatorChar; obj[1] = directorySeparatorChar.ToString(); obj[2] = type; directorySeparatorChar = Path.DirectorySeparatorChar; obj[3] = directorySeparatorChar.ToString(); obj[4] = season.ToString().ToLower(); obj[5] = "_corner.png"; string text = string.Concat(obj); string text2 = type + "/" + season.ToString().ToLower() + "_corner.png compressed as " + ((object)(TextureFormat)(ref textureFormat)).ToString() + ", filter " + ((object)(FilterMode)(ref filterMode)).ToString(); if (File.Exists(text)) { Texture val = RegisterCustomTexture(text, textureFormat, filterMode, 1, 0, (TextureWrapMode)0, isBark: true); if (!Object.op_Implicit((Object)(object)val)) { SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Failed: " + text2)); return; } textureMap.Add(season.ToString() + "_corner", val); SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Registered: " + text2)); } } private static void GetCornerWorn([<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 2 })] Dictionary<string, Texture> textureMap, SeasonalityPlugin.Season season, string path, string type, TextureFormat textureFormat, FilterMode filterMode) { //IL_00bb: 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) string[] obj = new string[6] { path, null, null, null, null, null }; char directorySeparatorChar = Path.DirectorySeparatorChar; obj[1] = directorySeparatorChar.ToString(); obj[2] = type; directorySeparatorChar = Path.DirectorySeparatorChar; obj[3] = directorySeparatorChar.ToString(); obj[4] = season.ToString().ToLower(); obj[5] = "_corner_worn.png"; string text = string.Concat(obj); string text2 = type + "/" + season.ToString().ToLower() + "_corner_worn.png compressed as " + ((object)(TextureFormat)(ref textureFormat)).ToString() + ", filter " + ((object)(FilterMode)(ref filterMode)).ToString(); if (File.Exists(text)) { Texture val = RegisterCustomTexture(text, textureFormat, filterMode, 1, 0, (TextureWrapMode)0, isBark: true); if (!Object.op_Implicit((Object)(object)val)) { SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Failed: " + text2)); return; } textureMap.Add(season.ToString() + "_corner_worn", val); SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Registered: " + text2)); } } private static void GetLegs([<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 2 })] Dictionary<string, Texture> textureMap, SeasonalityPlugin.Season season, string path, string type, TextureFormat textureFormat, FilterMode filterMode) { //IL_00bb: 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) string[] obj = new string[6] { path, null, null, null, null, null }; char directorySeparatorChar = Path.DirectorySeparatorChar; obj[1] = directorySeparatorChar.ToString(); obj[2] = type; directorySeparatorChar = Path.DirectorySeparatorChar; obj[3] = directorySeparatorChar.ToString(); obj[4] = season.ToString().ToLower(); obj[5] = "_legs.png"; string text = string.Concat(obj); string text2 = type + "/" + season.ToString().ToLower() + "_legs.png compressed as " + ((object)(TextureFormat)(ref textureFormat)).ToString() + ", filter " + ((object)(FilterMode)(ref filterMode)).ToString(); if (File.Exists(text)) { Texture val = RegisterCustomTexture(text, textureFormat, filterMode, 1, 0, (TextureWrapMode)0); if (!Object.op_Implicit((Object)(object)val)) { SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Failed: " + text2)); return; } textureMap.Add(season.ToString() + "_legs", val); SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Registered: " + text2)); } } private static void getChest([<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 2 })] Dictionary<string, Texture> textureMap, SeasonalityPlugin.Season season, string path, string type, TextureFormat textureFormat, FilterMode filterMode) { //IL_00bb: 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) string[] obj = new string[6] { path, null, null, null, null, null }; char directorySeparatorChar = Path.DirectorySeparatorChar; obj[1] = directorySeparatorChar.ToString(); obj[2] = type; directorySeparatorChar = Path.DirectorySeparatorChar; obj[3] = directorySeparatorChar.ToString(); obj[4] = season.ToString().ToLower(); obj[5] = "_chest.png"; string text = string.Concat(obj); string text2 = type + "/" + season.ToString().ToLower() + "_chest.png compressed as " + ((object)(TextureFormat)(ref textureFormat)).ToString() + ", filter " + ((object)(FilterMode)(ref filterMode)).ToString(); if (File.Exists(text)) { Texture val = RegisterCustomTexture(text, textureFormat, filterMode, 1, 0, (TextureWrapMode)0); if (!Object.op_Implicit((Object)(object)val)) { SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Failed: " + text2)); return; } textureMap.Add(season.ToString() + "_chest", val); SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Registered: " + text2)); } } private static void GetCape([<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 2 })] Dictionary<string, Texture> textureMap, SeasonalityPlugin.Season season, string path, string type, TextureFormat textureFormat, FilterMode filterMode) { //IL_00bb: 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) string[] obj = new string[6] { path, null, null, null, null, null }; char directorySeparatorChar = Path.DirectorySeparatorChar; obj[1] = directorySeparatorChar.ToString(); obj[2] = type; directorySeparatorChar = Path.DirectorySeparatorChar; obj[3] = directorySeparatorChar.ToString(); obj[4] = season.ToString().ToLower(); obj[5] = "_cape.png"; string text = string.Concat(obj); string text2 = type + "/" + season.ToString().ToLower() + "_cape.png compressed as " + ((object)(TextureFormat)(ref textureFormat)).ToString() + ", filter " + ((object)(FilterMode)(ref filterMode)).ToString(); if (File.Exists(text)) { Texture val = RegisterCustomTexture(text, textureFormat, filterMode, 1, 0, (TextureWrapMode)0); if (!Object.op_Implicit((Object)(object)val)) { SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Failed: " + text2)); return; } textureMap.Add(season.ToString() + "_cape", val); SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Registered: " + text2)); } } private static void GetHelmet([<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 2 })] Dictionary<string, Texture> textureMap, SeasonalityPlugin.Season season, string path, string type, TextureFormat textureFormat, FilterMode filterMode) { //IL_00bb: 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) string[] obj = new string[6] { path, null, null, null, null, null }; char directorySeparatorChar = Path.DirectorySeparatorChar; obj[1] = directorySeparatorChar.ToString(); obj[2] = type; directorySeparatorChar = Path.DirectorySeparatorChar; obj[3] = directorySeparatorChar.ToString(); obj[4] = season.ToString().ToLower(); obj[5] = "_helmet.png"; string text = string.Concat(obj); string text2 = type + "/" + season.ToString().ToLower() + "_helmet.png compressed as " + ((object)(TextureFormat)(ref textureFormat)).ToString() + ", filter " + ((object)(FilterMode)(ref filterMode)).ToString(); if (File.Exists(text)) { Texture val = RegisterCustomTexture(text, textureFormat, filterMode, 1, 0, (TextureWrapMode)0); if (!Object.op_Implicit((Object)(object)val)) { SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Failed: " + text2)); return; } textureMap.Add(season.ToString() + "_helmet", val); SeasonalityPlugin.SeasonalityLogger.LogDebug((object)("Registered: " + text2)); } } [return: <df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(new byte[] { 1, 1, 2 })] private static Dictionary<string, Texture> GetCustomTextures(string type, string path, TextureFormat textureFormat = 12, FilterMode filterMode = 2) { //IL_0033: 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_003f: 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_004b: 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_0057: 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_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_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) //IL_007b: 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_0087: Unknown result type (might be due to invalid IL or missing references) //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_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009f: 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) Dictionary<string, Texture> dictionary = new Dictionary<string, Texture>(); foreach (SeasonalityPlugin.Season value in Enum.GetValues(typeof(SeasonalityPlugin.Season))) { GetTexture(dictionary, value, path, type, textureFormat, filterMode); GetBark(dictionary, value, path, type, textureFormat, filterMode); GetNormal(dictionary, value, path, type, textureFormat, filterMode); GetWorn(dictionary, value, path, type, textureFormat, filterMode); GetCorner(dictionary, value, path, type, textureFormat, filterMode); GetCornerWorn(dictionary, value, path, type, textureFormat, filterMode); getChest(dictionary, value, path, type, textureFormat, filterMode); GetLegs(dictionary, value, path, type, textureFormat, filterMode); GetCape(dictionary, value, path, type, textureFormat, filterMode); GetHelmet(dictionary, value, path, type, textureFormat, filterMode); } return dictionary; } } } namespace Seasonality.Seasons { [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(1)] [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(0)] public static class Configurations { [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] public enum DurationType { Day, Hours, Minutes } [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] public enum DisplayType { Above, Below } [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(0)] public class SerializedWeather { public readonly List<WeatherData> environments; public SerializedWeather() { environments = new List<WeatherData>(); } public SerializedWeather(List<WeatherData> weathers) { environments = weathers; } public SerializedWeather(string weathers) { environments = weathers.Split(new char[1] { ',' }).Select([<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] (string input) => { string[] array = input.Split(new char[1] { ':' }); WeatherData result = default(WeatherData); result.name = array[0]; result.weight = ((array.Length > 1 && float.TryParse(array[1], out var result2)) ? result2 : 1f); return result; }).ToList(); } public void Add(string env, float weight) { environments.Add(new WeatherData { name = env, weight = weight }); } public override string ToString() { return string.Join(",", environments.Select([<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] (WeatherData e) => $"{e.name}:{e.weight}")); } } [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] public struct WeatherData { [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(1)] public string name; public float weight; } private static readonly Dictionary<List<string>, float> intConfigs = new Dictionary<List<string>, float> { { new List<string> { "Carry Weight", "Increase or decrease max carry weight" }, 0f } }; private static readonly Dictionary<List<string>, float> floatConfigs = new Dictionary<List<string>, float> { { new List<string> { "Health Regeneration", "Multiply the amount of health regeneration from food" }, 1f }, { new List<string> { "Damage", "Multiply the amount of damage inflicted on enemies" }, 1f }, { new List<string> { "Speed", "Multiply the speed" }, 1f }, { new List<string> { "Eitr Regeneration", "Multiply the amount of eitr regeneration from food" }, 1f }, { new List<string> { "Raise Skill", "Multiply the amount experience gained for skills" }, 1f }, { new List<string> { "Stamina Regeneration", "Define the rate of stamina regeneration" }, 1f } }; private static ConfigEntry<SeasonalityPlugin.Toggle> _serverConfigLocked = null; public static ConfigEntry<SeasonalityPlugin.Season> _Season = null; public static ConfigEntry<SeasonalityPlugin.Toggle> _ReplaceArmorTextures = null; public static ConfigEntry<SeasonalityPlugin.Toggle> _ReplaceCreatureTextures = null; public static ConfigEntry<SeasonalityPlugin.Toggle> _SeasonFades = null; public static ConfigEntry<SeasonalityPlugin.Toggle> _SleepOverride = null; public static ConfigEntry<float> _FadeLength = null; public static ConfigEntry<SeasonalityPlugin.Toggle> _WinterFreezes = null; public static ConfigEntry<SeasonalityPlugin.Toggle> _WinterAlwaysCold = null; public static ConfigEntry<SeasonalityPlugin.Toggle> _DisplaySeason = null; public static ConfigEntry<SeasonalityPlugin.Toggle> _DisplaySeasonTimer = null; public static ConfigEntry<DisplayType> _DisplayType = null; public static ConfigEntry<int> _WeatherDuration = null; public static ConfigEntry<SeasonalityPlugin.Toggle> _DisplayWeather = null; public static ConfigEntry<SeasonalityPlugin.Toggle> _EnableWeather = null; public static ConfigEntry<SeasonalityPlugin.Toggle> _DisplayWeatherTimer = null; public static ConfigEntry<SeasonalityPlugin.Toggle> _EnableModifiers = null; public static readonly Dictionary<SeasonalityPlugin.Season, Dictionary<DurationType, ConfigEntry<int>>> _Durations = new Dictionary<SeasonalityPlugin.Season, Dictionary<DurationType, ConfigEntry<int>>>(); public static readonly Dictionary<SeasonalityPlugin.Season, Dictionary<Biome, ConfigEntry<string>>> _WeatherConfigs = new Dictionary<SeasonalityPlugin.Season, Dictionary<Biome, ConfigEntry<string>>>(); public static readonly Dictionary<SeasonalityPlugin.Season, Dictionary<string, ConfigEntry<float>>> effectConfigs = new Dictionary<SeasonalityPlugin.Season, Dictionary<string, ConfigEntry<float>>>(); public static ConfigEntry<SeasonalityPlugin.Toggle> _fadeToBlackImmune = null; public static ConfigEntry<double> m_lastSeasonChange = null; public static readonly List<ConfigEntry<Color>> _fallColors = new List<ConfigEntry<Color>>(); [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] private static object configManager; public static void Init() { //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Expected O, but got Unknown //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0435: Unknown result type (might be due to invalid IL or missing references) _serverConfigLocked = SeasonalityPlugin._plugin.config("1 - General", "1 - Lock Configuration", SeasonalityPlugin.Toggle.On, "If on, the configuration is locked and can be changed by server admins only."); SeasonalityPlugin.ConfigSync.AddLockingConfigEntry<SeasonalityPlugin.Toggle>(_serverConfigLocked); m_lastSeasonChange = SeasonalityPlugin._plugin.config("9 - Data", "Last Season Change", 0.0, "Reset to set last season change"); _Season = SeasonalityPlugin._plugin.config("1 - General", "Current Season", SeasonalityPlugin.Season.Fall, "Set duration to 0, and select your season, else season is determined by plugin"); _ReplaceArmorTextures = SeasonalityPlugin._plugin.config("2 - Settings", "Replace Armor Textures", SeasonalityPlugin.Toggle.On, "If on, plugin modifies armor textures"); _ReplaceCreatureTextures = SeasonalityPlugin._plugin.config("2 - Settings", "Replace Creature Textures", SeasonalityPlugin.Toggle.On, "If on, creature skins change with the seasons"); _SeasonFades = SeasonalityPlugin._plugin.config("2 - Settings", "Fade to Black", SeasonalityPlugin.Toggle.On, "If on, plugin fades to black before season change"); _fadeToBlackImmune = SeasonalityPlugin._plugin.config("2 - Settings", "Fade Immunity", SeasonalityPlugin.Toggle.Off, "If on, while fading to black, player is immune to damage"); _SleepOverride = SeasonalityPlugin._plugin.config("2 - Settings", "Sleep Season Change", SeasonalityPlugin.Toggle.Off, "If on, seasons can only change if everyone is asleep"); _SleepOverride.SettingChanged += [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] (object _, EventArgs _) => { SeasonTimer.m_sleepOverride = _SleepOverride.Value == SeasonalityPlugin.Toggle.On; }; _FadeLength = SeasonalityPlugin._plugin.config("2 - Settings", "Fade Length (seconds)", 3f, new ConfigDescription("Set the length of fade to black", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 101f), Array.Empty<object>())); _DisplaySeason = SeasonalityPlugin._plugin.config("2 - Settings", "Display Season", SeasonalityPlugin.Toggle.On, "If on, season will be displayed alongside HUD Status Effects"); _DisplaySeason.SettingChanged += SeasonManager.OnSeasonDisplayConfigChange; _DisplaySeasonTimer = SeasonalityPlugin._plugin.config("2 - Settings", "Display Season Timer", SeasonalityPlugin.Toggle.On, "If on, season timer will be displayed"); _EnableModifiers = SeasonalityPlugin._plugin.config("2 - Settings", "Modifiers", SeasonalityPlugin.Toggle.Off, "If on, modifiers, as in health regeneration, carry weight etc... are enabled"); _DisplayType = SeasonalityPlugin._plugin.config("2 - Settings", "Name Display", DisplayType.Above, "Set if name of season should be displayed above or below icon"); _DisplayType.SettingChanged += SeasonManager.OnSeasonDisplayConfigChange; _WinterFreezes = SeasonalityPlugin._plugin.config("4 - Winter Settings", "Frozen Water", SeasonalityPlugin.Toggle.On, "If on, winter freezes water"); _WinterFreezes.SettingChanged += [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] (object _, EventArgs _) => { FrozenWaterLOD.UpdateInstances(); FrozenZones.UpdateInstances(); }; _WinterAlwaysCold = SeasonalityPlugin._plugin.config("4 - Winter Settings", "Always Cold", SeasonalityPlugin.Toggle.On, "If on, winter will always make player cold"); _Season.SettingChanged += SeasonManager.OnSeasonConfigChange; _WeatherDuration = SeasonalityPlugin._plugin.config("3 - Weather Settings", "Weather Duration (Minutes)", 20, new ConfigDescription("Set duration of custom weather", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000), Array.Empty<object>())); _WeatherDuration.SettingChanged += WeatherManager.OnWeatherDurationChange; _EnableWeather = SeasonalityPlugin._plugin.config("3 - Weather Settings", "Enabled", SeasonalityPlugin.Toggle.On, "If on, plugin can control weather and display information"); _EnableWeather.SettingChanged += WeatherManager.OnDisplayConfigChange; _DisplayWeather = SeasonalityPlugin._plugin.config("3 - Weather Settings", "Weather Display", SeasonalityPlugin.Toggle.Off, "If on, plugin can control weather and displays current weather as status effect"); _DisplayWeather.SettingChanged += WeatherManager.OnDisplayConfigChange; _DisplayWeatherTimer = SeasonalityPlugin._plugin.config("3 - Weather Settings", "Weather Timer", SeasonalityPlugin.Toggle.On, "If on, weather status effect displays countdown till next environment"); List<Color> list = new List<Color> { new Color(0.8f, 0.5f, 0f, 1f), new Color(0.8f, 0.3f, 0f, 1f), new Color(0.8f, 0.2f, 0f, 1f), new Color(0.9f, 0.5f, 0f, 1f) }; for (int i = 0; i < 4; i++) { _fallColors.Add(SeasonalityPlugin._plugin.config<Color>("5 - Fall Colors", $"Color {i}", list[i], $"Set fall color index {i}")); } InitDurationConfigs(); InitWeatherConfigs(); InitSeasonEffectConfigs(); } private static void InitSeasonEffectConfigs() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown foreach (SeasonalityPlugin.Season value5 in Enum.GetValues(typeof(SeasonalityPlugin.Season))) { Dictionary<string, ConfigEntry<float>> dictionary = new Dictionary<string, ConfigEntry<float>>(); foreach (KeyValuePair<List<string>, float> floatConfig in floatConfigs) { string text = floatConfig.Key[0]; string text2 = floatConfig.Key[1]; float value = floatConfig.Value; ConfigEntry<float> value2 = SeasonalityPlugin._plugin.config($"{value5} Modifiers", text, value, new ConfigDescription(text2 ?? "", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); dictionary[text] = value2; } foreach (KeyValuePair<List<string>, float> intConfig in intConfigs) { string text3 = intConfig.Key[0]; string text4 = intConfig.Key[1]; float value3 = intConfig.Value; ConfigEntry<float> value4 = SeasonalityPlugin._plugin.config($"{value5} Modifiers", text3, value3, new ConfigDescription(text4 ?? "", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-300f, 300f), Array.Empty<object>())); dictionary[text3] = value4; } effectConfigs[value5] = dictionary; } } private static void InitWeatherConfigs() { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Invalid comparison between Unknown and I4 //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Invalid comparison between Unknown and I4 //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Invalid comparison between Unknown and I4 //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Expected O, but got Unknown //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown Type type = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault([<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] (Assembly a) => a.GetName().Name == "ConfigurationManager")?.GetType("ConfigurationManager.ConfigurationManager"); configManager = ((type == null) ? null : Chainloader.ManagerObject.GetComponent(type)); foreach (SeasonalityPlugin.Season value in Enum.GetValues(typeof(SeasonalityPlugin.Season))) { Dictionary<Biome, ConfigEntry<string>> dictionary = new Dictionary<Biome, ConfigEntry<string>>(); SerializedWeather serializedWeather = new SerializedWeather(); serializedWeather.Add("WarmSnow", 1f); serializedWeather.Add("Twilight_Snow", 0.5f); serializedWeather.Add("WarmSnowStorm", 0.1f); foreach (Biome value2 in Enum.GetValues(typeof(Biome))) { if (((int)value2 != 0 && (int)value2 != 32 && (int)value2 != 895) || 1 == 0) { int num = BiomeIndex(value2); SeasonalityPlugin.ConfigurationManagerAttributes configurationManagerAttributes = new SeasonalityPlugin.ConfigurationManagerAttributes(); configurationManagerAttributes.CustomDrawer = DrawConfigTable; configurationManagerAttributes.Order = 0; configurationManagerAttributes.Category = $"{value} Weather Options"; SeasonalityPlugin.ConfigurationManagerAttributes configurationManagerAttributes2 = configurationManagerAttributes; if (value == SeasonalityPlugin.Season.Winter && (int)value2 != 4) { dictionary[value2] = SeasonalityPlugin._plugin.config($"{value} Weather Options", $"{num} - {(object)value2}", serializedWeather.ToString(), new ConfigDescription("Set weather options, [name]:[weight]", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes2 })); } else { dictionary[value2] = SeasonalityPlugin._plugin.config($"{value} Weather Options", $"{num} - {(object)value2}", "", new ConfigDescription("Set weather options, [name]:[weight]", (AcceptableValueBase)null, new object[1] { configurationManagerAttributes2 })); } } } _WeatherConfigs[value] = dictionary; } } private static void InitDurationConfigs() { //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown foreach (SeasonalityPlugin.Season value in Enum.GetValues(typeof(SeasonalityPlugin.Season))) { Dictionary<DurationType, ConfigEntry<int>> dictionary = new Dictionary<DurationType, ConfigEntry<int>>(); foreach (DurationType value2 in Enum.GetValues(typeof(DurationType))) { if (value2 == DurationType.Hours) { dictionary[value2] = SeasonalityPlugin._plugin.config($"Duration - {value}", $"Real-Time {value2}", 1, new ConfigDescription($"Set the length of {value}", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 1000), Array.Empty<object>())); } else { dictionary[value2] = SeasonalityPlugin._plugin.config($"Duration - {value}", $"Real-Time {value2}", 0, new ConfigDescription($"Set the length of {value}", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 1000), Array.Empty<object>())); } } _Durations[value] = dictionary; } } private static int BiomeIndex(Biome biome) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Invalid comparison between Unknown and I4 //IL_000a: 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_0022: Expected I4, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Invalid comparison between Unknown and I4 //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Invalid comparison between Unknown and I4 if (1 == 0) { } int result; if ((int)biome <= 16) { switch (biome - 1) { case 0: goto IL_004c; case 1: goto IL_0054; case 3: goto IL_0058; case 2: goto IL_006c; } if ((int)biome != 8) { if ((int)biome != 16) { goto IL_006c; } result = 5; } else { result = 2; } } else if ((int)biome != 64) { if ((int)biome != 256) { if ((int)biome != 512) { goto IL_006c; } result = 6; } else { result = 7; } } else { result = 8; } goto IL_0070; IL_006c: result = 0; goto IL_0070; IL_0058: result = 4; goto IL_0070; IL_004c: result = 1; goto IL_0070; IL_0054: result = 3; goto IL_0070; IL_0070: if (1 == 0) { } return result; } private static void DrawConfigTable(ConfigEntryBase cfg) { //IL_011e: 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_0137: Expected O, but got Unknown //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_018f: Expected O, but got Unknown //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Expected O, but got Unknown //IL_0231: 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_024c: Expected O, but got Unknown bool valueOrDefault = cfg.Description.Tags.Select([<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] (object a) => (a.GetType().Name == "ConfigurationManagerAttributes") ? ((bool?)a.GetType().GetField("ReadOnly")?.GetValue(a)) : null).FirstOrDefault((bool? v) => v.HasValue).GetValueOrDefault(); List<WeatherData> list = new List<WeatherData>(); bool flag = false; int num = (int)(configManager?.GetType().GetProperty("RightColumnWidth", BindingFlags.Instance | BindingFlags.NonPublic).GetGetMethod(nonPublic: true) .Invoke(configManager, Array.Empty<object>()) ?? ((object)130)); GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); foreach (WeatherData environment in new SerializedWeather((string)cfg.BoxedValue).environments) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); float num2 = environment.weight; int num3 = Mathf.Max(num - 40 - 21 - 21, 180); string text = GUILayout.TextField(environment.name, new GUIStyle(GUI.skin.textField) { fixedWidth = num3 }, Array.Empty<GUILayoutOption>()); string text2 = (valueOrDefault ? environment.name : text); flag = flag || text2 != environment.name; if (float.TryParse(GUILayout.TextField(num2.ToString(CultureInfo.InvariantCulture), new GUIStyle(GUI.skin.textField) { fixedWidth = 40f }, Array.Empty<GUILayoutOption>()), out var result) && Math.Abs(result - num2) > 0.01f && !valueOrDefault) { num2 = result; flag = true; } if (GUILayout.Button("x", new GUIStyle(GUI.skin.button) { fixedWidth = 21f }, Array.Empty<GUILayoutOption>()) && !valueOrDefault) { flag = true; } else { list.Add(new WeatherData { name = text2, weight = num2 }); } if (GUILayout.Button("+", new GUIStyle(GUI.skin.button) { fixedWidth = 21f }, Array.Empty<GUILayoutOption>()) && !valueOrDefault) { flag = true; list.Add(new WeatherData { weight = 1f, name = "" }); } GUILayout.EndHorizontal(); } GUILayout.EndVertical(); if (flag) { cfg.BoxedValue = new SerializedWeather(list).ToString(); } } } [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(0)] [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(1)] public static class MaterialReplacer { [HarmonyPatch(typeof(ZoneSystem), "Start")] [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(0)] private static class ZoneSystemPatch { [<3f8ea624-c3f0-4ff9-bffe-4b320226817a>NullableContext(1)] private static void Postfix(ZoneSystem __instance) { if (Object.op_Implicit((Object)(object)__instance)) { GetAllMaterials(); GetAllTextures(); } } } public static readonly Dictionary<string, Texture> CachedTextures = new Dictionary<string, Texture>(); public static readonly Dictionary<string, Material> CachedMaterials = new Dictionary<string, Material>(); public static readonly Dictionary<string, Material> CustomMaterials = new Dictionary<string, Material>(); public static readonly Dictionary<Material, Texture> m_mossMaterials = new Dictionary<Material, Texture>(); public static readonly Dictionary<Material, Color> m_mossColors = new Dictionary<Material, Color>(); public static readonly Dictionary<Material, Texture> m_customMossMaterials = new Dictionary<Material, Texture>(); private static readonly int ChestTex = Shader.PropertyToID("_ChestTex"); private static readonly int LegsTex = Shader.PropertyToID("_LegsTex"); private static readonly int MainTex = Shader.PropertyToID("_MainTex"); private static readonly int MossTex = Shader.PropertyToID("_MossTex"); private static readonly int MossColorProp = Shader.PropertyToID("_MossColor"); private static readonly int ColorProp = Shader.PropertyToID("_Color"); private static readonly int BumpMap = Shader.PropertyToID("_BumpMap"); private static bool m_inAshlands; private static bool m_firstCheck = true; private static float m_ashlandTimer; private static void GetAllMaterials() { Material[] array = Resources.FindObjectsOfTypeAll<Material>(); Material[] array2 = array; foreach (Material val in array2) { if (Object.op_Implicit((Object)(object)val)) { string key = ((Object)val).name.Replace("(Instance)", "").Replace(" ", ""); CachedMaterials[key] = val; } } } private static void SetArmorColors(SeasonalityPlugin.Season season) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) if (CachedMaterials.TryGetValue("CapeDeerHide", out var value)) { value.SetColor(ColorProp, Color32.op_Implicit(Object.op_Implicit((Object)(object)GetCustomTexture(season, Directories.ArmorDirectories.Leather, "CapeDeerHide", isLegs: false, isCape: true)) ? new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue) : new Color32((byte)182, (byte)125, (byte)102, byte.MaxValue))); } if (CachedMaterials.TryGetValue("CapeTrollHide", out var value2)) { value2.SetColor(ColorProp, Color32.op_Implicit(Object.op_Implicit((Object)(object)GetCustomTexture(season, Directories.ArmorDirectories.Troll, "CapeTrollHide", isLegs: false, isCape: true)) ? new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue) : new Color32((byte)102, (byte)149, (byte)182, byte.MaxValue))); } if (CachedMaterials.TryGetValue("helmet_trollleather", out var value3)) { value3.SetColor(ColorProp, Color32.op_Implicit(Object.op_Implicit((Object)(object)GetCustomTexture(season, Directories.ArmorDirectories.Troll, "helmet_trollleather", isLegs: false, isCape: false, isHelmet: true)) ? new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue) : new Color32((byte)88, (byte)123, (byte)151, byte.MaxValue))); } } private static void GetAllTextures() { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) foreach (Material value in CachedMaterials.Values) { if (Object.op_Implicit((Object)(object)value)) { string text = ((Object)value).name.Replace("(Instance)", "").Replace(" ", ""); if (value.HasProperty(MainTex)) { CachedTextures[text] = value.GetTexture(MainTex); } if (value.HasProperty(MossTex)) { Texture texture = value.GetTexture(MossTex); CachedTextures[text + "_moss"] = texture; m_mossMaterials[value] = texture; } if (value.HasProperty("_MossColor")) { m_mossColors[value] = value.GetColor(MossColorProp); } if (value.HasProperty(BumpMap)) { CachedTextures[text + "_normal"] = value.GetTexture(BumpMap); } if (value.HasProperty(ChestTex)) { CachedTextures[text + "_chest"] = value.GetTexture(ChestTex); } if (value.HasProperty(LegsTex)) { CachedTextures[text + "_legs"] = value.GetTexture(LegsTex); } } } } private static void SetMainTexture(string materialName, [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] Texture tex) { if (CachedMaterials.TryGetValue(materialName, out var value)) { value.SetTexture(MainTex, tex); } } private static void SetMossColor(string materialName, Color32 color) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (CachedMaterials.TryGetValue(materialName, out var value)) { value.SetColor(MossColorProp, Color32.op_Implicit(color)); } } private static void SetChestTexture(string materialName, [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] Texture tex) { if (CachedMaterials.TryGetValue(materialName, out var value)) { value.SetTexture(ChestTex, tex); } } private static void SetLegsTexture(string materialName, [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] Texture tex) { if (CachedMaterials.TryGetValue(materialName, out var value)) { value.SetTexture(LegsTex, tex); } } private static void SetNormalTexture(string materialName, [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] Texture normal) { if (CachedMaterials.TryGetValue(materialName, out var value) && Object.op_Implicit((Object)(object)normal)) { value.SetTexture(BumpMap, normal); } } private static void SetCustomMainTexture(string materialName, [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] Texture tex, int index = 0) { //IL_0043: 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) if (CustomMaterials.TryGetValue(materialName, out var value)) { value.SetTexture(MainTex, tex); SeasonalityPlugin.Season value2 = Configurations._Season.Value; SeasonalityPlugin.Season season = value2; if (season == SeasonalityPlugin.Season.Fall) { value.color = Configurations._fallColors[index].Value; } else { value.color = Color.white; } } } public static void ModifyCachedMaterials(SeasonalityPlugin.Season season) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 if ((int)SystemInfo.graphicsDeviceType != 4) { ModifyMossMaterials(season); if (Configurations._ReplaceCreatureTextures.Value == SeasonalityPlugin.Toggle.On) { ModifyCreatures(season); } ModifyVegetation(season); ModifyCustomMaterials(season); ModifyPieceMaterials(season); ModifyBarkMaterials(season); ModifyPickableMaterials(season); if (Configurations._ReplaceArmorTextures.Value == SeasonalityPlugin.Toggle.On) { SetArmorColors(season); ModifyArmorMaterials(season); } } } private static void ModifyArmorMaterials(SeasonalityPlugin.Season season) { Dictionary<string, Directories.ArmorDirectories> dictionary = new Dictionary<string, Directories.ArmorDirectories> { { "RagsChest", Directories.ArmorDirectories.Rags }, { "LeatherChest", Directories.ArmorDirectories.Leather }, { "TrollLeatherChest", Directories.ArmorDirectories.Troll } }; Dictionary<string, Directories.ArmorDirectories> dictionary2 = new Dictionary<string, Directories.ArmorDirectories> { { "RagsLegs", Directories.ArmorDirectories.Rags }, { "LeatherPants", Directories.ArmorDirectories.Leather }, { "TrollLeatherPants", Directories.ArmorDirectories.Troll } }; Dictionary<string, Directories.ArmorDirectories> dictionary3 = new Dictionary<string, Directories.ArmorDirectories> { { "CapeDeerHide", Directories.ArmorDirectories.Leather }, { "CapeTrollHide", Directories.ArmorDirectories.Troll }, { "WolfCape", Directories.ArmorDirectories.Wolf }, { "LoxCape_Mat", Directories.ArmorDirectories.Padded }, { "feathercape_mat", Directories.ArmorDirectories.Mage } }; Dictionary<string, Directories.ArmorDirectories> dictionary4 = new Dictionary<string, Directories.ArmorDirectories> { { "helmet_leather_mat", Directories.ArmorDirectories.Leather }, { "helmet_trollleather", Directories.ArmorDirectories.Troll }, { "helmet_bronze_mat", Directories.ArmorDirectories.Bronze }, { "helmet_iron_mat", Directories.ArmorDirectories.Iron } }; Dictionary<string, Directories.ArmorDirectories> dictionary5 = new Dictionary<string, Directories.ArmorDirectories> { { "BronzeArmorMesh_Mat", Directories.ArmorDirectories.Bronze }, { "IronArmorChest_mat", Directories.ArmorDirectories.Iron }, { "SilverArmourChest_mat", Directories.ArmorDirectories.Wolf }, { "DragonVisor_Mat", Directories.ArmorDirectories.Wolf }, { "Padded_mat", Directories.ArmorDirectories.Padded }, { "carapacearmor_mat", Directories.ArmorDirectories.Carapace }, { "MageArmor_mat", Directories.ArmorDirectories.Mage } }; Dictionary<string, Directories.ArmorDirectories> dictionary6 = new Dictionary<string, Directories.ArmorDirectories> { { "IronArmorLegs_mat", Directories.ArmorDirectories.Iron } }; foreach (KeyValuePair<string, Directories.ArmorDirectories> item in dictionary) { Texture customTexture = GetCustomTexture(season, item.Value, item.Key); if (!Object.op_Implicit((Object)(object)customTexture)) { if (CachedTextures.TryGetValue(item.Key + "_chest", out var value)) { SetChestTexture(item.Key, value); } } else { SetChestTexture(item.Key, customTexture); } } foreach (KeyValuePair<string, Directories.ArmorDirectories> item2 in dictionary2) { Texture customTexture2 = GetCustomTexture(season, item2.Value, item2.Key, isLegs: true); if (!Object.op_Implicit((Object)(object)customTexture2)) { if (CachedTextures.TryGetValue(item2.Key + "_legs", out var value2)) { SetLegsTexture(item2.Key, value2); } } else { SetLegsTexture(item2.Key, customTexture2); } } foreach (KeyValuePair<string, Directories.ArmorDirectories> item3 in dictionary3) { Texture customTexture3 = GetCustomTexture(season, item3.Value, item3.Key, isLegs: false, isCape: true); if (!Object.op_Implicit((Object)(object)customTexture3)) { if (CachedTextures.TryGetValue(item3.Key + "_cape", out var value3)) { SetMainTexture(item3.Key, value3); } } else { SetMainTexture(item3.Key, customTexture3); } } foreach (KeyValuePair<string, Directories.ArmorDirectories> item4 in dictionary4) { Texture customTexture4 = GetCustomTexture(season, item4.Value, item4.Key, isLegs: false, isCape: false, isHelmet: true); if (!Object.op_Implicit((Object)(object)customTexture4)) { if (CachedTextures.TryGetValue(item4.Key, out var value4)) { SetMainTexture(item4.Key, value4); } } else { SetMainTexture(item4.Key, customTexture4); } } foreach (KeyValuePair<string, Directories.ArmorDirectories> item5 in dictionary5) { Texture customTexture5 = GetCustomTexture(season, item5.Value, item5.Key); if (!Object.op_Implicit((Object)(object)customTexture5)) { if (CachedTextures.TryGetValue(item5.Key, out var value5)) { SetMainTexture(item5.Key, value5); } } else { SetMainTexture(item5.Key, customTexture5); } } foreach (KeyValuePair<string, Directories.ArmorDirectories> item6 in dictionary6) { Texture customTexture6 = GetCustomTexture(season, item6.Value, item6.Key, isLegs: true); if (!Object.op_Implicit((Object)(object)customTexture6)) { if (CachedTextures.TryGetValue(item6.Key, out var value6)) { SetMainTexture(item6.Key, value6); } } else { SetMainTexture(item6.Key, customTexture6); } } } private static void ModifyPieceMaterials(SeasonalityPlugin.Season season) { Dictionary<string, Directories.PieceDirectories> dictionary = new Dictionary<string, Directories.PieceDirectories> { { "straw_roof", Directories.PieceDirectories.Straw }, { "straw_roof_alpha", Directories.PieceDirectories.Straw }, { "RoofShingles", Directories.PieceDirectories.DarkWood }, { "GoblinVillage_Cloth", Directories.PieceDirectories.GoblinVillage }, { "GoblinVillage", Directories.PieceDirectories.GoblinVillage } }; Dictionary<string, Directories.PieceDirectories> dictionary2 = new Dictionary<string, Directories.PieceDirectories> { { "straw_roof_worn", Directories.PieceDirectories.Straw }, { "straw_roof_worn_alpha", Directories.PieceDirectories.Straw }, { "RoofShingles_worn", Directories.PieceDirectories.DarkWood }, { "GoblinVillage", Directories.PieceDirectories.GoblinVillage } }; Dictionary<string, Directories.PieceDirectories> dictionary3 = new Dictionary<string, Directories.PieceDirectories> { { "straw_roof_corner_alpha", Directories.PieceDirectories.Straw } }; Dictionary<string, Directories.PieceDirectories> dictionary4 = new Dictionary<string, Directories.PieceDirectories> { { "straw_roof_corner_worn_alpha", Directories.PieceDirectories.Straw } }; foreach (KeyValuePair<string, Directories.PieceDirectories> item in dictionary) { Texture customTexture = GetCustomTexture(season, item.Value, item.Key); if (Object.op_Implicit((Object)(object)customTexture)) { SetMainTexture(item.Key, customTexture); } } foreach (KeyValuePair<string, Directories.PieceDirectories> item2 in dictionary2) { Texture customTexture2 = GetCustomTexture(season, item2.Value, item2.Key, isWorn: true); if (Object.op_Implicit((Object)(object)customTexture2)) { SetMainTexture(item2.Key, customTexture2); } } foreach (KeyValuePair<string, Directories.PieceDirectories> item3 in dictionary3) { Texture customTexture3 = GetCustomTexture(season, item3.Value, item3.Key, isWorn: false, isCorner: true); if (Object.op_Implicit((Object)(object)customTexture3)) { SetMainTexture(item3.Key, customTexture3); } } foreach (KeyValuePair<string, Directories.PieceDirectories> item4 in dictionary4) { Texture customTexture4 = GetCustomTexture(season, item4.Value, item4.Key, isWorn: true, isCorner: true); if (Object.op_Implicit((Object)(object)customTexture4)) { SetMainTexture(item4.Key, customTexture4); } } } private static void ModifyPickableMaterials(SeasonalityPlugin.Season season) { Dictionary<string, Directories.PickableDirectories> dictionary = new Dictionary<string, Directories.PickableDirectories> { { "Boletus_edulis", Directories.PickableDirectories.Mushroom }, { "Boletus_Yellow", Directories.PickableDirectories.MushroomYellow }, { "Boletus_blue", Directories.PickableDirectories.MushroomBlue }, { "MistlandsMushrooms_balls", Directories.PickableDirectories.JotunPuff }, { "MistlandsMushrooms_magecap", Directories.PickableDirectories.Magecap }, { "raspberry", Directories.PickableDirectories.Raspberry }, { "blueberry", Directories.PickableDirectories.Blueberry }, { "Dandelion", Directories.PickableDirectories.Dandelion }, { "barley_ripe", Directories.PickableDirectories.Barley }, { "flax_ripe", Directories.PickableDirectories.Flax }, { "flax_item", Directories.PickableDirectories.Flax }, { "carrot", Directories.PickableDirectories.Carrot }, { "turnip_0", Directories.PickableDirectories.Turnip }, { "onion_ripe", Directories.PickableDirectories.Onion }, { "carrot_flower", Directories.PickableDirectories.CarrotSeed }, { "turnip_flower", Directories.PickableDirectories.TurnipSeed }, { "onion_seedling_ripe", Directories.PickableDirectories.OnionSeed }, { "branch", Directories.PickableDirectories.Branches }, { "flint", Directories.PickableDirectories.Flint }, { "stone", Directories.PickableDirectories.Rock }, { "fi_village_catacombs", Directories.PickableDirectories.BoneRemains }, { "surtlingcore", Directories.PickableDirectories.SurtlingCore }, { "BlackCore_mat", Directories.PickableDirectories.BlackCore }, { "swampplant2", Directories.PickableDirectories.Thistle } }; foreach (KeyValuePair<string, Directories.PickableDirectories> item in dictionary) { Texture customTexture = GetCustomTexture(season, item.Value, item.Key); if (Object.op_Implicit((Object)(object)customTexture)) { SetMainTexture(item.Key, customTexture); } } } private static void ModifyBarkMaterials(SeasonalityPlugin.Season season) { Dictionary<string, Directories.VegDirectories> dictionary = new Dictionary<string, Directories.VegDirectories> { { "olive_treebark2_darkland", Directories.VegDirectories.SwampTrees }, { "swamptree1_bark", Directories.VegDirectories.SwampTrees }, { "swamptree2_bark", Directories.VegDirectories.SwampTrees } }; Dictionary<string, Directories.VegDirectories> dictionary2 = new Dictionary<string, Directories.VegDirectories> { { "custom_beech_bark_0", Directories.VegDirectories.Beech }, { "custom_beech_bark_1", Directories.VegDirectories.Beech }, { "custom_beech_bark_2", Directories.VegDirectories.Beech }, { "custom_beech_bark_3", Directories.VegDirectories.Beech }, { "custom_beech_bark_small_0", Directories.VegDirectories.BeechSmall }, { "custom_beech_bark_small_1", Directories.VegDirectories.BeechSmall }, { "custom_beech_bark_small_2", Directories.VegDirectories.BeechSmall }, { "custom_beech_bark_small_3", Directories.VegDirectories.BeechSmall }, { "custom_birch_bark_0", Directories.VegDirectories.Birch }, { "custom_birch_bark_1", Directories.VegDirectories.Birch }, { "custom_birch_bark_2", Directories.VegDirectories.Birch }, { "custom_birch_bark_3", Directories.VegDirectories.Birch }, { "custom_oak_bark_0", Directories.VegDirectories.Oak }, { "custom_oak_bark_1", Directories.VegDirectories.Oak }, { "custom_oak_bark_2", Directories.VegDirectories.Oak }, { "custom_oak_bark_3", Directories.VegDirectories.Oak }, { "custom_Shoot_Trunk_mat_0", Directories.VegDirectories.YggaShoot }, { "custom_Shoot_Trunk_mat_1", Directories.VegDirectories.YggaShoot }, { "custom_Shoot_Trunk_mat_2", Directories.VegDirectories.YggaShoot }, { "custom_Shoot_Trunk_mat_3", Directories.VegDirectories.YggaShoot } }; foreach (KeyValuePair<string, Directories.VegDirectories> item in dictionary) { Texture customTexture = GetCustomTexture(season, item.Value, item.Key, isBark: true); if (Object.op_Implicit((Object)(object)customTexture)) { SetBarkMaterial(item.Key, customTexture); } } foreach (KeyValuePair<string, Directories.VegDirectories> item2 in dictionary2) { string originalMaterialName = item2.Key.Replace("custom_", "").Replace("_0", "").Replace("_1", "") .Replace("_2", "") .Replace("_3", ""); Texture customTexture2 = GetCustomTexture(season, item2.Value, originalMaterialName, isBark: true); if (Object.op_Implicit((Object)(object)customTexture2)) { SetBarkMaterial(item2.Key, customTexture2, isCustom: true); } } } private static void SetBarkMaterial(string materialName, [<df619281-0965-447f-950e-d7d6b4f32a5c>Nullable(2)] Texture tex, bool isCustom = false) { Material value2; if (isCustom) { if (CustomMaterials.TryGetValue(materialName, out var value)) { value.SetTexture(MainTex, tex); } } else if (CachedMaterials.TryGetValue(materialName, out value2)) { value2.SetTexture(MainTex, tex); } } private static void ModifyMossMaterials(SeasonalityPlugin.Season season) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_00aa: Unknown result type (might be due to invalid IL or missing references) try { if (WorldGenerator.IsAshlands(((Component)Player.m_localPlayer).transform.position.x, ((Component)Player.m_localPlayer).transform.position.z)) { ResetMossTextures(); m_inAshlands = true; return; } switch (season) { case SeasonalityPlugin.Season.Spring: case SeasonalityPlugin.Season.Summer: ResetMossTextures(); break; case SeasonalityPlugin.Season.Fall: { if (CachedTextures.TryGetValue("rock_heath_moss", out var value)) { SetMossTextures(value, Color.white); } break; } case SeasonalityPlugin.Season.Winter: { Texture pillar_Snow = TextureManager.Pillar_Snow; if (pillar_Snow != null) { SetMossTextures(pillar_Snow, Color.white); } break; } } } catch { SeasonalityPlugin.SeasonalityLogger.LogDebug((object)"Failed to modify moss materials"); } } public static void UpdateInAshlands(float dt) { //IL_004c: 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_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) if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return; } m_ashlandTimer += dt; if (m_ashlandTimer < 5f) { return; } m_ashlandTimer = 0f; Vector3 position = ((Component)Player.m_localPlayer).transform.position; bool flag = WorldGenerator.IsAshlands(position.x, position.z); if (m_inAshlands != flag || m_firstCheck) { m_inAshlands = flag; if (m_firstCheck) { m_firstCheck = false; } if (m_inAshlands) { ResetMossTextures(); } else { ModifyMossMaterials(Configurations._Season.Value); } FrozenZones.UpdateInstances(); FrozenWaterLOD.UpdateInstances(); } } private static void SetMossTextures(Texture texture, Color color) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair<Material, Texture> mossMaterial in m_mossMaterials) { Material key = mossMaterial.Key; if (key != null) { key.SetTexture(MossTex, texture); } } foreach (KeyValuePair<Material, Color> mossColor in m_mossColors) { Material key2 = mossColor.Key; if (key2 != null) { key2.SetColor(MossColorProp, color); } } } public static void ResetMossTextures() { //IL_0096: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair<Material, Texture> mossMaterial in m_mossMaterials) { Material key = mossMaterial.Key; if (key != null) { key.SetTexture(MossTex, mossMaterial.Value); } } foreach (KeyValuePair<Material, Color> mossColor in m_mossColors) { Material key2 = mossColor.Key; if (key2 != null) { key2.SetColor(MossColorProp, mossColor.Value); } } } private static void ModifyCustomMossMaterials() { switch (Configurations._Season.Value) { case SeasonalityPlugin.Season.Spring: case SeasonalityPlugin.Season.Summer: { foreach (KeyValuePair<Material, Texture> customMossMaterial in m_customMossMaterials) { Material key3 = customMossMaterial.Key; if (key3 != null) { key3.SetTexture(MossTex, customMossMaterial.Value); } } break; } case SeasonalityPlugin.Season.Fall: { if (!CachedTextures.TryGetValue("rock_heath_moss", out var value)) { break; } { foreach (KeyValuePair<Material, Texture> customMossMaterial2 in m_customMossMaterials) { Material key2 = customMossMaterial2.Key; if (key2 != null) { key2.SetTexture(MossTex, value); } } break; } } case SeasonalityPlugin.Season.Winter: { foreach (KeyValuePair<Material, Texture> customMossMaterial3 in m_customMossMaterials) { Material key = customMossMaterial3.Key; if (key != null) { key.SetTexture(MossTex, TextureManager.Pillar_Snow); } } break; } } } private static void ModifyCreatures(SeasonalityPlugin.Season season) { Dictionary<string, Directories.CreatureDirectories> dictionary = new Dictionary<string, Directories.CreatureDirectories> { { "lox", Directories.CreatureDirectories.Lox }, { "HildirsLox", Directories.CreatureDirectories.Lox }, { "lox_calf", Directories.CreatureDirectories.LoxCalf }, { "troll", Directories.CreatureDirectories.Troll }, { "Hare_mat", Directories.CreatureDirectories.Hare }, { "Feasting_mat", Directories.CreatureDirectories.Tick }, { "SeaSerpent_mat", Directories.CreatureDirectories.Serpent }, { "swampfish", Directories.CreatureDirectories.Leech }, { "Deathsquito_mat", Directories.CreatureDirectories.Deathsquito }, { "seagal", Directories.CreatureDirectories.Gull }, { "neck", Directories.CreatureDirectories.Neck }, { "wraith", Directories.CreatureDirectories.Wraith }, { "blob", Directories.CreatureDirectories.Blob }, { "blob_elite", Directories.CreatureDirectories.Oozer }, { "gjall_mat", Directories.CreatureDirectories.Gjall }, { "Skeleton", Directories.CreatureDirectories.Skeleton }, { "WolfSkinGrey", Directories.CreatureDirectories.Wolf }, { "WolfSkinGreycub", Directories.CreatureDirectories.WolfCub }, { "Dee