using System.Diagnostics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSLZ.Utilities;
using MelonLoader;
using ShowHolodecks;
using UnityEngine;
using UnityEngine.SceneManagement;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("ShowHolodecks")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany(null)]
[assembly: AssemblyProduct("ShowHolodecks")]
[assembly: AssemblyCopyright("Created by yellowyears")]
[assembly: AssemblyTrademark(null)]
[assembly: ComVisible(false)]
[assembly: AssemblyFileVersion("1.1.0")]
[assembly: NeutralResourcesLanguage("en")]
[assembly: MelonInfo(typeof(global::ShowHolodecks.ShowHolodecks), "ShowHolodecks", "1.1.0", "yellowyears", "https://bonelab.thunderstore.io/package/yellowyears/ShowHolodecks/")]
[assembly: MelonGame(null, null)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.1.0.0")]
namespace ShowHolodecks;
public static class BuildInfo
{
public const string Name = "ShowHolodecks";
public const string Author = "yellowyears";
public const string Company = null;
public const string Version = "1.1.0";
public const string DownloadLink = "https://bonelab.thunderstore.io/package/yellowyears/ShowHolodecks/";
}
internal class ShowHolodecks : MelonMod
{
private const string TargetSceneName = "scene_BoneLab_Hub_Lab_Floor";
private const string TargetRootName = "//-----ENVIRONMENT";
private const string TargetObjectName = "HOLODECKS";
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
{
if (!(sceneName != "scene_BoneLab_Hub_Lab_Floor"))
{
MelonLogger.Msg("BONELAB Hub loaded: Activating HoloDecks");
ActivateHolodecks();
}
}
private void ActivateHolodecks()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
Il2CppReferenceArray<GameObject> sceneRootGameObjects = GetSceneRootGameObjects("scene_BoneLab_Hub_Lab_Floor");
GameObject val = new GameObject();
foreach (GameObject item in (Il2CppArrayBase<GameObject>)(object)sceneRootGameObjects)
{
((Il2CppObjectBase)item).Cast<GameObject>();
if (((Object)item).name != "//-----ENVIRONMENT")
{
continue;
}
val = GetObjectInChildren("HOLODECKS", item);
break;
}
val.SetActive(true);
ModifyChildGameObjects(val);
}
private static void ModifyChildGameObjects(GameObject targetObject)
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: 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: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
Il2CppArrayBase<SkinnedMeshRenderer> componentsInChildren = targetObject.GetComponentsInChildren<SkinnedMeshRenderer>();
foreach (SkinnedMeshRenderer item in componentsInChildren)
{
Transform parent = ((Component)item).transform.parent;
Vector3 localPosition = parent.localPosition;
parent.localPosition = ((((Object)parent).name == "Holodeck_walls_05") ? new Vector3(-25.1f, -3.1f, localPosition.z) : new Vector3(parent.localPosition.x, -3.1f, localPosition.z));
}
GenericTrigger componentInChildren = targetObject.GetComponentInChildren<GenericTrigger>();
GameObject gameObject = ((Component)componentInChildren).gameObject;
gameObject.layer = LayerMask.NameToLayer("EntityTrigger");
componentInChildren.LayerFilter = LayerMask.op_Implicit(LayerMask.GetMask(new string[1] { "Player" }));
((Component)componentInChildren).tag = "";
}
private static Il2CppReferenceArray<GameObject> GetSceneRootGameObjects(string sceneName)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
Scene sceneByName = SceneManager.GetSceneByName(sceneName);
return ((Scene)(ref sceneByName)).GetRootGameObjects();
}
private static GameObject GetObjectInChildren(string targetObjectName, GameObject parentGameObject)
{
for (int i = 0; i < parentGameObject.transform.GetChildCount(); i++)
{
Transform child = parentGameObject.transform.GetChild(i);
if (((Object)child).name == targetObjectName)
{
return ((Component)child).gameObject;
}
}
return null;
}
}