Decompiled source of Wider Ship Mod v1.2.1

WiderShipMod.dll

Decompiled 4 days 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 BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LethalConfig;
using LethalConfig.ConfigItems;
using Unity.AI.Navigation;
using UnityEngine;
using UnityEngine.AI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("WiderShipMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WiderShipMod")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3b42a851-dbf6-428d-a7f2-0af1d6039c22")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace WiderShipMod;

public class ObjFunctions
{
	public static GameObject CreateShipObj(GameObject objOriginal, string objFile, int layer, string tag)
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		Object obj = WiderShipPlugin.mainAssetBundle.LoadAsset(objFile);
		GameObject val = Object.Instantiate<GameObject>((GameObject)(object)((obj is GameObject) ? obj : null), objOriginal.transform.parent);
		val.transform.position = objOriginal.transform.position;
		val.tag = tag;
		val.layer = layer;
		WiderShipPlugin.mls.LogMessage((object)(objFile + " has been created with name " + ((Object)val).name + "!"));
		return val;
	}

	public static GameObject CopyObj(string objName, Vector3 vector, string pathToObj)
	{
		//IL_0042: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		WiderShipPlugin.mls.LogMessage((object)("Copying an object " + objName + " to new position."));
		GameObject val = GameObject.Find(pathToObj + objName);
		GameObject val2 = Object.Instantiate<GameObject>(val, val.transform.parent);
		Transform transform = val2.transform;
		transform.position += vector;
		WiderShipPlugin.mls.LogInfo((object)("New obj name: " + ((Object)val2).name + ", parrent: " + ((Object)((Component)val2.transform.parent).gameObject).name));
		return val2;
	}

	public static void MoveObj(string objName, Vector3 vector, string pathToObj)
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		WiderShipPlugin.mls.LogMessage((object)("Moving an object " + objName + " to new position."));
		GameObject val = GameObject.Find(pathToObj + objName);
		Transform transform = val.transform;
		transform.localPosition += vector;
	}

	public static void MoveObjToPoint(string objName, Vector3 vector, string pathToObj)
	{
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		WiderShipPlugin.mls.LogMessage((object)("Moving an object " + objName + " to new point position."));
		GameObject val = GameObject.Find(pathToObj + objName);
		val.transform.localPosition = vector;
	}

	public static void RotateObj(string objName, Vector3 axis, string pathToObj, float angle)
	{
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		WiderShipPlugin.mls.LogMessage((object)("Rotating an object " + objName));
		GameObject val = GameObject.Find(pathToObj + objName);
		val.transform.RotateAround(val.transform.position, axis, angle);
	}

	public static void SetAnglesObj(string objName, Vector3 angles, string pathToObj)
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		WiderShipPlugin.mls.LogMessage((object)("Seting angle: object " + objName));
		GameObject val = GameObject.Find(pathToObj + objName);
		val.transform.localEulerAngles = angles;
	}

	public static void ScaleObj(string objName, Vector3 scaleVector, string pathToObj)
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		WiderShipPlugin.mls.LogMessage((object)("Scaling an object " + objName));
		GameObject val = GameObject.Find(pathToObj + objName);
		val.transform.localScale = scaleVector;
	}

	public static void SetChildObjToParentObj(string objChildName, string objParentName, string pathToChildObj, string pathToParentObj)
	{
		GameObject.Find(pathToChildObj + objChildName).transform.SetParent(GameObject.Find(pathToParentObj + objParentName).transform);
	}
}
public class ShipPartsFunctions : MonoBehaviour
{
	public static GameObject vanilaSI;

	public static GameObject vanilaSR;

	public static GameObject vanilaSRP;

	public static GameObject vanilaPosters;

	public static GameObject vanilaCatwalk;

	public static GameObject vanilaCatwalkRLB;

	public static GameObject vanilaCatwalkRL;

	public static GameObject moddedPoster;

	public static Material[] vanilaSIMaterials;

	public static Material[] vanilaSRMaterials;

	public static Material[] vanilaPostersMaterials;

	public static Material[] lampMaterials;

	public static Material[] moddedSIMaterials;

	public static Material[] vanilaCatwalkMaterials;

	public static Material[] vanilaCatwalkRLBMaterials;

	public static Material[] vanilaCatwalkRLMaterials;

	public static Material bulbOnMaterial;

	public static Material bulbOffMaterial;

	public static void Init()
	{
		vanilaSI = GameObject.Find("Environment/HangarShip/ShipInside");
		vanilaSR = GameObject.Find("Environment/HangarShip/ShipRails");
		vanilaSRP = GameObject.Find("Environment/HangarShip/ShipRailPosts");
		vanilaPosters = GameObject.Find("Environment/HangarShip/Plane.001");
		vanilaCatwalk = GameObject.Find("Environment/HangarShip/CatwalkShip");
		vanilaCatwalkRLB = GameObject.Find("Environment/HangarShip/CatwalkRailLiningB");
		vanilaCatwalkRL = GameObject.Find("Environment/HangarShip/CatwalkRailLining");
		vanilaSIMaterials = ((Renderer)vanilaSI.GetComponent<MeshRenderer>()).materials;
		vanilaSRMaterials = ((Renderer)vanilaSR.GetComponent<MeshRenderer>()).materials;
		vanilaCatwalkMaterials = ((Renderer)vanilaCatwalk.GetComponent<MeshRenderer>()).materials;
		vanilaCatwalkRLBMaterials = ((Renderer)vanilaCatwalkRLB.GetComponent<MeshRenderer>()).materials;
		vanilaCatwalkRLMaterials = ((Renderer)vanilaCatwalkRL.GetComponent<MeshRenderer>()).materials;
		lampMaterials = ((Renderer)GameObject.Find("Environment/HangarShip/ShipElectricLights/HangingLamp (3)").GetComponent<MeshRenderer>()).materials;
		vanilaPostersMaterials = ((Renderer)vanilaPosters.GetComponent<MeshRenderer>()).materials;
		moddedSIMaterials = (Material[])(object)new Material[vanilaSIMaterials.Length - 2];
		Array.Copy(vanilaSIMaterials, 0, moddedSIMaterials, 0, 3);
		bulbOnMaterial = lampMaterials[3];
		bulbOffMaterial = lampMaterials[0];
	}

	public static void CreateBothParts()
	{
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0348: Unknown result type (might be due to invalid IL or missing references)
		//IL_036e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0394: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0519: Unknown result type (might be due to invalid IL or missing references)
		//IL_054c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0570: Unknown result type (might be due to invalid IL or missing references)
		//IL_0594: Unknown result type (might be due to invalid IL or missing references)
		//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_061a: Unknown result type (might be due to invalid IL or missing references)
		//IL_063e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0662: Unknown result type (might be due to invalid IL or missing references)
		//IL_0677: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0460: Unknown result type (might be due to invalid IL or missing references)
		//IL_0486: Unknown result type (might be due to invalid IL or missing references)
		//IL_0768: Unknown result type (might be due to invalid IL or missing references)
		//IL_078c: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_07f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0860: Unknown result type (might be due to invalid IL or missing references)
		//IL_08eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_094c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0970: Unknown result type (might be due to invalid IL or missing references)
		//IL_0994: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_09f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a1a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a3e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a62: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a86: Unknown result type (might be due to invalid IL or missing references)
		//IL_0aaa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ace: Unknown result type (might be due to invalid IL or missing references)
		//IL_0af2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b16: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b3a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b5e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b82: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ba6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bca: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c12: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c36: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c5a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c7e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ca2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cc6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d0e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d32: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d56: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d9c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dc0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0de4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e08: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e1d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e46: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e6a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e8e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eb2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ed6: Unknown result type (might be due to invalid IL or missing references)
		((Object)ObjFunctions.CreateShipObj(vanilaSI, "ShipInsideBothVanila.fbx", vanilaSI.layer, vanilaSI.tag)).name = "ShipInsideBoth";
		((Object)ObjFunctions.CreateShipObj(vanilaSI, "FloorBoth.fbx", vanilaSI.layer, vanilaSI.tag)).name = "FloorBoth";
		((Object)ObjFunctions.CreateShipObj(vanilaSR, "ShipRailsRight.fbx", vanilaSR.layer, vanilaSR.tag)).name = "ShipRailsBoth";
		((Object)ObjFunctions.CreateShipObj(vanilaSRP, "ShipRailPostsRight.fbx", vanilaSRP.layer, vanilaSRP.tag)).name = "ShipRailPostsBoth";
		((Object)ObjFunctions.CreateShipObj(vanilaCatwalk, "CatwalkBoth.fbx", vanilaCatwalk.layer, vanilaCatwalk.tag)).name = "CatwalkBoth";
		((Object)ObjFunctions.CreateShipObj(vanilaCatwalkRLB, "CatwalkUnderneathLiningBRight.fbx", vanilaCatwalkRLB.layer, vanilaCatwalkRLB.tag)).name = "CatwalkRLBBoth";
		((Object)ObjFunctions.CreateShipObj(vanilaCatwalkRL, "CatwalkUnderneathLiningRight.fbx", vanilaCatwalkRL.layer, vanilaCatwalkRL.tag)).name = "CatwalkRLBoth";
		moddedPoster = ObjFunctions.CreateShipObj(vanilaPosters, "Plane.001Both.fbx", vanilaPosters.layer, vanilaPosters.tag);
		((Object)moddedPoster).name = "Plane.001Both";
		ObjFunctions.MoveObjToPoint("ShipRailsBoth", new Vector3(-10.19258f, 0.45f, -2.25f), "Environment/HangarShip/");
		ObjFunctions.MoveObjToPoint("ShipRailPostsBoth", new Vector3(-10.19258f, 0.4117996f, -0.7f), "Environment/HangarShip/");
		ObjFunctions.MoveObjToPoint("Plane.001Both", new Vector3(6.887688f, 2.157812f, -9.47f), "Environment/HangarShip/");
		((Renderer)GameObject.Find("Environment/HangarShip/FloorBoth").GetComponent<MeshRenderer>()).materials = moddedSIMaterials;
		((Renderer)GameObject.Find("Environment/HangarShip/ShipInsideBoth").GetComponent<MeshRenderer>()).materials = moddedSIMaterials;
		((Renderer)GameObject.Find("Environment/HangarShip/ShipRailsBoth").GetComponent<MeshRenderer>()).materials = vanilaSRMaterials;
		((Renderer)GameObject.Find("Environment/HangarShip/ShipRailPostsBoth").GetComponent<MeshRenderer>()).materials = vanilaSRMaterials;
		((Renderer)GameObject.Find("Environment/HangarShip/CatwalkBoth").GetComponent<MeshRenderer>()).materials = vanilaCatwalkMaterials;
		((Renderer)GameObject.Find("Environment/HangarShip/CatwalkRLBoth").GetComponent<MeshRenderer>()).materials = vanilaCatwalkRLMaterials;
		((Renderer)GameObject.Find("Environment/HangarShip/CatwalkRLBBoth").GetComponent<MeshRenderer>()).materials = vanilaCatwalkRLBMaterials;
		((Renderer)GameObject.Find("Environment/HangarShip/Plane.001Both").GetComponent<MeshRenderer>()).materials = vanilaPostersMaterials;
		if (WiderShipConfig.enableRightInnerWall.Value)
		{
			GameObject val = ((!WiderShipConfig.enableRightInnerWallSolidMode.Value) ? ObjFunctions.CreateShipObj(vanilaSI, "Beams.fbx", vanilaSI.layer, vanilaSI.tag) : ObjFunctions.CreateShipObj(vanilaSI, "Wall.fbx", vanilaSI.layer, vanilaSI.tag));
			((Object)val).name = "Right wall";
			ObjFunctions.SetAnglesObj(((Object)val).name, new Vector3(-89.98f, 0f, 0f), "Environment/HangarShip/");
			ObjFunctions.MoveObjToPoint(((Object)val).name, new Vector3(0f, 0.952f, -8.16f), "Environment/HangarShip/");
			ObjFunctions.ScaleObj(((Object)val).name, new Vector3(1f, -1f, 1f), "Environment/HangarShip/");
			((Renderer)GameObject.Find("Environment/HangarShip/" + ((Object)val).name).GetComponent<MeshRenderer>()).material = moddedSIMaterials[1];
		}
		if (WiderShipConfig.enableLeftInnerWall.Value)
		{
			GameObject val2 = ((!WiderShipConfig.enableLeftInnerWallSolidMode.Value) ? ObjFunctions.CreateShipObj(vanilaSI, "Beams.fbx", vanilaSI.layer, vanilaSI.tag) : ObjFunctions.CreateShipObj(vanilaSI, "Wall.fbx", vanilaSI.layer, vanilaSI.tag));
			((Object)val2).name = "Left wall";
			ObjFunctions.SetAnglesObj(((Object)val2).name, new Vector3(-89.98f, 0f, 0f), "Environment/HangarShip/");
			ObjFunctions.MoveObjToPoint(((Object)val2).name, new Vector3(0f, 0.952f, -5.224f), "Environment/HangarShip/");
			((Renderer)GameObject.Find("Environment/HangarShip/" + ((Object)val2).name).GetComponent<MeshRenderer>()).material = moddedSIMaterials[1];
		}
		string[] array = new string[2] { "ShipDoorClosed", "ShipDoorOpened" };
		string[] array2 = array;
		foreach (string objName in array2)
		{
			ObjFunctions.MoveObjToPoint(objName, new Vector3(7.3f, 0f, -0.25f), "Environment/HangarShip/ReverbTriggers/");
			ObjFunctions.ScaleObj(objName, new Vector3(16f, 1.76f, 15.5f), "Environment/HangarShip/ReverbTriggers/");
		}
		ObjFunctions.MoveObjToPoint("OutsideShip (1)", new Vector3(-2.519711f, 0f, -3.763971f), "Environment/HangarShip/ReverbTriggers/");
		ObjFunctions.ScaleObj("OutsideShip (1)", new Vector3(2.4f, 1.7614f, 1.064288f), "Environment/HangarShip/ReverbTriggers/");
		ObjFunctions.MoveObjToPoint("OutsideShip (2)", new Vector3(2.304527f, 3.1895f, 8.89f), "Environment/HangarShip/ReverbTriggers/");
		ObjFunctions.MoveObjToPoint("OutsideShip (3)", new Vector3(14.13f, 3.1895f, 6.08f), "Environment/HangarShip/ReverbTriggers/");
		ObjFunctions.MoveObjToPoint("VentEntrance", new Vector3(-1.37f, 0.567f, 0.721f), "Environment/HangarShip/");
		ObjFunctions.RotateObj("ChargeStation", Vector3.up, "Environment/HangarShip/ShipModels2b/", -60f);
		ObjFunctions.MoveObjToPoint("ChargeStation", new Vector3(4.201f, 1.25f, -3.774f), "Environment/HangarShip/ShipModels2b/");
		ObjFunctions.MoveObjToPoint("Light (3)", new Vector3(3f, 3.13f, -3.1f), "Environment/HangarShip/ShipModels2b/");
		ObjFunctions.MoveObjToPoint("Light (1)", new Vector3(4.742f, 3.249997f, -10.823f), "Environment/HangarShip/ShipModels2b/");
		ObjFunctions.RotateObj("Light (3)", Vector3.up, "Environment/HangarShip/ShipModels2b/", -85f);
		GameObject.Find("Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/LeavingShip (6)").SetActive(false);
		ObjFunctions.MoveObjToPoint("LeavingShip (3)", new Vector3(-2.817f, 3.2812f, -5.797956f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
		ObjFunctions.ScaleObj("LeavingShip (3)", new Vector3(2.983845f, 12.2338f, 0.8325825f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
		GameObject.Find("Environment/HangarShip/WallInsulator2").SetActive(false);
		GameObject.Find("Environment/HangarShip/WallInsulator").SetActive(false);
		string[] array3 = new string[2] { "Cube (1)", "Cube (3)" };
		string[] array4 = array3;
		foreach (string text in array4)
		{
			GameObject.Find("Environment/HangarShip/Railing/" + text).SetActive(false);
		}
		ObjFunctions.MoveObjToPoint("Cube (2)", new Vector3(-7.625f, 0.64f, -11.119f), "Environment/HangarShip/Railing/");
		ObjFunctions.MoveObjToPoint("ShipBoundsTrigger", new Vector3(1.4908f, 4.1675f, -6.73f), "Environment/HangarShip/");
		ObjFunctions.ScaleObj("ShipBoundsTrigger", new Vector3(23.75926f, 10.11447f, 22f), "Environment/HangarShip/");
		ObjFunctions.MoveObjToPoint("ShipInnerRoomBoundsTrigger", new Vector3(1.4367f, 1.781f, -6.661f), "Environment/HangarShip/");
		ObjFunctions.ScaleObj("ShipInnerRoomBoundsTrigger", new Vector3(17.52326f, 5.341722f, 16f), "Environment/HangarShip/");
		string[] array5 = new string[6] { "HangingLamp (3)", "HangingLamp (4)", "Area Light (4)", "Area Light (5)", "Area Light (8)", "Area Light (7)" };
		string[] array6 = array5;
		foreach (string objName2 in array6)
		{
			GameObject obj = ObjFunctions.CopyObj(objName2, new Vector3(0f, 0f, -4.5f), "Environment/HangarShip/ShipElectricLights/");
			((Object)obj).name = ((Object)obj).name + "_left";
		}
		array5 = new string[6] { "HangingLamp (3)", "HangingLamp (4)", "Area Light (4)", "Area Light (5)", "Area Light (8)", "Area Light (7)" };
		string[] array7 = array5;
		foreach (string objName3 in array7)
		{
			GameObject obj2 = ObjFunctions.CopyObj(objName3, new Vector3(0f, 0f, 4.5f), "Environment/HangarShip/ShipElectricLights/");
			((Object)obj2).name = ((Object)obj2).name + "_right";
		}
		ObjFunctions.SetChildObjToParentObj("Pipework2.002", "SideMachineryLeft", "Environment/HangarShip/", "Environment/HangarShip/");
		ObjFunctions.MoveObjToPoint("SideMachineryLeft", new Vector3(8.304f, 1.6f, -2.597f), "Environment/HangarShip/");
		ObjFunctions.SetAnglesObj("SideMachineryLeft", new Vector3(180f, 90f, -90f), "Environment/HangarShip/");
		ObjFunctions.ScaleObj("SideMachineryLeft", new Vector3(0.5793436f, 0.4392224f, 0.1953938f), "Environment/HangarShip/");
		ObjFunctions.MoveObjToPoint("GiantCylinderMagnet", new Vector3(-0.08f, 2.46f, -14.72f), "Environment/HangarShip/");
		ObjFunctions.SetChildObjToParentObj("MeterBoxDevice.001", "SideMachineryRight", "Environment/HangarShip/", "Environment/HangarShip/");
		ObjFunctions.MoveObjToPoint("SideMachineryRight", new Vector3(-4f, 1.947363f, 1.08f), "Environment/HangarShip/");
		ObjFunctions.SetAnglesObj("SingleScreen", new Vector3(-90f, -90f, -28f), "Environment/HangarShip/ShipModels2b/MonitorWall/");
		ObjFunctions.MoveObjToPoint("SingleScreen", new Vector3(-3.7253f, -1.017f, 1.9057f), "Environment/HangarShip/ShipModels2b/MonitorWall/");
		ObjFunctions.MoveObjToPoint("Cube.005", new Vector3(5.027f, 3.469644f, -2.696f), "Environment/HangarShip/");
		ObjFunctions.MoveObjToPoint("Cube.006", new Vector3(4.724743f, 3.469644f, -2.696f), "Environment/HangarShip/");
		ObjFunctions.MoveObj("OutsideShipRoom", new Vector3(0f, 0f, 5f), "Environment/HangarShip/");
		ObjFunctions.MoveObjToPoint("Light", new Vector3(-8.672f, 3.13f, -3.295f), "Environment/HangarShip/ShipModels2b/");
		ObjFunctions.SetAnglesObj("Light", new Vector3(-90f, 0f, -120f), "Environment/HangarShip/ShipModels2b/");
		ObjFunctions.MoveObjToPoint("Light (2)", new Vector3(-9.911f, 3.25f, -11.063f), "Environment/HangarShip/ShipModels2b/");
		ObjFunctions.MoveObjToPoint("LeavingShip (1)", new Vector3(0.8309021f, 3.2812f, 11.34f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
		ObjFunctions.MoveObjToPoint("LeavingShip (4)", new Vector3(13.72397f, 3.2812f, 12.72f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
		ObjFunctions.MoveObjToPoint("CatwalkUnderneathSupports", new Vector3(-7.093815f, -0.1557276f, -2.39f), "Environment/HangarShip/");
		ObjFunctions.MoveObjToPoint("Cube", new Vector3(-10.2128f, 0.6394f, -5.46f), "Environment/HangarShip/Railing/");
		ObjFunctions.ScaleObj("Cube", new Vector3(0.1611558f, 1.368879f, 18f), "Environment/HangarShip/Railing/");
		ObjFunctions.MoveObjToPoint("Cube (2)", new Vector3(-7.625f, 0.6394f, -14.43f), "Environment/HangarShip/Railing/");
		ObjFunctions.CopyObj("Cube (2)", new Vector3(-2f, 0f, 0f), "Environment/HangarShip/Railing/");
		ObjFunctions.MoveObjToPoint("Cube (4)", new Vector3(-3.25f, 0.6394f, 3.46f), "Environment/HangarShip/Railing/");
		ObjFunctions.ScaleObj("Cube (4)", new Vector3(14f, 1.368879f, 0.1241122f), "Environment/HangarShip/Railing/");
		ObjFunctions.MoveObjToPoint("Cube (6)", new Vector3(4.6534f, 0.6394f, 4.476f), "Environment/HangarShip/Railing/");
		ObjFunctions.MoveObjToPoint("Cube (7)", new Vector3(5.37f, 0.6394f, 2.67f), "Environment/HangarShip/Railing/");
		ObjFunctions.SetAnglesObj("Cube (7)", new Vector3(0f, 30f, 0f), "Environment/HangarShip/Railing/");
		ObjFunctions.MoveObjToPoint("Cube (8)", new Vector3(10.68f, 0.6394f, -0.62f), "Environment/HangarShip/Railing/");
		ObjFunctions.ScaleObj("Cube (8)", new Vector3(6f, 1.368879f, 0.1241122f), "Environment/HangarShip/Railing/");
		ObjFunctions.MoveObjToPoint("Cube (9)", new Vector3(13.12f, 0.6394f, -6.561f), "Environment/HangarShip/Railing/");
		ObjFunctions.ScaleObj("Cube (9)", new Vector3(8.6f, 1.368879f, 0.1241122f), "Environment/HangarShip/Railing/");
		GameObject.Find("Environment/HangarShip/Railing/Cube (5)").SetActive(false);
		GameObject.Find("Environment/HangarShip/Railing/Cube (6)").SetActive(false);
		ObjFunctions.MoveObjToPoint("ShipInnerRoomBoundsTrigger", new Vector3(1.4367f, 1.781f, -6.64f), "Environment/HangarShip/");
		ObjFunctions.ScaleObj("ShipInnerRoomBoundsTrigger", new Vector3(17.52326f, 5.341722f, 16f), "Environment/HangarShip/");
		ObjFunctions.MoveObjToPoint("Cube.005 (2)", new Vector3(-5.92f, 1.907f, -1.103f), "Environment/HangarShip/ShipModels2b/");
		ObjFunctions.MoveObjToPoint("Cube.005 (1)", new Vector3(0.674f, 2.757f, -0.221f), "Environment/HangarShip/ShipModels2b/");
		ObjFunctions.RotateObj("Cube.005 (1)", Vector3.up, "Environment/HangarShip/ShipModels2b/", 180f);
		ObjFunctions.MoveObjToPoint("LadderShort (1)", new Vector3(-9f, -2.58f, -14.562f), "Environment/HangarShip/");
		ObjFunctions.MoveObjToPoint("LadderShort", new Vector3(7.868f, -2.58f, 1.116f), "Environment/HangarShip/");
		ObjFunctions.SetAnglesObj("LadderShort", new Vector3(0f, 120f, 0f), "Environment/HangarShip/");
		ObjFunctions.MoveObjToPoint("HangarDoorButtonPanel", new Vector3(6.412f, 2.546f, -3.328f), "Environment/HangarShip/AnimatedShipDoor/");
		ObjFunctions.SetAnglesObj("HangarDoorButtonPanel", new Vector3(90f, 0f, 0f), "Environment/HangarShip/AnimatedShipDoor/");
		MiscStuff();
	}

	public static void MoveLightSwitch()
	{
		//IL_0021: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = GameObject.Find("Environment/HangarShip/LightSwitchContainer");
		val.transform.position = new Vector3(5.2f, 1.417171f, -3.327f);
	}

	public static void MiscStuff()
	{
		vanilaSI.SetActive(false);
		vanilaSR.SetActive(false);
		vanilaSRP.SetActive(false);
		vanilaCatwalk.SetActive(false);
		vanilaCatwalkRLB.SetActive(false);
		vanilaCatwalkRL.SetActive(false);
		((Object)moddedPoster).name = ((Object)vanilaPosters).name;
		Object.Destroy((Object)(object)vanilaPosters);
	}
}
public class WiderShipPatches
{
	[HarmonyPrefix]
	[HarmonyPatch(typeof(StartOfRound), "Start")]
	private static void StartPatch()
	{
		ShipPartsFunctions.Init();
		ShipPartsFunctions.CreateBothParts();
	}

	[HarmonyPostfix]
	[HarmonyPatch(typeof(ShipLights), "SetShipLightsClientRpc")]
	[HarmonyPatch(typeof(ShipLights), "ToggleShipLightsOnLocalClientOnly")]
	private static void SetShipLightsClientRpcPatch(ref bool ___areLightsOn)
	{
		string[] array = new string[8] { "Area Light (4)(Clone)_left", "Area Light (5)(Clone)_left", "Area Light (8)(Clone)_left", "Area Light (9)(Clone)_left", "Area Light (4)(Clone)_right", "Area Light (5)(Clone)_right", "Area Light (8)(Clone)_right", "Area Light (9)(Clone)_right" };
		string[] array2 = array;
		foreach (string text in array2)
		{
			try
			{
				((Behaviour)GameObject.Find("Environment/HangarShip/ShipElectricLights/" + text).GetComponent<Light>()).enabled = ___areLightsOn;
			}
			catch
			{
				WiderShipPlugin.mls.LogInfo((object)("Can't find a light source: " + text));
			}
		}
		if (___areLightsOn)
		{
			ShipPartsFunctions.lampMaterials[3] = ShipPartsFunctions.bulbOnMaterial;
		}
		else
		{
			ShipPartsFunctions.lampMaterials[3] = ShipPartsFunctions.bulbOffMaterial;
		}
		string[] array3 = new string[4] { "HangingLamp (3)(Clone)_left", "HangingLamp (4)(Clone)_left", "HangingLamp (3)(Clone)_right", "HangingLamp (4)(Clone)_right" };
		string[] array4 = array3;
		foreach (string text2 in array4)
		{
			try
			{
				MeshRenderer component = GameObject.Find("Environment/HangarShip/ShipElectricLights/" + text2).GetComponent<MeshRenderer>();
				((Renderer)component).materials = ShipPartsFunctions.lampMaterials;
			}
			catch
			{
				WiderShipPlugin.mls.LogInfo((object)("Can't find a lamp: " + text2));
			}
		}
	}

	[HarmonyPrefix]
	[HarmonyPatch(typeof(RoundManager), "SpawnOutsideHazards")]
	private static void SpawnOutsideHazardsPatch()
	{
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0157: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_020b: Unknown result type (might be due to invalid IL or missing references)
		//IL_022f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0253: Unknown result type (might be due to invalid IL or missing references)
		//IL_0277: Unknown result type (might be due to invalid IL or missing references)
		//IL_029b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0332: Unknown result type (might be due to invalid IL or missing references)
		//IL_036b: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0400: Unknown result type (might be due to invalid IL or missing references)
		//IL_0439: Unknown result type (might be due to invalid IL or missing references)
		//IL_0472: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_04cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0517: Unknown result type (might be due to invalid IL or missing references)
		//IL_053b: Unknown result type (might be due to invalid IL or missing references)
		//IL_055f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0583: Unknown result type (might be due to invalid IL or missing references)
		//IL_05a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_05cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_0613: Unknown result type (might be due to invalid IL or missing references)
		//IL_0637: Unknown result type (might be due to invalid IL or missing references)
		//IL_065b: Unknown result type (might be due to invalid IL or missing references)
		//IL_067f: Unknown result type (might be due to invalid IL or missing references)
		//IL_06b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_06d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_06fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0720: Unknown result type (might be due to invalid IL or missing references)
		//IL_0744: Unknown result type (might be due to invalid IL or missing references)
		//IL_0768: Unknown result type (might be due to invalid IL or missing references)
		//IL_078c: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_07f8: Unknown result type (might be due to invalid IL or missing references)
		//IL_081c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0840: Unknown result type (might be due to invalid IL or missing references)
		//IL_0864: Unknown result type (might be due to invalid IL or missing references)
		//IL_0888: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			GameObject obj = ObjFunctions.CopyObj("Cube (17)", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			((Object)obj).name = ((Object)obj).name + "_left";
			GameObject obj2 = ObjFunctions.CopyObj("Cube (11)", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			((Object)obj2).name = ((Object)obj2).name + "_left";
			GameObject obj3 = ObjFunctions.CopyObj("Cube (13)", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			((Object)obj3).name = ((Object)obj3).name + "_left";
			GameObject obj4 = ObjFunctions.CopyObj("Cube (6)", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			((Object)obj4).name = ((Object)obj4).name + "_left";
			GameObject obj5 = ObjFunctions.CopyObj("Cube (12)", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			((Object)obj5).name = ((Object)obj5).name + "_left";
			ObjFunctions.ScaleObj("Cube (17)(Clone)_left", new Vector3(11f, 0.4828268f, 5f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.ScaleObj("Cube (6)(Clone)_left", new Vector3(11f, 0.2792f, 6f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.ScaleObj("Cube (11)", new Vector3(8f, 5.727483f, 0.6064278f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (16)", new Vector3(15.9863f, -0.9428f, -5.19f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (12)", new Vector3(26.27f, -3.7588f, -0.87f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (11)", new Vector3(16.122f, -3.7588f, -0.23f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (17)(Clone)_left", new Vector3(17.07f, -0.63f, -2.32f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (11)(Clone)_left", new Vector3(16.7011f, -3.7588f, -5.39f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (13)", new Vector3(11.57f, -3.7588f, -2.574f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (6)(Clone)_left", new Vector3(17.2f, -5.55f, -2.091f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (12)(Clone)_left", new Vector3(22.316f, -3.7588f, -3.269f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.RotateObj("Cube (12)(Clone)_left", Vector3.up, "Environment/NavMeshColliders/PlayerShipNavmesh/", -60f);
			ObjFunctions.CopyObj("MediumSpace", new Vector3(0f, 0f, -4f), "Environment/NavMeshColliders/PlayerShipNavmesh/SpaceBelowShip/");
			ObjFunctions.CopyObj("SmallSpace", new Vector3(0f, 0f, -6f), "Environment/NavMeshColliders/PlayerShipNavmesh/SpaceBelowShip/");
			GameObject.Find("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (10)").SetActive(false);
			GameObject obj6 = ObjFunctions.CopyObj("Cube (17)", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			((Object)obj6).name = ((Object)obj6).name + "_right";
			GameObject obj7 = ObjFunctions.CopyObj("Cube (12)", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			((Object)obj7).name = ((Object)obj7).name + "_right";
			((Object)ObjFunctions.CopyObj("Cube (12)(Clone)_left", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/")).name = "Cube (12)(Clone)_right (2)";
			((Object)ObjFunctions.CopyObj("Cube (11)(Clone)_left", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/")).name = "Cube (11)(Clone)_right (2)";
			GameObject obj8 = ObjFunctions.CopyObj("Cube (11)", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			((Object)obj8).name = ((Object)obj8).name + "_right";
			GameObject obj9 = ObjFunctions.CopyObj("Cube (13)", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			((Object)obj9).name = ((Object)obj9).name + "_right";
			GameObject obj10 = ObjFunctions.CopyObj("Cube (6)", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			((Object)obj10).name = ((Object)obj10).name + "_right";
			ObjFunctions.ScaleObj("Cube (17)(Clone)_right", new Vector3(11f, 0.4828268f, 5f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.ScaleObj("Cube (6)(Clone)_right", new Vector3(11f, 0.2792f, 6f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (18)", new Vector3(15.9863f, -0.9428f, 9.77f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (12)(Clone)_right", new Vector3(26.27f, -3.7588f, 5.957f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (12)(Clone)_right (2)", new Vector3(21.83f, -3.7588f, 7.89f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (11)(Clone)_right", new Vector3(16.122f, -3.7588f, 4.52f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (11)(Clone)_right (2)", new Vector3(16.7011f, -3.7588f, 9.860001f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (13)(Clone)_right", new Vector3(11.57f, -3.7588f, 7.426f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (17)(Clone)_right", new Vector3(17.07f, -0.63f, 6.93f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (6)(Clone)_right", new Vector3(17.2f, -5.55f, 6.659f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.SetAnglesObj("Cube (12)(Clone)_right (2)", new Vector3(0f, 60f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.CopyObj("MediumSpace", new Vector3(0f, 0f, 4f), "Environment/NavMeshColliders/PlayerShipNavmesh/SpaceBelowShip/");
			ObjFunctions.CopyObj("SmallSpace", new Vector3(0f, 0f, 6f), "Environment/NavMeshColliders/PlayerShipNavmesh/SpaceBelowShip/");
			ObjFunctions.MoveObjToPoint("MediumSpace1", new Vector3(19.86f, -10.4383f, 11.54f), "Environment/NavMeshColliders/PlayerShipNavmesh/SpaceBelowShip/");
			GameObject.Find("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (1)").SetActive(false);
			ObjFunctions.ScaleObj("Cube", new Vector3(2.69503f, 0.2792f, 18f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube", new Vector3(9.7117f, -5.75f, 3.69f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (2)", new Vector3(17.53f, -5.75f, 11.64f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (3)", new Vector3(25.3f, -5.75f, 7.1267f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.CopyObj("Cube (3)", new Vector3(0f, 0f, 0f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("Cube (3)", new Vector3(25.39f, -5.75f, 11f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.ScaleObj("Cube (3)", new Vector3(5f, 0.2792f, 5f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.ScaleObj("Cube (2)", new Vector3(12.93f, 0.2792f, 2.784142f), "Environment/NavMeshColliders/PlayerShipNavmesh/");
			ObjFunctions.MoveObjToPoint("A", new Vector3(1.89f, -4.72f, 3.1f), "Environment/NavMeshColliders/OffMeshLinks/ShipLadder/");
			ObjFunctions.MoveObjToPoint("B", new Vector3(0.644f, -0.98f, 1.76f), "Environment/NavMeshColliders/OffMeshLinks/ShipLadder/");
			ObjFunctions.MoveObjToPoint("A", new Vector3(-2.44f, -2.66f, -4.62f), "Environment/NavMeshColliders/OffMeshLinks/ShipLadder2/");
			ObjFunctions.MoveObjToPoint("B", new Vector3(-2.44f, -1.054f, -2.972f), "Environment/NavMeshColliders/OffMeshLinks/ShipLadder2/");
			ObjFunctions.MoveObjToPoint("A", new Vector3(-7.96f, -0.74f, 3.16f), "Environment/NavMeshColliders/PlayerShipNavmesh/ShipLadder3/");
			ObjFunctions.MoveObjToPoint("B", new Vector3(-8.11f, 4.473f, 1.559f), "Environment/NavMeshColliders/PlayerShipNavmesh/ShipLadder3/");
			string[] array = new string[3] { "Environment/NavMeshColliders/OffMeshLinks/ShipLadder", "Environment/NavMeshColliders/OffMeshLinks/ShipLadder2/", "Environment/NavMeshColliders/PlayerShipNavmesh/ShipLadder3" };
			string[] array2 = array;
			foreach (string text in array2)
			{
				GameObject.Find(text).GetComponent<OffMeshLink>().UpdatePositions();
			}
			GameObject val = GameObject.FindGameObjectWithTag("OutsideLevelNavMesh");
			if ((Object)(object)val != (Object)null)
			{
				val.GetComponent<NavMeshSurface>().BuildNavMesh();
			}
		}
		catch (Exception ex)
		{
			WiderShipPlugin.mls.LogWarning((object)"Cant change navmesh on that scene!!!");
			WiderShipPlugin.mls.LogError((object)ex.ToString());
		}
	}
}
public class WiderShipConfig
{
	public static ConfigEntry<bool> enableLeftInnerWall;

	public static ConfigEntry<bool> enableLeftInnerWallSolidMode;

	public static ConfigEntry<bool> enableRightInnerWall;

	public static ConfigEntry<bool> enableRightInnerWallSolidMode;

	public static void Config(ConfigFile cfg)
	{
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: Expected O, but got Unknown
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Expected O, but got Unknown
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Expected O, but got Unknown
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Expected O, but got Unknown
		enableLeftInnerWall = cfg.Bind<bool>("Left Part", "Enable Left Inner Wall", true, "Enable this if you want to have a wall between the new ship part and the vanilla one.");
		enableLeftInnerWallSolidMode = cfg.Bind<bool>("Left Part", "Solid Left Inner Wall", false, "Enable if you want your wall to be solid. Doesn't work without Left Inner Wall enabled.");
		enableRightInnerWall = cfg.Bind<bool>("Right Part", "Enable Right Inner Wall", true, "Enable this if you want to have a wall between the new ship part and the vanilla one.");
		enableRightInnerWallSolidMode = cfg.Bind<bool>("Right Part", "Solid Right Inner Wall", false, "Enable if you want your wall to be solid. Doesn't work without Left Inner Wall enabled.");
		BoolCheckBoxConfigItem val = new BoolCheckBoxConfigItem(enableLeftInnerWall);
		BoolCheckBoxConfigItem val2 = new BoolCheckBoxConfigItem(enableLeftInnerWallSolidMode);
		BoolCheckBoxConfigItem val3 = new BoolCheckBoxConfigItem(enableRightInnerWall);
		BoolCheckBoxConfigItem val4 = new BoolCheckBoxConfigItem(enableRightInnerWallSolidMode);
		LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val);
		LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2);
		LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val3);
		LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val4);
	}
}
[BepInPlugin("mborsh.WiderShipMod", "WiderShipMod", "1.2.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class WiderShipPlugin : BaseUnityPlugin
{
	private const string modGUID = "mborsh.WiderShipMod";

	private const string modName = "WiderShipMod";

	private const string modVersion = "1.2.1";

	private readonly Harmony harmony = new Harmony("mborsh.WiderShipMod");

	public static ManualLogSource mls;

	public static AssetBundle mainAssetBundle;

	public static Material[] lampMaterials;

	public static Material bulbOnMaterial;

	public static Material bulbOffMaterial;

	private static WiderShipPlugin Instance;

	private void Awake()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Expected O, but got Unknown
		Instance = this;
		ConfigFile cfg = new ConfigFile(Path.Combine(Paths.ConfigPath, "mborsh.WiderShipMod.cfg"), true);
		WiderShipConfig.Config(cfg);
		mls = Logger.CreateLogSource("Wider Ship Mod");
		mls = ((BaseUnityPlugin)this).Logger;
		mls.LogInfo((object)"Wider Ship Mod loaded. Patching.");
		harmony.PatchAll(typeof(WiderShipPatches));
		if (!LoadAssetBundle())
		{
			mls.LogError((object)"Failed to load asset bundle! Abort mission!");
		}
		static bool LoadAssetBundle()
		{
			mls.LogInfo((object)"Loading AssetBundle...");
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			mainAssetBundle = AssetBundle.LoadFromFile(Path.Combine(directoryName, "newship"));
			if ((Object)(object)mainAssetBundle == (Object)null)
			{
				return false;
			}
			mls.LogInfo((object)("AssetBundle " + ((Object)mainAssetBundle).name + " loaded from " + directoryName + "."));
			return true;
		}
	}
}