Decompiled source of EasyDeliveryMenuBETA v3.5.0

BepInEx/plugins/EasyDeliveryMenu.dll

Decompiled 18 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Steamworks;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("EasyDeliveryMenu")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EasyDeliveryMenu")]
[assembly: AssemblyCopyright("Copyright © 2026 Lightnite Productions")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b5208385-0f57-4074-a545-ce76e39c0136")]
[assembly: AssemblyFileVersion("3.5.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("3.5.0.0")]
internal sealed class ConfigurationManagerAttributes
{
	public delegate void CustomHotkeyDrawerFunc(ConfigEntryBase setting, ref bool isCurrentlyAcceptingInput);

	public bool? ShowRangeAsPercent;

	public Action<ConfigEntryBase> CustomDrawer;

	public CustomHotkeyDrawerFunc CustomHotkeyDrawer;

	public bool? Browsable;

	public string Category;

	public object DefaultValue;

	public bool? HideDefaultButton;

	public bool? HideSettingName;

	public string Description;

	public string DispName;

	public int? Order;

	public bool? ReadOnly;

	public bool? IsAdvanced;

	public Func<object, string> ObjToStr;

	public Func<string, object> StrToObj;
}
namespace EasyDeliveryMenu
{
	[BepInPlugin("soup.tweaks.modmenu", "EasyDeliveryMenu", "3.5.0")]
	public class EasyDeliveryMenuPlugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(CarDamage), "OnCollisionEnter")]
		public static class CarDamage_OnCollisionEnter_Patch
		{
			private static bool Prefix(CarDamage __instance, Collision collision)
			{
				if (!VehicleInvincibility.Value)
				{
					return true;
				}
				if (!((Behaviour)__instance).enabled || collision.gameObject.layer == LayerMask.NameToLayer("Car"))
				{
					return false;
				}
				__instance.damage = Mathf.Clamp01(__instance.damage);
				return false;
			}
		}

		[HarmonyPatch(typeof(CarDamage), "CheckDeadVelocity")]
		public static class CarDamage_CheckDeadVelocity_Patch
		{
			private static bool Prefix(ref bool __result)
			{
				if (VehicleInvincibility.Value)
				{
					__result = false;
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(CarDamage), "Update")]
		public static class CarDamage_Update_Patch
		{
			private static bool Prefix(CarDamage __instance)
			{
				if (InstantReset.Value && sInputManager.players[0].resetPressed && !CarLessMode.carless)
				{
					sPathFinder val = Object.FindObjectOfType<sPathFinder>();
					sCarController component = ((Component)__instance).GetComponent<sCarController>();
					if ((Object)(object)val != (Object)null && (Object)(object)component != (Object)null && !component.GuyActive)
					{
						val.ResetCar();
						return false;
					}
				}
				return true;
			}

			private static void Postfix(CarDamage __instance)
			{
				if (VehicleInvincibility.Value && __instance.damage > 0f)
				{
					__instance.damage = 0f;
				}
			}
		}

		[HarmonyPatch(typeof(sPathFinder), "ResetCar")]
		public static class sPathFinder_ResetCar_Patch
		{
			private static bool Prefix(sPathFinder __instance)
			{
				if (!InstantReset.Value)
				{
					return true;
				}
				if ((Object)(object)__instance.car == (Object)null)
				{
					return false;
				}
				__instance.car.ResetFreeze();
				MethodInfo method = typeof(sPathFinder).GetMethod("DoResetCar", BindingFlags.Instance | BindingFlags.NonPublic);
				if (method != null)
				{
					method.Invoke(__instance, null);
				}
				return false;
			}
		}

		[HarmonyPatch(typeof(sPathFinder), "DoResetCar")]
		public static class sPathFinder_DoResetCar_Patch
		{
			private static void Postfix(sPathFinder __instance)
			{
				//IL_0033: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)__instance.car != (Object)null && (Object)(object)__instance.car.rb != (Object)null)
				{
					Vector3 position = ((Component)__instance.car).transform.position;
					position.y += 1f;
					((Component)__instance.car).transform.position = position;
					__instance.car.rb.position = position;
				}
			}
		}

		[HarmonyPatch(typeof(sPathFinder), "ResetCar")]
		public static class sPathFinder_ResetCar_PostfixPatch
		{
			private static void Postfix(sPathFinder __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)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)__instance == (Object)null) && !((Object)(object)__instance.car == (Object)null) && !((Object)(object)__instance.car.rb == (Object)null))
				{
					Vector3 position = ((Component)__instance.car).transform.position;
					position.y += 1.25f;
					((Component)__instance.car).transform.position = position;
					__instance.car.rb.position = position;
					__instance.car.rb.velocity = Vector3.zero;
					__instance.car.rb.angularVelocity = Vector3.zero;
					__instance.car.rb.WakeUp();
				}
			}
		}

		[HarmonyPatch(typeof(sCarController), "Move")]
		public static class sCarController_Move_Patch
		{
			private static void Postfix(sCarController __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)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_005b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0082: Unknown result type (might be due to invalid IL or missing references)
				//IL_0084: Unknown result type (might be due to invalid IL or missing references)
				//IL_00af: Unknown result type (might be due to invalid IL or missing references)
				if (!PerfectTraction.Value || (Object)(object)__instance == (Object)null || (Object)(object)__instance.rb == (Object)null)
				{
					return;
				}
				try
				{
					float num = 2500f;
					Vector3 val = -Vector3.up * num * __instance.clampedDeltaTime;
					__instance.rb.AddForce(val, (ForceMode)0);
					if (__instance.Airbourne())
					{
						Vector3 velocity = __instance.rb.velocity;
						if (velocity.y > 0f)
						{
							velocity.y *= 0.5f;
							__instance.rb.velocity = velocity;
						}
					}
				}
				catch
				{
				}
			}
		}

		[HarmonyPatch(typeof(sCameraController), "Awake")]
		public static class sCameraController_Awake_Patch
		{
			private static void Postfix(sCameraController __instance)
			{
				mainCamera = __instance.cam;
				if ((Object)(object)cameraController == (Object)null)
				{
					cameraController = __instance;
				}
			}
		}

		[HarmonyPatch(typeof(sCameraController), "Update")]
		public static class sCameraController_Update_Patch
		{
			private static bool Prefix()
			{
				if (freeCamEnabled)
				{
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(sCameraController), "LateUpdate")]
		public static class sCameraController_LateUpdate_Patch
		{
			private static bool Prefix()
			{
				if (freeCamEnabled)
				{
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(ScreenSystem), "Awake")]
		public static class ScreenSystem_Awake_Patch
		{
			private static void Postfix(ScreenSystem __instance)
			{
				Transform val = ((Component)__instance).transform.Find("Camera Persp/ScreenPivot/Screen");
				if ((Object)(object)val != (Object)null)
				{
					screenMR = ((Component)val).GetComponent<MeshRenderer>();
				}
			}
		}

		[HarmonyPatch(typeof(sCarController), "Awake")]
		public static class sCarController_Awake_Patch
		{
			private static void Postfix(sCarController __instance)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				currentRes = default(Resolution);
				if (!Object.op_Implicit((Object)(object)rearViewMR))
				{
					Transform val = ((Component)__instance).transform.Find("carInt/RearViewMirror");
					if (Object.op_Implicit((Object)(object)val))
					{
						rearViewMR = ((Component)val).GetComponent<MeshRenderer>();
					}
					val = ((Component)__instance).transform.Find("RearViewCam");
					if (Object.op_Implicit((Object)(object)val))
					{
						rearViewCamera = ((Component)val).GetComponent<Camera>();
					}
				}
			}
		}

		[HarmonyPatch(typeof(sHUD), "Update")]
		public static class sHUD_Update_Patch
		{
			private static void Postfix(sHUD __instance)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				if (!((object)(Resolution)(ref currentRes)).Equals((object?)Screen.currentResolution))
				{
					FixPixelRendering();
				}
			}
		}

		[HarmonyPatch(typeof(sHUD), "WorldToHUDPoint")]
		public static class sHUD_WorldToHUDPoint_Patch
		{
			private static void Postfix(sHUD __instance, ref Vector2 __result, Vector3 worldPoint)
			{
				//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_008d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				try
				{
					if (!NoPixelRendering.Value || resWidthRatio == 0f || __result.x == -100f || (Object)(object)__instance.navigation == (Object)null || (Object)(object)__instance.navigation.car == (Object)null || (Object)(object)__instance.navigation.car.carCamera == (Object)null)
					{
						return;
					}
					__result = Vector2.op_Implicit(__instance.navigation.car.carCamera.WorldToScreenPoint(worldPoint));
					__result = new Vector2(__result.x / resWidthRatio, __result.y / resHeightRatio);
					FieldInfo field = typeof(sHUD).GetField("R", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
					if (!(field != null))
					{
						return;
					}
					object value = field.GetValue(__instance);
					if (value != null)
					{
						PropertyInfo property = value.GetType().GetProperty("height");
						if (property != null)
						{
							float num = (float)property.GetValue(value);
							__result.y = num - __result.y;
						}
					}
				}
				catch
				{
				}
			}
		}

		[HarmonyPatch(typeof(sCarController), "Update")]
		public static class sCarController_Update_Patch
		{
			private static bool Prefix()
			{
				if (freeCamEnabled && freeCamMovement)
				{
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(sCarController), "SetInput", new Type[] { typeof(Vector2) })]
		public static class sCarController_SetInput_Patch
		{
			private static bool Prefix()
			{
				if (freeCamEnabled && freeCamMovement)
				{
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(sCharacterController), "Update")]
		public static class sCharacterController_Update_Patch
		{
			private static bool Prefix()
			{
				if (freeCamEnabled && freeCamMovement)
				{
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(sItemManager), "Update")]
		public static class sItemManager_Update_Patch
		{
			private static bool Prefix()
			{
				if (freeCamEnabled && freeCamMovement)
				{
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(sItemManager), "DoInput")]
		public static class sItemManager_DoInput_Patch
		{
			private static bool Prefix()
			{
				if (freeCamEnabled && freeCamMovement)
				{
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(sCharacterRagdoll), "Ragdoll", new Type[] { typeof(Vector3) })]
		public static class sCharacterRagdoll_Ragdoll_Vector3_Patch
		{
			private static bool Prefix()
			{
				if ((PlayerInvincibility != null && PlayerInvincibility.Value) || (NoRagdoll != null && NoRagdoll.Value))
				{
					return false;
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(sCharacterRagdoll), "Ragdoll", new Type[] { })]
		public static class sCharacterRagdoll_Ragdoll_Patch
		{
			private static bool Prefix()
			{
				if ((PlayerInvincibility != null && PlayerInvincibility.Value) || (NoRagdoll != null && NoRagdoll.Value))
				{
					return false;
				}
				return true;
			}
		}

		private const string MyGUID = "soup.tweaks.modmenu";

		private const string PluginName = "EasyDeliveryMenu";

		private const string VersionString = "3.5.0";

		public static string SpeedKey = "Speed";

		public static string GravityKey = "Gravity";

		public static string VehicleInvincibilityKey = "Vehicle Invincibility";

		public static string ShowHUDKey = "Show HUD";

		public static string InfiniteFuelKey = "Infinite fuel";

		public static string SmoothDrivingKey = "Smooth driving";

		public static string InstantResetKey = "Instant vehicle reset";

		public static string SnowTiresKey = "Snow Tires";

		public static string IceChainsKey = "Ice Chains";

		public static string BumperBarKey = "Bumper Bar";

		public static string PerfectTractionKey = "Perfect traction";

		public static string BlowUpVehicleKey = "Blow up vehicle";

		public static string ZeroGravityKey = "Zero vehicle gravity";

		public static string UnlockAllKey = "Unlock all achievements";

		public static string SnowyPeaksKey = "Enter snowy peaks";

		public static string FishingTownKey = "Enter fishing town";

		public static string DuctTapeKey = "Secure a package with duct tape";

		public static string TeaKey = "Brew a cup of tea to stay warm";

		public static string FishKey = "Cook a fish";

		public static string RadioTowersKey = "Active every radio tower";

		public static string RebootKey = "Reboot Ending";

		public static string ShutdownKey = "Shutdown Ending";

		public static string RestoreKey = "Restore Ending";

		public static string SnowcatsKey = "Find all the snowcats";

		public static string BirdsKey = "Feed the birds";

		public static ConfigEntry<float> SpeedMultiplier;

		public static ConfigEntry<float> GravityMultiplier;

		public static ConfigEntry<bool> VehicleInvincibility;

		public static ConfigEntry<bool> ShowHUD;

		public static ConfigEntry<bool> InfiniteFuel;

		public static ConfigEntry<bool> SmoothDriving;

		public static ConfigEntry<bool> InstantReset;

		public static ConfigEntry<bool> SnowTiresToggle;

		public static ConfigEntry<bool> IceChainsToggle;

		public static ConfigEntry<bool> BumperBarToggle;

		public static ConfigEntry<bool> PerfectTraction;

		public static ConfigEntry<bool> BlowUpVehicle;

		public static ConfigEntry<bool> ZeroGravity;

		public static ConfigEntry<bool> UnlockAll;

		public static ConfigEntry<bool> SnowyPeaks;

		public static ConfigEntry<bool> FishingTown;

		public static ConfigEntry<bool> DuctTape;

		public static ConfigEntry<bool> Tea;

		public static ConfigEntry<bool> Fish;

		public static ConfigEntry<bool> RadioTowers;

		public static ConfigEntry<bool> Reboot;

		public static ConfigEntry<bool> Shutdown;

		public static ConfigEntry<bool> Restore;

		public static ConfigEntry<bool> Snowcats;

		public static ConfigEntry<bool> Birds;

		public static ConfigEntry<int> FPSAmount;

		public static ConfigEntry<bool> Vsync;

		public static ConfigEntry<bool> ShowFPS;

		public static ConfigEntry<bool> FreeCam;

		public static ConfigEntry<bool> NoPixelRendering;

		public static ConfigEntry<float> PlayerSpeed;

		public static ConfigEntry<float> MoneyAmount;

		public static ConfigEntry<bool> PlayerInvincibility;

		public static ConfigEntry<bool> InfiniteEnergy;

		public static ConfigEntry<bool> NoFreezing;

		public static ConfigEntry<bool> NoRagdoll;

		public static ConfigEntry<bool> ShowLocation;

		public static ConfigEntry<bool> ShowAllExes;

		public static ConfigEntry<bool> DraggableIcons;

		public static ConfigEntry<bool> RandomWeather;

		public static ConfigEntry<int> WeatherIntensity;

		public static ConfigEntry<int> WeatherCycle;

		public static ConfigEntry<bool> FreezeWeather;

		public static ConfigEntry<int> SpeedUpWeather;

		public static ConfigEntry<bool> NoFog;

		public static ConfigEntry<bool> FreezeTime;

		public static ConfigEntry<bool> ReverseTime;

		public static ConfigEntry<float> ChangeTime;

		public static ConfigEntry<int> SpeedUpTime;

		public static ConfigEntry<bool> SyncTime;

		private static readonly Harmony Harmony = new Harmony("soup.tweaks.modmenu");

		private static bool vehicleInvincible;

		private static bool zeroGravity;

		private static bool instantReset;

		private static bool snowInit;

		private static bool bumperInit;

		private static bool hudInit;

		private static bool weatherInit;

		private static RotationRounding truckRR;

		private static string currentSaveFile = "";

		private static bool lastHadTires = false;

		private static bool lastHadChains = false;

		private static bool lastHadBumper = false;

		private static float baseMaxSpeed = -1f;

		private static float baseMass = -1f;

		private static Dictionary<object, float> baseMaxFrictionForce = new Dictionary<object, float>();

		private static float baseDownForce = -1f;

		private static RenderTexture newRT;

		private static RenderTexture defaultRT;

		private static RenderTexture newRearViewRT;

		private static RenderTexture defaultRearViewRT;

		private static MeshRenderer screenMR;

		private static MeshRenderer rearViewMR;

		private static Camera mainCamera;

		private static Camera rearViewCamera;

		private static float resWidthRatio;

		private static float resHeightRatio;

		private static Resolution currentRes;

		private static bool _envInitialized;

		private static bool _suppressEnvWrites;

		private static float _baseWeatherSpeed = -1f;

		private static float _baseDayDuration = -1f;

		private static float _weatherFreezeValue = -1f;

		private static float _weatherTarget01 = -1f;

		private static float _weatherUserUntil;

		private static float _timeUserUntil;

		private static int _lastSpeedUpTime = 0;

		private static bool _lastReverseTime = false;

		private static bool freeCamEnabled = false;

		private static bool freeCamMovement = false;

		private static Vector3 freeCamRotation = Vector3.zero;

		private static float freeCamSpeed = 10f;

		private static float freeCamMouseSensitivity = 2f;

		private static Vector3 originalCameraPosition;

		private static Quaternion originalCameraRotation;

		private static Transform originalCameraParent;

		private static bool wasFreeCamActive = false;

		private static sCameraController cameraController;

		private static float basePlayerAcceleration = -1f;

		private static float basePlayerDeceleration = -1f;

		private static float baseMoney = -1f;

		private static bool moneyInitialized = false;

		private static Dictionary<File, bool> originalFileVisibility = new Dictionary<File, bool>();

		private static bool fileVisibilityInitialized = false;

		private void Awake()
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Expected O, but got Unknown
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Expected O, but got Unknown
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Expected O, but got Unknown
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Expected O, but got Unknown
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Expected O, but got Unknown
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Expected O, but got Unknown
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Expected O, but got Unknown
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Expected O, but got Unknown
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Expected O, but got Unknown
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Expected O, but got Unknown
			//IL_0346: Unknown result type (might be due to invalid IL or missing references)
			//IL_0350: Expected O, but got Unknown
			//IL_039c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Expected O, but got Unknown
			//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fc: Expected O, but got Unknown
			//IL_0436: Unknown result type (might be due to invalid IL or missing references)
			//IL_0440: Expected O, but got Unknown
			//IL_047a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0484: Expected O, but got Unknown
			//IL_04be: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c8: Expected O, but got Unknown
			//IL_0502: Unknown result type (might be due to invalid IL or missing references)
			//IL_050c: Expected O, but got Unknown
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_0550: Expected O, but got Unknown
			//IL_0591: Unknown result type (might be due to invalid IL or missing references)
			//IL_059b: Expected O, but got Unknown
			//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e6: Expected O, but got Unknown
			//IL_0620: Unknown result type (might be due to invalid IL or missing references)
			//IL_062a: Expected O, but got Unknown
			//IL_066c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0676: Expected O, but got Unknown
			//IL_06b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ba: Expected O, but got Unknown
			//IL_06f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fe: Expected O, but got Unknown
			//IL_0738: Unknown result type (might be due to invalid IL or missing references)
			//IL_0742: Expected O, but got Unknown
			//IL_078e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0798: Expected O, but got Unknown
			//IL_07da: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e4: Expected O, but got Unknown
			//IL_081e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0828: Expected O, but got Unknown
			//IL_0869: Unknown result type (might be due to invalid IL or missing references)
			//IL_0873: Expected O, but got Unknown
			//IL_08ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b7: Expected O, but got Unknown
			//IL_08f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fb: Expected O, but got Unknown
			//IL_0935: Unknown result type (might be due to invalid IL or missing references)
			//IL_093f: Expected O, but got Unknown
			//IL_0979: Unknown result type (might be due to invalid IL or missing references)
			//IL_0983: Expected O, but got Unknown
			//IL_09bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c7: Expected O, but got Unknown
			//IL_09fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a08: Expected O, but got Unknown
			//IL_0a3f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a49: Expected O, but got Unknown
			//IL_0a80: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8a: Expected O, but got Unknown
			//IL_0ac1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0acb: Expected O, but got Unknown
			//IL_0b02: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0c: Expected O, but got Unknown
			//IL_0b43: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b4d: Expected O, but got Unknown
			//IL_0b84: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b8e: Expected O, but got Unknown
			//IL_0bc5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bcf: Expected O, but got Unknown
			//IL_0c06: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c10: Expected O, but got Unknown
			//IL_0c47: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c51: Expected O, but got Unknown
			//IL_0c88: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c92: Expected O, but got Unknown
			//IL_0cc9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd3: Expected O, but got Unknown
			//IL_0d09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d13: Expected O, but got Unknown
			//IL_0d49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d53: Expected O, but got Unknown
			//IL_0d89: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d93: Expected O, but got Unknown
			SpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Vehicle", SpeedKey, 1f, new ConfigDescription("Vehicle speed multiplier", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 260
				}
			}));
			GravityMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Vehicle", GravityKey, 1f, new ConfigDescription("Vehicle gravity multiplier", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 250
				}
			}));
			VehicleInvincibility = ((BaseUnityPlugin)this).Config.Bind<bool>("Vehicle", VehicleInvincibilityKey, false, new ConfigDescription("Toggle vehicle invincibility", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 230
				}
			}));
			InfiniteFuel = ((BaseUnityPlugin)this).Config.Bind<bool>("Vehicle", InfiniteFuelKey, false, new ConfigDescription("Never run out of fuel", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 229
				}
			}));
			SmoothDriving = ((BaseUnityPlugin)this).Config.Bind<bool>("Vehicle", SmoothDrivingKey, false, new ConfigDescription("Toggle off retro style driving", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 228
				}
			}));
			InstantReset = ((BaseUnityPlugin)this).Config.Bind<bool>("Vehicle", InstantResetKey, false, new ConfigDescription("Toggle instant vehicle reset", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 240
				}
			}));
			SnowTiresToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Vehicle", SnowTiresKey, false, new ConfigDescription("Toggle snow tires", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 210
				}
			}));
			IceChainsToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Vehicle", IceChainsKey, false, new ConfigDescription("Toggle ice chains", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 205
				}
			}));
			BumperBarToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("Vehicle", BumperBarKey, false, new ConfigDescription("Toggle bumper bar", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 200
				}
			}));
			PerfectTraction = ((BaseUnityPlugin)this).Config.Bind<bool>("Vehicle", PerfectTractionKey, false, new ConfigDescription("Max wheel traction (kinda buggy)", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 194
				}
			}));
			BlowUpVehicle = ((BaseUnityPlugin)this).Config.Bind<bool>("Vehicle", BlowUpVehicleKey, false, new ConfigDescription("Blow up the vehicle", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 190
				}
			}));
			ZeroGravity = ((BaseUnityPlugin)this).Config.Bind<bool>("Vehicle", ZeroGravityKey, false, new ConfigDescription("Toggle zero vehicle gravity", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 180
				}
			}));
			PlayerSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Player", "Speed", 1f, new ConfigDescription("Player speed multiplier", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 169
				}
			}));
			MoneyAmount = ((BaseUnityPlugin)this).Config.Bind<float>("Player", "Money amount", 0f, new ConfigDescription("Amount of money (0 = Default)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 100f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 168
				}
			}));
			PlayerInvincibility = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "Player Invincibility", false, new ConfigDescription("Toggle player invincibility", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 167
				}
			}));
			InfiniteEnergy = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "Infinite energy", false, new ConfigDescription("Toggle infinite energy", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 166
				}
			}));
			NoFreezing = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "No freezing", false, new ConfigDescription("Toggle no freezing", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 165
				}
			}));
			NoRagdoll = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "No ragdoll", false, new ConfigDescription("Toggle ragdoll after falling from large heights", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 164
				}
			}));
			RandomWeather = ((BaseUnityPlugin)this).Config.Bind<bool>("Environment", "Random weather", true, new ConfigDescription("Turn off random weather in order to change the weather manually", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 160
				}
			}));
			WeatherIntensity = ((BaseUnityPlugin)this).Config.Bind<int>("Environment", "Weather intensity", 0, new ConfigDescription("Change weather intensity", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 159
				}
			}));
			WeatherCycle = ((BaseUnityPlugin)this).Config.Bind<int>("Environment", "Weather cycle", 0, new ConfigDescription("Change weather cycle", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 158
				}
			}));
			FreezeWeather = ((BaseUnityPlugin)this).Config.Bind<bool>("Environment", "Freeze weather", false, new ConfigDescription("Freeze the weather cycle", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 157
				}
			}));
			SpeedUpWeather = ((BaseUnityPlugin)this).Config.Bind<int>("Environment", "Speed up weather", 0, new ConfigDescription("Speed up the weather cycle", (AcceptableValueBase)(object)new AcceptableValueRange<int>(-10, 10), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 156
				}
			}));
			NoFog = ((BaseUnityPlugin)this).Config.Bind<bool>("Environment", "No fog", false, new ConfigDescription("Toggle off fog", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 155
				}
			}));
			FreezeTime = ((BaseUnityPlugin)this).Config.Bind<bool>("Environment", "Freeze time", false, new ConfigDescription("Freeze time of day", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 154
				}
			}));
			ReverseTime = ((BaseUnityPlugin)this).Config.Bind<bool>("Environment", "Reverse time", false, new ConfigDescription("Reverse time of day", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 153
				}
			}));
			ChangeTime = ((BaseUnityPlugin)this).Config.Bind<float>("Environment", "Change time", 6f, new ConfigDescription("Change time of day", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 24f), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 152
				}
			}));
			SpeedUpTime = ((BaseUnityPlugin)this).Config.Bind<int>("Environment", "Speed up time", 0, new ConfigDescription("Speed up time of day", (AcceptableValueBase)(object)new AcceptableValueRange<int>(-10, 10), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 151
				}
			}));
			SyncTime = ((BaseUnityPlugin)this).Config.Bind<bool>("Environment", "Sync time", false, new ConfigDescription("Sync time to the clock of your operating system", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 150
				}
			}));
			FPSAmount = ((BaseUnityPlugin)this).Config.Bind<int>("Camera & Visuals", "FPS amount", 0, new ConfigDescription("Adjust the amount of FPS. 0 = Default (60). 10 = Uncapped", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 175
				}
			}));
			Vsync = ((BaseUnityPlugin)this).Config.Bind<bool>("Camera & Visuals", "Vsync", false, new ConfigDescription("Sync FPS with monitor", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 174
				}
			}));
			ShowFPS = ((BaseUnityPlugin)this).Config.Bind<bool>("Camera & Visuals", "Show FPS", false, new ConfigDescription("Display 'Frames Per Second'", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 173
				}
			}));
			ShowHUD = ((BaseUnityPlugin)this).Config.Bind<bool>("Camera & Visuals", ShowHUDKey, true, new ConfigDescription("Toggle vehicle & player HUD (shortcut U)", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 172
				}
			}));
			FreeCam = ((BaseUnityPlugin)this).Config.Bind<bool>("Camera & Visuals", "Freecam", false, new ConfigDescription("Freely move around the world (WASD to move when M is pressed, U to toggle HUD)", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 171
				}
			}));
			NoPixelRendering = ((BaseUnityPlugin)this).Config.Bind<bool>("Camera & Visuals", "No pixelated rendering", false, new ConfigDescription("Remove the retro look of the game", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 170
				}
			}));
			UnlockAll = ((BaseUnityPlugin)this).Config.Bind<bool>("Achievements", UnlockAllKey, false, new ConfigDescription("Unlock all achievements", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 120
				}
			}));
			SnowyPeaks = ((BaseUnityPlugin)this).Config.Bind<bool>("Achievements", SnowyPeaksKey, false, new ConfigDescription("Unlock snowy peaks", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 110
				}
			}));
			FishingTown = ((BaseUnityPlugin)this).Config.Bind<bool>("Achievements", FishingTownKey, false, new ConfigDescription("Unlock fishing town", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 100
				}
			}));
			DuctTape = ((BaseUnityPlugin)this).Config.Bind<bool>("Achievements", DuctTapeKey, false, new ConfigDescription("Unlock duct tape", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 90
				}
			}));
			Tea = ((BaseUnityPlugin)this).Config.Bind<bool>("Achievements", TeaKey, false, new ConfigDescription("Unlock tea", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 80
				}
			}));
			Fish = ((BaseUnityPlugin)this).Config.Bind<bool>("Achievements", FishKey, false, new ConfigDescription("Unlock fish", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 70
				}
			}));
			RadioTowers = ((BaseUnityPlugin)this).Config.Bind<bool>("Achievements", RadioTowersKey, false, new ConfigDescription("Unlock radio towers", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 60
				}
			}));
			Reboot = ((BaseUnityPlugin)this).Config.Bind<bool>("Achievements", RebootKey, false, new ConfigDescription("Unlock reboot", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 50
				}
			}));
			Shutdown = ((BaseUnityPlugin)this).Config.Bind<bool>("Achievements", ShutdownKey, false, new ConfigDescription("Unlock shutdown", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 40
				}
			}));
			Restore = ((BaseUnityPlugin)this).Config.Bind<bool>("Achievements", RestoreKey, false, new ConfigDescription("Unlock restore", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 30
				}
			}));
			Snowcats = ((BaseUnityPlugin)this).Config.Bind<bool>("Achievements", SnowcatsKey, false, new ConfigDescription("Unlock snowcats", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 20
				}
			}));
			Birds = ((BaseUnityPlugin)this).Config.Bind<bool>("Achievements", BirdsKey, false, new ConfigDescription("Unlock birds", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 10
				}
			}));
			ShowLocation = ((BaseUnityPlugin)this).Config.Bind<bool>("Extras", "Show location", false, new ConfigDescription("Show car location on map", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 6
				}
			}));
			ShowAllExes = ((BaseUnityPlugin)this).Config.Bind<bool>("Extras", "Show all EXEs", false, new ConfigDescription("Show all app icons in EasyOS. WARNING! This feature may be buggy. Only way to get rid of extra icons is by restarting the game with this feature toggled OFF", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			DraggableIcons = ((BaseUnityPlugin)this).Config.Bind<bool>("Extras", "Draggable icons", false, new ConfigDescription("Toggle dragging icons around", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			VehicleInvincibility.SettingChanged += ConfigSettingChanged;
			ShowHUD.SettingChanged += ConfigSettingChanged;
			InfiniteFuel.SettingChanged += ConfigSettingChanged;
			SmoothDriving.SettingChanged += ConfigSettingChanged;
			InstantReset.SettingChanged += ConfigSettingChanged;
			SnowTiresToggle.SettingChanged += ConfigSettingChanged;
			IceChainsToggle.SettingChanged += ConfigSettingChanged;
			BumperBarToggle.SettingChanged += ConfigSettingChanged;
			PerfectTraction.SettingChanged += ConfigSettingChanged;
			BlowUpVehicle.SettingChanged += ConfigSettingChanged;
			ZeroGravity.SettingChanged += ConfigSettingChanged;
			FPSAmount.SettingChanged += ConfigSettingChanged;
			Vsync.SettingChanged += ConfigSettingChanged;
			ShowFPS.SettingChanged += ConfigSettingChanged;
			ShowHUD.SettingChanged += ConfigSettingChanged;
			FreeCam.SettingChanged += ConfigSettingChanged;
			NoPixelRendering.SettingChanged += ConfigSettingChanged;
			PlayerSpeed.SettingChanged += ConfigSettingChanged;
			MoneyAmount.SettingChanged += ConfigSettingChanged;
			PlayerInvincibility.SettingChanged += ConfigSettingChanged;
			InfiniteEnergy.SettingChanged += ConfigSettingChanged;
			NoFreezing.SettingChanged += ConfigSettingChanged;
			NoRagdoll.SettingChanged += ConfigSettingChanged;
			RandomWeather.SettingChanged += EnvironmentSettingChanged;
			WeatherIntensity.SettingChanged += EnvironmentSettingChanged;
			WeatherCycle.SettingChanged += EnvironmentSettingChanged;
			FreezeWeather.SettingChanged += EnvironmentSettingChanged;
			SpeedUpWeather.SettingChanged += EnvironmentSettingChanged;
			NoFog.SettingChanged += EnvironmentSettingChanged;
			FreezeTime.SettingChanged += EnvironmentSettingChanged;
			ReverseTime.SettingChanged += EnvironmentSettingChanged;
			ChangeTime.SettingChanged += EnvironmentSettingChanged;
			SpeedUpTime.SettingChanged += EnvironmentSettingChanged;
			SyncTime.SettingChanged += EnvironmentSettingChanged;
			UnlockAll.SettingChanged += ConfigSettingChanged;
			SnowyPeaks.SettingChanged += ConfigSettingChanged;
			FishingTown.SettingChanged += ConfigSettingChanged;
			DuctTape.SettingChanged += ConfigSettingChanged;
			Tea.SettingChanged += ConfigSettingChanged;
			Fish.SettingChanged += ConfigSettingChanged;
			RadioTowers.SettingChanged += ConfigSettingChanged;
			Reboot.SettingChanged += ConfigSettingChanged;
			Shutdown.SettingChanged += ConfigSettingChanged;
			Restore.SettingChanged += ConfigSettingChanged;
			Snowcats.SettingChanged += ConfigSettingChanged;
			Birds.SettingChanged += ConfigSettingChanged;
			ShowLocation.SettingChanged += ConfigSettingChanged;
			ShowAllExes.SettingChanged += ConfigSettingChanged;
			DraggableIcons.SettingChanged += ConfigSettingChanged;
			Harmony.PatchAll();
			ApplyGraphicsSettings();
		}

		private void EnvironmentSettingChanged(object sender, EventArgs e)
		{
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			if (_suppressEnvWrites)
			{
				return;
			}
			if (sender == WeatherIntensity || sender == WeatherCycle)
			{
				_weatherUserUntil = Time.unscaledTime + 0.75f;
			}
			if (sender == ChangeTime)
			{
				_timeUserUntil = Time.unscaledTime + 0.75f;
			}
			if (sender == RandomWeather)
			{
				_envInitialized = false;
			}
			ConfigEntry<bool> val = sender as ConfigEntry<bool>;
			ConfigEntry<int> val2 = sender as ConfigEntry<int>;
			ConfigEntry<float> val3 = sender as ConfigEntry<float>;
			if (val2 != null && val2 == FPSAmount)
			{
				ApplyGraphicsSettings();
			}
			else if (val != null && (val == Vsync || val == ShowFPS || val == NoPixelRendering))
			{
				ApplyGraphicsSettings();
				if (val == NoPixelRendering)
				{
					currentRes = default(Resolution);
					FixPixelRendering();
				}
			}
		}

		private bool TryUnlock(string id, string label)
		{
			if (!SteamManager.Initialized)
			{
				return false;
			}
			bool flag = default(bool);
			SteamUserStats.GetAchievement(id, ref flag);
			if (flag)
			{
				return false;
			}
			SteamUserStats.SetAchievement(id);
			return true;
		}

		private void EasyDeliveryMenu()
		{
			if (SteamManager.Initialized)
			{
				bool flag = false;
				flag |= TryUnlock("ACH_SNOWYPEAKS", "snowy peaks");
				flag |= TryUnlock("ACH_FISHINGTOWN", "fishing town");
				flag |= TryUnlock("ACH_TAPE", "duct tape");
				flag |= TryUnlock("ACH_TEA", "tea");
				flag |= TryUnlock("ACH_FISH", "fish");
				flag |= TryUnlock("ACH_RADIOTOWERS", "radio towers");
				flag |= TryUnlock("ACH_REBOOT", "reboot");
				flag |= TryUnlock("ACH_SHUTDOWN", "shutdown");
				flag |= TryUnlock("ACH_RESTORE", "restore");
				flag |= TryUnlock("ACH_SNOWCATS", "snowcats");
				if (flag | TryUnlock("ACH_BIRDS", "birds"))
				{
					SteamUserStats.StoreStats();
				}
			}
		}

		private void UnlockSingleAchievement(string id, string label)
		{
			if (TryUnlock(id, label))
			{
				SteamUserStats.StoreStats();
			}
		}

		private void Update()
		{
			ApplyVehicleToggles();
			ApplyPlayerToggles();
			ApplyEnvironment();
			ApplyExtras();
			UpdateFreeCam();
			EnforceFPSSettings();
		}

		private void UpdateFreeCam()
		{
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: 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_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: 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_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: 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_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			if (Keyboard.current != null && ((ButtonControl)Keyboard.current.uKey).wasPressedThisFrame)
			{
				ShowHUD.Value = !ShowHUD.Value;
			}
			if (Keyboard.current != null && ((ButtonControl)Keyboard.current.mKey).wasPressedThisFrame && freeCamEnabled)
			{
				freeCamMovement = !freeCamMovement;
				if (!freeCamMovement)
				{
					RestoreCameraToParent();
				}
			}
			if (FreeCam.Value && !wasFreeCamActive)
			{
				EnableFreeCam();
				wasFreeCamActive = true;
			}
			else if (!FreeCam.Value && wasFreeCamActive)
			{
				DisableFreeCam();
				wasFreeCamActive = false;
			}
			if (!freeCamEnabled || !freeCamMovement || !((Object)(object)mainCamera != (Object)null))
			{
				return;
			}
			if (Mouse.current != null)
			{
				Vector2 val = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).delta).ReadValue();
				float num = val.x * freeCamMouseSensitivity * 0.1f;
				float num2 = val.y * freeCamMouseSensitivity * 0.1f;
				freeCamRotation.y += num;
				freeCamRotation.x -= num2;
				freeCamRotation.x = Mathf.Clamp(freeCamRotation.x, -90f, 90f);
				((Component)mainCamera).transform.rotation = Quaternion.Euler(freeCamRotation.x, freeCamRotation.y, 0f);
			}
			if (Keyboard.current != null)
			{
				Vector3 val2 = Vector3.zero;
				float num3 = freeCamSpeed;
				if (((ButtonControl)Keyboard.current.leftShiftKey).isPressed || ((ButtonControl)Keyboard.current.rightShiftKey).isPressed)
				{
					num3 *= 3f;
				}
				if (((ButtonControl)Keyboard.current.wKey).isPressed)
				{
					val2 += ((Component)mainCamera).transform.forward;
				}
				if (((ButtonControl)Keyboard.current.sKey).isPressed)
				{
					val2 -= ((Component)mainCamera).transform.forward;
				}
				if (((ButtonControl)Keyboard.current.aKey).isPressed)
				{
					val2 -= ((Component)mainCamera).transform.right;
				}
				if (((ButtonControl)Keyboard.current.dKey).isPressed)
				{
					val2 += ((Component)mainCamera).transform.right;
				}
				if (((ButtonControl)Keyboard.current.spaceKey).isPressed)
				{
					val2 += Vector3.up;
				}
				if (((ButtonControl)Keyboard.current.leftCtrlKey).isPressed || ((ButtonControl)Keyboard.current.rightCtrlKey).isPressed)
				{
					val2 -= Vector3.up;
				}
				Transform transform = ((Component)mainCamera).transform;
				transform.position += ((Vector3)(ref val2)).normalized * num3 * Time.deltaTime;
			}
		}

		private void RestoreCameraToParent()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)mainCamera == (Object)null) && !((Object)(object)originalCameraParent == (Object)null))
			{
				((Component)mainCamera).transform.SetParent(originalCameraParent);
				((Component)mainCamera).transform.localPosition = originalCameraPosition;
				((Component)mainCamera).transform.localRotation = originalCameraRotation;
			}
		}

		private void EnableFreeCam()
		{
			//IL_0054: 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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00c1: 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_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)mainCamera == (Object)null))
			{
				freeCamEnabled = true;
				freeCamMovement = false;
				cameraController = Object.FindObjectOfType<sCameraController>();
				if ((Object)(object)cameraController != (Object)null)
				{
					((Behaviour)cameraController).enabled = false;
				}
				originalCameraPosition = ((Component)mainCamera).transform.localPosition;
				originalCameraRotation = ((Component)mainCamera).transform.localRotation;
				originalCameraParent = ((Component)mainCamera).transform.parent;
				Vector3 position = ((Component)mainCamera).transform.position;
				Quaternion rotation = ((Component)mainCamera).transform.rotation;
				((Component)mainCamera).transform.SetParent((Transform)null);
				((Component)mainCamera).transform.position = position;
				((Component)mainCamera).transform.rotation = rotation;
				Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles;
				freeCamRotation = new Vector3(eulerAngles.x, eulerAngles.y, 0f);
			}
		}

		private void DisableFreeCam()
		{
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)mainCamera == (Object)null))
			{
				freeCamEnabled = false;
				freeCamMovement = false;
				if ((Object)(object)cameraController != (Object)null)
				{
					((Behaviour)cameraController).enabled = true;
				}
				if ((Object)(object)originalCameraParent != (Object)null)
				{
					((Component)mainCamera).transform.SetParent(originalCameraParent);
					((Component)mainCamera).transform.localPosition = originalCameraPosition;
					((Component)mainCamera).transform.localRotation = originalCameraRotation;
				}
			}
		}

		private void CacheCarBaseValues(sCarController car)
		{
			if (!((Object)(object)car == (Object)null) && !((Object)(object)car.rb == (Object)null))
			{
				if (baseMaxSpeed < 0f)
				{
					baseMaxSpeed = car.maxSpeed;
				}
				if (baseMass < 0f)
				{
					baseMass = car.rb.mass;
				}
				if (baseDownForce < 0f)
				{
					baseDownForce = car.downForce;
				}
			}
		}

		private void ApplyVehicleToggles()
		{
			sCarController val = Object.FindObjectOfType<sCarController>();
			sHUD val2 = Object.FindObjectOfType<sHUD>();
			CarDamage val3 = Object.FindObjectOfType<CarDamage>();
			TruckUpgrades val4 = Object.FindObjectOfType<TruckUpgrades>();
			BumperBar val5 = Object.FindObjectOfType<BumperBar>();
			SnowTires val6 = Object.FindObjectOfType<SnowTires>();
			vehicleInvincible = VehicleInvincibility.Value;
			zeroGravity = ZeroGravity.Value;
			instantReset = InstantReset.Value;
			float value = SpeedMultiplier.Value;
			float value2 = GravityMultiplier.Value;
			if ((Object)(object)val != (Object)null && (Object)(object)val.rb != (Object)null)
			{
				CacheCarBaseValues(val);
				if (baseMaxSpeed > 0f)
				{
					val.maxSpeed = baseMaxSpeed * value;
				}
				if (baseMass > 0f)
				{
					val.rb.mass = baseMass * value2;
				}
				if (Mathf.Abs(value2 - 1f) > 0.0001f)
				{
					val.rb.useGravity = true;
				}
				else
				{
					val.rb.mass = baseMass;
					val.rb.useGravity = !zeroGravity;
				}
				ApplyPerfectTraction(val);
			}
			if ((Object)(object)val2 != (Object)null)
			{
				if (!hudInit)
				{
					ShowHUD.Value = val2.showInfo;
					hudInit = true;
				}
				val2.showInfo = ShowHUD.Value;
				if (ShowFPS != null)
				{
					try
					{
						FieldInfo field = typeof(sHUD).GetField("showFPS", BindingFlags.Instance | BindingFlags.NonPublic);
						if (field != null)
						{
							field.SetValue(val2, ShowFPS.Value);
						}
					}
					catch
					{
					}
				}
				if (InfiniteFuel.Value)
				{
					val2.fuel = val2.fuelCapacity;
				}
			}
			if ((Object)(object)val3 != (Object)null && vehicleInvincible && val3.damage > 0f)
			{
				val3.damage = 0f;
			}
			if ((Object)(object)val4 != (Object)null)
			{
				sSaveSystem val7 = Object.FindObjectOfType<sSaveSystem>();
				if ((Object)(object)val7 != (Object)null)
				{
					string saveFileName = val7.saveFileName;
					if (currentSaveFile != saveFileName)
					{
						currentSaveFile = saveFileName;
						snowInit = false;
						bumperInit = false;
						moneyInitialized = false;
					}
				}
				if (!snowInit)
				{
					bool @bool = sSaveSystem.GetBool("deliveryHasTires", false);
					bool bool2 = sSaveSystem.GetBool("deliveryHasChains", false);
					SnowTiresToggle.Value = @bool;
					IceChainsToggle.Value = bool2;
					lastHadTires = @bool;
					lastHadChains = bool2;
					snowInit = true;
				}
				else
				{
					bool bool3 = sSaveSystem.GetBool("deliveryHasTires", false);
					bool bool4 = sSaveSystem.GetBool("deliveryHasChains", false);
					if (bool3 && !lastHadTires)
					{
						SnowTiresToggle.Value = true;
						lastHadTires = true;
					}
					if (bool4 && !lastHadChains)
					{
						IceChainsToggle.Value = true;
						lastHadChains = true;
					}
				}
				if (!bumperInit)
				{
					bool bool5 = sSaveSystem.GetBool("deliveryHasBumper", false);
					BumperBarToggle.Value = bool5;
					lastHadBumper = bool5;
					bumperInit = true;
				}
				else if (sSaveSystem.GetBool("deliveryHasBumper", false) && !lastHadBumper)
				{
					BumperBarToggle.Value = true;
					lastHadBumper = true;
				}
				bool value3 = SnowTiresToggle.Value;
				bool value4 = IceChainsToggle.Value;
				val4.SetHasTires(value3);
				val4.SetHasChains(value4);
				if ((Object)(object)val6 != (Object)null)
				{
					val6.hasSnowTires = value3;
					val6.hasIceChains = value4;
				}
				bool value5 = BumperBarToggle.Value;
				val4.SetHasBumper(value5);
				if ((Object)(object)val5 != (Object)null)
				{
					val5.active = value5;
					if ((Object)(object)val5.view != (Object)null)
					{
						val5.view.SetActive(value5);
					}
				}
			}
			if ((Object)(object)val != (Object)null && (Object)(object)truckRR == (Object)null)
			{
				Transform val8 = ((Component)val).transform.Find("Model");
				if ((Object)(object)val8 != (Object)null)
				{
					truckRR = ((Component)val8).GetComponent<RotationRounding>();
				}
			}
			if ((Object)(object)truckRR != (Object)null)
			{
				((Behaviour)truckRR).enabled = !SmoothDriving.Value;
			}
			if (BlowUpVehicle.Value && (Object)(object)val3 != (Object)null)
			{
				val3.damage = 1f;
				BlowUpVehicle.Value = false;
			}
		}

		private void ApplyPlayerToggles()
		{
			sCharacterController val = Object.FindObjectOfType<sCharacterController>();
			sHUD val2 = Object.FindObjectOfType<sHUD>();
			sCharacterRagdoll val3 = Object.FindObjectOfType<sCharacterRagdoll>();
			if ((Object)(object)val != (Object)null)
			{
				if (basePlayerAcceleration < 0f)
				{
					basePlayerAcceleration = val.acceleration;
				}
				if (basePlayerDeceleration < 0f)
				{
					basePlayerDeceleration = val.deceleration;
				}
				float num = ((PlayerSpeed != null) ? PlayerSpeed.Value : 1f);
				val.acceleration = basePlayerAcceleration * num;
				val.deceleration = basePlayerDeceleration / num;
			}
			if ((Object)(object)val2 != (Object)null)
			{
				if (!moneyInitialized)
				{
					baseMoney = val2.money;
					moneyInitialized = true;
				}
				if (Mathf.Abs(val2.money - baseMoney) > 0.01f && MoneyAmount.Value <= 0.01f)
				{
					baseMoney = val2.money;
				}
				float num2 = ((MoneyAmount != null) ? MoneyAmount.Value : 0f);
				if (num2 <= 0.01f)
				{
					val2.money = baseMoney;
				}
				else
				{
					float num3 = num2 / 20f;
					float money = Mathf.Pow(10f, num3) * 100f;
					val2.money = money;
				}
				if ((PlayerInvincibility != null && PlayerInvincibility.Value) || (InfiniteEnergy != null && InfiniteEnergy.Value))
				{
					val2.energy = val2.energyCapacity;
				}
				if ((PlayerInvincibility != null && PlayerInvincibility.Value) || (NoFreezing != null && NoFreezing.Value))
				{
					val2.temperature = val2.temperatureLimit;
				}
			}
		}

		private void ApplyExtras()
		{
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: 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_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			DesktopDotExe val = Object.FindObjectOfType<DesktopDotExe>();
			if ((Object)(object)val != (Object)null && val.files != null)
			{
				if (!fileVisibilityInitialized)
				{
					originalFileVisibility.Clear();
					foreach (File file in val.files)
					{
						if (file != null)
						{
							originalFileVisibility[file] = file.visible;
						}
					}
					fileVisibilityInitialized = true;
				}
				if (ShowAllExes != null && ShowAllExes.Value)
				{
					foreach (File file2 in val.files)
					{
						if (file2 != null)
						{
							file2.visible = true;
						}
					}
				}
				else if (fileVisibilityInitialized)
				{
					foreach (File file3 in val.files)
					{
						if (file3 != null && originalFileVisibility.ContainsKey(file3))
						{
							file3.visible = originalFileVisibility[file3];
						}
					}
				}
				if (DraggableIcons != null)
				{
					val.drag = DraggableIcons.Value;
				}
			}
			else
			{
				fileVisibilityInitialized = false;
			}
			if (ShowLocation != null && ShowLocation.Value)
			{
				jobBoard val2 = Object.FindObjectOfType<jobBoard>();
				sPathFinder val3 = Object.FindObjectOfType<sPathFinder>();
				if ((Object)(object)val2 != (Object)null && (Object)(object)val3 != (Object)null && (Object)(object)val3.car != (Object)null)
				{
					Vector3 position = ((Component)val3.car).transform.position;
					bool flag = Vector3.Dot(((Component)val3.car).transform.forward, Vector3.right) < 0f;
					val2.NewMapIcon("You", position, 0, 32, 16, 16, 0.5f, 10f, flag, false);
				}
			}
		}

		private void ApplyPerfectTraction(sCarController car)
		{
			if ((Object)(object)car == (Object)null || car.wheels == null)
			{
				return;
			}
			try
			{
				Type nestedType = ((object)car).GetType().GetNestedType("Wheel", BindingFlags.Public);
				if (nestedType == null)
				{
					return;
				}
				FieldInfo field = nestedType.GetField("maxFrictionForce", BindingFlags.Instance | BindingFlags.Public);
				if (field == null)
				{
					return;
				}
				Wheel[] wheels = car.wheels;
				foreach (Wheel val in wheels)
				{
					if (val != null)
					{
						if (!baseMaxFrictionForce.ContainsKey(val))
						{
							float value = (float)field.GetValue(val);
							baseMaxFrictionForce[val] = value;
						}
						if (PerfectTraction.Value)
						{
							float num = baseMaxFrictionForce[val];
							field.SetValue(val, num * 3f);
						}
						else
						{
							field.SetValue(val, baseMaxFrictionForce[val]);
						}
					}
				}
			}
			catch
			{
			}
		}

		private void ApplyGraphicsSettings()
		{
			if (Vsync != null && Vsync.Value)
			{
				QualitySettings.vSyncCount = 1;
				Application.targetFrameRate = -1;
				return;
			}
			QualitySettings.vSyncCount = 0;
			int num = ((FPSAmount != null) ? FPSAmount.Value : 0);
			if (num <= 0)
			{
				Application.targetFrameRate = 60;
				return;
			}
			if (num >= 10)
			{
				Application.targetFrameRate = -1;
				return;
			}
			int[] array = new int[9] { 75, 90, 120, 144, 165, 240, 300, 360, 480 };
			int num2 = Mathf.Clamp(num - 1, 0, array.Length - 1);
			Application.targetFrameRate = array[num2];
		}

		private void EnforceFPSSettings()
		{
			if (Vsync != null && Vsync.Value)
			{
				if (QualitySettings.vSyncCount != 1)
				{
					QualitySettings.vSyncCount = 1;
				}
				if (Application.targetFrameRate != -1)
				{
					Application.targetFrameRate = -1;
				}
				return;
			}
			if (QualitySettings.vSyncCount != 0)
			{
				QualitySettings.vSyncCount = 0;
			}
			int num = ((FPSAmount != null) ? FPSAmount.Value : 0);
			int num2;
			if (num <= 0)
			{
				num2 = 60;
			}
			else if (num >= 10)
			{
				num2 = -1;
			}
			else
			{
				int[] array = new int[9] { 75, 90, 120, 144, 165, 240, 300, 360, 480 };
				int num3 = Mathf.Clamp(num - 1, 0, array.Length - 1);
				num2 = array[num3];
			}
			if (Application.targetFrameRate != num2)
			{
				Application.targetFrameRate = num2;
			}
		}

		private void ConfigSettingChanged(object sender, EventArgs e)
		{
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			ConfigEntry<bool> val = sender as ConfigEntry<bool>;
			ConfigEntry<int> val2 = sender as ConfigEntry<int>;
			ConfigEntry<float> val3 = sender as ConfigEntry<float>;
			if (val2 != null && val2 == FPSAmount)
			{
				ApplyGraphicsSettings();
			}
			else
			{
				if (val == null)
				{
					return;
				}
				if (val == UnlockAll && val.Value)
				{
					EasyDeliveryMenu();
				}
				else if (val == SnowyPeaks && val.Value)
				{
					UnlockSingleAchievement("ACH_SNOWYPEAKS", "snowy peaks");
				}
				else if (val == FishingTown && val.Value)
				{
					UnlockSingleAchievement("ACH_FISHINGTOWN", "fishing town");
				}
				else if (val == DuctTape && val.Value)
				{
					UnlockSingleAchievement("ACH_TAPE", "duct tape");
				}
				else if (val == Tea && val.Value)
				{
					UnlockSingleAchievement("ACH_TEA", "tea");
				}
				else if (val == Fish && val.Value)
				{
					UnlockSingleAchievement("ACH_FISH", "fish");
				}
				else if (val == RadioTowers && val.Value)
				{
					UnlockSingleAchievement("ACH_RADIOTOWERS", "radio towers");
				}
				else if (val == Reboot && val.Value)
				{
					UnlockSingleAchievement("ACH_REBOOT", "reboot");
				}
				else if (val == Shutdown && val.Value)
				{
					UnlockSingleAchievement("ACH_SHUTDOWN", "shutdown");
				}
				else if (val == Restore && val.Value)
				{
					UnlockSingleAchievement("ACH_RESTORE", "restore");
				}
				else if (val == Snowcats && val.Value)
				{
					UnlockSingleAchievement("ACH_SNOWCATS", "snowcats");
				}
				else if (val == Birds && val.Value)
				{
					UnlockSingleAchievement("ACH_BIRDS", "birds");
				}
				else if (val == Vsync || val == ShowFPS || val == NoPixelRendering)
				{
					ApplyGraphicsSettings();
					if (val == NoPixelRendering)
					{
						currentRes = default(Resolution);
						FixPixelRendering();
					}
				}
			}
		}

		private static void CreateNewRenderTexture(Camera cam)
		{
			//IL_003f: 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_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if ((Object)(object)cam == (Object)null || (Object)(object)cam.targetTexture == (Object)null)
				{
					return;
				}
				if ((Object)(object)defaultRT == (Object)null)
				{
					defaultRT = cam.targetTexture;
				}
				Resolution currentResolution = Screen.currentResolution;
				int width = ((Resolution)(ref currentResolution)).width;
				currentResolution = Screen.currentResolution;
				int height = ((Resolution)(ref currentResolution)).height;
				if ((Object)(object)newRT != (Object)null && ((Texture)newRT).width == width && ((Texture)newRT).height == height)
				{
					return;
				}
				if (((Texture)defaultRT).width == width && ((Texture)defaultRT).height == height)
				{
					newRT = defaultRT;
					return;
				}
				if ((Object)(object)newRT != (Object)null && (Object)(object)newRT != (Object)(object)defaultRT)
				{
					newRT.Release();
				}
				newRT = new RenderTexture(width, height, defaultRT.depth);
				newRT.format = defaultRT.format;
				newRT.antiAliasing = defaultRT.antiAliasing;
				((Texture)newRT).filterMode = ((Texture)defaultRT).filterMode;
				newRT.Create();
			}
			catch
			{
			}
		}

		private static void CreateNewRearViewRenderTexture(Camera cam)
		{
			//IL_003f: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Expected O, but got Unknown
			//IL_0128: 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)
			try
			{
				if ((Object)(object)cam == (Object)null || (Object)(object)cam.targetTexture == (Object)null)
				{
					return;
				}
				if ((Object)(object)defaultRearViewRT == (Object)null)
				{
					defaultRearViewRT = cam.targetTexture;
				}
				Resolution currentResolution = Screen.currentResolution;
				int num = (int)((float)((Resolution)(ref currentResolution)).width / 4.5f);
				currentResolution = Screen.currentResolution;
				int num2 = (int)((float)((Resolution)(ref currentResolution)).height / 8f);
				if ((Object)(object)newRearViewRT != (Object)null && ((Texture)newRearViewRT).width == num && ((Texture)newRearViewRT).height == num2)
				{
					return;
				}
				if (((Texture)defaultRearViewRT).width == num && ((Texture)defaultRearViewRT).height == num2)
				{
					newRearViewRT = defaultRearViewRT;
					return;
				}
				if ((Object)(object)newRearViewRT != (Object)null && (Object)(object)newRearViewRT != (Object)(object)defaultRearViewRT)
				{
					newRearViewRT.Release();
				}
				newRearViewRT = new RenderTexture(num, num2, defaultRearViewRT.depth);
				newRearViewRT.format = defaultRearViewRT.format;
				newRearViewRT.antiAliasing = defaultRearViewRT.antiAliasing;
				((Texture)newRearViewRT).filterMode = ((Texture)defaultRearViewRT).filterMode;
				newRearViewRT.Create();
			}
			catch
			{
			}
		}

		private static void FixPixelRendering()
		{
			//IL_0026: 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)
			try
			{
				if ((Object)(object)mainCamera == (Object)null || (Object)(object)screenMR == (Object)null)
				{
					return;
				}
				currentRes = Screen.currentResolution;
				resWidthRatio = (float)((Resolution)(ref currentRes)).width / 456f;
				resHeightRatio = (float)((Resolution)(ref currentRes)).height / 256f;
				CreateNewRenderTexture(mainCamera);
				if ((Object)(object)rearViewCamera != (Object)null)
				{
					CreateNewRearViewRenderTexture(rearViewCamera);
				}
				if (NoPixelRendering != null && NoPixelRendering.Value)
				{
					if ((Object)(object)newRT != (Object)null && (Object)(object)screenMR != (Object)null && (Object)(object)mainCamera != (Object)null)
					{
						((Renderer)screenMR).material.mainTexture = (Texture)(object)newRT;
						mainCamera.targetTexture = newRT;
					}
					if ((Object)(object)rearViewCamera != (Object)null && (Object)(object)rearViewMR != (Object)null && (Object)(object)newRearViewRT != (Object)null)
					{
						rearViewCamera.targetTexture = newRearViewRT;
						((Renderer)rearViewMR).material.mainTexture = (Texture)(object)newRearViewRT;
					}
				}
				else
				{
					if ((Object)(object)defaultRT != (Object)null && (Object)(object)screenMR != (Object)null && (Object)(object)mainCamera != (Object)null)
					{
						((Renderer)screenMR).material.mainTexture = (Texture)(object)defaultRT;
						mainCamera.targetTexture = defaultRT;
					}
					if ((Object)(object)rearViewCamera != (Object)null && (Object)(object)rearViewMR != (Object)null && (Object)(object)defaultRearViewRT != (Object)null)
					{
						rearViewCamera.targetTexture = defaultRearViewRT;
						((Renderer)rearViewMR).material.mainTexture = (Texture)(object)defaultRearViewRT;
					}
				}
			}
			catch
			{
			}
		}

		private void ApplyEnvironment()
		{
			if (!_envInitialized)
			{
				InitializeEnvironmentBaseValues();
				_envInitialized = true;
			}
			ApplyNoFog();
			ApplyTimeControls();
			sDayNightCycle val = Object.FindObjectOfType<sDayNightCycle>();
			if ((Object)(object)val != (Object)null)
			{
				if (!weatherInit)
				{
					RandomWeather.Value = true;
					weatherInit = true;
				}
				if (RandomWeather != null)
				{
					val.randomWeather = RandomWeather.Value;
				}
			}
			if (RandomWeather == null || !RandomWeather.Value)
			{
				ApplyWeatherIntensity();
				ApplyWeatherCycle();
				ApplyWeatherSpeed();
			}
		}

		private void InitializeEnvironmentBaseValues()
		{
			try
			{
				sDayNightCycle val = Object.FindObjectOfType<sDayNightCycle>();
				if ((Object)(object)val != (Object)null)
				{
					if (_baseWeatherSpeed < 0f)
					{
						_baseWeatherSpeed = val.weatherSpeed;
					}
					if (_baseDayDuration < 0f)
					{
						_baseDayDuration = val.dayDuration;
					}
				}
				if (_baseWeatherSpeed < 0f)
				{
					_baseWeatherSpeed = 0.01f;
				}
				if (_baseDayDuration < 0f)
				{
					_baseDayDuration = 60f;
				}
			}
			catch
			{
			}
		}

		private void ApplyWeatherIntensity()
		{
			try
			{
				sWeatherSystem val = Object.FindObjectOfType<sWeatherSystem>();
				if (!((Object)(object)val == (Object)null))
				{
					float intensity = Mathf.Clamp01((float)((WeatherIntensity != null) ? WeatherIntensity.Value : 0) / 10f);
					val.intensity = intensity;
				}
			}
			catch
			{
			}
		}

		private void ApplyWeatherCycle()
		{
			try
			{
				sDayNightCycle val = Object.FindObjectOfType<sDayNightCycle>();
				if ((Object)(object)val == (Object)null)
				{
					return;
				}
				FieldInfo field = typeof(sDayNightCycle).GetField("weatherTarget", BindingFlags.Instance | BindingFlags.NonPublic);
				if (field == null)
				{
					return;
				}
				if (Time.unscaledTime < _weatherUserUntil)
				{
					float num = Mathf.Clamp01((float)((WeatherCycle != null) ? WeatherCycle.Value : 0) / 10f);
					field.SetValue(val, num);
					return;
				}
				object value = field.GetValue(val);
				if (value is float)
				{
					float num2 = (float)value;
					if (WeatherCycle != null)
					{
						_suppressEnvWrites = true;
						WeatherCycle.Value = Mathf.RoundToInt(Mathf.Clamp01(num2) * 10f);
						_suppressEnvWrites = false;
					}
				}
			}
			catch
			{
			}
		}

		private void ApplyWeatherSpeed()
		{
			try
			{
				sDayNightCycle val = Object.FindObjectOfType<sDayNightCycle>();
				if (!((Object)(object)val == (Object)null))
				{
					if (FreezeWeather != null && FreezeWeather.Value)
					{
						val.weatherSpeed = 0f;
						return;
					}
					int num = ((SpeedUpWeather != null) ? SpeedUpWeather.Value : 0);
					float num2 = 1f + (float)num / 10f;
					float weatherSpeed = _baseWeatherSpeed * Mathf.Max(0f, num2);
					val.weatherSpeed = weatherSpeed;
				}
			}
			catch
			{
			}
		}

		private void ApplyNoFog()
		{
			try
			{
				bool flag = NoFog != null && NoFog.Value;
				RenderSettings.fog = !flag;
			}
			catch
			{
			}
		}

		private void ApplyTimeControls()
		{
			try
			{
				sDayNightCycle val = Object.FindObjectOfType<sDayNightCycle>();
				if ((Object)(object)val == (Object)null)
				{
					return;
				}
				FieldInfo field = typeof(sDayNightCycle).GetField("doTime", BindingFlags.Instance | BindingFlags.Public);
				FieldInfo field2 = typeof(sDayNightCycle).GetField("time", BindingFlags.Instance | BindingFlags.Public);
				FieldInfo field3 = typeof(sDayNightCycle).GetField("dayDuration", BindingFlags.Instance | BindingFlags.Public);
				if (field == null || field2 == null || field3 == null)
				{
					return;
				}
				if (FreezeTime != null && FreezeTime.Value)
				{
					field.SetValue(val, false);
					return;
				}
				field.SetValue(val, true);
				if (SyncTime != null && SyncTime.Value)
				{
					DateTime now = DateTime.Now;
					float num = (float)now.Hour + (float)now.Minute / 60f + (float)now.Second / 3600f;
					float num2 = num / 24f;
					field2.SetValue(val, num2);
				}
				else if (Time.unscaledTime < _timeUserUntil && ChangeTime != null)
				{
					float num3 = Mathf.Clamp(ChangeTime.Value, 0f, 24f);
					float num4 = num3 / 24f;
					field2.SetValue(val, num4);
				}
				else if (ChangeTime != null && Time.frameCount % 10 == 0 && field2.GetValue(val) is float num5)
				{
					_suppressEnvWrites = true;
					ChangeTime.Value = num5 * 24f;
					_suppressEnvWrites = false;
				}
				int num6 = ((SpeedUpTime != null) ? SpeedUpTime.Value : 0);
				bool flag = ReverseTime != null && ReverseTime.Value;
				if (_baseDayDuration < 0f && field3.GetValue(val) is float num7)
				{
					_baseDayDuration = Mathf.Abs(num7);
				}
				if (num6 == _lastSpeedUpTime && flag == _lastReverseTime)
				{
					return;
				}
				_lastSpeedUpTime = num6;
				_lastReverseTime = flag;
				if (num6 != 0 || flag)
				{
					float num8 = 1f + (float)num6 / 10f;
					if (flag)
					{
						float num9 = (0f - _baseDayDuration) / Mathf.Max(0.1f, num8);
						field3.SetValue(val, num9);
					}
					else
					{
						float num10 = _baseDayDuration / Mathf.Max(0.1f, num8);
						field3.SetValue(val, num10);
					}
				}
				else
				{
					field3.SetValue(val, _baseDayDuration);
				}
			}
			catch
			{
			}
		}
	}
}
namespace EasyDeliveryMenu.MonoBehaviours
{
	internal class EasyDeliveryMenuComponent : MonoBehaviour
	{
		public void Awake()
		{
		}

		public void Start()
		{
		}

		public void Update()
		{
		}

		public void LateUpdate()
		{
		}
	}
}