Decompiled source of CreditedCompany v1.0.1

CreditedCompany/CreditedCompany.dll

Decompiled 11 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("CreditedCompany")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("A library to add yourself to the game's credits!")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+ce73f047954a38a8c54c562237a3d0ec5a8a983b")]
[assembly: AssemblyProduct("CreditedCompany")]
[assembly: AssemblyTitle("CreditedCompany")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.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 CreditedCompany
{
	[BepInPlugin("CreditedCompany", "Credited Company", "1.0.1")]
	public class Plugin : BaseUnityPlugin
	{
		private const string GUID = "CreditedCompany";

		private const string NAME = "Credited Company";

		private const string VERSION = "1.0.1";

		private readonly Harmony harmony = new Harmony("CreditedCompany");

		public static Plugin instance;

		public static ManualLogSource Logger;

		public static List<string> credits = new List<string>();

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			harmony.PatchAll(typeof(Plugin));
			Logger = Logger.CreateLogSource("CreditedCompany");
			Logger.LogInfo((object)"Plugin CreditedCompany is loaded!");
		}

		[HarmonyPatch(typeof(MenuManager), "Start")]
		[HarmonyPostfix]
		private static void PutMeInTheCreditsImImportantISwear(ref MenuManager __instance)
		{
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			Transform val = ((Component)__instance).transform.parent.Find("MenuContainer/CreditsPanel/Panel/Scroll View/Viewport/Content/CreditsText");
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			ScrollRect component = ((Component)((Component)__instance).transform.parent.Find("MenuContainer/CreditsPanel/Panel/Scroll View")).GetComponent<ScrollRect>();
			RectTransform component2 = ((Component)component.content).GetComponent<RectTransform>();
			int num = 50 + 16 * credits.Count;
			string text = "----------------------------------";
			string text2 = "";
			text2 = text2 + "\n\n" + text + "\nMod developers\n\nOrangenal - Credited Company\n";
			foreach (string credit in credits)
			{
				text2 = text2 + credit + "\n";
				if (credit.Contains("\n"))
				{
					string[] array = credit.Split('\n');
					int num2 = array.Length - 1;
					num += 16 * num2;
				}
			}
			component2.sizeDelta = new Vector2(component2.sizeDelta.x, component2.sizeDelta.y + (float)num);
			TextMeshProUGUI component3 = ((Component)val).GetComponent<TextMeshProUGUI>();
			((TMP_Text)component3).text = ((TMP_Text)component3).text + text2;
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "CreditedCompany";

		public const string PLUGIN_NAME = "CreditedCompany";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}