Decompiled source of Wider Ship Mod v1.3.6

WiderShipMod.dll

Decompiled a day ago
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using ShipWindows;
using ShipWindows.Components;
using ShipWindows.Utilities;
using Unity.AI.Navigation;
using UnityEngine;
using UnityEngine.AI;
using WiderShipMod.Compatibility.ShipWindows;
using WiderShipMod.Methods;
using WiderShipMod.Patches;

[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
{
	internal enum Side
	{
		Left,
		Right,
		Both
	}
	internal class WiderShipConfig
	{
		internal static ConfigEntry<Side> extendedSide;

		internal static ConfigEntry<bool> enableForceDontMovePosters;

		internal static ConfigEntry<bool> enableBuildNewNavmesh;

		internal static ConfigEntry<bool> enableClientBuildNavmeshToo;

		internal static ConfigEntry<string> whitelist;

		internal static ConfigEntry<string> blacklist;

		internal static ConfigEntry<string> example;

		internal static void Config(ConfigFile cfg)
		{
			extendedSide = cfg.Bind<Side>("General", "Extended Side", Side.Both, "Left - only left side.\nRight - only right side.\nBoth - both sides.");
			enableForceDontMovePosters = cfg.Bind<bool>("Compatibility", "Force Dont move posters to true", true, "Force \"Don't move posters\" to true so that the posters don't hang in the middle of the ship.\nIt probably won't matter in the future if TestAccount666 makes DontMovePosters true by default.");
			enableBuildNewNavmesh = cfg.Bind<bool>("Navmesh", "Enable New Navmesh", true, "Enable this to generate new navmesh (YOU DON't WANT THIS TO BE FALSE!!!)\nOnly for testing purposes.");
			enableClientBuildNavmeshToo = cfg.Bind<bool>("Navmesh", "Enable Client Build Navmesh Too", false, "Enable this if you (as a client) want to generate navmesh.\nIt won't speed up map loading, but will most likely slow it down for everyone.\nMade for testing and debugging in case of anything.");
			blacklist = cfg.Bind<string>("Navmesh", "Moon Blacklist", "44 Atlantica,46 Infernis,134 Oldred,154 Etern", "On these moons,Wider Ship will try to PLACE its own navmesh instead of the vanilla one.\n(Fast, buggy)");
			whitelist = cfg.Bind<string>("Navmesh", "Moon Whitelist", "220 Assurance,5 Embrion", "On these moons,Wider Ship will try to CREATE its own navmesh instead of the vanilla one.\n(Slower, less buggy, old method of creating navmesh)");
			example = cfg.Bind<string>("Navmesh", "Example moon list", "220 Assurance,5 Embrion,44 Atlantica,46 Infernis,134 Oldred,154 Etern", "Example list for whitelist/blacklist.\nWill fill up again every time if you accidentally erase it.");
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("mborsh.WiderShipMod", "WiderShipMod", "1.3.3")]
	public class WiderShipPlugin : BaseUnityPlugin
	{
		private const string modGUID = "mborsh.WiderShipMod";

		private const string modName = "WiderShipMod";

		private const string modVersion = "1.3.3";

		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;

		public static bool is2StoryHere = false;

		internal static GameObject[] windowGOs = (GameObject[])(object)new GameObject[3];

		internal static GameObject[] vanilaGOs = (GameObject[])(object)new GameObject[3];

		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;
			WiderShipConfig.example.Value = "220 Assurance,5 Embrion,44 Atlantica,46 Infernis,134 Oldred,154 Etern";
			if (!LoadAssetBundle())
			{
				mls.LogError((object)"Failed to load asset bundle! Abort mission!");
				return;
			}
			mls.LogInfo((object)"Wider Ship Mod loaded. Patching.");
			if (Chainloader.PluginInfos.ContainsKey("MelanieMelicious.2StoryShip"))
			{
				is2StoryHere = true;
				mls.LogMessage((object)"Hi Mel, сan you do all the hard work for me since 2StoryShip here?");
				harmony.PatchAll(typeof(LightPatches));
				return;
			}
			if (Chainloader.PluginInfos.ContainsKey("TestAccount666.ShipWindows"))
			{
				mls.LogMessage((object)"Hi TestAccount666.");
				harmony.PatchAll(typeof(ShipWindowsPatches));
			}
			harmony.PatchAll(typeof(WiderShipPatches));
			harmony.PatchAll(typeof(LightPatches));
			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;
			}
		}
	}
}
namespace WiderShipMod.Patches
{
	public class WiderShipPatches
	{
		[HarmonyAfter(new string[] { "TestAccount666.ShipWindows" })]
		[HarmonyPrefix]
		[HarmonyPatch(typeof(StartOfRound), "Start")]
		private static void StartPatch()
		{
			ShipSidesMethods.Init();
			ShipSidesMethods.CreateShip();
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")]
		private static void FinishGeneratingLevelPrefix()
		{
			if (WiderShipConfig.enableBuildNewNavmesh.Value && GameNetworkManager.Instance.isHostingGame && !WiderShipConfig.enableClientBuildNavmeshToo.Value)
			{
				string[] source = WiderShipConfig.whitelist.Value.Split(new char[1] { ',' });
				string[] source2 = WiderShipConfig.blacklist.Value.Split(new char[1] { ',' });
				if (!source.Contains(TimeOfDay.Instance.currentLevel.PlanetName) && !source2.Contains(TimeOfDay.Instance.currentLevel.PlanetName))
				{
					WiderShipPlugin.mls.LogWarning((object)"This moon not in whitelist or blacklits!!! Adding this moon to the Wider Ship whitelist...");
					ConfigEntry<string> whitelist = WiderShipConfig.whitelist;
					whitelist.Value = whitelist.Value + "," + TimeOfDay.Instance.currentLevel.PlanetName;
				}
				NavmeshMethods.PlaceNavmesh();
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")]
		private static void FinishGeneratingLevelPost()
		{
			if (WiderShipConfig.enableBuildNewNavmesh.Value && GameNetworkManager.Instance.isHostingGame && !WiderShipConfig.enableClientBuildNavmeshToo.Value)
			{
				string[] source = WiderShipConfig.whitelist.Value.Split(new char[1] { ',' });
				string[] source2 = WiderShipConfig.blacklist.Value.Split(new char[1] { ',' });
				if (source.Contains(TimeOfDay.Instance.currentLevel.PlanetName))
				{
					GameObject.Find("Environment").GetComponent<NavMeshSurface>().BuildNavMesh();
				}
				else if (!source2.Contains(TimeOfDay.Instance.currentLevel.PlanetName))
				{
					WiderShipPlugin.mls.LogError((object)"How did you even get there? THIS IS SUPER BAD!!!");
				}
			}
		}
	}
	public class LightPatches
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(StartOfRound), "Start")]
		private static void StartLightPatch()
		{
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			ShipSidesMethods.Init();
			WiderShipPlugin.lampMaterials = ((Renderer)GameObject.Find("Environment/HangarShip/ShipElectricLights/HangingLamp (3)").GetComponent<MeshRenderer>()).materials;
			WiderShipPlugin.bulbOnMaterial = WiderShipPlugin.lampMaterials[3];
			WiderShipPlugin.bulbOffMaterial = WiderShipPlugin.lampMaterials[0];
			if (WiderShipConfig.extendedSide.Value == Side.Left || WiderShipConfig.extendedSide.Value == Side.Both || WiderShipPlugin.is2StoryHere)
			{
				string[] array = new string[6] { "HangingLamp (3)", "HangingLamp (4)", "Area Light (4)", "Area Light (5)", "Area Light (8)", "Area Light (7)" };
				string[] array2 = array;
				foreach (string objName in array2)
				{
					GameObject obj = ObjMethods.CopyObj(objName, new Vector3(0f, 0f, -4.5f), "Environment/HangarShip/ShipElectricLights/");
					((Object)obj).name = ((Object)obj).name + "_left";
				}
			}
			if (WiderShipConfig.extendedSide.Value == Side.Right || WiderShipConfig.extendedSide.Value == Side.Both || WiderShipPlugin.is2StoryHere)
			{
				string[] array3 = new string[6] { "HangingLamp (3)", "HangingLamp (4)", "Area Light (4)", "Area Light (5)", "Area Light (8)", "Area Light (7)" };
				string[] array4 = array3;
				foreach (string objName2 in array4)
				{
					GameObject obj2 = ObjMethods.CopyObj(objName2, new Vector3(0f, 0f, 4.5f), "Environment/HangarShip/ShipElectricLights/");
					((Object)obj2).name = ((Object)obj2).name + "_right";
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(ShipLights), "SetShipLightsClientRpc")]
		[HarmonyPatch(typeof(ShipLights), "ToggleShipLightsOnLocalClientOnly")]
		private static void SetShipLightsClientRpcPatch(ref bool ___areLightsOn)
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Expected O, but got Unknown
			Transform transform = GameObject.Find("Environment/HangarShip/ShipElectricLights").transform;
			if (___areLightsOn)
			{
				ShipSidesMethods.lampMaterials[3] = ShipSidesMethods.bulbOnMaterial;
			}
			else
			{
				ShipSidesMethods.lampMaterials[3] = ShipSidesMethods.bulbOffMaterial;
			}
			foreach (Transform item in transform)
			{
				Transform val = item;
				Light component = ((Component)val).GetComponent<Light>();
				if ((Object)(object)component != (Object)null)
				{
					((Behaviour)component).enabled = ___areLightsOn;
					continue;
				}
				MeshRenderer component2 = ((Component)val).GetComponent<MeshRenderer>();
				if ((Object)(object)component2 != (Object)null)
				{
					((Renderer)component2).materials = ShipSidesMethods.lampMaterials;
				}
				else
				{
					WiderShipPlugin.mls.LogDebug((object)("Huh? What is " + ((Object)val).name + " ? Send this to Wider Ship dev please :)"));
				}
			}
		}
	}
}
namespace WiderShipMod.Methods
{
	public class ObjMethods
	{
		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 NavmeshMethods
	{
		internal static string GetNavmeshName()
		{
			return WiderShipConfig.extendedSide.Value switch
			{
				Side.Left => "navmesh_left", 
				Side.Right => "navmesh_right", 
				Side.Both => "navmesh_both", 
				_ => null, 
			};
		}

		public static void PlaceNavmesh()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_017b: 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_0059: Expected O, but got Unknown
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Expected O, but got Unknown
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.Find("NavMeshColliders");
			GameObject val2 = GameObject.Find("PlayerShipNavmesh");
			foreach (Transform item in val.transform)
			{
				Transform val3 = item;
				foreach (Transform item2 in ((Component)val3).transform)
				{
					Transform val4 = item2;
					if (((Object)((Component)val4).gameObject).name.Contains("ShipLadder"))
					{
						if (((Object)((Component)val4).gameObject).name == "ShipLadder3" && WiderShipConfig.extendedSide.Value != 0)
						{
							val4.position = new Vector3(24.91f, -4.78f, 12.48f);
							((Component)val4).gameObject.GetComponent<OffMeshLink>().UpdatePositions();
						}
					}
					else if (((Object)((Component)val4).gameObject).name == "Cube (6)")
					{
						continue;
					}
					Object.Destroy((Object)(object)((Component)val4).gameObject);
				}
			}
			Object obj = WiderShipPlugin.mainAssetBundle.LoadAsset(GetNavmeshName() + ".prefab");
			GameObject val5 = Object.Instantiate<GameObject>((GameObject)(object)((obj is GameObject) ? obj : null), val.transform);
			val5.transform.position = Vector3.zero;
			foreach (Transform item3 in val2.transform)
			{
				Transform val6 = item3;
				if (Object.op_Implicit((Object)(object)((Component)val6).gameObject.GetComponent<NavMeshModifier>()))
				{
					((Component)val6).gameObject.SetActive(false);
				}
				else
				{
					val6.SetParent(val5.transform);
				}
			}
		}
	}
	public class ShipSidesMethods
	{
		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[] lampMaterials;

		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");
			lampMaterials = ((Renderer)GameObject.Find("Environment/HangarShip/ShipElectricLights/HangingLamp (3)").GetComponent<MeshRenderer>()).materials;
			bulbOnMaterial = lampMaterials[3];
			bulbOffMaterial = lampMaterials[0];
		}

		public static void DestroyStuff()
		{
			vanilaSI.SetActive(false);
			Object.Destroy((Object)(object)vanilaSR);
			Object.Destroy((Object)(object)vanilaSRP);
			Object.Destroy((Object)(object)vanilaCatwalk);
			Object.Destroy((Object)(object)vanilaCatwalkRLB);
			Object.Destroy((Object)(object)vanilaCatwalkRL);
			((Object)moddedPoster).name = ((Object)vanilaPosters).name;
			Object.Destroy((Object)(object)vanilaPosters);
		}

		public static void DisableAndSave()
		{
			WiderShipPlugin.windowGOs[0] = GameObject.Find("left_window");
			WiderShipPlugin.windowGOs[1] = GameObject.Find("right_window");
			WiderShipPlugin.windowGOs[2] = GameObject.Find("floor_window");
			WiderShipPlugin.vanilaGOs[0] = GameObject.Find("left_vanila");
			WiderShipPlugin.vanilaGOs[1] = GameObject.Find("right_vanila");
			WiderShipPlugin.vanilaGOs[2] = GameObject.Find("floor_vanila");
			GameObject[] windowGOs = WiderShipPlugin.windowGOs;
			foreach (GameObject val in windowGOs)
			{
				val.SetActive(false);
			}
		}

		public static void CreateShip()
		{
			switch (WiderShipConfig.extendedSide.Value)
			{
			case Side.Left:
				CreateLeftSide();
				break;
			case Side.Right:
				CreateRightSide();
				break;
			case Side.Both:
				CreateBothSides();
				break;
			}
			DisableAndSave();
			DestroyStuff();
		}

		public static void CreateLeftSide()
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0305: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0386: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_047b: Unknown result type (might be due to invalid IL or missing references)
			//IL_049f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_050b: Unknown result type (might be due to invalid IL or missing references)
			//IL_052f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = ObjMethods.CreateShipObj(vanilaSI, "ShipLeft.prefab", vanilaSI.layer, vanilaSI.tag);
			moddedPoster = ObjMethods.CreateShipObj(vanilaPosters, "Plane.001Left.fbx", vanilaPosters.layer, vanilaPosters.tag);
			val.transform.localPosition = Vector3.zero;
			moddedPoster.transform.localPosition = new Vector3(-8.34465E-07f, 2.157811f, -5.229f);
			Object.Destroy((Object)(object)GameObject.Find("HangarShip/Railing"));
			ObjMethods.MoveObjToPoint("LadderShort (1)", new Vector3(-6.93f, -2.58f, -16.156f), "Environment/HangarShip/");
			string[] array = new string[6] { "HangingLamp (3)", "HangingLamp (4)", "Area Light (4)", "Area Light (5)", "Area Light (8)", "Area Light (9)" };
			string[] array2 = array;
			foreach (string objName in array2)
			{
				GameObject obj = ObjMethods.CopyObj(objName, new Vector3(0f, 0f, -4.5f), "Environment/HangarShip/ShipElectricLights/");
				((Object)obj).name = ((Object)obj).name + "_left";
			}
			ObjMethods.MoveObjToPoint("ShipInnerRoomBoundsTrigger", new Vector3(1.4367f, 1.781f, -9.1742f), "Environment/HangarShip/");
			ObjMethods.ScaleObj("ShipInnerRoomBoundsTrigger", new Vector3(17.52326f, 5.341722f, 11f), "Environment/HangarShip/");
			ObjMethods.SetChildObjToParentObj("Pipework2.002", "SideMachineryLeft", "Environment/HangarShip/", "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("SideMachineryLeft", new Vector3(8.304f, 1.6f, -2.597f), "Environment/HangarShip/");
			ObjMethods.SetAnglesObj("SideMachineryLeft", new Vector3(180f, 90f, -90f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("GiantCylinderMagnet", new Vector3(-0.08f, 2.46f, -14.72f), "Environment/HangarShip/");
			string[] array3 = new string[2] { "ShipDoorClosed", "ShipDoorOpened" };
			string[] array4 = array3;
			foreach (string objName2 in array4)
			{
				ObjMethods.MoveObjToPoint(objName2, new Vector3(7.3f, 0f, -2.3f), "Environment/HangarShip/ReverbTriggers/");
				ObjMethods.ScaleObj(objName2, new Vector3(16f, 1.76f, 10.5f), "Environment/HangarShip/ReverbTriggers/");
			}
			ObjMethods.MoveObjToPoint("OutsideShip (1)", new Vector3(-2.519711f, 0f, -3.763971f), "Environment/HangarShip/ReverbTriggers/");
			ObjMethods.ScaleObj("OutsideShip (1)", new Vector3(2.4f, 1.7614f, 1.064288f), "Environment/HangarShip/ReverbTriggers/");
			ObjMethods.MoveObjToPoint("LeavingShip (2)", new Vector3(-5.030502f, 3.2812f, -1.4f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
			ObjMethods.ScaleObj("LeavingShip (2)", new Vector3(0.8544563f, 12.2338f, 15.21f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
			ObjMethods.MoveObjToPoint("LeavingShip (3)", new Vector3(-1.187546f, 3.2812f, -8.83f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
			ObjMethods.ScaleObj("LeavingShip (3)", new Vector3(5.967689f, 12.2338f, 0.8325825f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
			ObjMethods.MoveObjToPoint("VentEntrance", new Vector3(1.5f, 1f, -4.25f), "Environment/HangarShip/");
			ObjMethods.RotateObj("ChargeStation", Vector3.up, "Environment/HangarShip/ShipModels2b/", -61.5f);
			ObjMethods.MoveObjToPoint("ChargeStation", new Vector3(4.194f, 1.25f, -3.788f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.MoveObjToPoint("Light (3)", new Vector3(3f, 3.13f, -3.1f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.MoveObjToPoint("Light (1)", new Vector3(4.742f, 3.249997f, -10.823f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.RotateObj("Light (3)", Vector3.up, "Environment/HangarShip/ShipModels2b/", -85f);
			GameObject.Find("Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/LeavingShip (6)").SetActive(false);
			ObjMethods.MoveObjToPoint("LightSwitchContainer", new Vector3(1.5f, 2f, -4.25f), "Environment/HangarShip/");
			GameObject.Find("Environment/HangarShip/WallInsulator2").SetActive(false);
			ObjMethods.MoveObjToPoint("ShipBoundsTrigger", new Vector3(1.4908f, 4.1675f, -8f), "Environment/HangarShip/");
			ObjMethods.ScaleObj("ShipBoundsTrigger", new Vector3(23.75926f, 10.11447f, 14f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("HangarDoorButtonPanel", new Vector3(-5.59f, 2.188215f, -4.323f), "Environment/HangarShip/AnimatedShipDoor/");
			ObjMethods.SetAnglesObj("HangarDoorButtonPanel", new Vector3(90f, 0f, 0f), "Environment/HangarShip/AnimatedShipDoor/");
			ObjMethods.SetAnglesObj("SingleScreen", new Vector3(-90f, -90f, -28f), "Environment/HangarShip/ShipModels2b/MonitorWall/");
			ObjMethods.MoveObjToPoint("SingleScreen", new Vector3(-13.803f, -1.4f, -0.756f), "Environment/HangarShip/ShipModels2b/MonitorWall/");
		}

		public static void CreateBothSides()
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_020e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_044a: 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_0555: Unknown result type (might be due to invalid IL or missing references)
			//IL_0579: Unknown result type (might be due to invalid IL or missing references)
			//IL_059d: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0609: Unknown result type (might be due to invalid IL or missing references)
			//IL_062d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0651: Unknown result type (might be due to invalid IL or missing references)
			//IL_0675: Unknown result type (might be due to invalid IL or missing references)
			//IL_0699: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0705: Unknown result type (might be due to invalid IL or missing references)
			//IL_0729: Unknown result type (might be due to invalid IL or missing references)
			//IL_074d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0771: Unknown result type (might be due to invalid IL or missing references)
			//IL_0786: Unknown result type (might be due to invalid IL or missing references)
			//IL_07af: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_081b: Unknown result type (might be due to invalid IL or missing references)
			//IL_083f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = ObjMethods.CreateShipObj(vanilaSI, "ShipBoth.prefab", vanilaSI.layer, vanilaSI.tag);
			moddedPoster = ObjMethods.CreateShipObj(vanilaPosters, "Plane.001Both.fbx", vanilaPosters.layer, vanilaPosters.tag);
			val.transform.localPosition = Vector3.zero;
			moddedPoster.transform.localPosition = new Vector3(6.913f, 2.157811f, -9.453f);
			Object.Destroy((Object)(object)GameObject.Find("HangarShip/Railing"));
			string[] array = new string[2] { "ShipDoorClosed", "ShipDoorOpened" };
			string[] array2 = array;
			foreach (string objName in array2)
			{
				ObjMethods.MoveObjToPoint(objName, new Vector3(7.3f, 0f, -0.25f), "Environment/HangarShip/ReverbTriggers/");
				ObjMethods.ScaleObj(objName, new Vector3(16f, 1.76f, 15.5f), "Environment/HangarShip/ReverbTriggers/");
			}
			ObjMethods.MoveObjToPoint("OutsideShip (1)", new Vector3(-2.519711f, 0f, -3.763971f), "Environment/HangarShip/ReverbTriggers/");
			ObjMethods.ScaleObj("OutsideShip (1)", new Vector3(2.4f, 1.7614f, 1.064288f), "Environment/HangarShip/ReverbTriggers/");
			ObjMethods.MoveObjToPoint("OutsideShip (2)", new Vector3(2.304527f, 3.1895f, 8.89f), "Environment/HangarShip/ReverbTriggers/");
			ObjMethods.MoveObjToPoint("OutsideShip (3)", new Vector3(14.13f, 3.1895f, 6.08f), "Environment/HangarShip/ReverbTriggers/");
			ObjMethods.MoveObjToPoint("VentEntrance", new Vector3(-1.37f, 0.567f, 0.721f), "Environment/HangarShip/");
			ObjMethods.RotateObj("ChargeStation", Vector3.up, "Environment/HangarShip/ShipModels2b/", -60f);
			ObjMethods.MoveObjToPoint("ChargeStation", new Vector3(4.201f, 1.25f, -3.774f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.MoveObjToPoint("Light (3)", new Vector3(3f, 3.13f, -3.1f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.MoveObjToPoint("Light (1)", new Vector3(4.742f, 3.249997f, -10.823f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.RotateObj("Light (3)", Vector3.up, "Environment/HangarShip/ShipModels2b/", -85f);
			GameObject.Find("Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/LeavingShip (6)").SetActive(false);
			ObjMethods.MoveObjToPoint("LeavingShip (3)", new Vector3(-2.817f, 3.2812f, -5.797956f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
			ObjMethods.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);
			ObjMethods.MoveObjToPoint("ShipBoundsTrigger", new Vector3(1.4908f, 4.1675f, -6.73f), "Environment/HangarShip/");
			ObjMethods.ScaleObj("ShipBoundsTrigger", new Vector3(23.75926f, 10.11447f, 22f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("ShipInnerRoomBoundsTrigger", new Vector3(1.4367f, 1.781f, -6.661f), "Environment/HangarShip/");
			ObjMethods.ScaleObj("ShipInnerRoomBoundsTrigger", new Vector3(17.52326f, 5.341722f, 16f), "Environment/HangarShip/");
			string[] array3 = new string[6] { "HangingLamp (3)", "HangingLamp (4)", "Area Light (4)", "Area Light (5)", "Area Light (8)", "Area Light (7)" };
			string[] array4 = array3;
			foreach (string objName2 in array4)
			{
				GameObject obj = ObjMethods.CopyObj(objName2, new Vector3(0f, 0f, -4.5f), "Environment/HangarShip/ShipElectricLights/");
				((Object)obj).name = ((Object)obj).name + "_left";
			}
			array3 = new string[6] { "HangingLamp (3)", "HangingLamp (4)", "Area Light (4)", "Area Light (5)", "Area Light (8)", "Area Light (7)" };
			string[] array5 = array3;
			foreach (string objName3 in array5)
			{
				GameObject obj2 = ObjMethods.CopyObj(objName3, new Vector3(0f, 0f, 4.5f), "Environment/HangarShip/ShipElectricLights/");
				((Object)obj2).name = ((Object)obj2).name + "_right";
			}
			ObjMethods.SetChildObjToParentObj("Pipework2.002", "SideMachineryLeft", "Environment/HangarShip/", "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("SideMachineryLeft", new Vector3(8.304f, 1.6f, -2.597f), "Environment/HangarShip/");
			ObjMethods.SetAnglesObj("SideMachineryLeft", new Vector3(180f, 90f, -90f), "Environment/HangarShip/");
			ObjMethods.ScaleObj("SideMachineryLeft", new Vector3(0.5793436f, 0.4392224f, 0.1953938f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("GiantCylinderMagnet", new Vector3(-0.08f, 2.46f, -14.72f), "Environment/HangarShip/");
			ObjMethods.SetChildObjToParentObj("MeterBoxDevice.001", "SideMachineryRight", "Environment/HangarShip/", "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("SideMachineryRight", new Vector3(-4f, 1.947363f, 1.08f), "Environment/HangarShip/");
			ObjMethods.SetAnglesObj("SingleScreen", new Vector3(-90f, -90f, -28f), "Environment/HangarShip/ShipModels2b/MonitorWall/");
			ObjMethods.MoveObjToPoint("SingleScreen", new Vector3(-3.7253f, -1.017f, 1.9057f), "Environment/HangarShip/ShipModels2b/MonitorWall/");
			ObjMethods.MoveObjToPoint("Cube.005", new Vector3(5.027f, 3.469644f, -2.696f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("Cube.006", new Vector3(4.724743f, 3.469644f, -2.696f), "Environment/HangarShip/");
			ObjMethods.MoveObj("OutsideShipRoom", new Vector3(0f, 0f, 5f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("Light", new Vector3(-8.672f, 3.13f, -3.295f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.SetAnglesObj("Light", new Vector3(-90f, 0f, -120f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.MoveObjToPoint("Light (2)", new Vector3(-9.911f, 3.25f, -11.063f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.MoveObjToPoint("LeavingShip (1)", new Vector3(0.8309021f, 3.2812f, 11.34f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
			ObjMethods.MoveObjToPoint("LeavingShip (4)", new Vector3(13.72397f, 3.2812f, 12.72f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
			ObjMethods.MoveObjToPoint("CatwalkUnderneathSupports", new Vector3(-7.093815f, -0.1557276f, -2.39f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("ShipInnerRoomBoundsTrigger", new Vector3(1.4367f, 1.781f, -6.64f), "Environment/HangarShip/");
			ObjMethods.ScaleObj("ShipInnerRoomBoundsTrigger", new Vector3(17.52326f, 5.341722f, 16f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("Cube.005 (2)", new Vector3(-5.92f, 1.907f, -1.103f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.MoveObjToPoint("Cube.005 (1)", new Vector3(0.674f, 2.757f, -0.221f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.RotateObj("Cube.005 (1)", Vector3.up, "Environment/HangarShip/ShipModels2b/", 180f);
			ObjMethods.MoveObjToPoint("LadderShort (1)", new Vector3(-6.93f, -2.58f, -16.156f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("LadderShort", new Vector3(6.568f, -2.58f, 2f), "Environment/HangarShip/");
			ObjMethods.SetAnglesObj("LadderShort", new Vector3(0f, 120f, 0f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("HangarDoorButtonPanel", new Vector3(6.412f, 2.546f, -3.328f), "Environment/HangarShip/AnimatedShipDoor/");
			ObjMethods.SetAnglesObj("HangarDoorButtonPanel", new Vector3(90f, 0f, 0f), "Environment/HangarShip/AnimatedShipDoor/");
		}

		public static void CreateRightSide()
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_023c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Unknown result type (might be due to invalid IL or missing references)
			//IL_0338: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0376: Unknown result type (might be due to invalid IL or missing references)
			//IL_039a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03be: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_045b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = ObjMethods.CreateShipObj(vanilaSI, "ShipRight.prefab", vanilaSI.layer, vanilaSI.tag);
			moddedPoster = ObjMethods.CreateShipObj(vanilaPosters, "Plane.001Right.fbx", vanilaPosters.layer, vanilaPosters.tag);
			val.transform.localPosition = Vector3.zero;
			moddedPoster.transform.localPosition = new Vector3(6.913f, 2.157811f, -9.453f);
			Object.Destroy((Object)(object)GameObject.Find("HangarShip/Railing"));
			ObjMethods.MoveObjToPoint("Cube.005", new Vector3(5.027f, 3.469644f, -2.696f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("Cube.006", new Vector3(4.724743f, 3.469644f, -2.696f), "Environment/HangarShip/");
			string[] array = new string[2] { "ShipDoorClosed", "ShipDoorOpened" };
			string[] array2 = array;
			foreach (string objName in array2)
			{
				ObjMethods.MoveObjToPoint(objName, new Vector3(7.3f, 0f, 2.4f), "Environment/HangarShip/ReverbTriggers/");
				ObjMethods.ScaleObj(objName, new Vector3(16f, 1.76f, 10.5f), "Environment/HangarShip/ReverbTriggers/");
			}
			ObjMethods.MoveObj("OutsideShipRoom", new Vector3(0f, 0f, 5f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("Light", new Vector3(-8.672f, 3.13f, -3.295f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.SetAnglesObj("Light", new Vector3(-90f, 0f, -120f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.MoveObjToPoint("Light (2)", new Vector3(-9.911f, 3.25f, -11.063f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.MoveObjToPoint("LeavingShip (1)", new Vector3(0.8309021f, 3.2812f, 11.34f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
			ObjMethods.MoveObjToPoint("LeavingShip (4)", new Vector3(13.72397f, 3.2812f, 12.72f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
			ObjMethods.MoveObjToPoint("LeavingShip (2)", new Vector3(-5.030502f, 3.2812f, 2.8f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
			ObjMethods.ScaleObj("LeavingShip (2)", new Vector3(0.8544563f, 12.2338f, 15.21f), "Environment/HangarShip/ReverbTriggers/LeavingShipTriggers/HorizontalTriggers/");
			ObjMethods.MoveObjToPoint("OutsideShip (2)", new Vector3(2.304527f, 3.1895f, 8.89f), "Environment/HangarShip/ReverbTriggers/");
			ObjMethods.MoveObjToPoint("OutsideShip (3)", new Vector3(14.13f, 3.1895f, 6.08f), "Environment/HangarShip/ReverbTriggers/");
			ObjMethods.MoveObjToPoint("LadderShort", new Vector3(6.568f, -2.58f, 2f), "Environment/HangarShip/");
			ObjMethods.SetAnglesObj("LadderShort", new Vector3(0f, 120f, 0f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("Cube.005 (2)", new Vector3(-5.92f, 1.907f, -1.103f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.MoveObjToPoint("Cube.005 (1)", new Vector3(0.674f, 2.757f, -0.221f), "Environment/HangarShip/ShipModels2b/");
			ObjMethods.RotateObj("Cube.005 (1)", Vector3.up, "Environment/HangarShip/ShipModels2b/", 180f);
			ObjMethods.MoveObjToPoint("ShipBoundsTrigger", new Vector3(1.4908f, 4.1675f, -4.657f), "Environment/HangarShip/");
			ObjMethods.ScaleObj("ShipBoundsTrigger", new Vector3(23.75926f, 10.11447f, 14f), "Environment/HangarShip/");
			ObjMethods.MoveObjToPoint("ShipInnerRoomBoundsTrigger", new Vector3(1.4367f, 1.781f, -3.9242f), "Environment/HangarShip/");
			ObjMethods.ScaleObj("ShipInnerRoomBoundsTrigger", new Vector3(17.52326f, 5.341722f, 11f), "Environment/HangarShip/");
			GameObject.Find("Environment/HangarShip/WallInsulator").SetActive(false);
			string[] array3 = new string[6] { "HangingLamp (3)", "HangingLamp (4)", "Area Light (4)", "Area Light (5)", "Area Light (8)", "Area Light (7)" };
			string[] array4 = array3;
			foreach (string objName2 in array4)
			{
				GameObject obj = ObjMethods.CopyObj(objName2, new Vector3(0f, 0f, 4.5f), "Environment/HangarShip/ShipElectricLights/");
				((Object)obj).name = ((Object)obj).name + "_right";
			}
		}
	}
}
namespace WiderShipMod.Compatibility.ShipWindows
{
	internal class ShipWindowsCompat
	{
		public static GameObject window1;

		public static GameObject window2;

		public static GameObject window3;

		public static void RenamePosters()
		{
			GameObject val = GameObject.Find("Plane.001 (Old)");
			GameObject val2 = GameObject.Find("Plane.001");
			((Object)val).name = "Plane.001";
			((Object)val2).name = "Plane.001 (Old)";
			val2.SetActive(false);
			val.SetActive(true);
		}

		public static void MoveScaleRotate(GameObject window)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			ObjMethods.MoveObjToPoint(((Object)window).name, new Vector3(3.6188f, -3.9069f, 1.37f), "");
			ObjMethods.ScaleObj(((Object)window).name, new Vector3(1f, 0.3f, 1f), "");
			ObjMethods.SetAnglesObj(((Object)window).name, new Vector3(0f, 0f, 62.2f), "");
		}

		public static void ParentWindows(string name)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Expected O, but got Unknown
			GameObject val = GameObject.Find(name + "/WindowContainer");
			GameObject val2 = GameObject.Find("ShipInside/WindowContainer");
			if ((Object)(object)val == (Object)null)
			{
				val2.transform.SetParent(GameObject.Find(name ?? "").transform);
				return;
			}
			foreach (Transform item in val2.transform)
			{
				Transform val3 = item;
				bool flag = false;
				foreach (Transform item2 in val.transform)
				{
					Transform val4 = item2;
					if (((Object)val3).name == ((Object)val4).name)
					{
						flag = true;
						break;
					}
				}
				if (!flag)
				{
					val3.SetParent(val.transform);
				}
			}
		}

		public static void RemoveSWShip()
		{
			GameObject.Find("ShipInside").SetActive(false);
		}

		internal static GameObject GetShipGO()
		{
			return (GameObject)(WiderShipConfig.extendedSide.Value switch
			{
				Side.Left => GameObject.Find("ShipLeft(Clone)"), 
				Side.Right => GameObject.Find("ShipRight(Clone)"), 
				Side.Both => GameObject.Find("ShipBoth(Clone)"), 
				_ => null, 
			});
		}

		public static IEnumerator DoWindows()
		{
			try
			{
				window1 = GameObject.Find("Window1");
				window2 = GameObject.Find("Window2");
				window3 = GameObject.Find("Window3");
				GameObject ship = GetShipGO();
				ParentWindows(((Object)ship).name);
				if ((Object)(object)window1 != (Object)null)
				{
					WiderShipPlugin.windowGOs[0].SetActive(true);
					WiderShipPlugin.vanilaGOs[0].SetActive(false);
					WiderShipPlugin.mls.LogInfo((object)"window1 done!");
				}
				if ((Object)(object)window2 != (Object)null)
				{
					WiderShipPlugin.windowGOs[1].SetActive(true);
					WiderShipPlugin.vanilaGOs[1].SetActive(false);
					if (WiderShipConfig.extendedSide.Value != 0)
					{
						MoveScaleRotate(window2);
					}
					WiderShipPlugin.mls.LogInfo((object)"window2 done!");
				}
				if ((Object)(object)window3 != (Object)null)
				{
					WiderShipPlugin.windowGOs[2].SetActive(true);
					WiderShipPlugin.vanilaGOs[2].SetActive(false);
					WiderShipPlugin.mls.LogInfo((object)"window3 done!");
				}
			}
			catch
			{
				WiderShipPlugin.mls.LogError((object)"Imposter!!!");
			}
			RemoveSWShip();
			yield return (object)new WaitForEndOfFrame();
		}
	}
	internal class ShipWindowsPatches
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(ShipReplacer), "ReplaceShip")]
		public static void ReplaceShipPatch()
		{
			((MonoBehaviour)StartOfRound.Instance).StartCoroutine(ShipWindowsCompat.DoWindows());
			WiderShipPlugin.mls.LogMessage((object)"I'M ALIVE!!!");
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(ShipWindow), "OnStart")]
		public static void OnStartPatch()
		{
			if (WiderShipConfig.enableForceDontMovePosters.Value)
			{
				WindowConfig.dontMovePosters.Value = true;
			}
		}
	}
}