Decompiled source of NoMap Cartography Map v1.0.0

plugins/NoMapCartographyMap.dll

Decompiled 9 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("CartographyMap")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CartographyMap")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d0275e06-5a54-45d1-b1af-c015a78db1b9")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace NoMapCartographyMap;

[HarmonyPatch(typeof(Minimap), "Start")]
public class Minimap_Start
{
	private static void Prefix()
	{
		Console.instance.Print("[NoMapCartographyMap] ready!");
	}
}
[BepInPlugin("treacleminer.NoMapCartographyMap", "NoMap Cartography Map", "1.0.0")]
[BepInProcess("valheim.exe")]
public class NoMapCartographyMapImpl : BaseUnityPlugin
{
	[HarmonyPatch(typeof(MapTable), "OnRead")]
	private class MapTableOnReadPatch
	{
		private static void Postfix()
		{
			if (Game.m_noMap)
			{
				Game.m_noMap = false;
				Minimap.instance.SetMapMode((MapMode)2);
				Game.m_noMap = true;
			}
		}
	}

	private readonly Harmony harmony = new Harmony("treacleminer.NoMapCartographyMap");

	private void Awake()
	{
		Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
	}
}