LC_NogrMod.dll

Decompiled 11 months ago
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using GameNetcodeStuff;
using HarmonyLib;
using LC_NogrMod.Patches;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("LC_NogrMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LC_NogrMod")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("615fa7c1-b5fa-4b8f-b711-2e86216e9f22")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace LC_NogrMod
{
	[BepInPlugin("OndyDev.LCNogr", "Nogr", "6.9.6.9")]
	public class plugin : BaseUnityPlugin
	{
		private const string modGUID = "OndyDev.LCNogr";

		private const string modName = "Nogr";

		private const string modVersion = "6.9.6.9";

		private readonly Harmony harmony = new Harmony("OndyDev.LCNogr");

		private static plugin Instance;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			harmony.PatchAll(typeof(plugin));
			harmony.PatchAll(typeof(PlayerControllerBPatch));
		}
	}
}
namespace LC_NogrMod.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void texturePatch()
		{
			AssetBundle val = AssetBundle.LoadFromFile(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "/nogr");
			Texture2D mainTexture = val.LoadAsset<Texture2D>("posters");
			Texture2D mainTexture2 = val.LoadAsset<Texture2D>("TipsPoster2");
			MeshRenderer component = GameObject.Find("Environment/HangarShip/Plane.001").GetComponent<MeshRenderer>();
			((Renderer)component).materials[0].mainTexture = (Texture)(object)mainTexture;
			((Renderer)component).materials[1].mainTexture = (Texture)(object)mainTexture2;
		}
	}
}