Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Wider Ship Mod v1.4.3
WiderShipMod.dll
Decompiled 10 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; 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 LethalConfig; using LethalConfig.ConfigItems; using ShipWindows; using ShipWindows.Api; using ShipWindows.Api.events; using ShipWindows.ShutterSwitch; using ShipWindows.Utilities; using Unity.AI.Navigation; using UnityEngine; using UnityEngine.AI; using WiderShipMod.Compatibility.CelestialTint; using WiderShipMod.Compatibility.LethalConfig; using WiderShipMod.Compatibility.ShipWindowsBeta; using WiderShipMod.Compatibility.TwoStoryShip; 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> enableLeftInnerWall; internal static ConfigEntry<bool> enableLeftInnerWallSolidMode; internal static ConfigEntry<bool> enableRightInnerWall; internal static ConfigEntry<bool> enableRightInnerWallSolidMode; internal static ConfigEntry<bool> enableBuildNewNavmesh; 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."); enableLeftInnerWall = cfg.Bind<bool>("Walls", "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>("Walls", "Solid Left Inner Wall", false, "Enable this if you want your wall to be solid. Doesn't work without Left Inner Wall enabled."); enableRightInnerWall = cfg.Bind<bool>("Walls", "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>("Walls", "Solid Right Inner Wall", false, "Enable this if you want your wall to be solid. Doesn't work without Left Inner Wall enabled."); 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."); blacklist = cfg.Bind<string>("Navmesh", "Moon Blacklist", "42 Cosmocos, 67 Utril", "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.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("mborsh.WiderShipMod", "WiderShipMod", "1.4.3")] public class WiderShipPlugin : BaseUnityPlugin { private const string modGUID = "mborsh.WiderShipMod"; private const string modName = "WiderShipMod"; private const string modVersion = "1.4.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("ainavt.lc.lethalconfig")) { LethalConfigCompat.LethalConfigSetup(); } 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?"); TwoStoryShip.Init(harmony); return; } if (Chainloader.PluginInfos.ContainsKey("TestAccount666.ShipWindows")) { mls.LogMessage((object)"Hi TestAccount666."); ShipWindowsUtils.RemoveRoofWindow(); harmony.PatchAll(typeof(ShipWindowsBetaPatches)); } if (Chainloader.PluginInfos.ContainsKey("CelestialTint")) { mls.LogMessage((object)"Celestial Tint found."); harmony.PatchAll(typeof(CelestialTintPatch)); } 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 { private static bool needBake; [HarmonyBefore(new string[] { "TestAccount666.ShipWindows", "TestAccount666.ShipWindowsBeta" })] [HarmonyPrefix] [HarmonyPatch(typeof(HUDManager), "Awake")] private static void HudManagerAwakePatch() { ShipSidesMethods.Init(); ShipSidesMethods.CreateShip(); } [HarmonyPrefix] [HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")] private static void FinishGeneratingLevelPrefix() { if (WiderShipConfig.enableBuildNewNavmesh.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() { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (WiderShipConfig.enableBuildNewNavmesh.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) && needBake) { GameObject.FindGameObjectWithTag("OutsideLevelNavMesh").GetComponent<NavMeshSurface>().BuildNavMesh(); GameObject val = GameObject.Find("ShipLadder3"); val.transform.position = new Vector3(7.3302f, 1.069f, -3.9058f); val.GetComponent<OffMeshLink>().UpdatePositions(); } else if (!source2.Contains(TimeOfDay.Instance.currentLevel.PlanetName)) { } } } [HarmonyTranspiler] [HarmonyPatch(typeof(RoundManager), "SpawnOutsideHazards")] private static IEnumerable<CodeInstruction> SpawnOutsideHazardsPatch(IEnumerable<CodeInstruction> instructions) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown MethodInfo methodInfo = AccessTools.Method(typeof(WiderShipPatches), "CaptureMethod", (Type[])null, (Type[])null); CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null); val.MatchEndForward((CodeMatch[])(object)new CodeMatch[1] { new CodeMatch((OpCode?)OpCodes.Ret, (object)null, (string)null) }).Insert((CodeInstruction[])(object)new CodeInstruction[2] { new CodeInstruction(OpCodes.Ldloc_S, (object)5), new CodeInstruction(OpCodes.Call, (object)methodInfo) }); return val.InstructionEnumeration(); } private static void CaptureMethod(int num2) { if (num2 <= 0) { needBake = true; } else { needBake = false; } } } 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 Walls { public static void CreateWalls() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) Side value = WiderShipConfig.extendedSide.Value; if ((value == Side.Left || value == Side.Both) && WiderShipConfig.enableLeftInnerWall.Value) { Object obj = WiderShipPlugin.mainAssetBundle.LoadAsset("wall_left.prefab"); GameObject val = Object.Instantiate<GameObject>((GameObject)(object)((obj is GameObject) ? obj : null), GameObject.Find("HangarShip").transform); ((Object)val).name = "wall_left"; if (WiderShipConfig.enableLeftInnerWallSolidMode.Value) { GameObject.Find("wall_left/Beams").SetActive(false); } else { GameObject.Find("wall_left/Wall").SetActive(false); } val.transform.localEulerAngles = new Vector3(0f, 180f, 0f); val.transform.localPosition = new Vector3(-6f, 0.952f, -5.224f); } if ((value == Side.Right || value == Side.Both) && !WiderShipPlugin.is2StoryHere && WiderShipConfig.enableRightInnerWall.Value) { Object obj2 = WiderShipPlugin.mainAssetBundle.LoadAsset("wall_right.prefab"); GameObject val2 = Object.Instantiate<GameObject>((GameObject)(object)((obj2 is GameObject) ? obj2 : null), GameObject.Find("HangarShip").transform); ((Object)val2).name = "wall_right"; if (WiderShipConfig.enableRightInnerWallSolidMode.Value) { GameObject.Find("wall_right/Beams").SetActive(false); } else { GameObject.Find("wall_right/Wall").SetActive(false); } val2.transform.localEulerAngles = new Vector3(0f, 180f, 0f); val2.transform.localPosition = new Vector3(-6f, 0.952f, -8.16f); } } } 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Expected O, but got Unknown //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Expected O, but got Unknown //IL_00d7: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("NavMeshColliders"); GameObject val2 = GameObject.Find("PlayerShipNavmesh"); if ((Object)(object)val == (Object)null) { val = ((Component)val2.transform.parent).gameObject; } 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")) { continue; } if (((Object)((Component)val4).gameObject).name == "ShipLadder3") { if (WiderShipConfig.extendedSide.Value != 0) { val4.position = new Vector3(24.91f, -4.78f, 12.48f); ((Component)val4).gameObject.GetComponent<OffMeshLink>().UpdatePositions(); } } else { 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>()) && ((Object)val6).name != "Cube (6)") { ((Component)val6).gameObject.SetActive(false); } else { val6.SetParent(val5.transform); } } if (!WiderShipConfig.enableLeftInnerWall.Value && WiderShipConfig.extendedSide.Value != Side.Right) { GameObject.Find(((Object)val5).name + "/PlayerShipNavmesh/left_wall_navmesh").SetActive(false); } if (!WiderShipConfig.enableRightInnerWall.Value && WiderShipConfig.extendedSide.Value != 0) { GameObject.Find(((Object)val5).name + "/PlayerShipNavmesh/right_wall_navmesh").SetActive(false); } } } 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() { ((Renderer)vanilaSI.GetComponent<MeshRenderer>()).enabled = false; ((Collider)vanilaSI.GetComponent<MeshCollider>()).enabled = 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; } Walls.CreateWalls(); DisableAndSave(); DestroyStuff(); } public static void CreateLeftSide() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_025d: 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_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: 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_041b: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0487: 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) GameObject val = ObjMethods.CreateShipObj(vanilaSI, "ShipLeft.prefab", vanilaSI.layer, vanilaSI.tag); moddedPoster = ObjMethods.CreateShipObj(vanilaPosters, "Plane.001Left.fbx", vanilaPosters.layer, vanilaPosters.tag); ((Object)val).name = "ShipLeft"; 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/"); 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[] array = new string[2] { "ShipDoorClosed", "ShipDoorOpened" }; string[] array2 = array; foreach (string objName in array2) { ObjMethods.MoveObjToPoint(objName, new Vector3(7.3f, 0f, -2.3f), "Environment/HangarShip/ReverbTriggers/"); ObjMethods.ScaleObj(objName, 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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) //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_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_0408: 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_046a: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_051e: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: 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_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_06e8: Unknown result type (might be due to invalid IL or missing references) //IL_070c: Unknown result type (might be due to invalid IL or missing references) //IL_0730: 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); ((Object)val).name = "ShipBoth"; 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/"); 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, 3.2079f, 0.8735f), "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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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) //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_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_0438: 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); ((Object)val).name = "ShipRight"; 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, 3.2079f, 0.8735f), "Environment/HangarShip/ShipModels2b/"); ObjMethods.RotateObj("Cube.005 (1)", Vector3.up, "Environment/HangarShip/ShipModels2b/", 180f); ObjMethods.MoveObjToPoint("ShipBoundsTrigger", new Vector3(1.4908f, 4.1675f, -4.157f), "Environment/HangarShip/"); ObjMethods.ScaleObj("ShipBoundsTrigger", new Vector3(23.75926f, 10.11447f, 14f), "Environment/HangarShip/"); ObjMethods.MoveObjToPoint("ShipInnerRoomBoundsTrigger", new Vector3(1.4367f, 1.781f, -4.1242f), "Environment/HangarShip/"); ObjMethods.ScaleObj("ShipInnerRoomBoundsTrigger", new Vector3(17.52326f, 5.341722f, 11f), "Environment/HangarShip/"); GameObject.Find("Environment/HangarShip/WallInsulator").SetActive(false); ObjMethods.SetChildObjToParentObj("MeterBoxDevice.001", "SideMachineryRight", "Environment/HangarShip/", "Environment/HangarShip/"); ObjMethods.MoveObjToPoint("SideMachineryRight", new Vector3(-4f, 1.947363f, 1.08f), "Environment/HangarShip/"); } } } namespace WiderShipMod.Compatibility { internal static class CompatibilityUtilities { internal static bool IsInstalledVersionGreaterOrEquallThanNeeded(string guid, Version version) { PluginInfo value; return Chainloader.PluginInfos.TryGetValue(guid, out value) && value.Metadata.Version >= version; } } } namespace WiderShipMod.Compatibility.TwoStoryShip { internal class TwoStoryShip { internal static void Init(Harmony h) { h.PatchAll(typeof(TwoStoryShip)); } [HarmonyPrefix] [HarmonyPatch(typeof(StartOfRound), "Start")] private static void TwoStoryShipStartPatch() { Walls.CreateWalls(); } } } namespace WiderShipMod.Compatibility.ShipWindowsBeta { internal class ShipWindowsUtils { internal static void RemoveRoofWindow() { foreach (WindowInfo window in ShipWindows.windowRegistry.Windows) { WiderShipPlugin.mls.LogMessage((object)(window.windowName + ", " + window.windowType)); if (window.windowName == "Roof Window") { ShipWindows.windowRegistry.UnregisterWindow(window); break; } } } } internal class ShipWindowsBetaPatches { internal static GameObject ShipWindowsBetaCompatScriptGO; [HarmonyBefore(new string[] { "TestAccount666.ShipWindows", "TestAccount666.ShipWindowsBeta" })] [HarmonyPostfix] [HarmonyPatch(typeof(HUDManager), "Awake")] internal static void HudManagerAwake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown ShipWindowsBetaCompatScriptGO = new GameObject("WiderShipCompatGO"); ShipWindowsBetaCompatScriptGO.AddComponent<ShipWindowsBetaCompatScript>(); ((Object)ShipWindowsBetaCompatScriptGO).hideFlags = (HideFlags)61; } [HarmonyAfter(new string[] { "TestAccount666.ShipWindows", "TestAccount666.ShipWindowsBeta" })] [HarmonyPostfix] [HarmonyPatch(/*Could not decode attribute arguments.*/)] internal static void DeactivateShipWindowsShip(ref WindowManager __instance) { ((MonoBehaviour)StartOfRound.Instance).StartCoroutine(DeactivateShipWindowsShipCoroutine()); } private static IEnumerator DeactivateShipWindowsShipCoroutine() { yield return null; ((Component)ShipWindows.windowManager.decapitatedShip.transform.Find("Door")).gameObject.SetActive(false); ((Component)ShipWindows.windowManager.decapitatedShip.transform.Find("Roof")).gameObject.SetActive(false); ((Component)ShipWindows.windowManager.decapitatedShip.transform.Find("SideBack")).gameObject.SetActive(false); Transform transfromToCheck3 = ShipWindows.windowManager.decapitatedShip.transform.Find("Floor"); if (((Component)transfromToCheck3).gameObject.activeSelf) { ((Component)transfromToCheck3).gameObject.SetActive(false); WiderShipPlugin.windowGOs[2].SetActive(false); WiderShipPlugin.vanilaGOs[2].SetActive(true); } transfromToCheck3 = ShipWindows.windowManager.decapitatedShip.transform.Find("SideLeft"); if (((Component)transfromToCheck3).gameObject.activeSelf) { ((Component)transfromToCheck3).gameObject.SetActive(false); WiderShipPlugin.windowGOs[0].SetActive(false); WiderShipPlugin.vanilaGOs[0].SetActive(true); } transfromToCheck3 = ShipWindows.windowManager.decapitatedShip.transform.Find("SideRight"); if (((Component)transfromToCheck3).gameObject.activeSelf) { ((Component)transfromToCheck3).gameObject.SetActive(false); WiderShipPlugin.windowGOs[1].SetActive(false); WiderShipPlugin.vanilaGOs[1].SetActive(true); } } [HarmonyPostfix] [HarmonyPatch(typeof(StartOfRound), "OnDestroy")] internal static void StartOfRoundOnDestroy() { Object.Destroy((Object)(object)ShipWindowsBetaCompatScriptGO); } [HarmonyPostfix] [HarmonyPatch(typeof(ShutterSwitchBehavior), "Awake")] internal static void ShutterSwitchBehaviorAwake() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (WiderShipConfig.extendedSide.Value == Side.Right || WiderShipConfig.extendedSide.Value == Side.Both) { ((Component)((Component)ShutterSwitchBehavior.Instance).transform.parent).GetComponent<AutoParentToShip>().positionOffset = new Vector3(-0.75f, 2.12f, 0.73f); } } } internal class ShipWindowsBetaCompatScript : MonoBehaviour { internal static GameObject GetShipGO() { return (GameObject)(WiderShipConfig.extendedSide.Value switch { Side.Left => GameObject.Find("ShipLeft"), Side.Right => GameObject.Find("ShipRight"), Side.Both => GameObject.Find("ShipBoth"), _ => null, }); } private void Awake() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown GameObject shipGO = GetShipGO(); ((Component)this).transform.SetParent(shipGO.transform); EventAPI.AfterWindowSpawned += new WindowEvent(HandleAfterWindowSpawn); } internal void HandleAfterWindowSpawn(WindowEventArguments arguments) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) WiderShipPlugin.mls.LogInfo((object)("window name = " + arguments.windowInfo.windowName)); WiderShipPlugin.mls.LogInfo((object)("window type = " + arguments.windowInfo.windowType)); string windowType = arguments.windowInfo.windowType; Transform transform = arguments.windowObject.transform; Transform val = null; if (windowType == "Door") { return; } val = transform.Find("Window"); foreach (Transform item in transform) { Transform val2 = item; if ((Object)(object)val2 != (Object)(object)val) { ((Component)val2).gameObject.SetActive(false); } } if (windowType == "SideRight") { WiderShipPlugin.windowGOs[1].SetActive(true); WiderShipPlugin.vanilaGOs[1].SetActive(false); if (WiderShipConfig.extendedSide.Value == Side.Right || WiderShipConfig.extendedSide.Value == Side.Both) { val.localPosition = new Vector3(5.367f, -0.975f, -0.143f); val.localScale = new Vector3(0.01f, 0.01f, 0.003f); val.localEulerAngles = new Vector3(-22.124f, -90f, -90f); } } if (windowType == "SideLeft") { WiderShipPlugin.windowGOs[0].SetActive(true); WiderShipPlugin.vanilaGOs[0].SetActive(false); } if (windowType == "Floor") { WiderShipPlugin.windowGOs[2].SetActive(true); WiderShipPlugin.vanilaGOs[2].SetActive(false); } } private void OnDisable() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown EventAPI.AfterWindowSpawned -= new WindowEvent(HandleAfterWindowSpawn); } } } namespace WiderShipMod.Compatibility.LethalConfig { internal class LethalConfigCompat { internal static void LethalConfigSetup() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown EnumDropDownConfigItem<Side> val = new EnumDropDownConfigItem<Side>(WiderShipConfig.extendedSide); BoolCheckBoxConfigItem val2 = new BoolCheckBoxConfigItem(WiderShipConfig.enableLeftInnerWall); BoolCheckBoxConfigItem val3 = new BoolCheckBoxConfigItem(WiderShipConfig.enableLeftInnerWallSolidMode); BoolCheckBoxConfigItem val4 = new BoolCheckBoxConfigItem(WiderShipConfig.enableRightInnerWall); BoolCheckBoxConfigItem val5 = new BoolCheckBoxConfigItem(WiderShipConfig.enableRightInnerWallSolidMode); BoolCheckBoxConfigItem val6 = new BoolCheckBoxConfigItem(WiderShipConfig.enableBuildNewNavmesh); TextInputFieldConfigItem val7 = new TextInputFieldConfigItem(WiderShipConfig.whitelist); TextInputFieldConfigItem val8 = new TextInputFieldConfigItem(WiderShipConfig.blacklist); TextInputFieldConfigItem val9 = new TextInputFieldConfigItem(WiderShipConfig.example); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val2); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val3); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val4); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val5); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val6); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val7); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val8); LethalConfigManager.AddConfigItem((BaseConfigItem)(object)val9); } } } namespace WiderShipMod.Compatibility.CelestialTint { internal class CelestialTintPatch { private static List<GameObject> go = new List<GameObject>(); [HarmonyPostfix] [HarmonyPatch(typeof(ShipPartsLoader), "ActivateSpaceProps")] private static void ShipPartsLoaderPatch(ref List<GameObject> ___spacePropsCopies, ref List<string> ___propNames) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) GameObject val = null; GameObject val2 = null; for (int i = 0; i < ___spacePropsCopies.Count; i++) { if (go.Count < ___spacePropsCopies.Count) { go.Add(GameObject.Find(___propNames[i])); } if (___propNames[i] == "SideMachineryRight") { val = ___spacePropsCopies[i]; } if (___propNames[i] == "MeterBoxDevice.001") { val2 = ___spacePropsCopies[i]; } ___spacePropsCopies[i].transform.position = go[i].transform.position; ___spacePropsCopies[i].transform.localScale = go[i].transform.localScale; ___spacePropsCopies[i].transform.rotation = go[i].transform.rotation; } val2.transform.SetParent(val.transform); } } }