Decompiled source of Structure Outlines v1.1.0

Mods/StructureOutlines.dll

Decompiled 3 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using HarmonyLib;
using Il2CppRUMBLE.MoveSystem;
using MelonLoader;
using Microsoft.CodeAnalysis;
using StructureOutlines;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(global::StructureOutlines.StructureOutlines), "StructureOutlines", "1.0.0", "yiak65", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("StructureOutlines")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("StructureOutlines")]
[assembly: AssemblyTitle("StructureOutlines")]
[assembly: NeutralResourcesLanguage("en-US")]
[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 StructureOutlines
{
	public class StructureOutlines : MelonMod
	{
		public OutlineHandler outlines;

		public override void OnLateInitializeMelon()
		{
			outlines = new OutlineHandler();
			outlines.Init();
		}
	}
	public class OutlineHandler
	{
		[HarmonyPatch(typeof(Structure), "Start")]
		public class StructureSpawnPatch
		{
			private static void Postfix(Structure __instance)
			{
				Outlines.CreateOutline(((Component)__instance).gameObject);
			}
		}

		private Color black;

		private Shader unlit;

		public static OutlineHandler Outlines;

		public void CreateOutline(GameObject structure)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject();
			((Object)val).name = "Structure Outline";
			val.transform.parent = structure.transform;
			if (((Object)structure).name == "LargeRock" || ((Object)structure).name == "SmallRock")
			{
				val.AddComponent<MeshFilter>().mesh = structure.GetComponent<MeshFilter>().mesh;
				val.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity);
				val.transform.localScale = structure.transform.localScale * 1.05f;
			}
			else
			{
				val.AddComponent<MeshFilter>().mesh = ((Component)structure.transform.GetChild(0)).GetComponent<MeshFilter>().mesh;
				val.transform.SetLocalPositionAndRotation(structure.transform.GetChild(0).localPosition, structure.transform.GetChild(0).localRotation);
				val.transform.localScale = structure.transform.GetChild(0).localScale * 1.05f;
			}
			MeshRenderer val2 = val.AddComponent<MeshRenderer>();
			((Renderer)val2).material.shader = unlit;
			((Renderer)val2).material.color = black;
			((Renderer)val2).material.SetFloat("_Cull", 1f);
		}

		public void Init()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			Outlines = this;
			unlit = Shader.Find("Universal Render Pipeline/Unlit");
			black = new Color(0f, 0f, 0f);
		}
	}
}