using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BoneLib.BoneMenu;
using BoneLib.BoneMenu.Elements;
using CutContentEnabler;
using MelonLoader;
using UnhollowerBaseLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: MelonInfo(typeof(CCEClass), "CutContentEnabler", "1.0.0", "Gman", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace CutContentEnabler;
public class CCEClass : MelonMod
{
public static string SceneLoaded = "scenenamegoesherelmao";
private static MenuCategory ccecategory;
public bool JumpChamberEnabled;
public bool DEBUGCUBESEnabled;
public bool recursionChamberEnabled;
public bool ViaductEnabled;
public override void OnInitializeMelon()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
MelonLogger.Msg("Cut Content Enabler Initialized");
ccecategory = MenuManager.CreateCategory("Cut Content", Color.white);
ccecategory.CreateFunctionElement("You must refresh the list each new level load.", Color.yellow, (Action)null);
ccecategory.CreateFunctionElement("Refresh", Color.white, (Action)RefreshContentList);
}
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
{
SceneLoaded = sceneName;
}
public GameObject FindGameObject(string GameObjectName)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
Il2CppArrayBase<GameObject> obj = Object.FindObjectsOfType<GameObject>(true);
GameObject result = new GameObject();
foreach (GameObject item in obj)
{
if (((Object)item).name == GameObjectName)
{
result = item;
}
if (((Object)item).name == null)
{
MelonLogger.LogError("ERROR! GameObject Name Cannot be null!");
}
}
return result;
}
public void RefreshContentList()
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
ccecategory.Elements.Clear();
ccecategory.CreateFunctionElement("Refresh", Color.white, (Action)RefreshContentList);
if (SceneLoaded == "75e60b3b6ed5d2b40936822f4520ed8e")
{
ccecategory.CreateFunctionElement($"Toggle Jump Chamber ({JumpChamberEnabled})", Color.white, (Action)delegate
{
ToggleJumpChamber();
});
}
if (SceneLoaded == "a2bf0f278bce2fd44830cabe9085032a")
{
ccecategory.CreateFunctionElement($"Toggle Gravity Cubes ({DEBUGCUBESEnabled})", Color.white, (Action)delegate
{
ToggleDEBUGCUBES();
});
}
if (SceneLoaded == "1378bdcaf9526974d98cc23b94c6ab5c")
{
ccecategory.CreateFunctionElement($"Toggle Recursion Chamber ({recursionChamberEnabled})", Color.white, (Action)delegate
{
TogglerecursionChamber();
});
}
if (SceneLoaded == "5435108e33b5ca0499dd1195f53d7e52")
{
ccecategory.CreateFunctionElement($"Toggle Viaduct ({ViaductEnabled})", Color.white, (Action)delegate
{
ToggleViaduct();
});
}
}
private void ToggleJumpChamber()
{
if (JumpChamberEnabled)
{
JumpChamberEnabled = false;
DisableJumpChamber();
}
else
{
JumpChamberEnabled = true;
EnableJumpChamber();
}
RefreshContentList();
}
private void ToggleDEBUGCUBES()
{
if (DEBUGCUBESEnabled)
{
DEBUGCUBESEnabled = false;
DisableDEBUGCUBES();
}
else
{
DEBUGCUBESEnabled = true;
EnableDEBUGCUBES();
}
RefreshContentList();
}
private void TogglerecursionChamber()
{
if (recursionChamberEnabled)
{
recursionChamberEnabled = false;
DisablerecursionChamber();
}
else
{
recursionChamberEnabled = true;
EnablerecursionChamber();
}
RefreshContentList();
}
private void ToggleViaduct()
{
if (ViaductEnabled)
{
ViaductEnabled = false;
EnableViaduct();
}
else
{
ViaductEnabled = true;
DisableViaduct();
}
RefreshContentList();
}
private void EnableJumpChamber()
{
FindGameObject("JUMP_CHAMBER").SetActive(true);
}
private void DisableJumpChamber()
{
FindGameObject("JUMP_CHAMBER").SetActive(false);
}
private void EnableDEBUGCUBES()
{
FindGameObject("DEBUG").SetActive(true);
}
private void DisableDEBUGCUBES()
{
FindGameObject("DEBUG").SetActive(false);
}
private void EnablerecursionChamber()
{
FindGameObject("recursionChamber").SetActive(true);
}
private void DisablerecursionChamber()
{
FindGameObject("recursionChamber").SetActive(false);
}
private void EnableViaduct()
{
FindGameObject("Viaduct_A").SetActive(true);
}
private void DisableViaduct()
{
FindGameObject("Viaduct_A").SetActive(false);
}
}