Decompiled source of speeedLab v1.0.2

Mods/speeedLab.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BoneLib.BoneMenu;
using HarmonyLib;
using MelonLoader;
using MelonLoader.Preferences;
using Microsoft.CodeAnalysis;
using UnityEngine;
using speeedLab;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Core), "speeedLab", "1.0.0", "freakycheesy", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("speeedLab")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+505667e23a58cadc9d94e2a70a6ede7a30ece452")]
[assembly: AssemblyProduct("speeedLab")]
[assembly: AssemblyTitle("speeedLab")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace speeedLab
{
	[HarmonyPatch]
	public class Core : MelonMod
	{
		private MelonPreferences_Entry<bool> entry;

		private MelonPreferences_Category category;

		public override void OnInitializeMelon()
		{
			try
			{
				((MelonBase)this).LoggerInstance.Msg("Initialized.");
				((MelonBase)this).HarmonyInstance.PatchAll();
			}
			catch (Exception ex)
			{
				MelonLogger.Error((object)ex);
			}
			MelonPrefs();
			BoneMenus();
		}

		private void BoneMenus()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			Page val = Page.Root.CreatePage("speeedLab", Color.green, 0, true);
			val.CreateBool("Enabled (Only works on restart)", Color.green, entry.Value, (Action<bool>)delegate(bool a)
			{
				entry.Value = a;
			});
		}

		private void MelonPrefs()
		{
			category = MelonPreferences.CreateCategory("speedlab");
			entry = category.CreateEntry<bool>("speedLab Enabled", true, (string)null, (string)null, false, false, (ValueValidator)null, (string)null);
			MelonPreferences.Save();
			category.SaveToFile(true);
		}

		public override void OnSceneWasLoaded(int buildIndex, string sceneName)
		{
			((MelonMod)this).OnSceneWasLoaded(buildIndex, sceneName);
			if (entry != null && entry.Value)
			{
				RenderSettings.fog = false;
				RenderSettings.customReflection = null;
				QualitySettings.anisotropicFiltering = (AnisotropicFiltering)0;
				QualitySettings.antiAliasing = 0;
				QualitySettings.billboardsFaceCameraPosition = false;
				QualitySettings.lodBias = 0f;
				QualitySettings.maximumLODLevel = 1;
				QualitySettings.pixelLightCount = 0;
				QualitySettings.realtimeReflectionProbes = false;
				QualitySettings.shadowmaskMode = (ShadowmaskMode)0;
				QualitySettings.shadowResolution = (ShadowResolution)0;
				QualitySettings.shadows = (ShadowQuality)0;
				QualitySettings.skinWeights = (SkinWeights)1;
				QualitySettings.softParticles = false;
				QualitySettings.softVegetation = false;
				QualitySettings.vSyncCount = 0;
				QualitySettings.particleRaycastBudget = 0;
				Physics.solverIterationCount /= 2;
				Physics.solverVelocityIterationCount /= 2;
				Physics.sleepThreshold = 0.04f;
				Physics.sleepVelocity = 0.04f;
				Physics.sleepAngularVelocity = 0.04f;
				AudioSettings.speakerMode = (AudioSpeakerMode)1;
			}
		}
	}
}