using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using MelonLoader;
using RumbleDarkMode;
using RumbleModdingAPI;
using UnityEngine;
using UnityEngine.Rendering;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Main), "Rumble Dark Mode", "1.0.1", "ERROR", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 255, 0, 0)]
[assembly: MelonAuthorColor(255, 255, 0, 0)]
[assembly: AssemblyTitle("RumbleDarkMode")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Rumble Dark Mode")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: VerifyLoaderVersion(0, 6, 2, true)]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b10c94a1-8a40-4701-bc5b-98eabb44dfea")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace RumbleDarkMode;
public class Main : MelonMod
{
private string currentScene = "Loader";
public override void OnLateInitializeMelon()
{
Calls.onMapInitialized += OnMapInitialized;
}
public override void OnSceneWasLoaded(int buildIndex, string sceneName)
{
currentScene = sceneName;
}
private void OnMapInitialized()
{
if (currentScene == "Gym" || currentScene == "Park")
{
Initialize();
}
}
private void Initialize()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Expected O, but got Unknown
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
RenderSettings.ambientMode = (AmbientMode)1;
RenderSettings.ambientIntensity = 1f;
RenderSettings.defaultReflectionMode = (DefaultReflectionMode)0;
RenderSettings.fogColor = Color.black;
Light[] array = Il2CppArrayBase<Light>.op_Implicit(Object.FindObjectsOfType<Light>());
Light[] array2 = array;
foreach (Light val in array2)
{
val.cullingMask = -1;
}
Renderer[] array3 = Il2CppArrayBase<Renderer>.op_Implicit(Object.FindObjectsOfType<Renderer>());
Renderer[] array4 = array3;
foreach (Renderer val2 in array4)
{
val2.lightProbeUsage = (LightProbeUsage)0;
val2.reflectionProbeUsage = (ReflectionProbeUsage)0;
val2.lightmapIndex = -1;
}
GameObject val3 = new GameObject("Moonlight");
Light val4 = val3.AddComponent<Light>();
val4.type = (LightType)1;
val4.intensity = 0.1f;
val4.color = new Color(0.72f, 0.8084f, 0.9344f);
val3.transform.rotation = Quaternion.Euler(42.8454f, 0f, 0f);
Material skybox = RenderSettings.skybox;
if ((Object)(object)skybox != (Object)null)
{
skybox.SetFloat("_Exposure", 0.2f);
}
if (currentScene == "Gym")
{
FTraceLightmaps.GetGameObject().SetActive(false);
DirectionalLight.GetGameObject().GetComponent<Light>().intensity = 0f;
Probes.GetGameObject().SetActive(false);
}
else if (currentScene == "Park")
{
FTraceLightMaps.GetGameObject().SetActive(false);
DirectionalLight.GetGameObject().GetComponent<Light>().intensity = 0f;
Probes.GetGameObject().SetActive(false);
}
}
}