Decompiled source of MikuBox v1.3.0

MikuBox.dll

Decompiled 3 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 HarmonyLib;
using PersonalBoombox;
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("MikuBox")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MikuBox")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("daadaf8d-1057-411a-9f9f-6e1e240c1178")]
[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 MikuBox;

[BepInPlugin("Alukard.MikuBox", "MikuBox", "1.1.0")]
[BepInProcess("Lethal Company.exe")]
[BepInDependency("ImoutoSama.PersonalBoombox", "1.4.4")]
public class MikuBoxBase : BaseUnityPlugin
{
	private const string modGUID = "Alukard.MikuBox";

	private const string modName = "MikuBox";

	private const string modVersion = "1.1.0";

	private readonly Harmony harmony = new Harmony("Alukard.MikuBox");

	internal ManualLogSource logger;

	public ConfigEntry<bool> overridePriceFlagConfig;

	public ConfigEntry<int> overridePriceValueConfig;

	private void Awake()
	{
		logger = Logger.CreateLogSource("Alukard.MikuBox");
		logger.LogInfo((object)"Plugin MikuBox has been added!");
		overridePriceFlagConfig = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Override Price Flag", false, "If you want to override price of the boomboxes, you MUST set this to true.");
		overridePriceValueConfig = ConfigBindClamp("General", "Override Price Value", 30, "Overrides the price of the Boomboxes by this value. Clamped from 0 to 1000.", 0, 1000);
		RequestData val = PersonalBoomboxPlugin.AddFromAssemblyDll(Assembly.GetExecutingAssembly().Location);
		val.overridePriceFlag = overridePriceFlagConfig.Value;
		val.overridePriceValue = overridePriceValueConfig.Value;
	}

	public ConfigEntry<int> ConfigBindClamp(string section, string key, int defaultValue, string description, int min, int max)
	{
		ConfigEntry<int> val = ((BaseUnityPlugin)this).Config.Bind<int>(section, key, defaultValue, description);
		val.Value = Mathf.Clamp(val.Value, min, max);
		return val;
	}
}