Decompiled source of UltrakillStyleEditor v1.0.4

plugins/UltrakillStyleEditor/UltrakillStyleEditor.dll

Decompiled 4 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using PluginConfig.API.Functionals;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("UltrakillStyleEditor")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Edit style hud texts with ease")]
[assembly: AssemblyFileVersion("1.0.4.0")]
[assembly: AssemblyInformationalVersion("1.0.4+7e4ce6d612ef899669a856b0bafe7b5790210b15")]
[assembly: AssemblyProduct("UltrakillStyleEditor")]
[assembly: AssemblyTitle("UltrakillStyleEditor")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.4.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace UltrakillStyleEditor
{
	public static class ConfigManager
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static OnClick <>9__13_0;

			internal void <Init>b__13_0()
			{
				//IL_0074: Unknown result type (might be due to invalid IL or missing references)
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_0197: Unknown result type (might be due to invalid IL or missing references)
				//IL_019e: Expected O, but got Unknown
				if ((Object)(object)MonoSingleton<StyleHUD>.instance == (Object)null)
				{
					return;
				}
				List<KeyValuePair<string, string>> list = new List<KeyValuePair<string, string>>();
				foreach (KeyValuePair<string, string> item in MonoSingleton<StyleHUD>.instance.idNameDict)
				{
					if (!styleDic.ContainsKey(item.Key) && !item.Key.StartsWith("customcorpse."))
					{
						list.Add(item);
					}
				}
				Scene activeScene = SceneManager.GetActiveScene();
				GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects();
				for (int i = 0; i < rootGameObjects.Length; i++)
				{
					DeathZone[] componentsInChildren = rootGameObjects[i].GetComponentsInChildren<DeathZone>(true);
					foreach (DeathZone val in componentsInChildren)
					{
						<>c__DisplayClass13_0 CS$<>8__locals0 = new <>c__DisplayClass13_0
						{
							id = val.deathType
						};
						if (!string.IsNullOrEmpty(CS$<>8__locals0.id) && !styleDic.ContainsKey(CS$<>8__locals0.id) && !CS$<>8__locals0.id.StartsWith("customcorpse.") && !list.Where((KeyValuePair<string, string> p) => p.Key == CS$<>8__locals0.id).Any())
						{
							string value = CS$<>8__locals0.id;
							if (MonoSingleton<StyleHUD>.Instance.idNameDict.TryGetValue(CS$<>8__locals0.id, out var value2))
							{
								value = value2;
							}
							list.Add(new KeyValuePair<string, string>(CS$<>8__locals0.id, value));
						}
					}
				}
				foreach (KeyValuePair<string, string> item2 in list)
				{
					FormattedStringField val2 = new FormattedStringField(unknownStylePanel, item2.Key, item2.Key, Utils.FormattedStringFromFormattedText(item2.Value));
					styleDic.Add(item2.Key, val2);
					AddValueChangeListener(item2.Key, val2);
				}
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass13_0
		{
			public string id;

			internal bool <Init>b__1(KeyValuePair<string, string> p)
			{
				return p.Key == id;
			}
		}

		public static PluginConfigurator config;

		public static Dictionary<string, FormattedStringField> styleDic = new Dictionary<string, FormattedStringField>();

		public static ConfigPanel killStylePanel;

		public static ConfigPanel hurtStylePanel;

		public static ConfigPanel miscStylePanel;

		public static ConfigPanel unknownStylePanel;

		public static StringField killPanelSearchbar;

		public static ButtonArrayField killPanelSearchButton;

		public static ButtonField unknownPanelSearchButton;

		private static bool inited = false;

		public static FormattedStringField GetOrCreateField(string id)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			if (styleDic.TryGetValue(id, out var value))
			{
				return value;
			}
			if (string.IsNullOrEmpty(id))
			{
				return null;
			}
			string text = id;
			if ((Object)(object)MonoSingleton<StyleHUD>.Instance != (Object)null && MonoSingleton<StyleHUD>.Instance.idNameDict.TryGetValue(id, out var value2))
			{
				text = value2;
			}
			FormattedStringField val = new FormattedStringField(unknownStylePanel, id, id, Utils.FormattedStringFromFormattedText(text), true);
			styleDic.Add(id, val);
			AddValueChangeListener(id, val);
			return val;
		}

		public static void AddValueChangeListener(string id, FormattedStringField field)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			field.onValueChange += (StringValueChangeEventDelegate)delegate(FormattedStringValueChangeEvent e)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				FormattedStringBuilder val = new FormattedStringBuilder();
				List<CharacterInfo> format = e.formattedString.GetFormat();
				string rawString = e.formattedString.rawString;
				for (int i = 0; i < format.Count; i++)
				{
					if (rawString[i] != '+')
					{
						val.currentFormat = format[i];
						val.Append(rawString[i]);
					}
				}
				e.formattedString = val.Build();
				if (!((Object)(object)MonoSingleton<StyleHUD>.instance == (Object)null))
				{
					MonoSingleton<StyleHUD>.instance.idNameDict[id] = e.formattedString.formattedString;
				}
			};
			field.TriggerValueChangeEvent();
		}

		private static void MakeSearchBar(StringField searchBar, ButtonArrayField searchButton, ConfigPanel targetPanel)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			searchButton.OnClickEventHandler(0).onClick += (OnClick)delegate
			{
				string value = searchBar.value.ToLower();
				bool flag = string.IsNullOrWhiteSpace(value);
				foreach (KeyValuePair<string, FormattedStringField> item in styleDic)
				{
					if (((ConfigField)item.Value).parentPanel == targetPanel)
					{
						if (flag)
						{
							((ConfigField)item.Value).hidden = false;
						}
						else
						{
							((ConfigField)item.Value).hidden = !item.Key.ToLower().Contains(value);
						}
					}
				}
			};
			searchButton.OnClickEventHandler(1).onClick += (OnClick)delegate
			{
				searchBar.value = "";
				foreach (KeyValuePair<string, FormattedStringField> item2 in styleDic)
				{
					if (((ConfigField)item2.Value).parentPanel == targetPanel)
					{
						((ConfigField)item2.Value).hidden = false;
					}
				}
			};
		}

		public static void Init()
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Expected O, but got Unknown
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Expected O, but got Unknown
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Expected O, but got Unknown
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Expected O, but got Unknown
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Expected O, but got Unknown
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Expected O, but got Unknown
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Expected O, but got Unknown
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Expected O, but got Unknown
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Expected O, but got Unknown
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Expected O, but got Unknown
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0285: Expected O, but got Unknown
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Expected O, but got Unknown
			//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Expected O, but got Unknown
			//IL_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Expected O, but got Unknown
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_033d: Expected O, but got Unknown
			//IL_0361: Unknown result type (might be due to invalid IL or missing references)
			//IL_036b: Expected O, but got Unknown
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0399: Expected O, but got Unknown
			//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c7: Expected O, but got Unknown
			//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f5: Expected O, but got Unknown
			//IL_0419: Unknown result type (might be due to invalid IL or missing references)
			//IL_0423: Expected O, but got Unknown
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_0451: Expected O, but got Unknown
			//IL_0475: Unknown result type (might be due to invalid IL or missing references)
			//IL_047f: Expected O, but got Unknown
			//IL_04a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ad: Expected O, but got Unknown
			//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04db: Expected O, but got Unknown
			//IL_04ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0509: Expected O, but got Unknown
			//IL_052d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0537: Expected O, but got Unknown
			//IL_055b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0565: Expected O, but got Unknown
			//IL_0589: Unknown result type (might be due to invalid IL or missing references)
			//IL_0593: Expected O, but got Unknown
			//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c1: Expected O, but got Unknown
			//IL_05e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ef: Expected O, but got Unknown
			//IL_0613: Unknown result type (might be due to invalid IL or missing references)
			//IL_061d: Expected O, but got Unknown
			//IL_0641: Unknown result type (might be due to invalid IL or missing references)
			//IL_064b: Expected O, but got Unknown
			//IL_066f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0679: Expected O, but got Unknown
			//IL_069d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a7: Expected O, but got Unknown
			//IL_06cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d5: Expected O, but got Unknown
			//IL_06f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0703: Expected O, but got Unknown
			//IL_0727: Unknown result type (might be due to invalid IL or missing references)
			//IL_0731: Expected O, but got Unknown
			//IL_0755: Unknown result type (might be due to invalid IL or missing references)
			//IL_075f: Expected O, but got Unknown
			//IL_0783: Unknown result type (might be due to invalid IL or missing references)
			//IL_078d: Expected O, but got Unknown
			//IL_07b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bb: Expected O, but got Unknown
			//IL_07df: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e9: Expected O, but got Unknown
			//IL_080d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0817: Expected O, but got Unknown
			//IL_083b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0845: Expected O, but got Unknown
			//IL_0869: Unknown result type (might be due to invalid IL or missing references)
			//IL_0873: Expected O, but got Unknown
			//IL_0897: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a1: Expected O, but got Unknown
			//IL_08c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cf: Expected O, but got Unknown
			//IL_08f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fd: Expected O, but got Unknown
			//IL_0921: Unknown result type (might be due to invalid IL or missing references)
			//IL_092b: Expected O, but got Unknown
			//IL_094f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0959: Expected O, but got Unknown
			//IL_097d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0987: Expected O, but got Unknown
			//IL_09ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b5: Expected O, but got Unknown
			//IL_09d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e3: Expected O, but got Unknown
			//IL_0a07: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a11: Expected O, but got Unknown
			//IL_0a35: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3f: Expected O, but got Unknown
			//IL_0a63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6d: Expected O, but got Unknown
			//IL_0a91: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a9b: Expected O, but got Unknown
			//IL_0abf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac9: Expected O, but got Unknown
			//IL_0aed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af7: Expected O, but got Unknown
			//IL_0b1b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b25: Expected O, but got Unknown
			//IL_0b49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b53: Expected O, but got Unknown
			//IL_0b77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b81: Expected O, but got Unknown
			//IL_0ba5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0baf: Expected O, but got Unknown
			//IL_0bd3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bdd: Expected O, but got Unknown
			//IL_0c01: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c0b: Expected O, but got Unknown
			//IL_0c2f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c39: Expected O, but got Unknown
			//IL_0c5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c67: Expected O, but got Unknown
			//IL_0c8b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c95: Expected O, but got Unknown
			//IL_0cb9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc3: Expected O, but got Unknown
			//IL_0ce7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf1: Expected O, but got Unknown
			//IL_0d15: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d1f: Expected O, but got Unknown
			//IL_0d43: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d4d: Expected O, but got Unknown
			//IL_0d71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d7b: Expected O, but got Unknown
			//IL_0d9f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0da9: Expected O, but got Unknown
			//IL_0dcd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dd7: Expected O, but got Unknown
			//IL_0dfb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e05: Expected O, but got Unknown
			//IL_0e29: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e33: Expected O, but got Unknown
			//IL_0e57: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e61: Expected O, but got Unknown
			//IL_0e85: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e8f: Expected O, but got Unknown
			//IL_0eb3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ebd: Expected O, but got Unknown
			//IL_0ee1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eeb: Expected O, but got Unknown
			//IL_0f0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f19: Expected O, but got Unknown
			//IL_0f3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f47: Expected O, but got Unknown
			//IL_0f6b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f75: Expected O, but got Unknown
			//IL_0f99: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fa3: Expected O, but got Unknown
			//IL_0fc7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fd1: Expected O, but got Unknown
			//IL_0ff5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fff: Expected O, but got Unknown
			//IL_1023: Unknown result type (might be due to invalid IL or missing references)
			//IL_102d: Expected O, but got Unknown
			//IL_1051: Unknown result type (might be due to invalid IL or missing references)
			//IL_105b: Expected O, but got Unknown
			//IL_107f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1089: Expected O, but got Unknown
			//IL_10ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_10b7: Expected O, but got Unknown
			//IL_10db: Unknown result type (might be due to invalid IL or missing references)
			//IL_10e5: Expected O, but got Unknown
			//IL_1109: Unknown result type (might be due to invalid IL or missing references)
			//IL_1113: Expected O, but got Unknown
			//IL_1137: Unknown result type (might be due to invalid IL or missing references)
			//IL_1141: Expected O, but got Unknown
			//IL_1165: Unknown result type (might be due to invalid IL or missing references)
			//IL_116f: Expected O, but got Unknown
			//IL_1193: Unknown result type (might be due to invalid IL or missing references)
			//IL_119d: Expected O, but got Unknown
			//IL_11c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_11cb: Expected O, but got Unknown
			//IL_11ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_11f9: Expected O, but got Unknown
			//IL_121d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1227: Expected O, but got Unknown
			//IL_1236: Unknown result type (might be due to invalid IL or missing references)
			//IL_1240: Expected O, but got Unknown
			//IL_1259: Unknown result type (might be due to invalid IL or missing references)
			//IL_125e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1264: Expected O, but got Unknown
			if (inited)
			{
				return;
			}
			inited = true;
			config = PluginConfigurator.Create("Style Editor", "eternalUnion.ultrakill.styleEditor");
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icon.png");
			config.SetIconWithURL("file://" + text);
			new ConfigHeader(config.rootPanel, "Ultrakill Styles", 24);
			killStylePanel = new ConfigPanel(config.rootPanel, "Kill Related Styles", "killStylePanel");
			hurtStylePanel = new ConfigPanel(config.rootPanel, "Hurt Related Styles", "hurtStylePanel");
			miscStylePanel = new ConfigPanel(config.rootPanel, "Misc Styles", "miscStylePanel");
			new ConfigHeader(config.rootPanel, "Additional Styles", 24);
			unknownStylePanel = new ConfigPanel(config.rootPanel, "Unknown Styles", "unknownStylePanel");
			killPanelSearchbar = new StringField(killStylePanel, "Search Bar", "killPanelSearchbar", "", true, false);
			killPanelSearchButton = new ButtonArrayField(killStylePanel, "killPanelSearchButton", 2, new float[2] { 0.5f, 0.5f }, new string[2] { "Search", "Clear Filter" }, 5f);
			MakeSearchBar(killPanelSearchbar, killPanelSearchButton, killStylePanel);
			styleDic.Add("ultrakill.kill", new FormattedStringField(killStylePanel, "Kill", "ultrakill.kill", Utils.FormattedStringFromFormattedText("KILL"), true));
			styleDic.Add("ultrakill.doublekill", new FormattedStringField(killStylePanel, "Double kill", "ultrakill.doublekill", Utils.FormattedStringFromFormattedText("<color=orange>DOUBLE KILL</color>"), true));
			styleDic.Add("ultrakill.triplekill", new FormattedStringField(killStylePanel, "Triple kill", "ultrakill.triplekill", Utils.FormattedStringFromFormattedText("<color=orange>TRIPLE KILL</color>"), true));
			styleDic.Add("ultrakill.multikill", new FormattedStringField(killStylePanel, "Multikill", "ultrakill.multikill", Utils.FormattedStringFromFormattedText("<color=orange>MULTIKILL</color>"), true));
			styleDic.Add("ultrakill.instakill", new FormattedStringField(killStylePanel, "Instakill", "ultrakill.instakill", Utils.FormattedStringFromFormattedText("<color=lime>INSTAKILL</color>"), true));
			styleDic.Add("ultrakill.interruption", new FormattedStringField(killStylePanel, "Interruption", "ultrakill.interruption", Utils.FormattedStringFromFormattedText("<color=lime>INTERRUPTION</color>"), true));
			styleDic.Add("ultrakill.bigkill", new FormattedStringField(killStylePanel, "Big kill", "ultrakill.bigkill", Utils.FormattedStringFromFormattedText("BIG KILL"), true));
			styleDic.Add("ultrakill.bigfistkill", new FormattedStringField(killStylePanel, "Big fist kill", "ultrakill.bigfistkill", Utils.FormattedStringFromFormattedText("BIG FISTKILL"), true));
			styleDic.Add("ultrakill.criticalpunch", new FormattedStringField(killStylePanel, "Critical punch", "ultrakill.criticalpunch", Utils.FormattedStringFromFormattedText("CRITICAL PUNCH"), true));
			styleDic.Add("ultrakill.arsenal", new FormattedStringField(killStylePanel, "Arsenal", "ultrakill.arsenal", Utils.FormattedStringFromFormattedText("<color=cyan>ARSENAL</color>"), true));
			styleDic.Add("ultrakill.splattered", new FormattedStringField(killStylePanel, "Splattered", "ultrakill.splattered", Utils.FormattedStringFromFormattedText("SPLATTERED"), true));
			styleDic.Add("ultrakill.groundslam", new FormattedStringField(killStylePanel, "Ground slam", "ultrakill.groundslam", Utils.FormattedStringFromFormattedText("GROUND SLAM"), true));
			styleDic.Add("ultrakill.airslam", new FormattedStringField(killStylePanel, "Air slam", "ultrakill.airslam", Utils.FormattedStringFromFormattedText("<color=cyan>AIR SLAM</color>"), true));
			styleDic.Add("ultrakill.airshot", new FormattedStringField(killStylePanel, "Airshot", "ultrakill.airshot", Utils.FormattedStringFromFormattedText("<color=cyan>AIRSHOT</color>"), true));
			styleDic.Add("ultrakill.fireworks", new FormattedStringField(killStylePanel, "Fireworks", "ultrakill.fireworks", Utils.FormattedStringFromFormattedText("<color=cyan>FIREWORKS</color>"), true));
			styleDic.Add("ultrakill.friendlyfire", new FormattedStringField(killStylePanel, "Friendly fire", "ultrakill.friendlyfire", Utils.FormattedStringFromFormattedText("FRIENDLY FIRE"), true));
			styleDic.Add("ultrakill.exploded", new FormattedStringField(killStylePanel, "Exploded", "ultrakill.exploded", Utils.FormattedStringFromFormattedText("EXPLODED"), true));
			styleDic.Add("ultrakill.fried", new FormattedStringField(killStylePanel, "Fried", "ultrakill.fried", Utils.FormattedStringFromFormattedText("FRIED"), true));
			styleDic.Add("ultrakill.finishedoff", new FormattedStringField(killStylePanel, "Finished off", "ultrakill.finishedoff", Utils.FormattedStringFromFormattedText("<color=cyan>FINISHED OFF</color>"), true));
			styleDic.Add("ultrakill.mauriced", new FormattedStringField(killStylePanel, "Mauriced", "ultrakill.mauriced", Utils.FormattedStringFromFormattedText("MAURICED"), true));
			styleDic.Add("ultrakill.overkill", new FormattedStringField(killStylePanel, "Overkill", "ultrakill.overkill", Utils.FormattedStringFromFormattedText("OVERKILL"), true));
			styleDic.Add("ultrakill.halfoff", new FormattedStringField(killStylePanel, "Half off", "ultrakill.halfoff", Utils.FormattedStringFromFormattedText("<color=cyan>HALF OFF</color>"), true));
			styleDic.Add("ultrakill.bipolar", new FormattedStringField(killStylePanel, "Bipolar", "ultrakill.bipolar", Utils.FormattedStringFromFormattedText("BIPOLAR"), true));
			styleDic.Add("ultrakill.attripator", new FormattedStringField(killStylePanel, "Attraptor", "ultrakill.attripator", Utils.FormattedStringFromFormattedText("<color=cyan>ATTRAPTOR</color>"), true));
			styleDic.Add("ultrakill.nailbombed", new FormattedStringField(killStylePanel, "Nailbombed (death)", "ultrakill.nailbombed", Utils.FormattedStringFromFormattedText("NAILBOMBED"), true));
			styleDic.Add("ultrakill.catapulted", new FormattedStringField(killStylePanel, "Catapulted", "ultrakill.catapulted", Utils.FormattedStringFromFormattedText("<color=cyan>CATAPULTED</color>"), true));
			styleDic.Add("ultrakill.cannonballed", new FormattedStringField(killStylePanel, "Cannonballed", "ultrakill.cannonballed", Utils.FormattedStringFromFormattedText("CANNONBALLED"), true));
			styleDic.Add("ultrakill.compressed", new FormattedStringField(killStylePanel, "Compressed (blackhole kill)", "ultrakill.compressed", Utils.FormattedStringFromFormattedText("COMPRESSED"), true));
			styleDic.Add("SHREDDED", new FormattedStringField(killStylePanel, "Shredded", "SHREDDED", Utils.FormattedStringFromFormattedText("SHREDDED"), true));
			styleDic.Add("MINCED", new FormattedStringField(killStylePanel, "Minced", "MINCED", Utils.FormattedStringFromFormattedText("MINCED"), true));
			styleDic.Add("CRUSHED", new FormattedStringField(killStylePanel, "Crushed", "CRUSHED", Utils.FormattedStringFromFormattedText("CRUSHED"), true));
			styleDic.Add("FALL", new FormattedStringField(killStylePanel, "Fall", "FALL", Utils.FormattedStringFromFormattedText("FALL"), true));
			styleDic.Add("ZAPPED", new FormattedStringField(killStylePanel, "Zapped", "ZAPPED", Utils.FormattedStringFromFormattedText("ZAPPED"), true));
			styleDic.Add("OUT OF BOUNDS", new FormattedStringField(killStylePanel, "Out of bounds", "OUT OF BOUNDS", Utils.FormattedStringFromFormattedText("OUT OF BOUNDS"), true));
			styleDic.Add("why are you even spawning enemies here", new FormattedStringField(killStylePanel, "why are you even spawning enemies here", "why are you even spawning enemies here", Utils.FormattedStringFromFormattedText("why are you even spawning enemies here"), true));
			styleDic.Add("SCRINDONGULODED", new FormattedStringField(killStylePanel, "Scrindonguloded", "SCRINDONGULODED", Utils.FormattedStringFromFormattedText("SCRINDONGULODED"), true));
			styleDic.Add("SCRONGBONGLED", new FormattedStringField(killStylePanel, "Scrongbongled", "SCRONGBONGLED", Utils.FormattedStringFromFormattedText("SCRONGBONGLED"), true));
			styleDic.Add("SCRONGLED", new FormattedStringField(killStylePanel, "Scrongled", "SCRONGLED", Utils.FormattedStringFromFormattedText("SCRONGLED"), true));
			styleDic.Add("ENVIROKILL", new FormattedStringField(killStylePanel, "Envirokill", "ENVIROKILL", Utils.FormattedStringFromFormattedText("ENVIROKILL"), true));
			styleDic.Add("TRAMPLED", new FormattedStringField(killStylePanel, "Trampled", "TRAMPLED", Utils.FormattedStringFromFormattedText("TRAMPLED"), true));
			styleDic.Add("ROADKILL", new FormattedStringField(killStylePanel, "Roadkill", "ROADKILL", Utils.FormattedStringFromFormattedText("ROADKILL"), true));
			styleDic.Add("FOR THEE", new FormattedStringField(killStylePanel, "For Thee", "FOR THEE", Utils.FormattedStringFromFormattedText("FOR THEE"), true));
			styleDic.Add("BOILED", new FormattedStringField(killStylePanel, "Boiled", "BOILED", Utils.FormattedStringFromFormattedText("BOILED"), true));
			styleDic.Add("PANCAKED", new FormattedStringField(killStylePanel, "Pancaked", "PANCAKED", Utils.FormattedStringFromFormattedText("PANCAKED"), true));
			styleDic.Add("ultrakill.roundtrip", new FormattedStringField(killStylePanel, "Round Trip", "ultrakill.roundtrip", Utils.FormattedStringFromFormattedText("<color=lime>ROUND TRIP</color>"), true));
			styleDic.Add("SLIPPED", new FormattedStringField(killStylePanel, "Slipped", "SLIPPED", Utils.FormattedStringFromFormattedText("SLIPPED"), true));
			styleDic.Add("LOST", new FormattedStringField(killStylePanel, "Lost", "LOST", Utils.FormattedStringFromFormattedText("LOST"), true));
			styleDic.Add("LONG WAY DOWN", new FormattedStringField(killStylePanel, "Long Way Down", "LONG WAY DOWN", Utils.FormattedStringFromFormattedText("LONG WAY DOWN"), true));
			styleDic.Add("M.A.D.", new FormattedStringField(killStylePanel, "M.A.D.", "M.A.D.", Utils.FormattedStringFromFormattedText("M.A.D."), true));
			styleDic.Add("ultrakill.headshot", new FormattedStringField(hurtStylePanel, "Headshot", "ultrakill.headshot", Utils.FormattedStringFromFormattedText("HEADSHOT"), true));
			styleDic.Add("ultrakill.bigheadshot", new FormattedStringField(hurtStylePanel, "Big headshot", "ultrakill.bigheadshot", Utils.FormattedStringFromFormattedText("BIG HEADSHOT"), true));
			styleDic.Add("ultrakill.headshotcombo", new FormattedStringField(hurtStylePanel, "Headshot combo", "ultrakill.headshotcombo", Utils.FormattedStringFromFormattedText("<color=cyan>HEADSHOT COMBO</color>"), true));
			styleDic.Add("ultrakill.ricoshot", new FormattedStringField(hurtStylePanel, "Ricoshot", "ultrakill.ricoshot", Utils.FormattedStringFromFormattedText("<color=cyan>RICOSHOT</color>"), true));
			styleDic.Add("ultrakill.conductor", new FormattedStringField(hurtStylePanel, "Conductor", "ultrakill.conductor", Utils.FormattedStringFromFormattedText("<color=cyan>CONDUCTOR</color>"), true));
			styleDic.Add("ultrakill.limbhit", new FormattedStringField(hurtStylePanel, "Limb hit", "ultrakill.limbhit", Utils.FormattedStringFromFormattedText("LIMB HIT"), true));
			styleDic.Add("ultrakill.fistfullofdollar", new FormattedStringField(hurtStylePanel, "Fistfull of dollar", "ultrakill.fistfullofdollar", Utils.FormattedStringFromFormattedText("<color=cyan>FISTFUL OF DOLLAR</color>"), true));
			styleDic.Add("ultrakill.nailbombedalive", new FormattedStringField(hurtStylePanel, "Nailbombed (hurt)", "ultrakill.nailbombedalive", Utils.FormattedStringFromFormattedText("<color=grey>NAILBOMBED</color>"), true));
			styleDic.Add("ultrakill.homerun", new FormattedStringField(hurtStylePanel, "Homerun", "ultrakill.homerun", Utils.FormattedStringFromFormattedText("HOMERUN"), true));
			styleDic.Add("ultrakill.projectileboost", new FormattedStringField(hurtStylePanel, "Projectile boost", "ultrakill.projectileboost", Utils.FormattedStringFromFormattedText("<color=lime>PROJECTILE BOOST</color>"), true));
			styleDic.Add("ultrakill.disrespect", new FormattedStringField(hurtStylePanel, "Disrespect", "ultrakill.disrespect", Utils.FormattedStringFromFormattedText("DISRESPECT"), true));
			styleDic.Add("ultrakill.shotgunhit", new FormattedStringField(hurtStylePanel, "Shotgun hit", "ultrakill.shotgunhit", Utils.FormattedStringFromFormattedText(""), true));
			styleDic.Add("ultrakill.nailhit", new FormattedStringField(hurtStylePanel, "Nail hit", "ultrakill.nailhit", Utils.FormattedStringFromFormattedText(""), true));
			styleDic.Add("ultrakill.explosionhit", new FormattedStringField(hurtStylePanel, "Explosion hit", "ultrakill.explosionhit", Utils.FormattedStringFromFormattedText(""), true));
			styleDic.Add("ultrakill.firehit", new FormattedStringField(hurtStylePanel, "Fire hit", "ultrakill.firehit", Utils.FormattedStringFromFormattedText(""), true));
			styleDic.Add("<color=green>GUARD BREAK</color>", new FormattedStringField(hurtStylePanel, "Guard Break", "<color=green>GUARD BREAK</color>", Utils.FormattedStringFromFormattedText("<color=green>GUARD BREAK</color>"), true));
			styleDic.Add("ultrakill.serve", new FormattedStringField(hurtStylePanel, "Served", "ultrakill.serve", Utils.FormattedStringFromFormattedText("<color=cyan>SERVED</color>"), true));
			styleDic.Add("ultrakill.strike", new FormattedStringField(hurtStylePanel, "Strike!", "ultrakill.strike", Utils.FormattedStringFromFormattedText("<color=cyan>STRIKE!</color>"), true));
			styleDic.Add("ultrakill.landyours", new FormattedStringField(hurtStylePanel, "Landyours", "ultrakill.landyours", Utils.FormattedStringFromFormattedText("<color=green>LANDYOURS</color>"), true));
			styleDic.Add("ultrakill.rocketreturn", new FormattedStringField(hurtStylePanel, "Rocket Return", "ultrakill.rocketreturn", Utils.FormattedStringFromFormattedText("<color=cyan>ROCKET RETURN</color>"), true));
			styleDic.Add("ultrakill.secret", new FormattedStringField(miscStylePanel, "Secret", "ultrakill.secret", Utils.FormattedStringFromFormattedText("<color=cyan>SECRET</color>"), true));
			styleDic.Add("ultrakill.quickdraw", new FormattedStringField(miscStylePanel, "Quickdraw", "ultrakill.quickdraw", Utils.FormattedStringFromFormattedText("<color=cyan>QUICKDRAW</color>"), true));
			styleDic.Add("ultrakill.parry", new FormattedStringField(miscStylePanel, "Parry", "ultrakill.parry", Utils.FormattedStringFromFormattedText("<color=lime>PARRY</color>"), true));
			styleDic.Add("ultrakill.enraged", new FormattedStringField(miscStylePanel, "Enraged", "ultrakill.enraged", Utils.FormattedStringFromFormattedText("<color=red>ENRAGED</color>"), true));
			styleDic.Add("ultrakill.downtosize", new FormattedStringField(miscStylePanel, "Down to size", "ultrakill.downtosize", Utils.FormattedStringFromFormattedText("<color=cyan>DOWN TO SIZE</color>"), true));
			styleDic.Add("ultrakill.chargeback", new FormattedStringField(miscStylePanel, "Chargeback", "ultrakill.chargeback", Utils.FormattedStringFromFormattedText("CHARGEBACK"), true));
			styleDic.Add("ultrakill.ultra", new FormattedStringField(miscStylePanel, "Ultra prefix", "ultrakill.ultra", Utils.FormattedStringFromFormattedText("<color=orange>ULTRA</color>"), true));
			styleDic.Add("ultrakill.counter", new FormattedStringField(miscStylePanel, "Counter prefix", "ultrakill.counter", Utils.FormattedStringFromFormattedText("<color=red>COUNTER</color>"), true));
			styleDic.Add("<color=white>PAWN CAPTURE</color>", new FormattedStringField(miscStylePanel, "Pawn Capture", "<color=white>PAWN CAPTURE</color>", Utils.FormattedStringFromFormattedText("<color=white>PAWN CAPTURE</color>"), true));
			styleDic.Add("<color=green>KNIGHT CAPTURE</color>", new FormattedStringField(miscStylePanel, "Knight Capture", "<color=green>KNIGHT CAPTURE</color>", Utils.FormattedStringFromFormattedText("<color=green>KNIGHT CAPTURE</color>"), true));
			styleDic.Add("<color=green>BISHOP CAPTURE</color>", new FormattedStringField(miscStylePanel, "Bishop Capture", "<color=green>BISHOP CAPTURE</color>", Utils.FormattedStringFromFormattedText("<color=green>BISHOP CAPTURE</color>"), true));
			styleDic.Add("<color=orange>ROOK CAPTURE</color>", new FormattedStringField(miscStylePanel, "Rook Capture", "<color=green>ROOK CAPTURE</color>", Utils.FormattedStringFromFormattedText("<color=green>ROOK CAPTURE</color>"), true));
			styleDic.Add("<color=red>QUEEN CAPTURE</color>", new FormattedStringField(miscStylePanel, "Queen Capture", "<color=green>QUEEN CAPTURE</color>", Utils.FormattedStringFromFormattedText("<color=green>QUEEN CAPTURE</color>"), true));
			styleDic.Add("<color=green>KNIGHT PROMOTION</color>", new FormattedStringField(miscStylePanel, "Knight Promotion", "<color=green>KNIGHT PROMOTION</color>", Utils.FormattedStringFromFormattedText("<color=green>KNIGHT PROMOTION</color>"), true));
			styleDic.Add("<color=green>BISHOP PROMOTION</color>", new FormattedStringField(miscStylePanel, "Bishop Promotion", "<color=green>BISHOP PROMOTION</color>", Utils.FormattedStringFromFormattedText("<color=green>BISHOP PROMOTION</color>"), true));
			styleDic.Add("<color=green>ROOK PROMOTION</color>", new FormattedStringField(miscStylePanel, "Rook Promotion", "<color=green>ROOK PROMOTION</color>", Utils.FormattedStringFromFormattedText("<color=green>ROOK PROMOTION</color>"), true));
			styleDic.Add("<color=green>QUEEN PROMOTION</color>", new FormattedStringField(miscStylePanel, "Queen Promotion", "<color=green>QUEEN PROMOTION</color>", Utils.FormattedStringFromFormattedText("<color=green>QUEEN PROMOTION</color>"), true));
			styleDic.Add("<color=#00ffffff>EN PASSANT</color>", new FormattedStringField(miscStylePanel, "En Passant", "<color=#00ffffff>EN PASSANT</color>", Utils.FormattedStringFromFormattedText("<color=#00ffffff>EN PASSANT</color>"), true));
			styleDic.Add("<color=#00ffffff>CASTLED</color>", new FormattedStringField(miscStylePanel, "Castled", "<color=#00ffffff>CASTLED</color>", Utils.FormattedStringFromFormattedText("<color=#00ffffff>CASTLED</color>"), true));
			styleDic.Add("<color=green>BONGCLOUD</color>", new FormattedStringField(miscStylePanel, "Bongcloud", "<color=green>BONGCLOUD</color>", Utils.FormattedStringFromFormattedText("<color=green>BONGCLOUD</color>"), true));
			styleDic.Add("<color=red>FOOLS MATE</color>", new FormattedStringField(miscStylePanel, "Fools Mate", "<color=red>FOOLS MATE</color>", Utils.FormattedStringFromFormattedText("<color=red>FOOLS MATE</color>"), true));
			styleDic.Add("<color=orange>WHITE WINS</color>", new FormattedStringField(miscStylePanel, "White Wins", "<color=orange>WHITE WINS</color>", Utils.FormattedStringFromFormattedText("<color=orange>WHITE WINS</color>"), true));
			styleDic.Add("<color=orange>BLACK WINS</color>", new FormattedStringField(miscStylePanel, "Black Wins", "<color=orange>BLACK WINS</color>", Utils.FormattedStringFromFormattedText("<color=orange>BLACK WINS</color>"), true));
			styleDic.Add("<color=red>ULTRAVICTORY</color>", new FormattedStringField(miscStylePanel, "Ultravictory", "<color=red>ULTRAVICTORY</color>", Utils.FormattedStringFromFormattedText("<color=red>ULTRAVICTORY</color>"), true));
			unknownPanelSearchButton = new ButtonField(unknownStylePanel, "Search For Unknown Styles", "unknownPanelSearchButton");
			ButtonField obj = unknownPanelSearchButton;
			object obj2 = <>c.<>9__13_0;
			if (obj2 == null)
			{
				OnClick val = delegate
				{
					//IL_0074: Unknown result type (might be due to invalid IL or missing references)
					//IL_0079: Unknown result type (might be due to invalid IL or missing references)
					//IL_0197: Unknown result type (might be due to invalid IL or missing references)
					//IL_019e: Expected O, but got Unknown
					if ((Object)(object)MonoSingleton<StyleHUD>.instance == (Object)null)
					{
						return;
					}
					List<KeyValuePair<string, string>> list = new List<KeyValuePair<string, string>>();
					foreach (KeyValuePair<string, string> item in MonoSingleton<StyleHUD>.instance.idNameDict)
					{
						if (!styleDic.ContainsKey(item.Key) && !item.Key.StartsWith("customcorpse."))
						{
							list.Add(item);
						}
					}
					Scene activeScene = SceneManager.GetActiveScene();
					GameObject[] rootGameObjects = ((Scene)(ref activeScene)).GetRootGameObjects();
					for (int i = 0; i < rootGameObjects.Length; i++)
					{
						DeathZone[] componentsInChildren = rootGameObjects[i].GetComponentsInChildren<DeathZone>(true);
						foreach (DeathZone val2 in componentsInChildren)
						{
							string id = val2.deathType;
							if (!string.IsNullOrEmpty(id) && !styleDic.ContainsKey(id) && !id.StartsWith("customcorpse.") && !list.Where((KeyValuePair<string, string> p) => p.Key == id).Any())
							{
								string value = id;
								if (MonoSingleton<StyleHUD>.Instance.idNameDict.TryGetValue(id, out var value2))
								{
									value = value2;
								}
								list.Add(new KeyValuePair<string, string>(id, value));
							}
						}
					}
					foreach (KeyValuePair<string, string> item2 in list)
					{
						FormattedStringField val3 = new FormattedStringField(unknownStylePanel, item2.Key, item2.Key, Utils.FormattedStringFromFormattedText(item2.Value));
						styleDic.Add(item2.Key, val3);
						AddValueChangeListener(item2.Key, val3);
					}
				};
				<>c.<>9__13_0 = val;
				obj2 = (object)val;
			}
			obj.onClick += (OnClick)obj2;
			foreach (KeyValuePair<string, FormattedStringField> item3 in styleDic)
			{
				AddValueChangeListener(item3.Key, item3.Value);
			}
		}
	}
	[BepInPlugin("eternalUnion.ultrakill.styleEditor", "StyleEditor", "1.0.4")]
	[BepInDependency("com.eternalUnion.pluginConfigurator", "1.7.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string PLUGIN_NAME = "StyleEditor";

		public const string PLUGIN_GUID = "eternalUnion.ultrakill.styleEditor";

		public const string PLUGIN_VERSION = "1.0.4";

		public static Harmony harmony;

		private void Awake()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			ConfigManager.Init();
			harmony = new Harmony("eternalUnion.ultrakill.styleEditor");
			harmony.PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin eternalUnion.ultrakill.styleEditor is loaded!");
		}
	}
	public static class Utils
	{
		private enum TagType
		{
			Color,
			Bold,
			Italic,
			Size
		}

		private static Dictionary<string, Color> validColorWords = new Dictionary<string, Color>
		{
			{
				"aqua",
				Color.cyan
			},
			{
				"black",
				Color.black
			},
			{
				"blue",
				Color.blue
			},
			{
				"brown",
				new Color(0.64705884f, 14f / 85f, 14f / 85f)
			},
			{
				"cyan",
				Color.cyan
			},
			{
				"darkblue",
				new Color(0f, 0f, 32f / 51f)
			},
			{
				"fuchsia",
				Color.magenta
			},
			{
				"green",
				new Color(0f, 0.5019608f, 0f)
			},
			{
				"grey",
				Color.grey
			},
			{
				"lightblue",
				new Color(0.6784314f, 72f / 85f, 46f / 51f)
			},
			{
				"lime",
				Color.green
			},
			{
				"magenta",
				Color.magenta
			},
			{
				"maroon",
				new Color(0.5019608f, 0f, 0f)
			},
			{
				"navy",
				new Color(0f, 0f, 0.5019608f)
			},
			{
				"olive",
				new Color(0.5019608f, 0.5019608f, 0f)
			},
			{
				"orange",
				new Color(1f, 0.64705884f, 0f)
			},
			{
				"purple",
				new Color(0.5019608f, 0f, 0.5019608f)
			},
			{
				"red",
				Color.red
			},
			{
				"silver",
				new Color(64f / 85f, 64f / 85f, 64f / 85f)
			},
			{
				"teal",
				new Color(0f, 0.5019608f, 0.5019608f)
			},
			{
				"white",
				Color.white
			},
			{
				"yellow",
				new Color(1f, 1f, 0f)
			}
		};

		public static FormattedString FormattedStringFromFormattedText(string text)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			FormattedStringBuilder val = new FormattedStringBuilder();
			Stack<TagType> stack = new Stack<TagType>();
			for (int i = 0; i < text.Length; i++)
			{
				char c = text[i];
				if (c == '<')
				{
					int num = text.IndexOf('>', i + 1);
					if (num == -1)
					{
						val += c;
						continue;
					}
					string text2 = text.Substring(i + 1, num - i - 1).ToLower();
					switch (text2)
					{
					case "b":
						stack.Push(TagType.Bold);
						val.currentFormat.bold = true;
						i = num;
						continue;
					case "/b":
						if (stack.Count != 0 && stack.Peek() == TagType.Bold)
						{
							stack.Pop();
							val.currentFormat.bold = false;
							i = num;
							continue;
						}
						break;
					case "i":
						stack.Push(TagType.Italic);
						val.currentFormat.italic = true;
						i = num;
						continue;
					case "/i":
						if (stack.Count != 0 && stack.Peek() == TagType.Italic)
						{
							stack.Pop();
							val.currentFormat.italic = false;
							i = num;
							continue;
						}
						break;
					default:
						if (!text2.StartsWith("size="))
						{
							switch (text2)
							{
							case "/size":
								if (stack.Count != 0 && stack.Peek() == TagType.Size)
								{
									stack.Pop();
									i = num;
									continue;
								}
								break;
							case "/color":
								if (stack.Count != 0 && stack.Peek() == TagType.Color)
								{
									stack.Pop();
									i = num;
									continue;
								}
								break;
							case "color":
								val.currentFormat.color = Color.white;
								stack.Push(TagType.Color);
								i = num;
								continue;
							default:
								if (text2.StartsWith("color="))
								{
									string text3 = text2.Substring(6);
									Color value = default(Color);
									if (!validColorWords.TryGetValue(text3, out value) && !ColorUtility.TryParseHtmlString(text3, ref value))
									{
										value = Color.white;
									}
									val.currentFormat.color = value;
									stack.Push(TagType.Color);
									i = num;
									continue;
								}
								break;
							}
							break;
						}
						goto case "size";
					case "size":
						stack.Push(TagType.Size);
						i = num;
						continue;
					}
				}
				val += c;
			}
			return val.Build();
		}
	}
	public static class ReflectionUtils
	{
		public static MethodInfo InstanceMethod(Type type, string name)
		{
			return type.GetMethod(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}

		public static MethodInfo InstanceMethod<T>(string name)
		{
			return InstanceMethod(typeof(T), name);
		}

		public static MethodInfo StaticMethod(Type type, string name)
		{
			return type.GetMethod(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
		}

		public static PropertyInfo InstanceProperty(Type type, string name)
		{
			return type.GetProperty(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}

		public static PropertyInfo InstanceProperty<T>(string name)
		{
			return InstanceProperty(typeof(T), name);
		}

		public static PropertyInfo StaticProperty(Type type, string name)
		{
			return type.GetProperty(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
		}

		public static FieldInfo InstanceField(Type type, string name)
		{
			return type.GetField(name, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
		}

		public static FieldInfo InstanceField<T>(string name)
		{
			return InstanceField(typeof(T), name);
		}

		public static FieldInfo StaticField(Type type, string name)
		{
			return type.GetField(name, BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "UltrakillStyleEditor";

		public const string PLUGIN_NAME = "UltrakillStyleEditor";

		public const string PLUGIN_VERSION = "1.0.4";
	}
}
namespace UltrakillStyleEditor.Patches
{
	[HarmonyPatch(typeof(Coin), "RicoshotPointsCheck")]
	public static class Coin_RicoshotPointsCheck
	{
		private static MethodInfo m_GetUltraPrefix = typeof(Coin_RicoshotPointsCheck).GetMethod("GetUltraPrefix", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);

		private static MethodInfo m_GetCounterPrefix = typeof(Coin_RicoshotPointsCheck).GetMethod("GetCounterPrefix", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);

		[MethodImpl(MethodImplOptions.NoInlining)]
		public static string GetUltraPrefix()
		{
			return ConfigManager.styleDic["ultrakill.ultra"].formattedString;
		}

		[MethodImpl(MethodImplOptions.NoInlining)]
		public static string GetCounterPrefix()
		{
			return ConfigManager.styleDic["ultrakill.counter"].formattedString;
		}

		[HarmonyTranspiler]
		public static IEnumerable Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = instructions.ToList();
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldstr)
				{
					if (CodeInstructionExtensions.OperandIs(list[i], (object)"<color=orange>ULTRA</color>"))
					{
						list[i].opcode = OpCodes.Call;
						list[i].operand = m_GetUltraPrefix;
					}
					else if (CodeInstructionExtensions.OperandIs(list[i], (object)"<color=red>COUNTER</color>"))
					{
						list[i].opcode = OpCodes.Call;
						list[i].operand = m_GetCounterPrefix;
					}
				}
			}
			return list.AsEnumerable();
		}
	}
	[HarmonyPatch(typeof(DeathZone), "GotHit")]
	public static class DeathZone_GotHit
	{
		private static string MakeGrey(string id)
		{
			string text = "customcorpse." + id;
			FormattedStringField orCreateField = ConfigManager.GetOrCreateField(id);
			if ((Object)(object)MonoSingleton<StyleHUD>.Instance != (Object)null && orCreateField != null)
			{
				MonoSingleton<StyleHUD>.Instance.idNameDict[text] = "<color=grey>" + orCreateField.rawString + "</color>";
			}
			return text;
		}

		[HarmonyTranspiler]
		public static IEnumerable Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Expected O, but got Unknown
			MethodInfo methodInfo = ReflectionUtils.StaticMethod(typeof(DeathZone_GotHit), "MakeGrey");
			List<CodeInstruction> list = instructions.ToList();
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldstr)
				{
					if (CodeInstructionExtensions.OperandIs(list[i], (object)"<color=grey>"))
					{
						list[i].operand = "";
					}
					else if (CodeInstructionExtensions.OperandIs(list[i], (object)"</color>"))
					{
						list[i].operand = "";
						i += 2;
						list.Insert(i, new CodeInstruction(OpCodes.Call, (object)methodInfo));
					}
				}
			}
			return list.AsEnumerable();
		}
	}
	[HarmonyPatch(typeof(EnemyIdentifier), "AfterShock")]
	public static class EnemyIdentifier_AfterShock
	{
		private static FormattedStringField conductorField;

		[HarmonyTranspiler]
		public static IEnumerable Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Expected O, but got Unknown
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Expected O, but got Unknown
			conductorField = ConfigManager.styleDic["ultrakill.conductor"];
			List<CodeInstruction> list = instructions.ToList();
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldstr && CodeInstructionExtensions.OperandIs(list[i], (object)"<color=#00ffffff>CONDUCTOR</color>"))
				{
					PropertyInfo propertyInfo = ReflectionUtils.InstanceProperty<FormattedStringField>("value");
					PropertyInfo propertyInfo2 = ReflectionUtils.InstanceProperty<FormattedString>("formattedString");
					list[i].opcode = OpCodes.Ldsfld;
					list[i].operand = ReflectionUtils.StaticField(typeof(EnemyIdentifier_AfterShock), "conductorField");
					i++;
					list.Insert(i, new CodeInstruction(OpCodes.Call, (object)propertyInfo.GetMethod));
					i++;
					list.Insert(i, new CodeInstruction(OpCodes.Call, (object)propertyInfo2.GetMethod));
				}
			}
			return list.AsEnumerable();
		}
	}
	[HarmonyPatch(typeof(StyleCalculator), "HitCalculator")]
	public static class StyleCalculator_HitCalculator
	{
		[HarmonyTranspiler]
		public static IEnumerable Transpiler(IEnumerable<CodeInstruction> instructions)
		{
			List<CodeInstruction> list = instructions.ToList();
			for (int i = 0; i < list.Count; i++)
			{
				if (list[i].opcode == OpCodes.Ldstr && CodeInstructionExtensions.OperandIs(list[i], (object)"FRIED"))
				{
					list[i].operand = "ultrakill.fried";
					break;
				}
			}
			return list.AsEnumerable();
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public static class StyleHUD_CtorPatch
	{
		[HarmonyPostfix]
		[HarmonyAfter(new string[] { })]
		public static void Postfix(StyleHUD __instance)
		{
			foreach (KeyValuePair<string, FormattedStringField> item in ConfigManager.styleDic)
			{
				__instance.idNameDict[item.Key] = item.Value.formattedString;
			}
		}
	}
	[HarmonyPatch(typeof(StyleHUD), "RegisterStyleItem")]
	public static class StyleHUD_RegisterStyleItem
	{
		[HarmonyPrefix]
		public static bool Prefix(StyleHUD __instance, string __0)
		{
			if (__instance.idNameDict.ContainsKey(__0))
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(StyleHUD), "GetLocalizedName")]
	public static class StyleHUD_GetLocalizedName
	{
		[HarmonyPrefix]
		public static bool Prefix(StyleHUD __instance, string __0, ref string __result)
		{
			if (string.IsNullOrEmpty(__0) || __0.StartsWith("customcorpse."))
			{
				return true;
			}
			FormattedStringField orCreateField = ConfigManager.GetOrCreateField(__0);
			if (orCreateField == null)
			{
				return true;
			}
			__result = orCreateField.formattedString;
			return false;
		}
	}
}