Decompiled source of LCConfigTest v1.0.0

LCCofigTest.dll

Decompiled 11 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using LCCofigTest.Data;
using LCCofigTest.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("LCCofigTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HP")]
[assembly: AssemblyProduct("LCCofigTest")]
[assembly: AssemblyCopyright("Copyright © HP 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("94d82dda-b184-4161-a616-78e6464d6aac")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace LCCofigTest
{
	[BepInPlugin("Sweeper_bot.LCCofigTest", "LC Config Mod", "1.0.0.0")]
	public class LCCofigTestBase : BaseUnityPlugin
	{
		private const string modGUID = "Sweeper_bot.LCCofigTest";

		private const string modName = "LC Config Mod";

		private const string modVersion = "1.0.0.0";

		private string configOutput;

		private readonly Harmony harmony = new Harmony("Sweeper_bot.LCCofigTest");

		private LCCofigTestBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Expected O, but got Unknown
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Sweeper_bot.LCCofigTest");
			ConfigSettings.GetConfig((BaseUnityPlugin)Instance);
			configOutput = "Double: " + ConfigSettings.doubleVal_C.Value + " Float:" + ConfigSettings.floatVal_C.Value;
			mls.LogInfo((object)"test mod has awaken");
			mls.LogInfo((object)configOutput);
			harmony.PatchAll(typeof(LCCofigTestBase));
			harmony.PatchAll(typeof(PlayerControllerBPatch));
		}
	}
}
namespace LCCofigTest.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void infiniteSprintPatch(ref float ___sprintMeter)
		{
			if (ConfigSettings.boolVal_C.Value)
			{
				___sprintMeter = ConfigSettings.floatVal_C.Value;
			}
		}
	}
}
namespace LCCofigTest.Data
{
	internal class ConfigSettings
	{
		public static ConfigEntry<bool> boolVal_C { get; private set; }

		public static ConfigEntry<double> doubleVal_C { get; private set; }

		public static ConfigEntry<float> floatVal_C { get; private set; }

		public static void GetConfig(BaseUnityPlugin Instance)
		{
			boolVal_C = Instance.Config.Bind<bool>("Boolean", "Infinite Stamina", false, "Whether or not the boolean is true.");
			doubleVal_C = Instance.Config.Bind<double>("Double", "Input a Double", 1.1, "{decimal val)");
			floatVal_C = Instance.Config.Bind<float>("Float", "Input a Float", 0.5f, "Tbh idk the difference between floats and doubles");
		}
	}
}