Decompiled source of OppiesBoomBox v1.0.5

plugins/OppiesBoombox.dll

Decompiled a year 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("OppiesBoombox")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OppiesBoombox")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4ba12110-4ee0-455a-9658-e42cfc21fa19")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace OppiesBoombox;

[BepInPlugin("Thisisnotkj.OppiesBoombox", "Oppie's Boombox", "1.0.5")]
[BepInProcess("Lethal Company.exe")]
[BepInDependency("ImoutoSama.PersonalBoombox", "1.2.0")]
public class OppiesBoomBoxBase : BaseUnityPlugin
{
	private const string modGUID = "Thisisnotkj.OppiesBoombox";

	private const string modName = "Oppie's Boombox";

	private const string modVersion = "1.0.5";

	private readonly Harmony harmony = new Harmony("Thisisnotkj.OppiesBoombox");

	private static OppiesBoomBoxBase Instance;

	internal ManualLogSource logger;

	public ConfigEntry<bool> overridePriceFlagConfig;

	public ConfigEntry<int> overridePriceValueConfig;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		logger = Logger.CreateLogSource("Thisisnotkj.OppiesBoombox");
		logger.LogInfo((object)"Oppie's Boombox has bombed The Company!");
		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", 100, "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;
	}
}