Decompiled source of CustomLoading v1.0.0

plugins/Custom_Loading/Custom_Loading.dll

Decompiled 4 days ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using PluginConfig.API;
using PluginConfig.API.Decorators;
using PluginConfig.API.Fields;
using TMPro;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Custom_Loading")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Custom Loading")]
[assembly: AssemblyTitle("Custom_Loading")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 Custom_Loading
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.alma.customLoading", "Custom Loading", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private PluginConfigurator config;

		private Transform loaderText;

		private TextMeshProUGUI loaderTextTMP;

		private GameObject mapLoader;

		private StringField textSetting;

		private FloatField fontSizeSetting;

		private ConfigHeader styleSettingsText;

		private ConfigHeader fontSettingsText;

		private ConfigHeader imageSettingsText;

		private BoolField boldSetting;

		private BoolField italicSetting;

		private BoolField underlinedSetting;

		private BoolField forceUppercaseSetting;

		private BoolField strikethroughSetting;

		private BoolField smallCapsSetting;

		public static string workingPath = Assembly.GetExecutingAssembly().Location;

		public static string workingDir = Path.GetDirectoryName(workingPath);

		internal static ManualLogSource Logger { get; private set; } = null;

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Logger.LogInfo((object)"Plugin com.alma.customLoading is loaded!");
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)4;
			config = PluginConfigurator.Create("Custom Loading", "com.alma.customLoading");
			string text = Path.Combine(workingDir, "icon.png");
			if (File.Exists(text))
			{
				config.SetIconWithURL(text);
			}
			PluginConfigStuff();
		}

		private void Start()
		{
			mapLoader = GameObject.Find("MapLoader");
			loaderText = mapLoader.transform.Find("Loading Blocker/Panel/Text");
			loaderTextTMP = ((Component)loaderText).GetComponent<TextMeshProUGUI>();
			((TMP_Text)loaderTextTMP).richText = true;
		}

		private void PluginConfigStuff()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Expected O, but got Unknown
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Expected O, but got Unknown
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Expected O, but got Unknown
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Expected O, but got Unknown
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Expected O, but got Unknown
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Expected O, but got Unknown
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Expected O, but got Unknown
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Expected O, but got Unknown
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Expected O, but got Unknown
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Expected O, but got Unknown
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Expected O, but got Unknown
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Expected O, but got Unknown
			fontSettingsText = new ConfigHeader(config.rootPanel, "Text Settings", 24);
			textSetting = new StringField(config.rootPanel, "Text", "Text_guid", "Loading");
			fontSizeSetting = new FloatField(config.rootPanel, "Font Size", "fontSize_guid", 40f);
			styleSettingsText = new ConfigHeader(config.rootPanel, "Style Settings", 24);
			boldSetting = new BoolField(config.rootPanel, "Bold", "Bold_guid", false);
			italicSetting = new BoolField(config.rootPanel, "Italic", "Italic_guid", false);
			underlinedSetting = new BoolField(config.rootPanel, "Underlined", "Underlined_guid", false);
			forceUppercaseSetting = new BoolField(config.rootPanel, "Force Uppercase", "forceUppercase_guid", true);
			strikethroughSetting = new BoolField(config.rootPanel, "Strikethrough", "strikethrough_guid", false);
			smallCapsSetting = new BoolField(config.rootPanel, "Small Caps", "smallCaps_guid", false);
			textSetting.onValueChange += (StringValueChangeEventDelegate)delegate(StringValueChangeEvent data)
			{
				((TMP_Text)loaderTextTMP).text = data.value;
			};
			fontSizeSetting.onValueChange += (FloatValueChangeEventDelegate)delegate(FloatValueChangeEvent data)
			{
				((TMP_Text)loaderTextTMP).fontSize = data.value;
				((TMP_Text)loaderTextTMP).fontSizeMax = data.value;
			};
			boldSetting.onValueChange += (BoolValueChangeEventDelegate)delegate
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				TextMeshProUGUI obj = loaderTextTMP;
				((TMP_Text)obj).fontStyle = (FontStyles)(((TMP_Text)obj).fontStyle ^ 1);
			};
			italicSetting.onValueChange += (BoolValueChangeEventDelegate)delegate
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				TextMeshProUGUI obj = loaderTextTMP;
				((TMP_Text)obj).fontStyle = (FontStyles)(((TMP_Text)obj).fontStyle ^ 2);
			};
			underlinedSetting.onValueChange += (BoolValueChangeEventDelegate)delegate
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				TextMeshProUGUI obj = loaderTextTMP;
				((TMP_Text)obj).fontStyle = (FontStyles)(((TMP_Text)obj).fontStyle ^ 4);
			};
			forceUppercaseSetting.onValueChange += (BoolValueChangeEventDelegate)delegate
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				TextMeshProUGUI obj = loaderTextTMP;
				((TMP_Text)obj).fontStyle = (FontStyles)(((TMP_Text)obj).fontStyle ^ 0x10);
			};
			strikethroughSetting.onValueChange += (BoolValueChangeEventDelegate)delegate
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				TextMeshProUGUI obj = loaderTextTMP;
				((TMP_Text)obj).fontStyle = (FontStyles)(((TMP_Text)obj).fontStyle ^ 0x40);
			};
			smallCapsSetting.onValueChange += (BoolValueChangeEventDelegate)delegate
			{
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				TextMeshProUGUI obj = loaderTextTMP;
				((TMP_Text)obj).fontStyle = (FontStyles)(((TMP_Text)obj).fontStyle ^ 0x20);
			};
		}
	}
	internal static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "com.alma.customLoading";

		public const string PLUGIN_NAME = "Custom Loading";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}