Decompiled source of Colorful Piku v1.0.1

colourfulpiku.dll

Decompiled 9 hours ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Tabs Poof Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Tabs Poof Mod")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8aad4f38-2ad4-4206-bf0b-7d28fb6d5c2e")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace pikucolor;

public enum coloroption
{
	red,
	green,
	blue,
	magenta,
	yellow,
	cyan,
	white,
	black,
	grey,
	invisible,
	rainbow
}
[BepInPlugin("bayturtleking.pikuniku.pikucolor", "pikucolor", "1.0.0")]
public class pikucolorplugin : BaseUnityPlugin
{
	public static coloroption selected = coloroption.green;

	private static bool menuopen;

	private void Awake()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("bayturtleking.pikuniku.pikucolor").PatchAll();
	}

	private void Update()
	{
		if (Input.GetKeyDown((KeyCode)290))
		{
			menuopen = !menuopen;
		}
	}

	private void OnGUI()
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		if (menuopen)
		{
			GUILayout.BeginArea(new Rect(20f, 20f, 160f, 300f));
			GUILayout.Label("Piku's color", (GUILayoutOption[])(object)new GUILayoutOption[0]);
			if (GUILayout.Button("Red", (GUILayoutOption[])(object)new GUILayoutOption[0]))
			{
				selected = coloroption.red;
			}
			if (GUILayout.Button("Lime Green", (GUILayoutOption[])(object)new GUILayoutOption[0]))
			{
				selected = coloroption.green;
			}
			if (GUILayout.Button("Blue", (GUILayoutOption[])(object)new GUILayoutOption[0]))
			{
				selected = coloroption.blue;
			}
			if (GUILayout.Button("Magenta", (GUILayoutOption[])(object)new GUILayoutOption[0]))
			{
				selected = coloroption.magenta;
			}
			if (GUILayout.Button("Yellow", (GUILayoutOption[])(object)new GUILayoutOption[0]))
			{
				selected = coloroption.yellow;
			}
			if (GUILayout.Button("Cyan", (GUILayoutOption[])(object)new GUILayoutOption[0]))
			{
				selected = coloroption.cyan;
			}
			if (GUILayout.Button("White", (GUILayoutOption[])(object)new GUILayoutOption[0]))
			{
				selected = coloroption.white;
			}
			if (GUILayout.Button("Black", (GUILayoutOption[])(object)new GUILayoutOption[0]))
			{
				selected = coloroption.black;
			}
			if (GUILayout.Button("Gray (Grey)", (GUILayoutOption[])(object)new GUILayoutOption[0]))
			{
				selected = coloroption.grey;
			}
			if (GUILayout.Button("Invisible", (GUILayoutOption[])(object)new GUILayoutOption[0]))
			{
				selected = coloroption.invisible;
			}
			if (GUILayout.Button("Rainbow", (GUILayoutOption[])(object)new GUILayoutOption[0]))
			{
				selected = coloroption.rainbow;
			}
			GUILayout.EndArea();
		}
	}
}
[HarmonyPatch(typeof(Piku), "Update")]
public class pikucolorpatch
{
	private static void Postfix(Piku __instance)
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		Color bodyColor = getcolor(pikucolorplugin.selected);
		__instance.Set_BodyColor(bodyColor);
	}

	private static Color getcolor(coloroption option)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		return (Color)(option switch
		{
			coloroption.red => Color.red, 
			coloroption.green => Color.green, 
			coloroption.blue => Color.blue, 
			coloroption.magenta => Color.magenta, 
			coloroption.yellow => Color.yellow, 
			coloroption.cyan => Color.cyan, 
			coloroption.white => Color.white, 
			coloroption.black => Color.black, 
			coloroption.grey => Color.grey, 
			coloroption.invisible => Color.clear, 
			coloroption.rainbow => Color.HSVToRGB(Mathf.Repeat(Time.time * 0.5f, 1f), 1f, 1f), 
			_ => Color.white, 
		});
	}
}