Decompiled source of EasyDeliveryMenu v3.5.8
BepInEx/plugins/EasyDeliveryMenu.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; 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.8")] 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.8"; 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 static int _cachedFPSTarget = -999; private static int _cachedVsyncCount = -1; private static bool _fpsSettingsApplied = false; private static Queue<float> _deltaTimeQueue = new Queue<float>(); private static float _smoothDeltaTime = 0.016f; private const int DELTA_TIME_SAMPLES = 10; private static float _originalTimeScale = 1f; private static float _originalFixedDeltaTime = 0.02f; private void Awake() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Expected O, but got Unknown //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Expected O, but got Unknown //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Expected O, but got Unknown //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Expected O, but got Unknown //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Expected O, but got Unknown //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Expected O, but got Unknown //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Expected O, but got Unknown //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Expected O, but got Unknown //IL_0406: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Expected O, but got Unknown //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Expected O, but got Unknown //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Expected O, but got Unknown //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Expected O, but got Unknown //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Expected O, but got Unknown //IL_055a: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Expected O, but got Unknown //IL_05a5: Unknown result type (might be due to invalid IL or missing references) //IL_05af: Expected O, but got Unknown //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_05fa: Expected O, but got Unknown //IL_0634: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Expected O, but got Unknown //IL_0680: Unknown result type (might be due to invalid IL or missing references) //IL_068a: Expected O, but got Unknown //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Expected O, but got Unknown //IL_0708: Unknown result type (might be due to invalid IL or missing references) //IL_0712: Expected O, but got Unknown //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_0756: Expected O, but got Unknown //IL_07a2: Unknown result type (might be due to invalid IL or missing references) //IL_07ac: Expected O, but got Unknown //IL_07ee: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Expected O, but got Unknown //IL_0832: Unknown result type (might be due to invalid IL or missing references) //IL_083c: Expected O, but got Unknown //IL_087d: Unknown result type (might be due to invalid IL or missing references) //IL_0887: Expected O, but got Unknown //IL_08c1: Unknown result type (might be due to invalid IL or missing references) //IL_08cb: Expected O, but got Unknown //IL_0905: Unknown result type (might be due to invalid IL or missing references) //IL_090f: Expected O, but got Unknown //IL_0949: Unknown result type (might be due to invalid IL or missing references) //IL_0953: Expected O, but got Unknown //IL_098d: Unknown result type (might be due to invalid IL or missing references) //IL_0997: Expected O, but got Unknown //IL_09d1: Unknown result type (might be due to invalid IL or missing references) //IL_09db: Expected O, but got Unknown //IL_0a12: Unknown result type (might be due to invalid IL or missing references) //IL_0a1c: Expected O, but got Unknown //IL_0a53: Unknown result type (might be due to invalid IL or missing references) //IL_0a5d: Expected O, but got Unknown //IL_0a94: Unknown result type (might be due to invalid IL or missing references) //IL_0a9e: Expected O, but got Unknown //IL_0ad5: Unknown result type (might be due to invalid IL or missing references) //IL_0adf: Expected O, but got Unknown //IL_0b16: Unknown result type (might be due to invalid IL or missing references) //IL_0b20: Expected O, but got Unknown //IL_0b57: Unknown result type (might be due to invalid IL or missing references) //IL_0b61: Expected O, but got Unknown //IL_0b98: Unknown result type (might be due to invalid IL or missing references) //IL_0ba2: Expected O, but got Unknown //IL_0bd9: Unknown result type (might be due to invalid IL or missing references) //IL_0be3: Expected O, but got Unknown //IL_0c1a: Unknown result type (might be due to invalid IL or missing references) //IL_0c24: Expected O, but got Unknown //IL_0c5b: Unknown result type (might be due to invalid IL or missing references) //IL_0c65: Expected O, but got Unknown //IL_0c9c: Unknown result type (might be due to invalid IL or missing references) //IL_0ca6: Expected O, but got Unknown //IL_0cdd: Unknown result type (might be due to invalid IL or missing references) //IL_0ce7: Expected O, but got Unknown //IL_0d1d: Unknown result type (might be due to invalid IL or missing references) //IL_0d27: Expected O, but got Unknown //IL_0d5d: Unknown result type (might be due to invalid IL or missing references) //IL_0d67: Expected O, but got Unknown //IL_0d9d: Unknown result type (might be due to invalid IL or missing references) //IL_0da7: Expected O, but got Unknown _originalTimeScale = Time.timeScale; _originalFixedDeltaTime = Time.fixedDeltaTime; 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() { UpdateSmoothDeltaTime(); ApplyVehicleToggles(); ApplyPlayerToggles(); ApplyEnvironment(); ApplyExtras(); UpdateFreeCam(); if (!_fpsSettingsApplied) { EnforceFPSSettings(); } } private void UpdateSmoothDeltaTime() { float unscaledDeltaTime = Time.unscaledDeltaTime; unscaledDeltaTime = Mathf.Clamp(unscaledDeltaTime, 0.001f, 0.1f); _deltaTimeQueue.Enqueue(unscaledDeltaTime); if (_deltaTimeQueue.Count > 10) { _deltaTimeQueue.Dequeue(); } float num = 0f; foreach (float item in _deltaTimeQueue) { num += item; } _smoothDeltaTime = num / (float)_deltaTimeQueue.Count; } 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 * _smoothDeltaTime; } } 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() { int num = ((Vsync != null && Vsync.Value) ? 1 : 0); int num2 = CalculateTargetFPS(); if (_cachedVsyncCount != num || _cachedFPSTarget != num2 || !_fpsSettingsApplied) { if (Vsync != null && Vsync.Value) { QualitySettings.vSyncCount = 1; Application.targetFrameRate = -1; } else { QualitySettings.vSyncCount = 0; Application.targetFrameRate = num2; } _cachedVsyncCount = num; _cachedFPSTarget = num2; _fpsSettingsApplied = true; } } private int CalculateTargetFPS() { int num = ((FPSAmount != null) ? FPSAmount.Value : 0); if (num <= 0) { return 60; } if (num >= 10) { return -1; } int[] array = new int[9] { 75, 90, 120, 144, 165, 240, 300, 360, 480 }; int num2 = Mathf.Clamp(num - 1, 0, array.Length - 1); return array[num2]; } private void EnforceFPSSettings() { int num = ((Vsync != null && Vsync.Value) ? 1 : 0); int num2 = CalculateTargetFPS(); bool flag = QualitySettings.vSyncCount != num; bool flag2 = Application.targetFrameRate != num2; if (flag || flag2) { if (Vsync != null && Vsync.Value) { if (flag) { QualitySettings.vSyncCount = 1; } if (flag2) { Application.targetFrameRate = -1; } } else { if (flag) { QualitySettings.vSyncCount = 0; } if (flag2) { Application.targetFrameRate = num2; } } _cachedVsyncCount = num; _cachedFPSTarget = num2; } else { _fpsSettingsApplied = true; } } private void ConfigSettingChanged(object sender, EventArgs e) { //IL_0298: 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) { _fpsSettingsApplied = false; 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) { _fpsSettingsApplied = false; 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 { } } } [BepInPlugin("soup.easydelivery.mintmenu", "Easy Delivery Menu Config Manager", "1.8.2")] public class MintMenu : BaseUnityPlugin { private class PluginSettings { public string PluginName; public bool Collapsed; public List<SettingInfo> Settings; } private class SettingInfo { public string Key; public string Section; public ConfigEntryBase Entry; } private static readonly Color MINT = new Color(0f, 0.87f, 0.68f, 1f); private static readonly Color MINT_DARK = new Color(0f, 0.65f, 0.5f, 1f); private static readonly Color MINT_LIGHT = new Color(0.4f, 1f, 0.9f, 1f); private static readonly Color MINT_BG = new Color(0.05f, 0.15f, 0.13f, 0.98f); private ManualLogSource log; private bool menuVisible = false; private Rect windowRect; private Vector2 scrollPos = Vector2.zero; private bool windowInitialized = false; private List<PluginSettings> allPluginSettings = new List<PluginSettings>(); private Texture2D mintTexture; private Texture2D darkTexture; private Texture2D buttonTexture; private GUIStyle windowStyle; private GUIStyle headerStyle; private GUIStyle labelStyle; private GUIStyle buttonStyle; private GUIStyle toggleStyle; private GUIStyle textFieldStyle; private GUIStyle boxStyle; private bool stylesInitialized = false; private void Awake() { //IL_006a: 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) log = ((BaseUnityPlugin)this).Logger; log.LogInfo((object)"╔════════════════════════════════════╗"); log.LogInfo((object)"║ Easy Delivery Menu LOADED! :3 ║"); log.LogInfo((object)"║ Press ~ or ` to open menu ║"); log.LogInfo((object)"╚════════════════════════════════════╝"); int num = 450; int height = Screen.height; int num2 = 0; int num3 = 0; windowRect = new Rect((float)num2, (float)num3, (float)num, (float)height); windowInitialized = true; CreateTextures(); } private void Update() { if (Input.GetKeyDown((KeyCode)96)) { menuVisible = !menuVisible; if (menuVisible) { ((Rect)(ref windowRect)).width = 450f; ((Rect)(ref windowRect)).height = Screen.height; ((Rect)(ref windowRect)).x = 0f; ((Rect)(ref windowRect)).y = 0f; RefreshSettings(); } } if (menuVisible && ((Rect)(ref windowRect)).height != (float)Screen.height) { ((Rect)(ref windowRect)).height = Screen.height; } } private void OnGUI() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) if (menuVisible) { if (!stylesInitialized) { InitializeStyles(); stylesInitialized = true; } Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; GUI.color = Color.white; GUI.backgroundColor = Color.white; GUI.contentColor = Color.white; GUI.Window(12345, windowRect, new WindowFunction(DrawMenuWindow), "Easy Delivery Menu", windowStyle); } } private void DrawMenuWindow(int windowID) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); scrollPos = GUILayout.BeginScrollView(scrollPos, false, true, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandHeight(true) }); foreach (PluginSettings allPluginSetting in allPluginSettings) { DrawPlugin(allPluginSetting); } GUILayout.Space(20f); GUILayout.EndScrollView(); DrawFooter(); GUILayout.EndVertical(); } private void DrawFooter() { GUILayout.BeginHorizontal(boxStyle, Array.Empty<GUILayoutOption>()); GUILayout.FlexibleSpace(); if (GUILayout.Button("✕ Close Menu", buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) })) { menuVisible = false; } GUILayout.EndHorizontal(); } private void DrawPlugin(PluginSettings plugin) { if (plugin.PluginName == "EasyDeliveryMenu") { IEnumerable<IGrouping<string, SettingInfo>> enumerable = from s in plugin.Settings group s by s.Section; { foreach (IGrouping<string, SettingInfo> item in enumerable) { if (!string.IsNullOrEmpty(item.Key)) { GUILayout.BeginVertical(boxStyle, Array.Empty<GUILayoutOption>()); GUILayout.Label("▸ " + item.Key, headerStyle, Array.Empty<GUILayoutOption>()); foreach (SettingInfo item2 in item) { DrawSetting(item2); } GUILayout.EndVertical(); GUILayout.Space(5f); continue; } foreach (SettingInfo item3 in item) { DrawSetting(item3); } } return; } } GUILayout.BeginVertical(boxStyle, Array.Empty<GUILayoutOption>()); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); string text = (plugin.Collapsed ? "▶" : "▼"); if (GUILayout.Button(text + " " + plugin.PluginName, headerStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) })) { plugin.Collapsed = !plugin.Collapsed; } GUILayout.EndHorizontal(); if (!plugin.Collapsed) { GUILayout.Space(5f); IEnumerable<IGrouping<string, SettingInfo>> enumerable2 = from s in plugin.Settings group s by s.Section; foreach (IGrouping<string, SettingInfo> item4 in enumerable2) { if (!string.IsNullOrEmpty(item4.Key)) { GUILayout.Label("▸ " + item4.Key, labelStyle, Array.Empty<GUILayoutOption>()); } foreach (SettingInfo item5 in item4) { DrawSetting(item5); } GUILayout.Space(3f); } } GUILayout.EndVertical(); GUILayout.Space(5f); } private void DrawSetting(SettingInfo setting) { //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); GUILayout.Label(setting.Key, labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(150f) }); try { if (setting.Entry.SettingType == typeof(bool)) { bool flag = (bool)setting.Entry.BoxedValue; bool flag2 = GUILayout.Toggle(flag, flag ? "ON" : "OFF", toggleStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) }); if (flag2 != flag) { setting.Entry.BoxedValue = flag2; } } else if (setting.Entry.SettingType == typeof(int)) { if (setting.Entry.Description.AcceptableValues is AcceptableValueRange<int> val) { int num = (int)setting.Entry.BoxedValue; float num2 = GUILayout.HorizontalSlider((float)num, (float)val.MinValue, (float)val.MaxValue, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) }); int num3 = Mathf.RoundToInt(num2); GUILayout.Label(num3.ToString(), labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(35f) }); if (num3 != num) { setting.Entry.BoxedValue = num3; } } else { string text = setting.Entry.BoxedValue.ToString(); string text2 = GUILayout.TextField(text, textFieldStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) }); if (text2 != text && int.TryParse(text2, out var result)) { setting.Entry.BoxedValue = result; } } } else if (setting.Entry.SettingType == typeof(float)) { if (setting.Entry.Description.AcceptableValues is AcceptableValueRange<float> val2) { float num4 = (float)setting.Entry.BoxedValue; float num5 = GUILayout.HorizontalSlider(num4, val2.MinValue, val2.MaxValue, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(100f) }); GUILayout.Label(num5.ToString("F2"), labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(35f) }); if (Math.Abs(num5 - num4) > 0.001f) { setting.Entry.BoxedValue = num5; } } else { string text3 = setting.Entry.BoxedValue.ToString(); string text4 = GUILayout.TextField(text3, textFieldStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) }); if (text4 != text3 && float.TryParse(text4, out var result2)) { setting.Entry.BoxedValue = result2; } } } else if (setting.Entry.SettingType == typeof(string)) { string text5 = setting.Entry.BoxedValue?.ToString() ?? ""; string text6 = GUILayout.TextField(text5, textFieldStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) }); if (text6 != text5) { setting.Entry.BoxedValue = text6; } } else if (setting.Entry.SettingType == typeof(KeyCode)) { KeyCode val3 = (KeyCode)setting.Entry.BoxedValue; GUILayout.Label(((object)(KeyCode)(ref val3)).ToString(), labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) }); } else { string text7 = setting.Entry.BoxedValue?.ToString() ?? "null"; GUILayout.Label(text7, labelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(120f) }); } GUILayout.FlexibleSpace(); if (GUILayout.Button("RESET", buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) })) { object defaultValue = GetDefaultValue(setting); if (defaultValue != null) { setting.Entry.BoxedValue = defaultValue; } else if (setting.Entry.SettingType == typeof(bool)) { setting.Entry.BoxedValue = false; } else if (setting.Entry.SettingType == typeof(int)) { AcceptableValueRange<int> val4 = setting.Entry.Description.AcceptableValues as AcceptableValueRange<int>; setting.Entry.BoxedValue = val4?.MinValue ?? 0; } else if (setting.Entry.SettingType == typeof(float)) { AcceptableValueRange<float> val5 = setting.Entry.Description.AcceptableValues as AcceptableValueRange<float>; setting.Entry.BoxedValue = val5?.MinValue ?? 0f; } } } catch (Exception ex) { GUILayout.Label("Error: " + ex.Message, labelStyle, Array.Empty<GUILayoutOption>()); } GUILayout.EndHorizontal(); } private object GetDefaultValue(SettingInfo setting) { try { ConfigEntryBase entry = setting.Entry; switch (setting.Key) { case "Speed": return 1f; case "Gravity": return 1f; case "Vehicle Invincibility": return false; case "Show HUD": return true; case "Infinite fuel": return false; case "Smooth driving": return false; case "Instant vehicle reset": return false; case "Snow Tires": return false; case "Ice Chains": return false; case "Bumper Bar": return false; case "Perfect traction": return false; case "Blow up vehicle": return false; case "Zero vehicle gravity": return false; case "Money amount": return 0f; case "Player Invincibility": return false; case "Infinite energy": return false; case "No freezing": return false; case "No ragdoll": return false; case "Random weather": return true; case "Weather intensity": return 0; case "Weather cycle": return 0; case "Freeze weather": return false; case "Speed up weather": return 0; case "No fog": return false; case "Freeze time": return false; case "Reverse time": return false; case "Change time": return 6f; case "Speed up time": return 0; case "Sync time": return false; case "FPS amount": return 0; case "Vsync": return false; case "Show FPS": return false; case "Freecam": return false; case "No pixelated rendering": return false; case "Unlock all achievements": return false; case "Enter snowy peaks": return false; case "Enter fishing town": return false; case "Secure a package with duct tape": return false; case "Brew a cup of tea to stay warm": return false; case "Cook a fish": return false; case "Active every radio tower": return false; case "Reboot Ending": return false; case "Shutdown Ending": return false; case "Restore Ending": return false; case "Find all the snowcats": return false; case "Feed the birds": return false; case "Show location": return false; case "Show all EXEs": return false; case "Draggable icons": return false; default: { Type type = ((object)entry.Description).GetType(); PropertyInfo property = type.GetProperty("DefaultValue"); if (property != null) { object value = property.GetValue(entry.Description); if (value != null) { return value; } } if (entry.Description.Tags != null) { object[] tags = entry.Description.Tags; foreach (object obj in tags) { if (obj == null) { continue; } Type type2 = obj.GetType(); PropertyInfo property2 = type2.GetProperty("DefaultValue"); if (property2 != null) { object value2 = property2.GetValue(obj); if (value2 != null) { return value2; } } } } PropertyInfo property3 = ((object)entry).GetType().GetProperty("BoxedDefaultValue", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (property3 != null) { object value3 = property3.GetValue(entry); if (value3 != null) { return value3; } } FieldInfo field = ((object)entry).GetType().GetField("DefaultValue", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (field != null) { object value4 = field.GetValue(entry); if (value4 != null) { return value4; } } break; } } } catch (Exception) { } return null; } private void RefreshSettings() { allPluginSettings.Clear(); foreach (PluginInfo value2 in Chainloader.PluginInfos.Values) { BaseUnityPlugin instance = value2.Instance; if (((instance != null) ? instance.Config : null) == null) { continue; } string name = value2.Metadata.Name; switch (name) { case "Configuration Manager": case "Mint Config Manager": case "Mint Menu": case "Easy Delivery Mint Menu": continue; } if (value2.Metadata.GUID.Contains("configmanager") || value2.Metadata.GUID.Contains("mintmenu") || value2.Metadata.GUID.Contains("mintconfig")) { continue; } PluginSettings pluginSettings = new PluginSettings { PluginName = name, Collapsed = false, Settings = new List<SettingInfo>() }; foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item in value2.Instance.Config) { ConfigEntryBase value = item.Value; if (value != null) { pluginSettings.Settings.Add(new SettingInfo { Key = value.Definition.Key, Section = value.Definition.Section, Entry = value }); } } if (pluginSettings.Settings.Count > 0) { allPluginSettings.Add(pluginSettings); } } allPluginSettings = allPluginSettings.OrderBy((PluginSettings p) => p.PluginName).ToList(); } private void CreateTextures() { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) mintTexture = new Texture2D(1, 1); mintTexture.SetPixel(0, 0, MINT); mintTexture.Apply(); darkTexture = new Texture2D(1, 1); darkTexture.SetPixel(0, 0, MINT_BG); darkTexture.Apply(); buttonTexture = new Texture2D(1, 1); buttonTexture.SetPixel(0, 0, MINT_DARK); buttonTexture.Apply(); } private void InitializeStyles() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_00d9: 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_0117: Expected O, but got Unknown //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected O, but got Unknown //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Expected O, but got Unknown //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Expected O, but got Unknown //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Expected O, but got Unknown //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Expected O, but got Unknown //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b9: Expected O, but got Unknown //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Expected O, but got Unknown //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Expected O, but got Unknown //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) windowStyle = new GUIStyle(GUI.skin.window); windowStyle.normal.background = darkTexture; windowStyle.onNormal.background = darkTexture; windowStyle.focused.background = darkTexture; windowStyle.onFocused.background = darkTexture; windowStyle.hover.background = darkTexture; windowStyle.onHover.background = darkTexture; windowStyle.active.background = darkTexture; windowStyle.onActive.background = darkTexture; windowStyle.normal.textColor = MINT_LIGHT; windowStyle.fontSize = 16; windowStyle.fontStyle = (FontStyle)1; windowStyle.padding = new RectOffset(10, 10, 25, 10); windowStyle.border = new RectOffset(0, 0, 0, 0); boxStyle = new GUIStyle(GUI.skin.box); boxStyle.normal.background = MakeTexture(2, 2, new Color(0.02f, 0.08f, 0.07f, 0.9f)); boxStyle.padding = new RectOffset(5, 5, 5, 5); boxStyle.margin = new RectOffset(2, 2, 2, 2); headerStyle = new GUIStyle(GUI.skin.button); headerStyle.normal.background = mintTexture; headerStyle.normal.textColor = Color.white; headerStyle.hover.background = MakeTexture(1, 1, MINT_LIGHT); headerStyle.active.background = mintTexture; headerStyle.focused.background = mintTexture; headerStyle.fontSize = 14; headerStyle.fontStyle = (FontStyle)1; headerStyle.alignment = (TextAnchor)3; headerStyle.padding = new RectOffset(10, 10, 5, 5); labelStyle = new GUIStyle(GUI.skin.label); labelStyle.normal.textColor = MINT_LIGHT; labelStyle.fontSize = 12; buttonStyle = new GUIStyle(GUI.skin.button); buttonStyle.normal.background = buttonTexture; buttonStyle.normal.textColor = Color.white; buttonStyle.hover.background = mintTexture; buttonStyle.active.background = MakeTexture(1, 1, MINT_DARK); buttonStyle.focused.background = buttonTexture; buttonStyle.fontSize = 12; buttonStyle.fontStyle = (FontStyle)1; toggleStyle = new GUIStyle(GUI.skin.toggle); toggleStyle.normal.textColor = MINT_LIGHT; toggleStyle.onNormal.textColor = Color.white; toggleStyle.fontSize = 12; textFieldStyle = new GUIStyle(GUI.skin.textField); textFieldStyle.normal.background = MakeTexture(1, 1, new Color(0.1f, 0.1f, 0.1f, 1f)); textFieldStyle.normal.textColor = MINT_LIGHT; textFieldStyle.focused.background = MakeTexture(1, 1, new Color(0.15f, 0.15f, 0.15f, 1f)); textFieldStyle.fontSiz