Decompiled source of ReduceAnimation v1.3.1

plugins/ReduceAnimation.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.NET.Common;
using BepInExResoniteShim;
using FrooxEngine;
using FrooxEngine.UIX;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v9.0", FrameworkDisplayName = ".NET 9.0")]
[assembly: AssemblyCompany("eia485")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.3.1.0")]
[assembly: AssemblyInformationalVersion("1.3.1+acb53d7d31f0414b615a8809a5abadf10607286f")]
[assembly: AssemblyProduct("ReduceAnimation")]
[assembly: AssemblyTitle("ReduceAnimation")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/EIA485/NeosReduceAnimation")]
[assembly: AssemblyVersion("1.3.1.0")]
[module: RefSafetyRules(11)]
namespace ReduceAnimation;

[ResonitePlugin("net.eia485.ReduceAnimation", "ReduceAnimation", "1.3.1", "eia485", "https://github.com/EIA485/NeosReduceAnimation")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class ReduceAnimation : BasePlugin
{
	[HarmonyPatch]
	private class ReduceAnimationPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(RadiantDash), "OnDashSettingsUpdated")]
		private static void RadiantDashOnDashSettingsUpdatedPostfix(RadiantDash __instance)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			RadiantDash __instance2 = __instance;
			((ComponentBase<Component>)(object)__instance2).RunSynchronously((Action)delegate
			{
				((SyncField<float>)(object)__instance2.AnimationSpeed).Value = 3.4028235E+38f;
			}, false);
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(SlideSwapRegion), "Swap")]
		private static void SlideSwapRegionSwapPrefix(ref float duration)
		{
			duration = 0f;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(LegacySwapCanvasPanel), "SwapPanel")]
		private static void NeosSwapCanvasPanelSwapPanelPrefix(ref float duration)
		{
			duration = 0f;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(RadiantDash), "OnCommonUpdate")]
		private static void ModalOverlayOnAwakePostfix(RadiantDash __instance, ref float ____screenLerp, ref RadiantDashScreen ____previousScreen, RadiantDashScreen ____currentScreen)
		{
			if (____previousScreen != null)
			{
				____screenLerp = 0f;
				____previousScreen.Hide();
				____previousScreen = null;
			}
			if (____currentScreen != null)
			{
				((MethodBase)PositionScreen).Invoke((object)__instance, new object[3] { ____currentScreen, 0f, 0f });
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(ModalOverlay), "OnAwake")]
		private static void ModalOverlayOnAwakePostfix(ModalOverlay __instance)
		{
			((SyncField<float>)(object)__instance.AnimationTime).Value = 0f;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(LegacyWorldDetail), "OnChanges")]
		private static void WorldDetailOnChangesPostfix(LegacyWorldDetail __instance, ref float ____expandLerp, ref float ____compactDetailLerp)
		{
			____expandLerp = (((SyncField<bool>)(object)__instance.Expanded).Value ? 1f : 0f);
			____compactDetailLerp = (((SyncField<bool>)(object)__instance.CompactDetailExpanded).Value ? 1f : 0f);
		}
	}

	private static MethodInfo PositionScreen = AccessTools.Method(typeof(RadiantDash), "PositionScreen", (global::System.Type[])null, (global::System.Type[])null);

	public override void Load()
	{
		((BasePlugin)this).HarmonyInstance.PatchAll();
	}
}
public static class PluginMetadata
{
	public const string GUID = "net.eia485.ReduceAnimation";

	public const string NAME = "ReduceAnimation";

	public const string VERSION = "1.3.1";

	public const string AUTHORS = "eia485";

	public const string REPOSITORY_URL = "https://github.com/EIA485/NeosReduceAnimation";
}