Decompiled source of Rumble LIV Camera Enabler v2.0.1

Mods/LIVCameraEnabler.dll

Decompiled 5 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Il2CppRUMBLE.Utilities;
using LIV_Camera_Enabler;
using MelonLoader;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(LIVCameraStart), "LIV Camera Enabler", "2.0.1", "UlvakSkillz", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 195, 0, 255)]
[assembly: MelonAuthorColor(255, 195, 0, 255)]
[assembly: VerifyLoaderVersion(0, 6, 2, true)]
[assembly: AssemblyTitle("LIV Camera Enabler")]
[assembly: AssemblyDescription("Start playing Rumble with the F10 Camera Active")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LIV Camera Enabler")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("ce5c6056-f5fe-45d6-92f5-42037a30db8f")]
[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 LIV_Camera_Enabler;

public class LIVCameraStart : MelonMod
{
	private string currentScene = "";

	private bool sceneChanged = false;

	private RecordingCamera playerLIV;

	public override void OnFixedUpdate()
	{
		if (!sceneChanged || !(currentScene != "") || !(currentScene != "Loader"))
		{
			return;
		}
		if (IsProcessRunning("capture"))
		{
			try
			{
				playerLIV = Singleton<RecordingCamera>.instance;
				playerLIV.OnModernRecordingCameraEnabledChanged(true);
				playerLIV.SaveConfiguration();
				sceneChanged = false;
				return;
			}
			catch
			{
				return;
			}
		}
		sceneChanged = false;
	}

	public override void OnSceneWasLoaded(int buildIndex, string sceneName)
	{
		((MelonMod)this).OnSceneWasLoaded(buildIndex, sceneName);
		currentScene = sceneName;
		sceneChanged = true;
	}

	private static bool IsProcessRunning(string processName)
	{
		return Process.GetProcessesByName(processName).Length != 0;
	}
}