Decompiled source of CustomCountry v1.0.0

CustomCountry.dll

Decompiled 3 days ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
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("CustomCountry")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyProduct("CustomCountry")]
[assembly: AssemblyTitle("CustomCountry")]
[assembly: AssemblyVersion("0.1.0.0")]
namespace CustomCountry;

[BepInPlugin("radsi.country", "CustomCountry", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private class Patcher
	{
		[HarmonyPatch(typeof(PassportManager), "Awake")]
		[HarmonyPostfix]
		public static void PassportManagerAwakePostfix()
		{
			GameObject val = GameObject.Find("GAME/PassportManager/PassportUI/Canvas/Panel/Panel/BG/Text/Nationality/Text");
			if ((Object)(object)val != (Object)null)
			{
				TextMeshProUGUI component = val.GetComponent<TextMeshProUGUI>();
				if ((Object)(object)component != (Object)null)
				{
					((TMP_Text)component).text = country.Value;
				}
			}
		}
	}

	private static ConfigEntry<string> country;

	private void Awake()
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		country = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Country", "Skyland", "Text to display as nationality in the passport.");
		new Harmony("radsi.country").PatchAll(typeof(Patcher));
	}
}