Decompiled source of PloppableRICO v1.0.1

PloppableRICO/PloppableRICO.dll

Decompiled a year ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Configuration;
using System.Diagnostics;
using System.IO;
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.Permissions;
using System.Threading;
using System.Xml;
using BepInEx;
using BepInEx.Logging;
using Cinemachine;
using Colossal.Entities;
using Colossal.IO.AssetDatabase;
using Colossal.IO.AssetDatabase.VirtualTexturing;
using Colossal.Localization;
using Game;
using Game.CinematicCamera;
using Game.Citizens;
using Game.Common;
using Game.Companies;
using Game.Creatures;
using Game.Events;
using Game.Objects;
using Game.Prefabs;
using Game.Rendering;
using Game.Rendering.CinematicCamera;
using Game.Rendering.Utilities;
using Game.Routes;
using Game.SceneFlow;
using Game.Settings;
using Game.Simulation;
using Game.Tools;
using Game.UI;
using Game.UI.InGame;
using Game.Vehicles;
using HarmonyLib;
using LemmyModFramework;
using LemmyModFramework.hooks;
using LemmyModFramework.src.hooks;
using LemmyModFramework.systems;
using Microsoft.CodeAnalysis;
using Unity.Entities;
using Unity.Jobs;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Rendering;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.Rendering.VirtualTexturing;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
[assembly: AssemblyCompany("PloppableRICO")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("PloppableRICO")]
[assembly: AssemblyTitle("PloppableRICO")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace LemmyMod_Mono
{
	[BepInPlugin("PloppableRICO", "PloppableRICO", "1.0.0")]
	public class LemmyModFrameworkPlugin : BaseUnityPlugin
	{
		public const string GUID = "CinematicRendererMod";

		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			Logger.LogSource = ((BaseUnityPlugin)this).Logger;
			Patcher.Init(new Harmony("LemmyMod"));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"PloppableRICO is loaded!");
			Patcher.AddPostFixPatch(typeof(SystemOrder), "Initialize", BindingFlags.Static | BindingFlags.Public, typeof(LemmyModFrameworkPlugin), "InjectSystems");
		}

		private void UiUpdate()
		{
		}

		private void LogHandler(string message, LogType type)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			if ((int)type == 0)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)message);
			}
			else
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)message);
			}
		}

		public static void InjectSystems(UpdateSystem updateSystem)
		{
			Patcher.InjectSystems(updateSystem);
		}

		private void OnInitialized()
		{
		}
	}
}
namespace LemmyModFramework
{
	public class Globals
	{
		public static float FixedStepSimulationSpeed = 60f;

		public static bool fixedTimeActive = false;

		public static bool recordCinematics { get; set; }
	}
	public class Logger
	{
		public static ManualLogSource LogSource;

		public static void LogDebug(object data)
		{
			LogSource.Log((LogLevel)32, data);
		}

		public static void LogMessage(object data)
		{
			LogSource.Log((LogLevel)8, data);
		}

		public static void LogInfo(object data)
		{
			LogSource.Log((LogLevel)16, data);
		}

		public static void LogWarning(object data)
		{
			LogSource.Log((LogLevel)4, data);
		}

		public static void LogError(object data)
		{
			LogSource.Log((LogLevel)2, data);
		}
	}
	public enum MirrorAxisPlacement
	{
		None,
		PlacingA,
		PlacingB
	}
	public class MirrorToolGlobals
	{
		public static bool useMirror = true;

		public static MirrorAxisPlacement placement = MirrorAxisPlacement.PlacingA;
	}
	public class Patcher
	{
		public class MyBehaviour : MonoBehaviour
		{
			public void OnDestroy()
			{
				go = null;
			}
		}

		private class PatchResults
		{
			public MethodInfo pre;

			public MethodInfo post;

			public MethodInfo orig;
		}

		private static Harmony harmony;

		public static MonoBehaviour modBehaviour;

		private static GameObject go;

		public static void InjectSystems(UpdateSystem updateSystem)
		{
			updateSystem.UpdateBefore<PreSimulationSystem>((SystemUpdatePhase)12);
			updateSystem.UpdateAfter<PostSimulationSystem>((SystemUpdatePhase)12);
		}

		public static void TakeScreenshot(string filename)
		{
			//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_0029: Expected O, but got Unknown
			if ((Object)(object)go == (Object)null || !go.activeInHierarchy)
			{
				GameObject val = new GameObject("LemmyMod");
				go = val;
				modBehaviour = (MonoBehaviour)(object)val.AddComponent<MyBehaviour>();
			}
			modBehaviour.StartCoroutine(CaptureScreenshot(filename));
		}

		internal static IEnumerator CaptureScreenshot(string filename)
		{
			yield return (object)new WaitForEndOfFrame();
			ScreenUtilityHooked.CaptureScreenshot(out var _, filename);
		}

		public static void Init(Harmony harmony)
		{
			Patcher.harmony = harmony;
			PatchClass<AssetLibrary, AssetLibraryHooked>();
			PatchClass<AssetCollection, AssetCollectionHooked>();
			PatchClass<NameSystem, NameSystemHooked>();
		}

		public static void PatchClass<Type, SecondType>()
		{
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			Logger.LogInfo("Attempting to patch class: " + typeof(Type).Name);
			try
			{
				MethodInfo[] methods = typeof(SecondType).GetMethods();
				Dictionary<string, PatchResults> dictionary = new Dictionary<string, PatchResults>();
				MethodInfo[] array = methods;
				foreach (MethodInfo methodInfo in array)
				{
					if (!methodInfo.IsStatic)
					{
						continue;
					}
					string text = methodInfo.Name;
					bool flag = true;
					if (methodInfo.Name.StartsWith("Prefix_"))
					{
						flag = false;
						text = text.Substring(7);
					}
					PatchResults patchResults = new PatchResults();
					if (!dictionary.ContainsKey(text))
					{
						MethodInfo method = typeof(Type).GetMethod(text);
						if (method == null)
						{
							method = typeof(Type).GetMethod(text, BindingFlags.NonPublic);
						}
						if (method == null)
						{
							method = typeof(Type).GetMethod(text, BindingFlags.Instance);
						}
						if (method == null)
						{
							method = typeof(Type).GetMethod(text, BindingFlags.Instance | BindingFlags.NonPublic);
						}
						if (method == null)
						{
							Logger.LogError("Method was blank: " + typeof(Type).Name + "." + text + " - could not patch.");
							continue;
						}
						patchResults = (dictionary[text] = new PatchResults());
						patchResults.orig = method;
					}
					else
					{
						patchResults = dictionary[text];
					}
					if (flag)
					{
						patchResults.post = methodInfo;
					}
					else
					{
						patchResults.pre = methodInfo;
					}
				}
				foreach (KeyValuePair<string, PatchResults> item in dictionary)
				{
					PatchResults value = item.Value;
					string text2 = "\nPatching " + typeof(Type).Name + "." + value.orig.Name + "\n";
					if (value.pre != null)
					{
						text2 = text2 + "\tPre:\t" + typeof(SecondType).Name + "." + value.pre.Name + "\n";
					}
					if (value.post != null)
					{
						text2 = text2 + "\tPost:\t" + typeof(SecondType).Name + "." + value.post.Name + "\n";
					}
					Logger.LogInfo(text2);
					harmony.Patch((MethodBase)value.orig, (value.pre == null) ? ((HarmonyMethod)null) : new HarmonyMethod(value.pre), (value.post == null) ? ((HarmonyMethod)null) : new HarmonyMethod(value.post), (HarmonyMethod)null, (HarmonyMethod)null);
				}
			}
			catch (Exception ex)
			{
				Console.WriteLine(ex);
				Logger.LogError(ex);
				throw;
			}
		}

		public static void AddPostFixPatch(Type origType, string origFunc, BindingFlags origBinding, Type patchType, string patchFunc)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			MethodInfo method = patchType.GetMethod(patchFunc, BindingFlags.Static | BindingFlags.Public);
			MethodInfo method2 = origType.GetMethod(origFunc, origBinding);
			harmony.Patch((MethodBase)method2, (HarmonyMethod)null, new HarmonyMethod(method), (HarmonyMethod)null, (HarmonyMethod)null);
		}

		public static void AdPreFixPatch(Type origType, string origFunc, BindingFlags origBinding, Type patchType, string patchFunc)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			MethodInfo method = patchType.GetMethod(patchFunc, BindingFlags.Static | BindingFlags.Public);
			MethodInfo method2 = origType.GetMethod(origFunc, origBinding);
			harmony.Patch((MethodBase)method2, new HarmonyMethod(method), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}

		public static void AddPatch(Type origType, string origFunc, BindingFlags origBinding, Type patchType, string prepatchFunc, string postpatchFunc)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_0038: Expected O, but got Unknown
			MethodInfo method = patchType.GetMethod(prepatchFunc, BindingFlags.Static | BindingFlags.Public);
			MethodInfo method2 = patchType.GetMethod(prepatchFunc, BindingFlags.Static | BindingFlags.Public);
			MethodInfo method3 = origType.GetMethod(origFunc, origBinding);
			harmony.Patch((MethodBase)method3, new HarmonyMethod(method), new HarmonyMethod(method2), (HarmonyMethod)null, (HarmonyMethod)null);
		}
	}
	public class VideoRenderer
	{
		public struct SaveVideoData
		{
			public string dir { get; set; }

			public string assDir { get; set; }
		}

		private struct ImageData
		{
			public string fileName;

			public byte[] bytes;
		}

		public static VideoRenderer Instance = new VideoRenderer();

		public static string AssemblyDirectory => Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path));

		[DllImport("shell32.dll")]
		private static extern int SHGetKnownFolderPath([MarshalAs(UnmanagedType.LPStruct)] Guid rfid, uint dwFlags, IntPtr hToken, ref IntPtr ppszPath);

		public void GetVideoLibraryFolders()
		{
			IntPtr ppszPath = default(IntPtr);
			SHGetKnownFolderPath(new Guid("491E922F-5643-4AF4-A7EB-4E7A138D8174"), 0u, IntPtr.Zero, ref ppszPath);
			string? inputUri = Marshal.PtrToStringUni(ppszPath);
			Marshal.FreeCoTaskMem(ppszPath);
			List<string> list = new List<string>();
			using (XmlReader xmlReader = XmlReader.Create(inputUri))
			{
				while (xmlReader.ReadToFollowing("simpleLocation"))
				{
					xmlReader.ReadToFollowing("url");
					list.Add(xmlReader.ReadElementContentAsString());
				}
			}
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].Contains("knownfolder"))
				{
					list[i] = list[i].Replace("knownfolder:{", "");
					list[i] = list[i].Replace("}", "");
					SHGetKnownFolderPath(new Guid(list[i]), 0u, IntPtr.Zero, ref ppszPath);
					list[i] = Marshal.PtrToStringUni(ppszPath);
					Marshal.FreeCoTaskMem(ppszPath);
				}
			}
		}

		public void Render(int framerate = 60)
		{
			string assemblyDirectory = AssemblyDirectory;
			string dir = Path.Combine(Application.persistentDataPath, "VideoFrames");
			ThreadPool.UnsafeQueueUserWorkItem(SaveVideo, new SaveVideoData
			{
				dir = dir,
				assDir = assemblyDirectory
			});
		}

		private static void SaveVideo(object state)
		{
			SaveVideoData saveVideoData = ((state is SaveVideoData) ? ((SaveVideoData)state) : default(SaveVideoData));
			string assDir = saveVideoData.assDir;
			string dir = saveVideoData.dir;
			try
			{
				if (File.Exists(dir + "\\out.mp4"))
				{
					File.Delete(dir + "\\out.mp4");
				}
			}
			catch (Exception)
			{
			}
			try
			{
				Process process = new Process();
				process.StartInfo.FileName = "CMD.exe";
				string arguments = "/C .\\ffmpeg.exe -pattern_type sequence -i \"" + dir + "\\Video_%05d.tga\" -c:v libx264 -pix_fmt yuv444p -r 60 -s:v " + Screen.width + "x" + Screen.height + " \"" + dir + "\\out.mp4\"";
				process.StartInfo.Arguments = arguments;
				process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
				process.StartInfo.CreateNoWindow = false;
				process.StartInfo.WorkingDirectory = assDir;
				process.StartInfo.UseShellExecute = true;
				process.StartInfo.RedirectStandardOutput = false;
				process.Start();
				process.WaitForExit();
			}
			catch (Exception)
			{
			}
			try
			{
				IntPtr ppszPath = default(IntPtr);
				SHGetKnownFolderPath(new Guid("491E922F-5643-4AF4-A7EB-4E7A138D8174"), 0u, IntPtr.Zero, ref ppszPath);
				string? inputUri = Marshal.PtrToStringUni(ppszPath);
				Marshal.FreeCoTaskMem(ppszPath);
				List<string> list = new List<string>();
				using (XmlReader xmlReader = XmlReader.Create(inputUri))
				{
					while (xmlReader.ReadToFollowing("simpleLocation"))
					{
						xmlReader.ReadToFollowing("url");
						list.Add(xmlReader.ReadElementContentAsString());
					}
				}
				for (int i = 0; i < list.Count; i++)
				{
					if (list[i].Contains("knownfolder"))
					{
						list[i] = list[i].Replace("knownfolder:{", "");
						list[i] = list[i].Replace("}", "");
						SHGetKnownFolderPath(new Guid(list[i]), 0u, IntPtr.Zero, ref ppszPath);
						list[i] = Marshal.PtrToStringUni(ppszPath);
						Marshal.FreeCoTaskMem(ppszPath);
					}
				}
				string text = list[0];
				File.Copy(dir + "\\out.mp4", text + "\\" + DateTime.Now.ToString("yyyy-dd-M--HH-mm-ss") + ".mp4");
			}
			catch (Exception)
			{
				string text2 = Path.Combine(Application.persistentDataPath, "Videos");
				if (!Directory.Exists(text2))
				{
					Directory.CreateDirectory(text2);
				}
				File.Copy(dir + "\\out.mp4", text2 + "\\" + DateTime.Now.ToString("yyyy-dd-M--HH-mm-ss") + ".mp4");
			}
			try
			{
				string[] files = Directory.GetFiles(dir);
				foreach (string path in files)
				{
					try
					{
						File.Delete(path);
					}
					catch (Exception)
					{
					}
				}
			}
			catch (Exception)
			{
			}
			try
			{
				Directory.Delete(dir);
			}
			catch (Exception)
			{
			}
		}

		public void AddFrameToExport(byte[] pngdata, string fileName)
		{
			ThreadPool.QueueUserWorkItem(WriteImageToFile, new ImageData
			{
				fileName = fileName,
				bytes = pngdata
			});
		}

		private void WriteImageToFile(object state)
		{
			ImageData imageData = (ImageData)state;
			File.WriteAllBytes(imageData.fileName, imageData.bytes);
		}
	}
}
namespace LemmyModFramework.util
{
	public class DeepCloner
	{
		private const BindingFlags Binding = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy;

		private Type _primaryType;

		private object _desireObjectToBeCloned;

		private bool collectionsOnly;

		public DeepCloner(object desireObjectToBeCloned)
		{
			if (desireObjectToBeCloned == null)
			{
				throw new Exception("The desire object to be cloned cant be NULL");
			}
			_primaryType = desireObjectToBeCloned.GetType();
			_desireObjectToBeCloned = desireObjectToBeCloned;
			collectionsOnly = false;
		}

		public DeepCloner(object desireObjectToBeCloned, bool collectionsOnly)
		{
			if (desireObjectToBeCloned == null)
			{
				throw new Exception("The desire object to be cloned cant be NULL");
			}
			_primaryType = desireObjectToBeCloned.GetType();
			_desireObjectToBeCloned = desireObjectToBeCloned;
			this.collectionsOnly = collectionsOnly;
		}

		private object DeepClone()
		{
			if (_desireObjectToBeCloned == null)
			{
				return null;
			}
			if (_primaryType.IsArray)
			{
				return ((Array)_desireObjectToBeCloned).Clone();
			}
			object obj = _desireObjectToBeCloned as IList;
			if (obj != null)
			{
				PropertyInfo[] properties = _primaryType.GetProperties();
				obj = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(properties[^1].PropertyType));
				IList list = (IList)obj;
				foreach (object item in (IList)_desireObjectToBeCloned)
				{
					if (item != null)
					{
						if (collectionsOnly)
						{
							list?.Add(item);
							continue;
						}
						object value = new DeepCloner(item, collectionsOnly).DeepClone();
						list?.Add(value);
					}
				}
			}
			else
			{
				if (_primaryType == typeof(string))
				{
					return (_desireObjectToBeCloned as string)?.Clone();
				}
				obj = FormatterServices.GetUninitializedObject(_primaryType);
				FieldInfo[] fields = _desireObjectToBeCloned.GetType().GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy);
				foreach (FieldInfo fieldInfo in fields)
				{
					if (fieldInfo.IsInitOnly)
					{
						continue;
					}
					object value2 = fieldInfo.GetValue(_desireObjectToBeCloned);
					if (fieldInfo.FieldType.IsClass && fieldInfo.FieldType != typeof(string))
					{
						object obj2 = value2 as IList;
						if (collectionsOnly && obj2 == null)
						{
							obj.GetType().GetField(fieldInfo.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy)?.SetValue(obj, value2);
							continue;
						}
						object value3 = new DeepCloner(value2, collectionsOnly).DeepClone();
						obj.GetType().GetField(fieldInfo.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy)?.SetValue(obj, value3);
					}
					else
					{
						obj.GetType().GetField(fieldInfo.Name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.FlattenHierarchy)?.SetValue(obj, value2);
					}
				}
			}
			return obj;
		}

		public object Clone()
		{
			return DeepClone();
		}

		public T Clone<T>()
		{
			return (T)DeepClone();
		}
	}
}
namespace LemmyModFramework.systems
{
	public class PreSimulationSystem : GameSystemBase
	{
		protected override void OnUpdate()
		{
		}
	}
	public class PostSimulationSystem : GameSystemBase
	{
		protected override void OnUpdate()
		{
		}
	}
}
namespace LemmyModFramework.src.hooks
{
	public class AssetCollectionHooked
	{
		public static void AddPrefabsTo(AssetCollection __instance, PrefabSystem prefabSystem)
		{
			AssetLibraryHookedImpl.Buildings.ContainsKey(((Object)__instance).name);
		}
	}
	public class AssetLibraryHookedImpl
	{
		public static Dictionary<string, AssetCollection> Buildings = new Dictionary<string, AssetCollection>();

		public static AssetLibrary Instance;

		public static Dictionary<string, UIAssetCategoryPrefab> PrefabSubmenus = new Dictionary<string, UIAssetCategoryPrefab>();

		public static Dictionary<string, string> InheritPrefabMenu = new Dictionary<string, string>();

		private static int menuPriority = 1000;

		private static HashSet<string> added = new HashSet<string>();

		public static void Load(AssetLibrary __instance, PrefabSystem prefabSystem, CancellationToken token)
		{
			if (Buildings.Count != 0)
			{
				return;
			}
			Instance = __instance;
			foreach (AssetCollection collection in __instance.m_Collections)
			{
				if (((Object)collection).name.Contains("Signature"))
				{
					Buildings[((Object)collection).name] = collection;
					continue;
				}
				if (((Object)collection).name.Contains("Residential"))
				{
					Buildings[((Object)collection).name] = collection;
				}
				if (((Object)collection).name.Contains("Mixed"))
				{
					Buildings[((Object)collection).name] = collection;
				}
				if (((Object)collection).name.Contains("Commercial"))
				{
					Buildings[((Object)collection).name] = collection;
				}
				if (((Object)collection).name.Contains("Industrial"))
				{
					Buildings[((Object)collection).name] = collection;
				}
				if (((Object)collection).name.Contains("Office"))
				{
					Buildings[((Object)collection).name] = collection;
				}
			}
			CreatePrefabSubmenu("ResidentialLow_Ploppable", "EU_ResidentialLowSignatureAssetCollection", "Media/Game/Icons/ZoneResidentialLow.svg", "Residential Low Ploppable");
			CreatePrefabSubmenu("ResidentialMedium_Ploppable", "EU_ResidentialMediumSignatureAssetCollection", "Media/Game/Icons/ZoneResidentialMedium.svg", "Residential Med Ploppable");
			CreatePrefabSubmenu("ResidentialHigh_Ploppable", "EU_ResidentialHighSignatureAssetCollection", "Media/Game/Icons/ZoneResidentialHigh.svg", "Residential High Ploppable");
			CreatePrefabSubmenu("ResidentialMediumRow_Ploppable", "EU_ResidentialMediumSignatureAssetCollection", "Media/Game/Icons/ZoneResidentialMediumRow.svg", "Residential Row Ploppable");
			CreatePrefabSubmenu("shared_ResidentialLowRent_Ploppable", "EU_ResidentialHighSignatureAssetCollection", "Media/Game/Icons/ZoneResidentialLowRent.svg", "Residential Low Rent Ploppable");
			CreatePrefabSubmenu("shared_Mixed_Ploppable", "EU_MixedSignatureAssetCollection", "Media/Game/Icons/ZoneResidentialMixed.svg", "Mixed Ploppable");
			CreatePrefabSubmenu("CommercialLow_Ploppable", "EU_CommercialLowSignatureAssetCollection", "Media/Game/Icons/ZoneCommercialLow.svg", "Commercial Low Ploppable");
			CreatePrefabSubmenu("CommercialHigh_Ploppable", "EU_CommercialHighSignatureAssetCollection", "Media/Game/Icons/ZoneCommercialHigh.svg", "Commercial High Ploppable");
			CreatePrefabSubmenu("shared_OfficeLow_Ploppable", "shared_OfficeLowSignature", "Media/Game/Icons/ZoneOfficeLow.svg", "Office Low Ploppable");
			CreatePrefabSubmenu("shared_OfficeHigh_Ploppable", "shared_OfficeHighSignature", "Media/Game/Icons/ZoneOfficeHigh.svg", "Office High Ploppable");
			CreatePrefabSubmenu("shared_Industrial_Ploppable", "shared_IndustrialManufacturingSignatureCollection", "Media/Game/Icons/ZoneIndustrialManufacturing.svg", "Manufacturing Ploppable");
			CreatePrefabSubmenu("shared_Industrial_Warehouse_Ploppable", "shared_IndustrialManufacturingSignatureCollection", "Media/Game/Icons/ZoneIndustrialWarehouses.svg", "Warehouse Ploppable");
			Copy("shared_OfficeHigh", "shared_OfficeHigh_Ploppable");
			Copy("shared_OfficeLow", "shared_OfficeLow_Ploppable");
			Copy("shared_ResidentialLowRentCollection", "shared_ResidentialLowRent_Ploppable");
			Copy("EU_ResidentialMediumRowAssetCollection", "ResidentialMediumRow_Ploppable");
			Copy("EU_ResidentialHighAssetCollection", "ResidentialHigh_Ploppable");
			Copy("EU_ResidentialMediumAssetCollection", "ResidentialMedium_Ploppable");
			Copy("EU_ResidentialLowAssetCollection", "ResidentialLow_Ploppable");
			Copy("EU_CommercialHighAssetCollection", "CommercialHigh_Ploppable");
			Copy("EU_CommercialLowAssetCollection", "CommercialLow_Ploppable");
			Copy("EU_CommercialGasStationAssetCollection", "CommercialLow_Ploppable");
			Copy("EU_CommercialMotelAssetCollection", "CommercialLow_Ploppable");
			Copy("EU_CommercialHotelAssetCollection", "CommercialHigh_Ploppable");
			Copy("EU_MixedAssetCollection", "shared_Mixed_Ploppable");
			Copy("EU_MixedStorefrontAssetCollection", "shared_Mixed_Ploppable");
			Copy("EU_MixedLeftAssetCollection", "shared_Mixed_Ploppable");
			Copy("EU_MixedRightAssetCollection", "shared_Mixed_Ploppable");
			Copy("shared_IndustrialManufacturingCollection", "shared_Industrial_Ploppable");
			Copy("shared_IndustrialManufacturingWarehouseCollection", "shared_Industrial_Warehouse_Ploppable");
		}

		private static void CreatePrefabSubmenu(string name, string inherit_from, string icon, string localizedName)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			UIAssetCategoryPrefab val = (UIAssetCategoryPrefab)ScriptableObject.CreateInstance(typeof(UIAssetCategoryPrefab));
			((Object)val).name = name;
			UIObject obj = ((PrefabBase)val).AddComponent<UIObject>();
			obj.m_Icon = icon;
			PrefabSubmenus[name] = val;
			obj.m_Priority = menuPriority++;
			AssetCollection val2 = (AssetCollection)ScriptableObject.CreateInstance(typeof(AssetCollection));
			Instance.m_Collections.Add(val2);
			Buildings[name] = val2;
			val2.m_Prefabs = new List<PrefabBase>();
			val2.m_Collections = new List<AssetCollection>();
			InheritPrefabMenu[name] = inherit_from;
			LocalizationManager localizationManager = GameManager.instance.localizationManager;
			localizationManager.activeDictionary.Add("SubServices.NAME[" + name + "]", localizedName, true);
			localizationManager.activeDictionary.Add("Assets.SUB_SERVICE_DESCRIPTION[" + name + "]", localizedName, true);
		}

		private static void Copy(string fromCollection, string toCollection)
		{
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Expected O, but got Unknown
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Expected O, but got Unknown
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Expected O, but got Unknown
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			LocalizationManager localizationManager = GameManager.instance.localizationManager;
			if (!Buildings.ContainsKey(fromCollection) || !Buildings.ContainsKey(toCollection))
			{
				return;
			}
			if (fromCollection.StartsWith("EU_"))
			{
				Copy("NA_" + fromCollection.Substring(3), toCollection);
			}
			_ = Buildings[fromCollection].m_Prefabs;
			ZonePrefab val = null;
			UIAssetCategoryPrefab val2 = null;
			UIObject val3 = null;
			if (PrefabSubmenus.ContainsKey(toCollection))
			{
				if (Buildings[InheritPrefabMenu[toCollection]].m_Prefabs.Count == 0)
				{
					return;
				}
				PrefabBase obj = Buildings[InheritPrefabMenu[toCollection]].m_Prefabs[0];
				val = ((ComponentBase)obj).GetComponent<SignatureBuilding>().m_ZoneType;
				val3 = ((ComponentBase)obj).GetComponent<UIObject>();
				val2 = PrefabSubmenus[toCollection];
				val2.m_Menu = ((UIAssetCategoryPrefab)val3.m_Group).m_Menu;
			}
			else
			{
				using List<PrefabBase>.Enumerator enumerator = Buildings[toCollection].m_Prefabs.GetEnumerator();
				if (enumerator.MoveNext())
				{
					PrefabBase current = enumerator.Current;
					val = ((ComponentBase)current).GetComponent<SignatureBuilding>().m_ZoneType;
					val3 = ((ComponentBase)current).GetComponent<UIObject>();
					val2 = (UIAssetCategoryPrefab)val3.m_Group;
				}
			}
			foreach (PrefabBase prefab in Buildings[fromCollection].m_Prefabs)
			{
				if (prefab is BuildingPrefab && !added.Contains(((Object)prefab).name + "_ploppable"))
				{
					added.Add(((Object)prefab).name + "_ploppable");
					BuildingPrefab val4 = (BuildingPrefab)prefab;
					BuildingPrefab val5 = (BuildingPrefab)ScriptableObject.CreateInstance(typeof(BuildingPrefab));
					val5.m_AccessType = val4.m_AccessType;
					val5.m_LotDepth = val4.m_LotDepth;
					val5.m_LotWidth = val4.m_LotWidth;
					((ObjectGeometryPrefab)val5).m_Meshes = ((ObjectGeometryPrefab)val4).m_Meshes;
					((Object)val5).name = ((Object)prefab).name + "_ploppable";
					localizationManager.activeDictionary.Add("Assets.DESCRIPTION[" + ((Object)val5).name + "]", "", true);
					((PrefabBase)val5).components.AddRange(prefab.components);
					Buildings[toCollection].m_Prefabs.Insert(0, (PrefabBase)(object)val5);
					if ((Object)(object)val != (Object)null && !prefab.Has<SignatureBuilding>())
					{
						((PrefabBase)val5).Remove<SpawnableBuilding>();
						((PrefabBase)val5).AddComponent<SignatureBuilding>().m_ZoneType = val;
						UIObject obj2 = ((PrefabBase)val5).AddComponent<UIObject>();
						obj2.m_Group = (UIGroupPrefab)(object)val2;
						obj2.m_Icon = val3.m_Icon;
						obj2.m_LargeIcon = val3.m_LargeIcon;
					}
				}
			}
		}
	}
	public class AssetLibraryHooked
	{
		public static bool Prefix_Load(AssetLibrary __instance, PrefabSystem prefabSystem, CancellationToken token)
		{
			AssetLibraryHookedImpl.Load(__instance, prefabSystem, token);
			return true;
		}
	}
	internal class NameSystemHooked
	{
		public static bool Prefix_GetName(NameSystem __instance, ref Name __result, Entity entity, bool omitBrand = false)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: 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_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: 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_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: 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_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: 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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			Entity val = Entity.Null;
			PrefabRef val2 = default(PrefabRef);
			if (EntitiesExtensions.TryGetComponent<PrefabRef>(((ComponentSystemBase)__instance).EntityManager, entity, ref val2))
			{
				val = val2.m_Prefab;
			}
			string text = default(string);
			if (__instance.TryGetCustomName(entity, ref text))
			{
				__result = Name.CustomName(text);
				return false;
			}
			CompanyData val3 = default(CompanyData);
			if (EntitiesExtensions.TryGetComponent<CompanyData>(((ComponentSystemBase)__instance).EntityManager, entity, ref val3))
			{
				string id = __instance.GetId(val3.m_Brand, true);
				__result = ((id == null) ? Name.CustomName(((Object)__instance.m_PrefabSystem.GetPrefab<PrefabBase>(val)).name + " brand is null!") : Name.LocalizedName(id));
				return false;
			}
			EntityManager entityManager;
			if (val != Entity.Null)
			{
				entityManager = ((ComponentSystemBase)__instance).EntityManager;
				SpawnableBuildingData val4 = default(SpawnableBuildingData);
				if (EntitiesExtensions.TryGetComponent<SpawnableBuildingData>(((ComponentSystemBase)__instance).EntityManager, val, ref val4))
				{
					__result = __instance.GetSpawnableBuildingName(entity, val4.m_ZonePrefab, omitBrand);
					return false;
				}
			}
			entityManager = ((ComponentSystemBase)__instance).EntityManager;
			if (((EntityManager)(ref entityManager)).HasComponent<TransportStop>(entity))
			{
				entityManager = ((ComponentSystemBase)__instance).EntityManager;
				if (!((EntityManager)(ref entityManager)).HasComponent<OutsideConnection>(entity))
				{
					entityManager = ((ComponentSystemBase)__instance).EntityManager;
					__result = (((EntityManager)(ref entityManager)).HasComponent<Marker>(entity) ? __instance.GetMarkerTransportStopName(entity) : __instance.GetStaticTransportStopName(entity));
					return false;
				}
			}
			if (val != Entity.Null)
			{
				entityManager = ((ComponentSystemBase)__instance).EntityManager;
				if (((EntityManager)(ref entityManager)).HasComponent<TransportLine>(entity))
				{
					__result = __instance.GetRouteName(entity, val);
					return false;
				}
			}
			if (val != Entity.Null)
			{
				entityManager = ((ComponentSystemBase)__instance).EntityManager;
				if (((EntityManager)(ref entityManager)).HasComponent<Citizen>(entity))
				{
					__result = __instance.GetCitizenName(entity, val);
					return false;
				}
			}
			if (val != Entity.Null)
			{
				entityManager = ((ComponentSystemBase)__instance).EntityManager;
				if (((EntityManager)(ref entityManager)).HasComponent<Resident>(entity))
				{
					__result = __instance.GetResidentName(entity, val);
					return false;
				}
			}
			entityManager = ((ComponentSystemBase)__instance).EntityManager;
			if (((EntityManager)(ref entityManager)).HasComponent<TrafficAccident>(entity))
			{
				__result = Name.LocalizedName("SelectedInfoPanel.TRAFFIC_ACCIDENT");
				return false;
			}
			Controller val5 = default(Controller);
			if (EntitiesExtensions.TryGetComponent<Controller>(((ComponentSystemBase)__instance).EntityManager, entity, ref val5))
			{
				entity = val5.m_Controller;
			}
			__result = Name.LocalizedName(__instance.GetId(entity, true));
			return false;
		}
	}
	public class VFXVelocityBinderHooked
	{
	}
}
namespace LemmyModFramework.hooks
{
	public class AdaptiveDynamicResolutionScaleHooked
	{
		public static void SetParams(AdaptiveDynamicResolutionScale __instance, bool enabled, bool adaptive, float minScale, DynResUpscaleFilter filter, Camera camera)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			Resolution currentResolution = Screen.currentResolution;
			if (((Resolution)(ref currentResolution)).height < 8640)
			{
				Screen.SetResolution(15360, 8640, (FullScreenMode)2, 120);
			}
		}
	}
	public class AnimationSystemHooked
	{
		public static bool OnUpdate(AnimationSystem __instance)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			float fixedStepSimulationSpeed = Globals.FixedStepSimulationSpeed;
			float unscaledDeltaTime = Time.unscaledDeltaTime;
			unscaledDeltaTime = 1f / fixedStepSimulationSpeed;
			__instance.__TypeHandle.__Game_Tools_Animation_RW_ComponentTypeHandle.Update(ref ((SystemBase)__instance).CheckedStateRef);
			__instance.__TypeHandle.__Game_Objects_Transform_RO_ComponentTypeHandle.Update(ref ((SystemBase)__instance).CheckedStateRef);
			((SystemBase)__instance).Dependency = JobChunkExtensions.ScheduleParallel<AnimateJob>(new AnimateJob
			{
				m_DeltaTime = unscaledDeltaTime,
				m_TransformType = __instance.__TypeHandle.__Game_Objects_Transform_RO_ComponentTypeHandle,
				m_AnimationType = __instance.__TypeHandle.__Game_Tools_Animation_RW_ComponentTypeHandle
			}, __instance.m_AnimatedQuery, ((SystemBase)__instance).Dependency);
			return false;
		}
	}
	public class BatchDataSystemHooked
	{
		public static bool Prefix_GetLevelOfDetail(ref float __result, BatchDataSystem __instance, float levelOfDetail, IGameCameraController cameraController)
		{
			if (cameraController != null)
			{
				levelOfDetail *= (float)(1.0 - 1.0 / (2.0 + 0.009999999776482582 * (double)cameraController.zoom));
			}
			__result = levelOfDetail;
			return false;
		}
	}
	public class CinemachineBrainHooked
	{
		public bool Prefix_GetEffectiveDeltaTime(ref float __result, CinemachineBrain __instance, bool fixedDelta)
		{
			if (!Globals.fixedTimeActive)
			{
				return true;
			}
			float fixedStepSimulationSpeed = Globals.FixedStepSimulationSpeed;
			float unscaledDeltaTime = Time.unscaledDeltaTime;
			unscaledDeltaTime = 1f / fixedStepSimulationSpeed;
			__result = unscaledDeltaTime;
			return false;
		}
	}
	public class CinematicCameraControllerHooked
	{
		public static bool Prefix_UpdateController(CinematicCameraController __instance, Input input)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: 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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			if (!Globals.fixedTimeActive)
			{
				return true;
			}
			float fixedStepSimulationSpeed = Globals.FixedStepSimulationSpeed;
			__instance.m_RestrictToTerrain.Refresh();
			float unscaledDeltaTime = Time.unscaledDeltaTime;
			unscaledDeltaTime = 1f / fixedStepSimulationSpeed;
			Vector3 position = __instance.m_Anchor.position;
			float num = default(float);
			__instance.m_RestrictToTerrain.ClampToTerrain(position, true, ref num);
			float num2 = Mathf.Min(position.y - num, __instance.m_MaxMovementSpeedHeight) / __instance.m_MaxMovementSpeedHeight;
			Vector2 val = ((Input)(ref input)).move;
			if ((double)((Vector2)(ref val)).sqrMagnitude > 1.0)
			{
				((Vector2)(ref val)).Normalize();
			}
			val *= unscaledDeltaTime * Mathf.Lerp(__instance.m_MinMoveSpeed, __instance.m_MaxMoveSpeed, num2);
			Vector2 val2 = ((Input)(ref input)).rotate * unscaledDeltaTime * __instance.m_RotateSpeed + ((Input)(ref input)).mouseRotate * __instance.m_MouseRotateSpeed;
			float num3 = (float)((double)((Input)(ref input)).zoom * (double)Mathf.Lerp(__instance.m_MinZoomSpeed, __instance.m_MaxZoomSpeed, num2) * (double)unscaledDeltaTime + (double)((Input)(ref input)).mouseZoom * (double)Mathf.Lerp(__instance.m_MinMouseZoomSpeed, __instance.m_MaxMouseZoomSpeed, num2));
			Quaternion rotation = __instance.m_Anchor.rotation;
			Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles;
			float num4 = default(float);
			Vector3 val3 = __instance.m_RestrictToTerrain.ClampToTerrain(position + Quaternion.AngleAxis(eulerAngles.y, Vector3.up) * new Vector3(val.x, 0f - num3, val.y), true, ref num4);
			val3.y = Mathf.Min(val3.y, num4 + __instance.m_MaxHeight);
			Quaternion val4 = Quaternion.Euler(Mathf.Clamp((float)(((double)eulerAngles.x + 90.0) % 360.0) - val2.y, 0f, 180f) - 90f, eulerAngles.y + val2.x, 0f);
			Vector3 val5 = default(Vector3);
			__instance.m_Anchor.position = ((!__instance.m_RestrictToTerrain.enableObjectCollisions || !__instance.m_RestrictToTerrain.CheckForCollision(val3, __instance.m_RestrictToTerrain.previousPosition, val4, ref val5)) ? val3 : val5);
			__instance.m_Anchor.rotation = val4;
			return false;
		}
	}
	internal class CinematicCameraUISystemHooked
	{
		private static int frame;

		private static bool recording;

		private static bool was_playing;

		private static Resolution res;

		public static bool Prefix_set_playing(CinematicCameraUISystem __instance)
		{
			was_playing = __instance.m_Playing;
			return true;
		}

		public static void set_playing(CinematicCameraUISystem __instance)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			if (!Globals.recordCinematics)
			{
				return;
			}
			if (__instance.m_Playing && !was_playing)
			{
				frame = 0;
				recording = true;
				float fixedStepSimulationSpeed = Globals.FixedStepSimulationSpeed;
				_ = Time.unscaledDeltaTime;
				Time.captureDeltaTime = 1f / fixedStepSimulationSpeed;
				res = Screen.currentResolution;
				Globals.fixedTimeActive = true;
				try
				{
					string path = Path.Combine(Application.persistentDataPath, "VideoFrames");
					try
					{
						string[] files = Directory.GetFiles(path);
						foreach (string path2 in files)
						{
							try
							{
								File.Delete(path2);
							}
							catch (Exception)
							{
							}
						}
					}
					catch (Exception)
					{
					}
					Directory.Delete(path);
					return;
				}
				catch (Exception)
				{
					return;
				}
			}
			if (!__instance.m_Playing && was_playing)
			{
				frame = 0;
				if (recording)
				{
					VideoRenderer.Instance.Render();
				}
				recording = false;
				Time.captureDeltaTime = 0f;
				Globals.fixedTimeActive = false;
			}
		}

		public static bool Prefix_UpdatePlayback(CinematicCameraUISystem __instance)
		{
			if (!Globals.fixedTimeActive)
			{
				Time.captureDeltaTime = 0f;
				return true;
			}
			float fixedStepSimulationSpeed = Globals.FixedStepSimulationSpeed;
			float unscaledDeltaTime = Time.unscaledDeltaTime;
			unscaledDeltaTime = 1f / fixedStepSimulationSpeed;
			if (__instance.playing)
			{
				Time.captureDeltaTime = unscaledDeltaTime;
			}
			__instance.t += unscaledDeltaTime;
			CinematicCameraSequence val = __instance.m_ActiveAutoplaySequence ?? __instance.activeSequence;
			if ((double)__instance.t >= (double)val.playbackDuration)
			{
				if (val.loop)
				{
					__instance.t -= val.playbackDuration;
				}
				else
				{
					__instance.playing = false;
				}
				recording = false;
			}
			__instance.t = Mathf.Min(__instance.t, val.playbackDuration);
			val.Refresh(__instance.t, (IDictionary<string, PhotoModeProperty>)__instance.m_PhotoModeRenderSystem.photoModeProperties, __instance.m_CameraUpdateSystem.activeCameraController);
			string text = "Video_";
			if (__instance.m_Playing && recording)
			{
				string text2 = frame.ToString();
				while (text2.Length < 5)
				{
					text2 = "0" + text2;
				}
				text += text2;
				Patcher.TakeScreenshot(text);
				frame++;
			}
			else
			{
				frame = 0;
				Globals.fixedTimeActive = false;
				Time.captureDeltaTime = 0f;
				if (recording)
				{
					recording = false;
					VideoRenderer.Instance.Render();
				}
			}
			return false;
		}
	}
	internal class DynamicResolutionHandlerHooked
	{
		public static bool Prefix_FlushScalableBufferManagerState(DynamicResolutionHandler __instance)
		{
			DynamicResolutionHandler.s_GlobalHwUpresActive = __instance.HardwareDynamicResIsEnabled();
			DynamicResolutionHandler.s_GlobalHwFraction = __instance.m_CurrentFraction;
			ScalableBufferManager.ResizeBuffers(3f, 3f);
			return false;
		}

		public static bool Prefix_ProcessSettings(DynamicResolutionHandler __instance, GlobalDynamicResolutionSettings settings)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: 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_0069: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			__instance.m_ForceSoftwareFallback = false;
			if (!settings.forceResolution)
			{
				DynamicResolutionHandler.s_ActiveInstanceDirty = true;
			}
			settings.forceResolution = true;
			settings.forcedPercentage = 300f;
			__instance.m_Enabled = settings.enabled && (Application.isPlaying || settings.forceResolution);
			if (!__instance.m_Enabled)
			{
				__instance.m_CurrentFraction = 1f;
			}
			else
			{
				__instance.type = settings.dynResType;
				__instance.m_UseMipBias = settings.useMipBias;
				__instance.m_MinScreenFraction = 1f;
				__instance.m_MaxScreenFraction = 3f;
				__instance.filter = (DynamicResolutionHandler.s_CameraUpscaleFilters.TryGetValue(DynamicResolutionHandler.s_ActiveCameraId, out var value) ? value : settings.upsampleFilter);
				__instance.m_ForcingRes = settings.forceResolution;
				if (__instance.m_ForcingRes)
				{
					__instance.m_CurrentFraction = Mathf.Clamp(settings.forcedPercentage / 100f, 0.1f, 3f);
				}
			}
			__instance.m_CachedSettings = settings;
			return false;
		}
	}
	public class RenderingUtilsHooked
	{
		public static bool CalculateLodParameters(ref float4 __result, float lodFactor, LODParameters lodParameters)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			float num = 1f / math.tan(math.radians(((LODParameters)(ref lodParameters)).fieldOfView * 0.5f));
			lodFactor *= 540f * num;
			__result = new float4(lodFactor, (float)(1.0 / ((double)lodFactor * (double)lodFactor)), num + 1f, num);
			return false;
		}
	}
	public class ScreenUtilityHooked
	{
		public static bool CaptureScreenshot(out string __result, string fileName = null, int supersize = 1)
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			if (fileName == null)
			{
				__result = "";
				return true;
			}
			Texture2D val = ScreenCapture.CaptureScreenshotAsTexture(supersize);
			string text = Path.Combine(Application.persistentDataPath, "VideoFrames");
			if (!Directory.Exists(text))
			{
				Directory.CreateDirectory(text);
			}
			string text2 = Path.Combine(text, Path.ChangeExtension(fileName, ".tga"));
			byte[] pngdata = ImageConversion.EncodeArrayToTGA((Array)val.GetRawTextureData(), ((Texture)val).graphicsFormat, (uint)((Texture)val).width, (uint)((Texture)val).height, 0u);
			VideoRenderer.Instance.AddFrameToExport(pngdata, text2);
			Object.DestroyImmediate((Object)(object)val);
			__result = text2;
			return false;
		}
	}
	public class SimulationSystemHooked
	{
		public static bool Prefix_OnUpdate()
		{
			if (Globals.fixedTimeActive)
			{
				return false;
			}
			return true;
		}

		public static void OnUpdate(SimulationSystem __instance)
		{
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			if (!Globals.fixedTimeActive)
			{
				return;
			}
			int num = (int)(120f / Globals.FixedStepSimulationSpeed);
			if (num < 1)
			{
				num = 1;
			}
			float fixedStepSimulationSpeed = Globals.FixedStepSimulationSpeed;
			float num2 = 1f / fixedStepSimulationSpeed;
			((JobHandle)(ref __instance.m_WatchDeps)).Complete();
			__instance.frameDuration = num2;
			__instance.m_Stopwatch.Reset();
			__instance.m_StepCount = num;
			if (__instance.m_IsLoading)
			{
				if ((double)__instance.loadingProgress != 1.0)
				{
					__instance.UpdateLoadingProgress();
					return;
				}
				if (!GameManager.instance.isGameLoading)
				{
					__instance.m_IsLoading = false;
					SharedSettings instance = SharedSettings.instance;
					GameplaySettings val = ((instance != null) ? instance.gameplay : null);
					__instance.selectedSpeed = ((val == null || !val.pausedAfterLoading) ? 1f : 0f);
				}
			}
			else if (GameManager.instance.isGameLoading)
			{
				__instance.selectedSpeed = 0f;
				num = (__instance.m_StepCount = 0);
			}
			if ((double)__instance.selectedSpeed == 0.0)
			{
				__instance.smoothSpeed = 0f;
				num = (__instance.m_StepCount = 0);
			}
			else
			{
				__instance.smoothSpeed = 1f;
				float num3 = num2 * __instance.selectedSpeed;
				__instance.m_Timer += num3;
				int num4 = (int)Mathf.Floor(__instance.m_Timer * 60f);
				__instance.m_Timer = Mathf.Clamp(__instance.m_Timer - (float)num4 / 60f, 0f, num2);
			}
			__instance.frameTime = __instance.m_Timer * 60f;
			__instance.m_LastSpeed = __instance.selectedSpeed;
			__instance.m_UpdateSystem.Update((SystemUpdatePhase)10);
			for (int i = 0; i < num; i++)
			{
				__instance.m_StepCount = num;
				__instance.m_Stopwatch.Start();
				uint frameIndex = __instance.frameIndex + 1;
				__instance.frameIndex = frameIndex;
				if (GameModeExtensions.IsEditor(__instance.m_ToolSystem.actionMode))
				{
					__instance.m_UpdateSystem.Update((SystemUpdatePhase)13, __instance.frameIndex, 0);
				}
				if (GameModeExtensions.IsGame(__instance.m_ToolSystem.actionMode))
				{
					__instance.m_UpdateSystem.Update((SystemUpdatePhase)12, __instance.frameIndex, 0);
				}
				SimulationEndTimeJob val2 = default(SimulationEndTimeJob);
				val2.m_Stopwatch = GCHandle.Alloc(__instance.m_Stopwatch);
				SimulationEndTimeJob val3 = val2;
				__instance.m_WatchDeps = IJobExtensions.Schedule<SimulationEndTimeJob>(val3, __instance.m_EndFrameBarrier.producerHandle);
			}
			__instance.m_UpdateSystem.Update((SystemUpdatePhase)11);
		}
	}
	public class TextureStreamingSystemHooked
	{
		public static bool Initialize(TextureStreamingSystem __instance, int desiredMipBias, FilterMode filterMode)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Expected O, but got Unknown
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Expected O, but got Unknown
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Expected O, but got Unknown
			__instance.CleanupVT();
			__instance.m_VirtualTexturingConfig.filterMode = filterMode;
			__instance.m_MipBias = Mathf.Max(__instance.m_DatasetMipBias, desiredMipBias);
			__instance.m_VtProceduralCPU = new VTProceduralCPU(__instance.m_VirtualTexturingConfig);
			__instance.m_VtDatabase = new VTDatabase(__instance.m_VirtualTexturingConfig, __instance.m_AtlasMaterialsGrouper.midMipLevelsCount, (IVTStackCreator)(object)__instance.m_VtProceduralCPU);
			if (__instance.m_AtlasMaterialsGrouper.IsInitialized)
			{
				__instance.m_AtlasMaterialsGrouper.PreRegisterToVT(__instance);
			}
			foreach (SurfaceAsset asset in AssetDatabase.global.GetAssets<SurfaceAsset>(default(SearchFilter<SurfaceAsset>)))
			{
				asset.ClearVTAtlassingInfos();
				if (!__instance.m_AtlasMaterialsGrouper.SetPreReservedIndex(asset))
				{
					if (asset.isVTMaterial)
					{
						asset.RegisterToVT(__instance);
						__instance.m_VTAssetsToInit.Enqueue(asset);
					}
				}
				else if (__instance.m_AtlasMaterialsGrouper.IsDuplicate(((AssetData)asset).guid))
				{
					__instance.m_VTAssetsShallowInit.Enqueue(asset);
				}
				else
				{
					__instance.m_VTAssetsToInit.Enqueue(asset);
				}
			}
			__instance.m_VTMaterialsCountToLoad = __instance.m_VTAssetsToInit.Count;
			__instance.m_VTMaterialsDuplicatesCountToInit = __instance.m_VTAssetsShallowInit.Count;
			RenderTexture val = new RenderTexture(1, 1, (GraphicsFormat)49, (GraphicsFormat)0);
			((Object)val).name = "VTWorkingSetBiasReadbackRT";
			__instance.m_WorkingSetLodBiasRT = val;
			__instance.m_WorkingSetLodBiasRT.Create();
			Material val2 = new Material(Resources.Load<Shader>("VirtualTexturingBiasReadback"));
			((Object)val2).name = "VTWorkingSetBiasReadback";
			__instance.m_WorkingSetLodBiasMat = val2;
			return false;
		}
	}
	public class ToolUISystemHooked
	{
		public static void OnCreate(ToolUISystem __instance)
		{
			_ = GameManager.instance.userInterface.view;
		}

		public static void OnElevationUp(ToolUISystem __instance)
		{
			_ = GameManager.instance.userInterface.view;
		}

		public static void OnElevationDown(ToolUISystem __instance)
		{
			_ = GameManager.instance.userInterface.view;
		}
	}
	public class WaterSimulationResourcesHooked
	{
		private static float time_since_startup;

		public static bool Prefix_Update(WaterSimulationResources __instance, float timeMultiplier)
		{
			if (!Globals.fixedTimeActive)
			{
				return true;
			}
			float fixedStepSimulationSpeed = Globals.FixedStepSimulationSpeed;
			float num = 1f / fixedStepSimulationSpeed;
			__instance.m_Time = time_since_startup;
			__instance.deltaTime = num;
			__instance.simulationTime += num;
			time_since_startup += num;
			return false;
		}
	}
	public class WaterSystemHooked
	{
		public static void SourceStep(WaterSystem __instance)
		{
			if (Globals.fixedTimeActive)
			{
				float fixedStepSimulationSpeed = Globals.FixedStepSimulationSpeed;
				float unscaledDeltaTime = Time.unscaledDeltaTime;
				unscaledDeltaTime = 1f / fixedStepSimulationSpeed;
				__instance.m_TimeStep = unscaledDeltaTime * 1E-08f;
				__instance.TimeStepOverride = unscaledDeltaTime * 1E-08f;
			}
		}
	}
	public class WindControlHooked
	{
		private static float time;

		public static bool Prefix_SetGlobalProperties(WindControl __instance, CommandBuffer cmd, WindVolumeComponent wind)
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0337: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0414: Unknown result type (might be due to invalid IL or missing references)
			//IL_0445: Unknown result type (might be due to invalid IL or missing references)
			//IL_0476: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_0499: Unknown result type (might be due to invalid IL or missing references)
			//IL_049e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
			if (!Globals.fixedTimeActive)
			{
				return true;
			}
			ProfilingScope val = default(ProfilingScope);
			((ProfilingScope)(ref val))..ctor(cmd, ProfilingSampler.Get<ProfileId>((ProfileId)13));
			try
			{
				float fixedStepSimulationSpeed = Globals.FixedStepSimulationSpeed;
				float num = 1f / fixedStepSimulationSpeed;
				float num2 = time;
				time += num;
				float3 val2 = math.mul(quaternion.Euler(0f, math.radians(((VolumeParameter<float>)(object)wind.windDirection).value) + math.cos((float)Math.PI * 2f * num2 / ((VolumeParameter<float>)(object)wind.windDirectionVariancePeriod).value) * math.radians(((VolumeParameter<float>)(object)wind.windDirectionVariance).value), 0f, (RotationOrder)4), WindControl.kForward);
				float3 val3 = math.mul(quaternion.Euler(0f, ((VolumeParameter<float>)(object)wind.windDirection).value, 0f, (RotationOrder)4), WindControl.kForward);
				float num3 = ((VolumeParameter<AnimationCurve>)(object)wind.windGustStrengthControl).value.Evaluate(num2);
				float num4 = ((VolumeParameter<AnimationCurve>)(object)wind.windTreeGustStrengthControl).value.Evaluate(num2);
				ref ShaderVariablesWind shaderVariablesWindCB = ref __instance.m_ShaderVariablesWindCB;
				float4 val4 = new float4(val2, 1f);
				float4 val5 = new float4(val3, num2);
				float4 zero = float4.zero;
				zero.w = math.min(1f, (Time.fixedTime - __instance._LastParametersSamplingTime) / ((VolumeParameter<float>)(object)wind.windParameterInterpolationDuration).value);
				shaderVariablesWindCB._WindData_0 = float4x4.op_Implicit(math.transpose(new float4x4(val4, val5, zero, new float4(__instance._WindBaseStrengthPhase.previous, __instance._WindBaseStrengthPhase2.previous, __instance._WindBaseStrengthPhase.current, __instance._WindBaseStrengthPhase2.current))));
				__instance.m_ShaderVariablesWindCB._WindData_1 = float4x4.op_Implicit(math.transpose(new float4x4(new float4(((VolumeParameter<float>)(object)wind.windBaseStrength).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale2).value, ((VolumeParameter<float>)(object)wind.windBaseStrengthOffset).value, ((VolumeParameter<float>)(object)wind.windTreeBaseStrength).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale2).value, ((VolumeParameter<float>)(object)wind.windTreeBaseStrengthOffset).value), new float4(0f, ((VolumeParameter<float>)(object)wind.windGustStrength).value * num3 * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale2).value, ((VolumeParameter<float>)(object)wind.windGustStrengthOffset).value, __instance._WindFlutterGustVariancePeriod.current), new float4(__instance._WindGustStrengthVariancePeriod.current, __instance._WindGustStrengthVariancePeriod.previous, ((VolumeParameter<float>)(object)wind.windGustInnerCosScale).value, ((VolumeParameter<float>)(object)wind.windFlutterStrength).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale2).value), new float4(((VolumeParameter<float>)(object)wind.windFlutterGustStrength).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale2).value, ((VolumeParameter<float>)(object)wind.windFlutterGustStrengthOffset).value, ((VolumeParameter<float>)(object)wind.windFlutterGustStrengthScale).value, __instance._WindFlutterGustVariancePeriod.previous))));
				__instance.m_ShaderVariablesWindCB._WindData_2 = float4x4.op_Implicit(math.transpose(new float4x4(new float4(__instance._WindTreeBaseStrengthPhase.previous, __instance._WindTreeBaseStrengthPhase2.previous, __instance._WindTreeBaseStrengthPhase.current, __instance._WindTreeBaseStrengthPhase2.current), new float4(0f, ((VolumeParameter<float>)(object)wind.windTreeGustStrength).value * num4 * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale2).value, ((VolumeParameter<float>)(object)wind.windTreeGustStrengthOffset).value, __instance._WindTreeFlutterGustVariancePeriod.current), new float4(__instance._WindTreeGustStrengthVariancePeriod.current, __instance._WindTreeGustStrengthVariancePeriod.previous, ((VolumeParameter<float>)(object)wind.windTreeGustInnerCosScale).value, ((VolumeParameter<float>)(object)wind.windTreeFlutterStrength).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale2).value), new float4(((VolumeParameter<float>)(object)wind.windTreeFlutterGustStrength).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale).value * ((VolumeParameter<float>)(object)wind.windGlobalStrengthScale2).value, ((VolumeParameter<float>)(object)wind.windTreeFlutterGustStrengthOffset).value, ((VolumeParameter<float>)(object)wind.windTreeFlutterGustStrengthScale).value, __instance._WindTreeFlutterGustVariancePeriod.previous))));
				__instance.m_ShaderVariablesWindCB._WindData_3 = float4x4.op_Implicit(math.transpose(new float4x4(new float4(__instance._WindBaseStrengthVariancePeriod.previous, __instance._WindTreeBaseStrengthVariancePeriod.previous, __instance._WindBaseStrengthVariancePeriod.previous, __instance._WindTreeBaseStrengthVariancePeriod.current), new float4(__instance._WindGustStrengthPhase.previous, __instance._WindGustStrengthPhase2.previous, __instance._WindGustStrengthPhase.current, __instance._WindGustStrengthPhase2.current), new float4(__instance._WindTreeGustStrengthPhase.previous, __instance._WindTreeGustStrengthPhase2.previous, __instance._WindTreeGustStrengthPhase.current, __instance._WindTreeGustStrengthPhase2.current), new float4(0f, 0f, 0f, 0f))));
				ConstantBuffer.PushGlobal<ShaderVariablesWind>(cmd, ref __instance.m_ShaderVariablesWindCB, WindControl.m_ShaderVariablesWind);
			}
			finally
			{
				((IDisposable)(ProfilingScope)(ref val)).Dispose();
			}
			return false;
		}

		public static bool Prefix_UpdateCPUData(WindControl __instance, WindVolumeComponent wind)
		{
			if (!Globals.fixedTimeActive)
			{
				return true;
			}
			float fixedStepSimulationSpeed = Globals.FixedStepSimulationSpeed;
			_ = 1f / fixedStepSimulationSpeed;
			__instance._LastParametersSamplingTime = time;
			__instance._WindBaseStrengthPhase.Update(((VolumeParameter<float>)(object)wind.windBaseStrengthPhase).value);
			__instance._WindBaseStrengthPhase2.Update(((VolumeParameter<float>)(object)wind.windBaseStrengthPhase2).value);
			__instance._WindTreeBaseStrengthPhase.Update(((VolumeParameter<float>)(object)wind.windTreeBaseStrengthPhase).value);
			__instance._WindTreeBaseStrengthPhase2.Update(((VolumeParameter<float>)(object)wind.windTreeBaseStrengthPhase2).value);
			__instance._WindBaseStrengthVariancePeriod.Update(((VolumeParameter<float>)(object)wind.windBaseStrengthVariancePeriod).value);
			__instance._WindTreeBaseStrengthVariancePeriod.Update(((VolumeParameter<float>)(object)wind.windTreeBaseStrengthVariancePeriod).value);
			__instance._WindGustStrengthPhase.Update(((VolumeParameter<float>)(object)wind.windGustStrengthPhase).value);
			__instance._WindGustStrengthPhase2.Update(((VolumeParameter<float>)(object)wind.windGustStrengthPhase2).value);
			__instance._WindTreeGustStrengthPhase.Update(((VolumeParameter<float>)(object)wind.windTreeGustStrengthPhase).value);
			__instance._WindTreeGustStrengthPhase2.Update(((VolumeParameter<float>)(object)wind.windTreeGustStrengthPhase2).value);
			__instance._WindGustStrengthVariancePeriod.Update(((VolumeParameter<float>)(object)wind.windGustStrengthVariancePeriod).value);
			__instance._WindTreeGustStrengthVariancePeriod.Update(((VolumeParameter<float>)(object)wind.windTreeGustStrengthVariancePeriod).value);
			__instance._WindFlutterGustVariancePeriod.Update(((VolumeParameter<float>)(object)wind.windFlutterGustVariancePeriod).value);
			__instance._WindTreeFlutterGustVariancePeriod.Update(((VolumeParameter<float>)(object)wind.windTreeFlutterGustVariancePeriod).value);
			return false;
		}
	}
}
namespace LemmyModFramework.Properties
{
	[CompilerGenerated]
	[GeneratedCode("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.8.0.0")]
	internal sealed class Settings : ApplicationSettingsBase
	{
		private static Settings defaultInstance = (Settings)(object)SettingsBase.Synchronized((SettingsBase)(object)new Settings());

		public static Settings Default => defaultInstance;
	}
}