Decompiled source of Street Of Patch Playlist v1.0.2

StreetOfPatchPlaylist.dll

Decompiled 22 minutes ago
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
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("StreetOfPatchPlaylist")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("StreetOfPatchPlaylist")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a8eaf8a2-28f4-4b45-aec7-369030d9970b")]
[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 StreetOfPatchPlaylist;

[BepInPlugin("Whopper.StreetOfPatch", "StreetOfPatchPlaylist", "1.0.1")]
public class StreetOfPatchBase : BaseUnityPlugin
{
	private const string modGUID = "Whopper.StreetOfPatch";

	private const string modName = "StreetOfPatchPlaylist";

	private const string modVersion = "1.0.1";

	private readonly Harmony harmony = new Harmony("Whopper.StreetOfPatch");

	internal ManualLogSource mls;

	private static StreetOfPatchBase Instance;

	private void Awake()
	{
		if ((Object)(object)Instance == (Object)null)
		{
			Instance = this;
		}
		mls = Logger.CreateLogSource("Whopper.StreetOfPatch");
		mls.LogInfo((object)"StreetOfPatch has awakened");
		Harmony.CreateAndPatchAll(typeof(StreetOfPatchBase), (string)null);
		CopyMusicFiles();
	}

	private void CopyMusicFiles()
	{
		string text = Path.Combine(Paths.BepInExRootPath, "Custom Songs", "Boombox Music");
		string text2 = Path.Combine(Paths.BepInExRootPath, "plugins", "GaryWhopteam-Street_Of_Patch_Playlist", "Custom Songs");
		IEnumerable<string> enumerable = from file in Directory.EnumerateFiles(text2)
			select (file);
		mls.LogInfo((object)(text ?? ""));
		mls.LogInfo((object)(text2 ?? ""));
		foreach (string item in enumerable)
		{
			if (File.Exists(item))
			{
				File.Copy(item, text + "\\" + Path.GetFileName(item));
			}
		}
	}
}