Decompiled source of TimeControl v1.1.1

TimeControl.dll

Decompiled 6 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using Receiver2;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("TimeControl")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TimeControl")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("62c40b34-1188-4ec4-a049-4fdfdc0a9376")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.1", FrameworkDisplayName = "")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace TimeControl;

[BepInProcess("Receiver2.exe")]
[BepInPlugin("SmilingLizard.plugins.timecontrol", "Time Control", "1.1.1")]
public class MediaModeControls : BaseUnityPlugin
{
	private ConfigEntry<KeyboardShortcut> _keyToggleMM_Enabled;

	private ConfigEntry<float> _mmTimeScale1;

	private ConfigEntry<KeyboardShortcut> _keySetMM_TimeScale1;

	private ConfigEntry<float> _mmTimeScale2;

	private ConfigEntry<KeyboardShortcut> _keySetMM_TimeScale2;

	private ConfigEntry<float> _mmTimeScale3;

	private ConfigEntry<KeyboardShortcut> _keySetMM_TimeScale3;

	private ConfigEntry<float> _mmTimeScale4;

	private ConfigEntry<KeyboardShortcut> _keySetMM_TimeScale4;

	private ConfigEntry<float> _mmTimeScale5;

	private ConfigEntry<KeyboardShortcut> _keySetMM_TimeScale5;

	private bool _MM_Enabled
	{
		get
		{
			return ConfigFiles.global.media_mode_enabled;
		}
		set
		{
			ConfigFiles.global.media_mode_enabled = value;
		}
	}

	private float _MM_TimeScale
	{
		set
		{
			ConfigFiles.global.media_mode_time_scale = value;
		}
	}

	public void Awake()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Expected O, but got Unknown
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Expected O, but got Unknown
		//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0139: Expected O, but got Unknown
		//IL_014f: Unknown result type (might be due to invalid IL or missing references)
		//IL_018e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Expected O, but got Unknown
		//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f7: Expected O, but got Unknown
		_keyToggleMM_Enabled = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("MediaMode", "Toggle Enabled", KeyboardShortcut.Empty, (ConfigDescription)null);
		_keySetMM_TimeScale1 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Timescale Preset 1", "Set", KeyboardShortcut.Empty, (ConfigDescription)null);
		_mmTimeScale1 = ((BaseUnityPlugin)this).Config.Bind<float>("Timescale Preset 1", "Value", 1f, new ConfigDescription("", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.001f, 2f), Array.Empty<object>()));
		_keySetMM_TimeScale2 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Timescale Preset 2", "Set", KeyboardShortcut.Empty, (ConfigDescription)null);
		_mmTimeScale2 = ((BaseUnityPlugin)this).Config.Bind<float>("Timescale Preset 2", "Value", 1f, new ConfigDescription("", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.001f, 2f), Array.Empty<object>()));
		_keySetMM_TimeScale3 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Timescale Preset 3", "Set", KeyboardShortcut.Empty, (ConfigDescription)null);
		_mmTimeScale3 = ((BaseUnityPlugin)this).Config.Bind<float>("Timescale Preset 3", "Value", 1f, new ConfigDescription("", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.001f, 2f), Array.Empty<object>()));
		_keySetMM_TimeScale4 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Timescale Preset 4", "Set", KeyboardShortcut.Empty, (ConfigDescription)null);
		_mmTimeScale4 = ((BaseUnityPlugin)this).Config.Bind<float>("Timescale Preset 4", "Value", 1f, new ConfigDescription("", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.001f, 2f), Array.Empty<object>()));
		_keySetMM_TimeScale5 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Timescale Preset 5", "Set", KeyboardShortcut.Empty, (ConfigDescription)null);
		_mmTimeScale5 = ((BaseUnityPlugin)this).Config.Bind<float>("Timescale Preset 5", "Value", 1f, new ConfigDescription("", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.001f, 2f), Array.Empty<object>()));
	}

	public void Update()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		KeyboardShortcut value = _keyToggleMM_Enabled.Value;
		if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey))
		{
			_MM_Enabled = !_MM_Enabled;
		}
		value = _keySetMM_TimeScale1.Value;
		if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey))
		{
			_MM_TimeScale = _mmTimeScale1.Value;
		}
		value = _keySetMM_TimeScale2.Value;
		if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey))
		{
			_MM_TimeScale = _mmTimeScale2.Value;
		}
		value = _keySetMM_TimeScale3.Value;
		if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey))
		{
			_MM_TimeScale = _mmTimeScale3.Value;
		}
		value = _keySetMM_TimeScale4.Value;
		if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey))
		{
			_MM_TimeScale = _mmTimeScale4.Value;
		}
		value = _keySetMM_TimeScale5.Value;
		if (Input.GetKeyDown(((KeyboardShortcut)(ref value)).MainKey))
		{
			_MM_TimeScale = _mmTimeScale5.Value;
		}
	}
}