Decompiled source of DankFrog v1.0.0

DankFrog.dll

Decompiled 4 months 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;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("DankFrog")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+4b078f2d6f3b77fcde41ad74fc61e7bda6f6a10d")]
[assembly: AssemblyProduct("DankFrog")]
[assembly: AssemblyTitle("DankFrog")]
[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 DysonSphereProgram.Modding.DankFrog
{
	[HarmonyPatch]
	public class Patch
	{
		private static string ReplaceDarkFogWithDankFrog(string value)
		{
			return value.Replace("dark fog", "dank frog").Replace("dark Fog", "dank Frog").Replace("Dark fog", "Dank frog")
				.Replace("Dark Fog", "Dank Frog");
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Localization), "Translate")]
		public static void ReplaceDarkFogWithDankFrogTranslate(ref string __result)
		{
			__result = ReplaceDarkFogWithDankFrog(__result);
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(UIMainMenu), "UpdateLogText")]
		public static void ReplaceDarkFogWithDankFrogUpdateLog(UIMainMenu __instance)
		{
			for (int i = 0; i < __instance.updateLogs.Length; i++)
			{
				UpdateLogEntry[] logs = __instance.updateLogs[i].logs;
				for (int j = 0; j < logs.Length; j++)
				{
					logs[i].logEn = ReplaceDarkFogWithDankFrog(logs[i].logEn);
				}
			}
		}
	}
	[BepInPlugin("dev.raptor.dsp.DankFrog", "DankFrog", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		public const string GUID = "dev.raptor.dsp.DankFrog";

		public const string NAME = "DankFrog";

		public const string VERSION = "1.0.0";

		private Harmony _harmony;

		internal static ManualLogSource Log;

		private void Awake()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			_harmony = new Harmony("dev.raptor.dsp.DankFrog");
			_harmony.PatchAll(typeof(Patch));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"DankFrog Awake() called");
		}

		private void OnDestroy()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"DankFrog OnDestroy() called");
			Harmony harmony = _harmony;
			if (harmony != null)
			{
				harmony.UnpatchSelf();
			}
			Log = null;
		}
	}
}