Decompiled source of TrackerModelSwapper v2.0.0

plugins/TrackerModelSwapper/TrackerModelSwapper.dll

Decompiled a day ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using BepInEx.NET.Common;
using BepInExResoniteShim;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v10.0", FrameworkDisplayName = ".NET 10.0")]
[assembly: AssemblyCompany("art0007i")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: AssemblyInformationalVersion("2.0.0+436bdedf882300d2add9642049487754e1878840")]
[assembly: AssemblyProduct("TrackerModelSwapper")]
[assembly: AssemblyTitle("TrackerModelSwapper")]
[assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/art0007i/TrackerModelSwapper")]
[assembly: AssemblyVersion("2.0.0.0")]
[module: RefSafetyRules(11)]
namespace TrackerModelSwapper;

[ResonitePlugin("art0007i.TrackerModelSwapper", "TrackerModelSwapper", "2.0.0", "art0007i", "https://github.com/art0007i/TrackerModelSwapper")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class Plugin : BasePlugin
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static EventHandler <>9__3_0;

		internal void <Load>b__3_0(object? _, EventArgs _)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			vive_model.SetValue((object)null, (object)new Uri(TrackerModel.Value, (UriKind)1));
		}
	}

	internal static ManualLogSource Log;

	internal static ConfigEntry<string> TrackerModel;

	public static FieldInfo vive_model = AccessTools.Field(typeof(SteamVR), "__uri_vr_tracker_vive_1_0");

	public override void Load()
	{
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: Expected O, but got Unknown
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Expected O, but got Unknown
		Log = ((BasePlugin)this).Log;
		TrackerModel = ((BasePlugin)this).Config.Bind<string>("General", "TrackerModel", "resdb:///a421748d183ed60f8ea767b85ff7d0c7351b3a611ab04887aac4b5f2a0a500d3.7zbson", "The URL pointing towards your tracker model.");
		vive_model.SetValue((object)null, (object)new Uri(TrackerModel.Value, (UriKind)1));
		ConfigEntry<string> trackerModel = TrackerModel;
		object obj = <>c.<>9__3_0;
		if (obj == null)
		{
			EventHandler val = delegate
			{
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Expected O, but got Unknown
				vive_model.SetValue((object)null, (object)new Uri(TrackerModel.Value, (UriKind)1));
			};
			<>c.<>9__3_0 = val;
			obj = (object)val;
		}
		trackerModel.SettingChanged += (EventHandler)obj;
	}
}
public static class PluginMetadata
{
	public const string GUID = "art0007i.TrackerModelSwapper";

	public const string NAME = "TrackerModelSwapper";

	public const string VERSION = "2.0.0";

	public const string AUTHORS = "art0007i";

	public const string REPOSITORY_URL = "https://github.com/art0007i/TrackerModelSwapper";
}