Decompiled source of CensoreTheFlag v1.0.0

BepInEx/plugins/CensoreTheFlag.dll

Decompiled 6 days ago
using System;
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 UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("CensoreTheFlag")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+b71bd60af168e02f7e3955964f5a8a3e05e61ba0")]
[assembly: AssemblyProduct("CensoreTheFlag")]
[assembly: AssemblyTitle("CensoreTheFlag")]
[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 MyFirstPlugin
{
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "CensoreTheFlag";

		public const string PLUGIN_NAME = "CensoreTheFlag";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace CensoreTheFlag
{
	[BepInPlugin("com.infernumvii.censoretheflag", "Censore The Flag", "1.0.0")]
	public class CensoreTheFlag : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(MainMenuManager))]
		private class FlagMaterialReplacePatch
		{
			[HarmonyPatch("ActuallyStartGameActually")]
			[HarmonyPostfix]
			private static void Postfix(MainMenuManager __instance)
			{
				FlagController[] array = Object.FindObjectsOfType<FlagController>(true);
				Material val = array[0].flagMats[0];
				FlagController[] array2 = array;
				foreach (FlagController obj in array2)
				{
					((Renderer)obj.flagvisual).material = val;
					obj.flagMats[1] = val;
					obj.flagMats[2] = val;
					Logger.LogInfo((object)"Flag replaced");
				}
			}
		}

		private readonly Harmony harmony = new Harmony("com.infernumvii.censoretheflag");

		internal static ManualLogSource Logger;

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			harmony.PatchAll();
			Logger.LogInfo((object)"Censore The Flag loaded!");
		}
	}
}