Decompiled source of Title Text Variety v1.0.0

plugins/TitleTextVariety.dll

Decompiled 11 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("TitleTextVariety")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TitleTextVariety")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9390c654-6ad8-4b9c-afc6-3f174ccc4a3b")]
[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 TitleTextVariety;

[BepInPlugin("unfinished.ultrakill.titletextvariety", "Size 2 I Want To Believe!", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	[HarmonyPatch]
	private class MainMenuAgony_Patch
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(MainMenuAgony), "Start")]
		private static void Start_Patch()
		{
			GameObject val = GameObject.Find("Main Menu (1)");
			GameObject gameObject = ((Component)val.transform.Find("Title")).gameObject;
			List<GameObject> list = new List<GameObject>();
			List<Text> list2 = new List<Text>();
			string randomText = plugin.GetRandomText();
			for (int i = 0; gameObject.transform.childCount > i; i++)
			{
				list.Add(((Component)gameObject.transform.GetChild(i)).gameObject);
				list2.Add(list[i].GetComponent<Text>());
				list2[i].text = randomText;
			}
		}
	}

	internal static Plugin plugin;

	private const string pluginGuid = "unfinished.ultrakill.titletextvariety";

	private const string pluginName = "Size 2 I Want To Believe!";

	private const string pluginVersion = "1.0.0";

	private void Awake()
	{
		plugin = this;
	}

	private void Start()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("unfinished.ultrakill.titletextvariety").PatchAll();
	}

	private string GetRandomText()
	{
		Random random = new Random();
		return random.Next(0, 15) switch
		{
			0 => "-- SIZE 2 I WANT TO BELIEVE --", 
			1 => "-- SIZE 2 I HAVE TO KNOW --", 
			2 => "-- MADE BY A FUMO PLUSH --", 
			3 => "-- PREPARE THYSELF --", 
			4 => "-- SPEEDRUN 2-1 --", 
			5 => "-- SECRETS OF 5-S --", 
			6 => "-- TRY TO P RANK ANOTHER GOD DAMN TIME --", 
			7 => "-- THY END IS NOW --", 
			8 => "-- THE SEX UPDATE --", 
			9 => "-- NOW AVAILABLE ON YOUR SMART FRIDGE --", 
			10 => "-- SIZE 2 IS REAL --", 
			11 => "-- BENJAMIN EDITION --", 
			12 => "-- MAURICE EDITION --", 
			13 => "-- MY BELOVED --", 
			14 => "-- SIZE 2 I HAVE TO SEE --", 
			_ => "-- HOW --", 
		};
	}
}