Decompiled source of SkillNotifier v1.3.0

SkillNotifier.dll

Decompiled 3 days ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SkillNotifier")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("SkillNotifier")]
[assembly: AssemblyTitle("SkillNotifier")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 SkillNotifier
{
	[BepInPlugin("Harchytek.SkillNotifier", "SkillNotifier", "1.3.0")]
	public class SkillNotifierPlugin : BaseUnityPlugin
	{
		public enum LevelPos
		{
			BeforeSkill,
			AfterSkill,
			BeforeTotal
		}

		public enum TotalPos
		{
			Start,
			End
		}

		public enum GainXpPos
		{
			BeforeExtended,
			AfterExtended
		}

		[HarmonyPatch(typeof(Skills), "RaiseSkill")]
		public static class Patch_RaiseSkill
		{
			public struct SkillState
			{
				public Skill Skill;

				public float LevelBefore;

				public float CalculatedXpBefore;

				public float NeededXpBefore;
			}

			private static readonly FieldRef<Skills, Dictionary<SkillType, Skill>> SkillDataRef = AccessTools.FieldRefAccess<Skills, Dictionary<SkillType, Skill>>("m_skillData");

			private static readonly StringBuilder _mainBuilder = new StringBuilder(512);

			private static readonly StringBuilder _levelBuilder = new StringBuilder(128);

			private static readonly StringBuilder _characterXpBuilder = new StringBuilder(128);

			private static readonly StringBuilder _gainXpBuilder = new StringBuilder(128);

			private static readonly StringBuilder _extendedXpBuilder = new StringBuilder(128);

			private static readonly StringBuilder _tempContentBuilder = new StringBuilder(128);

			private static readonly Dictionary<SkillType, string> _skillNameCache = new Dictionary<SkillType, string>();

			private static void AppendBuilder(StringBuilder target, StringBuilder source)
			{
				for (int i = 0; i < source.Length; i++)
				{
					target.Append(source[i]);
				}
			}

			private static void BuildWithBrackets(StringBuilder target, string bracketInput, StringBuilder content, string hexColor)
			{
				target.Append("<color=").Append(hexColor).Append('>');
				if (!string.IsNullOrEmpty(bracketInput))
				{
					target.Append(bracketInput[0]);
					AppendBuilder(target, content);
					if (bracketInput.Length >= 2)
					{
						target.Append(bracketInput[1]);
					}
				}
				else
				{
					AppendBuilder(target, content);
				}
				target.Append("</color>");
			}

			[HarmonyPrefix]
			private static void Prefix(Skills __instance, SkillType skillType, out SkillState __state)
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Invalid comparison between Unknown and I4
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				__state = default(SkillState);
				if ((!SkipRunningSkillNotifications.Value || (int)skillType != 102) && ShowXPNotifications.Value)
				{
					Dictionary<SkillType, Skill> dictionary = SkillDataRef.Invoke(__instance);
					if (dictionary != null && dictionary.TryGetValue(skillType, out var value))
					{
						float level = value.m_level;
						float num = (float)Math.Round((Mathf.Pow(level + 1f, 1.5f) * 0.5f + 0.5f) * 100f) / 100f;
						float num2 = value.GetLevelPercentage() * 100f;
						float calculatedXpBefore = (float)Math.Round(num2 / 100f * num * 100f) / 100f;
						__state = new SkillState
						{
							Skill = value,
							LevelBefore = level,
							NeededXpBefore = num,
							CalculatedXpBefore = calculatedXpBefore
						};
					}
				}
			}

			[HarmonyPostfix]
			private static void Postfix(Skills __instance, SkillType skillType, float factor, SkillState __state)
			{
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_015e: Unknown result type (might be due to invalid IL or missing references)
				if (__state.Skill == null)
				{
					return;
				}
				Skill skill = __state.Skill;
				bool flag = skill.m_level > __state.LevelBefore;
				float num = (float)Math.Round((Mathf.Pow(skill.m_level + 1f, 1.5f) * 0.5f + 0.5f) * 100f) / 100f;
				float num2 = skill.GetLevelPercentage() * 100f;
				float num3 = (float)Math.Round(num2 / 100f * num * 100f) / 100f;
				float num4 = (flag ? (__state.NeededXpBefore - __state.CalculatedXpBefore + num3) : (num3 - __state.CalculatedXpBefore));
				num4 = (float)Math.Round(num4 * 100f) / 100f;
				if (!_skillNameCache.TryGetValue(skillType, out var value))
				{
					string text = ((object)Unsafe.As<SkillType, SkillType>(ref skill.m_info.m_skill)/*cast due to .constrained prefix*/).ToString();
					string text2 = "$skill_" + text.ToLower();
					value = Localization.instance.Localize(text2);
					if (value.StartsWith("$skill_"))
					{
						string text3 = Localization.instance.Localize(text);
						value = ((string.IsNullOrEmpty(text3) || !(text3 != text) || text3.StartsWith("$")) ? Regex.Replace(text, "([a-z])([A-Z])", "$1 $2") : text3);
					}
					_skillNameCache[skillType] = value;
				}
				_mainBuilder.Clear();
				_mainBuilder.Append("<size=").Append(NotificationTextSizeXP.Value).Append('>');
				if (ShowSkillLevel.Value)
				{
					_levelBuilder.Clear();
					_tempContentBuilder.Clear();
					string value2 = TextSkillLevel.Value;
					if (AutoSpaceSkillLevel.Value && !string.IsNullOrEmpty(value2))
					{
						_tempContentBuilder.Append(value2).Append(' ');
					}
					else if (!string.IsNullOrEmpty(value2))
					{
						_tempContentBuilder.Append(value2);
					}
					_tempContentBuilder.Append((int)skill.m_level);
					BuildWithBrackets(_levelBuilder, SymbolsLevel.Value, _tempContentBuilder, _hexSkillLevel);
				}
				if (ShowCharacterXP.Value)
				{
					if (_cachedTotalLevel < 0f || flag)
					{
						_cachedTotalLevel = 0f;
						Dictionary<SkillType, Skill> dictionary = SkillDataRef.Invoke(__instance);
						if (dictionary != null)
						{
							foreach (KeyValuePair<SkillType, Skill> item in dictionary)
							{
								if (item.Value != null)
								{
									_cachedTotalLevel += item.Value.m_level;
								}
							}
						}
					}
					_characterXpBuilder.Clear();
					_tempContentBuilder.Clear();
					string value3 = TextTotalLevel.Value;
					if (AutoSpaceTotalLevel.Value && !string.IsNullOrEmpty(value3))
					{
						_tempContentBuilder.Append(value3).Append(' ');
					}
					else if (!string.IsNullOrEmpty(value3))
					{
						_tempContentBuilder.Append(value3);
					}
					_tempContentBuilder.Append((int)_cachedTotalLevel);
					BuildWithBrackets(_characterXpBuilder, SymbolsTotal.Value, _tempContentBuilder, _hexTotalLevel);
				}
				if (ShowCharacterXP.Value && CharacterXPPosition.Value == TotalPos.Start)
				{
					AppendBuilder(_mainBuilder, _characterXpBuilder.Append(' '));
				}
				if (!string.IsNullOrEmpty(SkillSymbol.Value))
				{
					_mainBuilder.Append(SkillSymbol.Value).Append(' ');
				}
				if (ShowSkillLevel.Value && SkillLevelPosition.Value == LevelPos.BeforeSkill)
				{
					AppendBuilder(_mainBuilder, _levelBuilder.Append(' '));
				}
				_mainBuilder.Append("<color=").Append(_hexSkillName).Append('>')
					.Append(value)
					.Append("</color>");
				if (ShowSkillLevel.Value && SkillLevelPosition.Value == LevelPos.AfterSkill)
				{
					AppendBuilder(_mainBuilder, _levelBuilder.Insert(0, ' '));
				}
				if (ShowGainPourcent.Value || ShowGainXP.Value || ShowExtendedXP.Value)
				{
					_mainBuilder.Append(" :");
					if (ShowGainPourcent.Value)
					{
						_mainBuilder.Append(' ');
						_tempContentBuilder.Clear();
						_tempContentBuilder.Append(num2.ToString("0.0#")).Append(" %");
						BuildWithBrackets(_mainBuilder, SymbolsPercent.Value, _tempContentBuilder, _hexPercentage);
					}
					if (ShowGainXP.Value)
					{
						_gainXpBuilder.Clear();
						_tempContentBuilder.Clear();
						_tempContentBuilder.Append('+').Append(num4.ToString("0.##"));
						BuildWithBrackets(_gainXpBuilder, SymbolsGain.Value, _tempContentBuilder, _hexXPGain);
					}
					if (ShowExtendedXP.Value)
					{
						_extendedXpBuilder.Clear();
						_tempContentBuilder.Clear();
						_tempContentBuilder.Append(num3.ToString("0.##")).Append('/').Append(num.ToString("0.##"));
						BuildWithBrackets(_extendedXpBuilder, SymbolsExtended.Value, _tempContentBuilder, _hexExtendedXP);
					}
					if (GainXPPosition.Value == GainXpPos.BeforeExtended)
					{
						if (ShowGainXP.Value)
						{
							AppendBuilder(_mainBuilder, _gainXpBuilder.Insert(0, ' '));
						}
						if (ShowExtendedXP.Value)
						{
							AppendBuilder(_mainBuilder, _extendedXpBuilder.Insert(0, ' '));
						}
					}
					else
					{
						if (ShowExtendedXP.Value)
						{
							AppendBuilder(_mainBuilder, _extendedXpBuilder.Insert(0, ' '));
						}
						if (ShowGainXP.Value)
						{
							AppendBuilder(_mainBuilder, _gainXpBuilder.Insert(0, ' '));
						}
					}
				}
				else if (!string.IsNullOrEmpty(TextFallbackMessage.Value))
				{
					_mainBuilder.Append(' ').Append(TextFallbackMessage.Value);
				}
				if (ShowSkillLevel.Value && SkillLevelPosition.Value == LevelPos.BeforeTotal)
				{
					AppendBuilder(_mainBuilder, _levelBuilder.Insert(0, ' '));
				}
				if (ShowCharacterXP.Value && CharacterXPPosition.Value == TotalPos.End)
				{
					AppendBuilder(_mainBuilder, _characterXpBuilder.Insert(0, ' '));
				}
				_mainBuilder.Append("</size>");
				if ((Object)(object)MessageHud.instance != (Object)null)
				{
					MessageHud.instance.ShowMessage((MessageType)1, _mainBuilder.ToString(), 0, (Sprite)null, false);
				}
			}
		}

		public const string ModGUID = "Harchytek.SkillNotifier";

		public const string ModName = "SkillNotifier";

		public const string ModVersion = "1.3.0";

		public static ConfigEntry<bool> ShowXPNotifications;

		public static ConfigEntry<int> NotificationTextSizeXP;

		public static ConfigEntry<bool> SkipRunningSkillNotifications;

		public static ConfigEntry<bool> ShowSkillLevel;

		public static ConfigEntry<bool> ShowGainPourcent;

		public static ConfigEntry<bool> ShowGainXP;

		public static ConfigEntry<bool> ShowExtendedXP;

		public static ConfigEntry<bool> ShowCharacterXP;

		public static ConfigEntry<string> TextSkillLevel;

		public static ConfigEntry<bool> AutoSpaceSkillLevel;

		public static ConfigEntry<string> TextTotalLevel;

		public static ConfigEntry<bool> AutoSpaceTotalLevel;

		public static ConfigEntry<string> TextFallbackMessage;

		public static ConfigEntry<LevelPos> SkillLevelPosition;

		public static ConfigEntry<TotalPos> CharacterXPPosition;

		public static ConfigEntry<GainXpPos> GainXPPosition;

		public static ConfigEntry<string> SkillSymbol;

		public static ConfigEntry<string> SymbolsLevel;

		public static ConfigEntry<string> SymbolsPercent;

		public static ConfigEntry<string> SymbolsGain;

		public static ConfigEntry<string> SymbolsExtended;

		public static ConfigEntry<string> SymbolsTotal;

		public static ConfigEntry<Color> ColorSkillName;

		public static ConfigEntry<Color> ColorSkillLevel;

		public static ConfigEntry<Color> ColorPercentage;

		public static ConfigEntry<Color> ColorXPGain;

		public static ConfigEntry<Color> ColorExtendedXP;

		public static ConfigEntry<Color> ColorTotalLevel;

		public static string _hexSkillName;

		public static string _hexSkillLevel;

		public static string _hexPercentage;

		public static string _hexXPGain;

		public static string _hexExtendedXP;

		public static string _hexTotalLevel;

		public static float _cachedTotalLevel = -1f;

		private void Awake()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Expected O, but got Unknown
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Expected O, but got Unknown
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Expected O, but got Unknown
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Expected O, but got Unknown
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Expected O, but got Unknown
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Expected O, but got Unknown
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0240: Expected O, but got Unknown
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_0280: Expected O, but got Unknown
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Expected O, but got Unknown
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Expected O, but got Unknown
			//IL_033e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: Expected O, but got Unknown
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0388: Expected O, but got Unknown
			//IL_03be: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c8: Expected O, but got Unknown
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0408: Expected O, but got Unknown
			//IL_0442: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Expected O, but got Unknown
			//IL_0486: Unknown result type (might be due to invalid IL or missing references)
			//IL_0490: Expected O, but got Unknown
			//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d4: Expected O, but got Unknown
			//IL_050e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0518: Expected O, but got Unknown
			//IL_0552: Unknown result type (might be due to invalid IL or missing references)
			//IL_055c: Expected O, but got Unknown
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a0: Expected O, but got Unknown
			//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05da: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e4: Expected O, but got Unknown
			//IL_0608: Unknown result type (might be due to invalid IL or missing references)
			//IL_062d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0637: Expected O, but got Unknown
			//IL_065b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0680: Unknown result type (might be due to invalid IL or missing references)
			//IL_068a: Expected O, but got Unknown
			//IL_069f: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ce: Expected O, but got Unknown
			//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0717: Unknown result type (might be due to invalid IL or missing references)
			//IL_0721: Expected O, but got Unknown
			//IL_0745: Unknown result type (might be due to invalid IL or missing references)
			//IL_076a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0774: Expected O, but got Unknown
			//IL_0808: Unknown result type (might be due to invalid IL or missing references)
			ShowXPNotifications = ((BaseUnityPlugin)this).Config.Bind<bool>("1 - General", "ShowXPNotifications", true, new ConfigDescription("Enable or disable XP notifications.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			SkipRunningSkillNotifications = ((BaseUnityPlugin)this).Config.Bind<bool>("1 - General", "SkipRunningSkillNotifications", true, new ConfigDescription("Ignore notifications for the running skill.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			NotificationTextSizeXP = ((BaseUnityPlugin)this).Config.Bind<int>("1 - General", "NotificationTextSizeXP", 18, new ConfigDescription("Text size of the notifications.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			ShowSkillLevel = ((BaseUnityPlugin)this).Config.Bind<bool>("2 - Visibility", "ShowSkillLevel", true, new ConfigDescription("Show the current skill level.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			ShowGainPourcent = ((BaseUnityPlugin)this).Config.Bind<bool>("2 - Visibility", "ShowGainPourcent", true, new ConfigDescription("Show the progress percentage.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			ShowGainXP = ((BaseUnityPlugin)this).Config.Bind<bool>("2 - Visibility", "ShowGainXP", true, new ConfigDescription("Show the actual XP gained.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			ShowExtendedXP = ((BaseUnityPlugin)this).Config.Bind<bool>("2 - Visibility", "ShowExtendedXP", true, new ConfigDescription("Show the extended XP ratio [Current/Needed].", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			ShowCharacterXP = ((BaseUnityPlugin)this).Config.Bind<bool>("2 - Visibility", "ShowCharacterXP", true, new ConfigDescription("Show the total character level.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			TextSkillLevel = ((BaseUnityPlugin)this).Config.Bind<string>("3 - Text", "TextSkillLevel", "Level", new ConfigDescription("Text displayed before the skill level.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			AutoSpaceSkillLevel = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Text", "AutoSpaceSkillLevel", true, new ConfigDescription("Automatically add a space after the skill level text.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			TextTotalLevel = ((BaseUnityPlugin)this).Config.Bind<string>("3 - Text", "TextTotalLevel", "Total:", new ConfigDescription("Text displayed before the total level.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			AutoSpaceTotalLevel = ((BaseUnityPlugin)this).Config.Bind<bool>("3 - Text", "AutoSpaceTotalLevel", true, new ConfigDescription("Automatically add a space after the total level text.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			TextFallbackMessage = ((BaseUnityPlugin)this).Config.Bind<string>("3 - Text", "TextFallbackMessage", "you win something, but what?", new ConfigDescription("Message displayed if all XP stats are hidden. Leave empty to disable.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			SkillLevelPosition = ((BaseUnityPlugin)this).Config.Bind<LevelPos>("4 - Position", "SkillLevelPosition", LevelPos.AfterSkill, new ConfigDescription("Position of the level: Before Skill Name, After Skill Name, or Before Total Level.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			GainXPPosition = ((BaseUnityPlugin)this).Config.Bind<GainXpPos>("4 - Position", "GainXPPosition", GainXpPos.BeforeExtended, new ConfigDescription("Position of the gained XP: Before or After the Extended XP.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			CharacterXPPosition = ((BaseUnityPlugin)this).Config.Bind<TotalPos>("4 - Position", "CharacterXPPosition", TotalPos.End, new ConfigDescription("Position of the total level: At the start or at the end of the message.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			SkillSymbol = ((BaseUnityPlugin)this).Config.Bind<string>("5 - Symbols", "SkillSymbol", "", new ConfigDescription("Symbol prefix before the skill name (e.g., ●, ◆, ->).", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 6
				}
			}));
			SymbolsLevel = ((BaseUnityPlugin)this).Config.Bind<string>("5 - Symbols", "SymbolsLevel", "[]", new ConfigDescription("Symbols wrapping the skill level (e.g., [], (), {}).", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			SymbolsPercent = ((BaseUnityPlugin)this).Config.Bind<string>("5 - Symbols", "SymbolsPercent", "", new ConfigDescription("Symbols wrapping the percentage (e.g., [], (), {}).", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			SymbolsGain = ((BaseUnityPlugin)this).Config.Bind<string>("5 - Symbols", "SymbolsGain", "()", new ConfigDescription("Symbols wrapping the XP gain (e.g., [], (), {}).", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			SymbolsExtended = ((BaseUnityPlugin)this).Config.Bind<string>("5 - Symbols", "SymbolsExtended", "()", new ConfigDescription("Symbols wrapping the Extended XP (e.g., [], (), {}).", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			SymbolsTotal = ((BaseUnityPlugin)this).Config.Bind<string>("5 - Symbols", "SymbolsTotal", "[]", new ConfigDescription("Symbols wrapping the Total character level (e.g., [], (), {}).", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			ColorSkillName = ((BaseUnityPlugin)this).Config.Bind<Color>("6 - Colors", "ColorSkillName", Color.white, new ConfigDescription("Color of the skill name.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 6
				}
			}));
			ColorSkillLevel = ((BaseUnityPlugin)this).Config.Bind<Color>("6 - Colors", "ColorSkillLevel", new Color(1f, 0.843f, 0f), new ConfigDescription("Color of the skill level.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 5
				}
			}));
			ColorPercentage = ((BaseUnityPlugin)this).Config.Bind<Color>("6 - Colors", "ColorPercentage", new Color(0.678f, 0.847f, 0.902f), new ConfigDescription("Color of the progress percentage.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 4
				}
			}));
			ColorXPGain = ((BaseUnityPlugin)this).Config.Bind<Color>("6 - Colors", "ColorXPGain", Color.green, new ConfigDescription("Color of the XP gain.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 3
				}
			}));
			ColorExtendedXP = ((BaseUnityPlugin)this).Config.Bind<Color>("6 - Colors", "ColorExtendedXP", new Color(1f, 0.843f, 0f), new ConfigDescription("Color of the extended XP ratio [Current/Needed].", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 2
				}
			}));
			ColorTotalLevel = ((BaseUnityPlugin)this).Config.Bind<Color>("6 - Colors", "ColorTotalLevel", new Color(1f, 0.647f, 0f), new ConfigDescription("Color of the total character level.", (AcceptableValueBase)null, new object[1]
			{
				new ConfigurationManagerAttributes
				{
					Order = 1
				}
			}));
			UpdateHexColors();
			ColorSkillName.SettingChanged += delegate
			{
				UpdateHexColors();
			};
			ColorSkillLevel.SettingChanged += delegate
			{
				UpdateHexColors();
			};
			ColorPercentage.SettingChanged += delegate
			{
				UpdateHexColors();
			};
			ColorXPGain.SettingChanged += delegate
			{
				UpdateHexColors();
			};
			ColorExtendedXP.SettingChanged += delegate
			{
				UpdateHexColors();
			};
			ColorTotalLevel.SettingChanged += delegate
			{
				UpdateHexColors();
			};
			new Harmony("Harchytek.SkillNotifier").PatchAll();
		}

		private void UpdateHexColors()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: 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_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			_hexSkillName = "#" + ColorUtility.ToHtmlStringRGB(ColorSkillName.Value);
			_hexSkillLevel = "#" + ColorUtility.ToHtmlStringRGB(ColorSkillLevel.Value);
			_hexPercentage = "#" + ColorUtility.ToHtmlStringRGB(ColorPercentage.Value);
			_hexXPGain = "#" + ColorUtility.ToHtmlStringRGB(ColorXPGain.Value);
			_hexExtendedXP = "#" + ColorUtility.ToHtmlStringRGB(ColorExtendedXP.Value);
			_hexTotalLevel = "#" + ColorUtility.ToHtmlStringRGB(ColorTotalLevel.Value);
		}
	}
	public class ConfigurationManagerAttributes
	{
		public int? Order;
	}
}