Decompiled source of ShaderLivFix v1.0.1

Mods/ShaderLivFix.dll

Decompiled 5 days ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using Il2CppLIV.SDK.Unity;
using MelonLoader;
using Microsoft.CodeAnalysis;
using RumbleModdingAPI;
using ShaderLivFix;
using StaticLIVCamera;
using UnityEngine;

[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), "Shader Liv Fix", "1.0.0", "ERROR", null)]
[assembly: MelonGame("Buckethead Entertainment", "RUMBLE")]
[assembly: MelonColor(255, 255, 0, 0)]
[assembly: MelonAuthorColor(255, 255, 0, 0)]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: VerifyLoaderVersion(0, 6, 2, true)]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b10c94a1-8a40-4701-bc5b-98eabb44dfea")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("ShaderLivFix")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ShaderLivFix")]
[assembly: AssemblyTitle("ShaderLivFix")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace ShaderLivFix
{
	public class ShaderLivFix : CameraMode
	{
		[Obsolete]
		public ShaderLivFix(string name, string description, bool isModeEnabled)
			: base(name, description, isModeEnabled)
		{
		}

		public override void OnEnteringMode()
		{
		}

		public override void OnExitingMode()
		{
		}

		public override void OnUpdate()
		{
			//IL_0044: 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)
			try
			{
				Transform child = ((Component)Players.GetLocalPlayer().Controller).transform.GetChild(1).GetChild(0).GetChild(0);
				((Component)((Component)Players.GetLocalPlayer().Controller).transform.GetChild(8)).GetComponent<LIV>().render.SetPose(child.position, child.rotation, 80f, false);
			}
			catch
			{
			}
		}
	}
	public class Main : MelonMod
	{
		private string currentScene = "Loader";

		private bool modeAdded = false;

		public override void OnLateInitializeMelon()
		{
			Calls.onMapInitialized += Initialize;
		}

		private void Initialize()
		{
			if (currentScene == "Gym" && !modeAdded)
			{
				StaticCamera.cameraModes.Add((CameraMode)(object)new ShaderLivFix("Shader Liv Fix", "A simple fix that resolves shader issues in default mode.", isModeEnabled: true));
				modeAdded = true;
			}
		}

		public override void OnSceneWasLoaded(int buildIndex, string sceneName)
		{
			currentScene = sceneName;
		}
	}
}