Decompiled source of I WONt SUGARCOAT IT v2.0.0

IWontSugarCoatIt.dll

Decompiled 3 months ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
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("IWontSugarCoatIt")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("IWontSugarCoatIt")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d6025689-10a2-4e6f-b98a-6e2aa6442186")]
[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 IWontSugarCoatIt;

public class HarmonyPatches
{
	private static Harmony instance;

	public const string InstanceId = "com.Graze.UltraKill.IWSCI";

	public static bool IsPatched { get; private set; }

	internal static void ApplyHarmonyPatches()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Expected O, but got Unknown
		if (!IsPatched)
		{
			if (instance == null)
			{
				instance = new Harmony("com.Graze.UltraKill.IWSCI");
			}
			instance.PatchAll(Assembly.GetExecutingAssembly());
			IsPatched = true;
		}
	}

	internal static void RemoveHarmonyPatches()
	{
		if (instance != null && IsPatched)
		{
			instance.UnpatchSelf();
			IsPatched = false;
		}
	}
}
[BepInPlugin("com.Graze.UltraKill.IWSCI", "I WONT SUGAR COAT IT", "2.0.0")]
public class Plugin : BaseUnityPlugin
{
	private void Awake()
	{
		HarmonyPatches.ApplyHarmonyPatches();
	}
}
[HarmonyPatch(typeof(HUDOptions))]
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
internal class HudPatch
{
	private static void Postfix(HUDOptions __instance)
	{
		if ((Object)(object)((Component)__instance).GetComponent<DAAYYM>() == (Object)null)
		{
			((Component)__instance).gameObject.AddComponent<DAAYYM>();
		}
	}
}
public static class cAssets
{
	private static Stream str = Assembly.GetExecutingAssembly().GetManifestResourceStream("IWontSugarCoatIt.Assets.f");

	private static AssetBundle bundle = AssetBundle.LoadFromStream(str);

	private static GameObject loader = bundle.LoadAsset<GameObject>("f");

	public static GameObject Image = ((Component)loader.transform.GetChild(0).GetChild(0)).gameObject;

	public static GameObject Aud = ((Component)loader.transform.GetChild(1)).gameObject;
}
public class DAAYYM : MonoBehaviour
{
	private GameObject Parryflash;

	private GameObject Image;

	private GameObject Aud;

	private void Awake()
	{
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)Parryflash == (Object)null)
		{
			Parryflash = ((Component)((Component)this).transform.Find("ParryFlash")).gameObject;
			Image = Object.Instantiate<GameObject>(cAssets.Image);
			Image.transform.SetParent(((Component)this).gameObject.transform);
			Image.transform.localPosition = Vector3.zero;
			Image.transform.localScale = new Vector3(4f, 4f, 4f);
			Aud = Object.Instantiate<GameObject>(cAssets.Aud);
			Aud.SetActive(true);
			Image.transform.SetParent(Parryflash.transform);
			Aud.transform.SetParent(((Component)this).gameObject.transform);
		}
	}

	private void Update()
	{
		if (Parryflash.activeSelf)
		{
			Aud.GetComponent<AudioSource>().Play();
		}
	}
}
internal class PluginInfo
{
	public const string GUID = "com.Graze.UltraKill.IWSCI";

	public const string Name = "I WONT SUGAR COAT IT";

	public const string Version = "2.0.0";
}