Decompiled source of Custom Cross Mod Compat MelanieMelicious v1.0.0

MelMelModCheck.dll

Decompiled a day ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using MelMel2SS;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Events;
using WiderShipMod;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("MelMelModCheck")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("MelanieMelicious")]
[assembly: AssemblyProduct("Melanie Mod Check")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 MelMelModCheck
{
	[Serializable]
	public class ModChange
	{
		public string modFolderName;

		public TransformChange[] changes = new TransformChange[0];

		public UnityEvent events;
	}
	internal class ModCheck : MonoBehaviour
	{
		public ModChange[] checkMod = new ModChange[0];

		private const string manifest = "manifest.json";

		private static string plugins = Paths.PluginPath;

		private void Start()
		{
			for (int i = 0; i < checkMod.Length; i++)
			{
				if (File.Exists(Path.Combine(plugins, checkMod[i].modFolderName, "manifest.json")))
				{
					for (int j = 0; j < checkMod[i].changes.Length; j++)
					{
						checkMod[i].changes[j].ApplyChange();
					}
					checkMod[i].events.Invoke();
				}
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("MelanieMelicious.CrossModCompat", "Melanie Melicious - Cross-Mod Compat", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string GUID = "MelanieMelicious.CrossModCompat";

		private const string NAME = "Melanie Melicious - Cross-Mod Compat";

		private const string VERSION = "1.0.0";

		private void Awake()
		{
			if (Chainloader.PluginInfos.ContainsKey("MelanieMelicious.2StoryShip"))
			{
				ShipCheck.story = true;
			}
			if (Chainloader.PluginInfos.ContainsKey("mborsh.WiderShipMod"))
			{
				ShipCheck.wide = true;
			}
			if (Chainloader.PluginInfos.ContainsKey("BiggerShip"))
			{
				ShipCheck.big = true;
			}
		}
	}
	public class ShipCheck : MonoBehaviour
	{
		[Header("2-Story Ship")]
		public TransformChange[] storyChange = new TransformChange[0];

		public TransformChange[] storyWideChange = new TransformChange[0];

		public TransformAdd[] perStoryAdd = new TransformAdd[0];

		[Header("Wider Ship")]
		public TransformChange[] wideChange = new TransformChange[0];

		public TransformChange[] wideLeftChange = new TransformChange[0];

		public TransformChange[] wideRightChange = new TransformChange[0];

		[Header("Bigger Ship")]
		public TransformChange[] bigChange = new TransformChange[0];

		internal static bool story;

		internal static bool wide;

		internal static bool big;

		private void Start()
		{
			if (story)
			{
				StoryChange();
			}
			else if (wide)
			{
				WideChange();
			}
			else if (big)
			{
				for (int i = 0; i < bigChange.Length; i++)
				{
					bigChange[i].ApplyChange();
				}
			}
		}

		private void StoryChange()
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: 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_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			if (wide)
			{
				for (int i = 0; i < storyWideChange.Length; i++)
				{
					storyWideChange[i].ApplyChange();
				}
			}
			else
			{
				for (int j = 0; j < storyChange.Length; j++)
				{
					storyChange[j].ApplyChange();
				}
			}
			for (int k = 0; k < perStoryAdd.Length; k++)
			{
				Transform targetObject = perStoryAdd[k].targetObject;
				targetObject.localPosition += perStoryAdd[k].localPosition * (float)(Plugin.stories - 1);
				Transform targetObject2 = perStoryAdd[k].targetObject;
				targetObject2.localScale += perStoryAdd[k].localScale * (float)(Plugin.stories - 1);
			}
		}

		private void WideChange()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Invalid comparison between Unknown and I4
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Invalid comparison between Unknown and I4
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Invalid comparison between Unknown and I4
			for (int i = 0; i < wideChange.Length; i++)
			{
				wideChange[i].ApplyChange();
			}
			Side value = WiderShipConfig.extendedSide.Value;
			if ((int)value == 2 || (int)value == 0)
			{
				for (int j = 0; j < wideLeftChange.Length; j++)
				{
					wideLeftChange[j].ApplyChange();
				}
			}
			if ((int)value == 2 || (int)value == 1)
			{
				for (int k = 0; k < wideRightChange.Length; k++)
				{
					wideRightChange[k].ApplyChange();
				}
			}
		}
	}
	[Serializable]
	public class TransformAdd
	{
		public Transform targetObject;

		public Vector3 localPosition;

		public Vector3 localScale;

		public void ApplyChange(int multi = 1)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)targetObject == (Object)null))
			{
				Transform obj = targetObject;
				obj.localPosition += localPosition * (float)multi;
				Transform obj2 = targetObject;
				obj2.localScale += localScale * (float)multi;
			}
		}
	}
	[Serializable]
	public class TransformChange
	{
		public Transform targetObject;

		public Vector3 localPosition;

		public Vector3 localRotation;

		public Vector3 localScale = Vector3.one;

		public bool isActive = true;

		public void ApplyChange()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)targetObject == (Object)null))
			{
				targetObject.localPosition = localPosition;
				targetObject.localEulerAngles = localRotation;
				targetObject.localScale = localScale;
				((Component)targetObject).gameObject.SetActive(isActive);
			}
		}
	}
}