Decompiled source of ColoredMeditateArrows v1.1.0

plugins/ColoredMeditateArrows/ColoredMeditateArrows.dll

Decompiled 2 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EntityStates.Seeker;
using Microsoft.CodeAnalysis;
using On.EntityStates.Seeker;
using RiskOfOptions;
using RiskOfOptions.Options;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("ColoredMeditateArrows")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ColoredMeditateArrows")]
[assembly: AssemblyTitle("ColoredMeditateArrows")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace ColoredMeditateArrows
{
	[BepInPlugin("SirFrogsAlot.ColoredMeditateArrows", "ColoredMeditateArrows", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class ExamplePlugin : BaseUnityPlugin
	{
		public const string PluginGUID = "SirFrogsAlot.ColoredMeditateArrows";

		public const string PluginAuthor = "SirFrogsAlot";

		public const string PluginName = "ColoredMeditateArrows";

		public const string PluginVersion = "1.0.0";

		private ConfigEntry<Color> upArrowColor;

		private ConfigEntry<Color> downArrowColor;

		private ConfigEntry<Color> rightArrowColor;

		private ConfigEntry<Color> leftArrowColor;

		public void Awake()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			Log.Init(((BaseUnityPlugin)this).Logger);
			ConfigOptions();
			MeditationUI.SetupInputUIIcons += new hook_SetupInputUIIcons(OnEntityStates_Seeker_MeditationUI_SetupInputUIIcons);
		}

		private void ConfigOptions()
		{
			//IL_0012: 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_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Expected O, but got Unknown
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Expected O, but got Unknown
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			upArrowColor = ((BaseUnityPlugin)this).Config.Bind<Color>("General", "ColorPickerUp", Color.red, "Color Picker to modify Up Arrow");
			downArrowColor = ((BaseUnityPlugin)this).Config.Bind<Color>("General", "ColorPickerDown", Color.blue, "Color Picker to modify Down Arrow");
			rightArrowColor = ((BaseUnityPlugin)this).Config.Bind<Color>("General", "ColorPickerRight", Color.yellow, "Color Picker to modify Right Arrow");
			leftArrowColor = ((BaseUnityPlugin)this).Config.Bind<Color>("General", "ColorPickerLeft", Color.green, "Color Picker to modify Up Arrow");
			ModSettingsManager.AddOption((BaseOption)new ColorOption(upArrowColor));
			ModSettingsManager.AddOption((BaseOption)new ColorOption(downArrowColor));
			ModSettingsManager.AddOption((BaseOption)new ColorOption(rightArrowColor));
			ModSettingsManager.AddOption((BaseOption)new ColorOption(leftArrowColor));
		}

		private void OnEntityStates_Seeker_MeditationUI_SetupInputUIIcons(orig_SetupInputUIIcons orig, MeditationUI self)
		{
			//IL_005b: 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_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			for (int i = 0; i < 5; i++)
			{
				switch (self.seekerController.meditationStepAndSequence[i + 1])
				{
				case 0:
					((Graphic)((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[i])).GetComponent<Image>()).color = upArrowColor.Value;
					break;
				case 1:
					((Graphic)((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[i])).GetComponent<Image>()).color = downArrowColor.Value;
					break;
				case 2:
					((Graphic)((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[i])).GetComponent<Image>()).color = rightArrowColor.Value;
					break;
				case 3:
					((Graphic)((Component)self.overlayInstanceChildLocator.FindChild(MeditationUI.c[i])).GetComponent<Image>()).color = leftArrowColor.Value;
					break;
				}
			}
		}

		private void Update()
		{
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
}