Decompiled source of RadialUIPlugin v2.6.1

RadialUI.dll

Decompiled 5 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using Bounce.Unmanaged;
using DataModel;
using HarmonyLib;
using RadialUI.Extensions;
using TaleSpire.GameMaster.Blocks;
using Unity.Mathematics;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("RadialUIPlugin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("HolloFox")]
[assembly: AssemblyProduct("RadialUIPlugin")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4e4deb5e-97f9-4901-bf67-6748a9c1229a")]
[assembly: AssemblyFileVersion("2.6.1.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("2.6.1.0")]
namespace RadialUI
{
	[BepInPlugin("org.hollofox.plugins.RadialUIPlugin", "RadialUIPlugin", "2.6.1.0")]
	public sealed class RadialUIPlugin : BaseUnityPlugin
	{
		internal static readonly Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)> _onSubmenuAttacks = new Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)>();

		internal static readonly Dictionary<string, List<RadialCheckRemove>> _removeOnSubmenuAttacks = new Dictionary<string, List<RadialCheckRemove>>();

		internal static readonly Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)> _onCharacterCallback = new Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)>();

		internal static readonly Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)> _onCanAttack = new Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)>();

		internal static readonly Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)> _onCantAttack = new Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)>();

		internal static readonly Dictionary<string, List<RadialCheckRemove>> _removeOnCharacter = new Dictionary<string, List<RadialCheckRemove>>();

		internal static NGuid lastCreature;

		internal static readonly Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)> _onSubmenuEmotes = new Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)>();

		internal static readonly Dictionary<string, List<RadialCheckRemove>> _removeOnSubmenuEmotes = new Dictionary<string, List<RadialCheckRemove>>();

		internal static readonly Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)> _onSubmenuGm = new Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)>();

		internal static readonly Dictionary<string, List<RadialCheckRemove>> _removeOnSubmenuGm = new Dictionary<string, List<RadialCheckRemove>>();

		internal static readonly Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)> _onSubmenuKill = new Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)>();

		internal static readonly Dictionary<string, List<RadialCheckRemove>> _removeOnSubmenuKill = new Dictionary<string, List<RadialCheckRemove>>();

		internal static readonly Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)> _onSubmenuSize = new Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)>();

		internal static readonly Dictionary<string, List<RadialCheckRemove>> _removeOnSubmenuSize = new Dictionary<string, List<RadialCheckRemove>>();

		internal static readonly Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)> _onStatCallback = new Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)>();

		internal static readonly Dictionary<string, (string, ShouldShowMenu)> _hideStat = new Dictionary<string, (string, ShouldShowMenu)>();

		internal static readonly Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)> _onSubmenuStatusEmotes = new Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)>();

		internal static readonly Dictionary<string, List<RadialCheckRemove>> _removeOnSubmenuStatusEmotes = new Dictionary<string, List<RadialCheckRemove>>();

		internal static readonly Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)> _onGroupSubmenuGm = new Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)>();

		internal static readonly Dictionary<string, List<RadialCheckRemove>> _removeOnGroupSubmenuGm = new Dictionary<string, List<RadialCheckRemove>>();

		internal static readonly Dictionary<string, List<RadialCheckRemove>> _removeOnGMBlock = new Dictionary<string, List<RadialCheckRemove>>();

		internal static readonly Dictionary<string, (ItemArgs, Func<AtmosphereBlock, bool>)> _onGMBlock = new Dictionary<string, (ItemArgs, Func<AtmosphereBlock, bool>)>();

		internal static readonly Dictionary<string, (ItemArgs, Func<HideVolumeItem, bool>)> _onHideVolumeCallback = new Dictionary<string, (ItemArgs, Func<HideVolumeItem, bool>)>();

		internal static readonly Dictionary<string, List<RadialCheckRemove>> _removeOnHideVolume = new Dictionary<string, List<RadialCheckRemove>>();

		internal static HideVolumeItem lastHideVolume;

		internal static readonly Dictionary<string, List<RadialCheckRemove>> _removeOnPlaceable = new Dictionary<string, List<RadialCheckRemove>>();

		internal static readonly Dictionary<string, (ItemArgs, Func<AtmosphereBlock, bool>)> _onPlaceable = new Dictionary<string, (ItemArgs, Func<AtmosphereBlock, bool>)>();

		public const string Guid = "org.hollofox.plugins.RadialUIPlugin";

		public const string Version = "2.6.1.0";

		public const string Name = "RadialUIPlugin";

		internal static ManualLogSource logger;

		public static void AddCustomButtonAttacksSubmenu(string key, ItemArgs value, Func<NGuid, NGuid, bool> externalCheck = null)
		{
			_onSubmenuAttacks.Add(key, (value, externalCheck));
		}

		public static bool RemoveCustomButtonAttacksSubmenu(string key)
		{
			return _onSubmenuAttacks.Remove(key);
		}

		public static void HideDefaultAttacksSubmenuItem(string key, string value, ShouldShowMenu callback = null)
		{
			AddRemoveOn(_removeOnSubmenuAttacks, key, value, callback);
		}

		public static void UnHideDefaultAttacksSubmenuItem(string key, string value)
		{
			RemoveRemoveOn(_removeOnSubmenuAttacks, key, value);
		}

		public static void AddCustomButtonOnCharacter(string key, ItemArgs value, Func<NGuid, NGuid, bool> externalCheck = null)
		{
			_onCharacterCallback.Add(key, (value, externalCheck));
		}

		public static bool RemoveCustomButtonOnCharacter(string key)
		{
			return _onCharacterCallback.Remove(key);
		}

		public static void HideDefaultCharacterMenuItem(string key, string value, ShouldShowMenu callback = null)
		{
			AddRemoveOn(_removeOnCharacter, key, value, callback);
		}

		public static void UnHideDefaultCharacterMenuItem(string key, string value)
		{
			RemoveRemoveOn(_removeOnCharacter, key, value);
		}

		public static NGuid GetLastRadialTargetCreature()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return lastCreature;
		}

		public static void AddCustomButtonEmotesSubmenu(string key, ItemArgs value, Func<NGuid, NGuid, bool> externalCheck = null)
		{
			_onSubmenuEmotes.Add(key, (value, externalCheck));
		}

		public static bool RemoveCustomButtonEmotesSubmenu(string key)
		{
			return _onSubmenuEmotes.Remove(key);
		}

		public static void HideDefaultEmotesSubmenuItem(string key, string value, ShouldShowMenu callback = null)
		{
			AddRemoveOn(_removeOnSubmenuEmotes, key, value, callback);
		}

		public static void UnHideDefaultEmotesSubmenuItem(string key, string value)
		{
			RemoveRemoveOn(_removeOnSubmenuEmotes, key, value);
		}

		public static void AddCustomButtonGMSubmenu(string key, ItemArgs value, Func<NGuid, NGuid, bool> externalCheck = null)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Expected O, but got Unknown
			_onSubmenuGm.Add(key, (value, externalCheck));
			ItemArgs item = new ItemArgs
			{
				Action = delegate(MapMenuItem MapMenuItem, object Object)
				{
					//IL_0024: Unknown result type (might be due to invalid IL or missing references)
					CreatureGuid[] array = default(CreatureGuid[]);
					if (LocalClient.TryGetLassoedCreatureIds(ref array))
					{
						int num = array.Length;
						for (int i = 0; i < num; i++)
						{
							value.Action(MapMenuItem, array[i].Value);
						}
					}
				},
				Title = value.Title,
				Icon = value.Icon,
				SubValueText = value.SubValueText,
				Scale = value.Scale,
				CloseMenuOnActivate = value.CloseMenuOnActivate,
				FadeName = value.FadeName,
				ValueText = value.ValueText,
				Obj = value.Obj
			};
			_onGroupSubmenuGm.Add(key, (item, externalCheck));
		}

		public static bool RemoveCustomButtonGMSubmenu(string key)
		{
			if (_onSubmenuGm.Remove(key))
			{
				return _onGroupSubmenuGm.Remove(key);
			}
			return false;
		}

		public static void HideDefaultEmotesGMItem(string key, string value, ShouldShowMenu callback = null)
		{
			AddRemoveOn(_removeOnSubmenuGm, key, value, callback);
		}

		public static void UnHideDefaultGMSubmenuItem(string key, string value)
		{
			RemoveRemoveOn(_removeOnSubmenuGm, key, value);
		}

		public static void AddCustomButtonOnKillSubmenu(string key, ItemArgs value, Func<NGuid, NGuid, bool> externalCheck = null)
		{
			_onSubmenuKill.Add(key, (value, externalCheck));
		}

		public static bool RemoveCustomButtonOnKillSubmenu(string key)
		{
			return _onSubmenuKill.Remove(key);
		}

		public static void HideDefaultKillSubmenuItem(string key, string value, ShouldShowMenu callback = null)
		{
			AddRemoveOn(_removeOnSubmenuKill, key, value, callback);
		}

		public static void ShowDefaultKillSubmenuItem(string key, string value)
		{
			RemoveRemoveOn(_removeOnSubmenuKill, key, value);
		}

		public static void AddCustomButtonOnSizeSubmenu(string key, ItemArgs value, Func<NGuid, NGuid, bool> externalCheck = null)
		{
			_onSubmenuSize.Add(key, (value, externalCheck));
		}

		public static bool RemoveCustomButtonOnSizeSubmenu(string key)
		{
			return _onSubmenuSize.Remove(key);
		}

		public static void HideDefaultSizeSubmenuItem(string key, string value, ShouldShowMenu callback = null)
		{
			AddRemoveOn(_removeOnSubmenuSize, key, value, callback);
		}

		public static void ShowDefaultSizeSubmenuItem(string key, string value)
		{
			RemoveRemoveOn(_removeOnSubmenuSize, key, value);
		}

		public static void AddCustomCharacterSubmenuStat(string key, ItemArgs value, Func<NGuid, NGuid, bool> externalCheck = null)
		{
			_onStatCallback.Add(key, (value, externalCheck));
		}

		public static bool RemoveCustomCharacterSubmenuStat(string key)
		{
			return _onStatCallback.Remove(key);
		}

		public static void HideDefaultCharacterSubmenuStat(string key, string value, ShouldShowMenu callback = null)
		{
			_hideStat.Add(key, (value, callback));
		}

		public static void HideDefaultCharacterSubmenuStat(string key, RadialCheckRemove remove)
		{
			_hideStat.Add(key, (remove.TitleToRemove, remove.ShouldRemoveCallback));
		}

		public static bool ShowDefaultCharacterSubmenuStat(string key)
		{
			return _hideStat.Remove(key);
		}

		public static void AddCustomButtonStatusEmotesSubmenu(string key, ItemArgs value, Func<NGuid, NGuid, bool> externalCheck = null)
		{
			_onSubmenuStatusEmotes.Add(key, (value, externalCheck));
		}

		public static bool RemoveCustomButtonStatusEmotesSubmenu(string key)
		{
			return _onSubmenuStatusEmotes.Remove(key);
		}

		public static void HideDefaultEmotesStatusSubmenuItem(string key, string value, ShouldShowMenu callback = null)
		{
			AddRemoveOn(_removeOnSubmenuStatusEmotes, key, value, callback);
		}

		public static void UnHideDefaultEmotesStatusSubmenuItem(string key, string value)
		{
			RemoveRemoveOn(_removeOnSubmenuStatusEmotes, key, value);
		}

		public static void HideDefaultGMBlockMenuItem(string key, string value, ShouldShowMenu callback = null)
		{
			AddRemoveOn(_removeOnGMBlock, key, value, callback);
		}

		public static void UnHideDefaultGMBlockMenuItem(string key, string value)
		{
			RemoveRemoveOn(_removeOnGMBlock, key, value);
		}

		public static void AddCustomButtonGMBlock(string key, ItemArgs value, Func<AtmosphereBlock, bool> externalCheck = null)
		{
			_onGMBlock.Add(key, (value, externalCheck));
		}

		public static bool RemoveCustomButtonGMBlock(string key)
		{
			return _onGMBlock.Remove(key);
		}

		public static void AddOnHideVolume(string key, ItemArgs value, Func<HideVolumeItem, bool> externalCheck = null)
		{
			_onHideVolumeCallback.Add(key, (value, externalCheck));
		}

		public static bool RemoveOnHideVolume(string key)
		{
			return _onHideVolumeCallback.Remove(key);
		}

		public static void AddOnRemoveHideVolume(string key, string value, ShouldShowMenu callback = null)
		{
			AddRemoveOn(_removeOnHideVolume, key, value, callback);
		}

		public static void RemoveOnRemoveHideVolume(string key, string value)
		{
			RemoveRemoveOn(_removeOnHideVolume, key, value);
		}

		public static HideVolumeItem GetLastRadialHideVolume()
		{
			return lastHideVolume;
		}

		private void Awake()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			logger = ((BaseUnityPlugin)this).Logger;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"In Awake for RadialUI");
			Harmony val = new Harmony("org.hollofox.plugins.RadialUIPlugin");
			try
			{
				val.PatchAll();
				((BaseUnityPlugin)this).Logger.LogDebug((object)"RadialUI Plug-in loaded");
			}
			catch (Exception)
			{
				val.UnpatchSelf();
				((BaseUnityPlugin)this).Logger.LogDebug((object)"RadialUI Failed to patch");
			}
		}

		public static void AddRemoveOn(Dictionary<string, List<RadialCheckRemove>> data, string key, string value, ShouldShowMenu shouldRemoveCallback)
		{
			if (!data.ContainsKey(key))
			{
				data.Add(key, new List<RadialCheckRemove>());
			}
			if (shouldRemoveCallback == null)
			{
				shouldRemoveCallback = AlwaysTrue;
			}
			data[key].Add(new RadialCheckRemove(value, shouldRemoveCallback));
		}

		public static bool AlwaysTrue(string s1, string s2, string s3)
		{
			return true;
		}

		public static bool RemoveRemoveOn(Dictionary<string, List<RadialCheckRemove>> data, string key, string value)
		{
			if (!data.ContainsKey(key))
			{
				return false;
			}
			List<RadialCheckRemove> list = data[key];
			int count = list.Count;
			list.RemoveAll((RadialCheckRemove x) => x.TitleToRemove == value);
			bool result = list.Count != count;
			if (list.Count == 0)
			{
				data.Remove(key);
			}
			return result;
		}
	}
	public delegate bool ShouldShowMenu(string menuText, string miniId, string targetId);
	public delegate bool ShouldShowHVMenu(string menuText);
	internal static class RCRExt
	{
		public static bool CanAdd(this Dictionary<string, (string, ShouldShowMenu)> dic, string menuText, string miniId, string targetId)
		{
			return dic.Keys.Where((string key) => dic[key].Item1 == menuText).All((string key) => dic[key].Item2(menuText, miniId, targetId));
		}

		public static bool CanAdd(this Dictionary<string, List<RadialCheckRemove>> dic, string menuText, string miniId, string targetId)
		{
			return dic.Values.SelectMany((List<RadialCheckRemove> l) => l.Where((RadialCheckRemove i) => i.TitleToRemove == menuText)).All((RadialCheckRemove remover) => !remover.ShouldRemoveCallback(menuText, miniId, targetId));
		}

		public static bool CanAdd(this Dictionary<string, List<RadialCheckRemove>> dic, string menuText)
		{
			return dic.Values.SelectMany((List<RadialCheckRemove> l) => l.Where((RadialCheckRemove i) => i.TitleToRemove == menuText)).All((RadialCheckRemove remover) => !remover.ShouldRemoveHVCallback(menuText));
		}
	}
	public class RadialCheckRemove
	{
		public string TitleToRemove { get; set; }

		public ShouldShowMenu ShouldRemoveCallback { get; }

		public ShouldShowHVMenu ShouldRemoveHVCallback { get; }

		public RadialCheckRemove()
		{
		}

		public RadialCheckRemove(string titleToRemove, ShouldShowMenu shouldRemoveCallback)
		{
			TitleToRemove = titleToRemove;
			ShouldRemoveCallback = shouldRemoveCallback;
		}
	}
	public class RadialSubmenu
	{
		public enum MenuType
		{
			character = 1,
			canAttack,
			cantAttack,
			HideVolume,
			GMBlock
		}

		private static CreatureGuid radialAsset = default(CreatureGuid);

		private static HideVolumeItem radialHideVolume;

		private static Dictionary<string, List<ItemArgs>> subMenuEntries = new Dictionary<string, List<ItemArgs>>();

		private static Dictionary<ItemArgs, Func<bool>> subMenuChecker = new Dictionary<ItemArgs, Func<bool>>();

		private static MenuType openMenuType = MenuType.character;

		public static void EnsureMainMenuItem(string mainGuid, MenuType type, string title, Sprite icon, Func<NGuid, NGuid, bool> checker = null)
		{
			if (checker == null)
			{
				checker = Reporter;
			}
			if (!subMenuEntries.ContainsKey(mainGuid))
			{
				switch (type)
				{
				case MenuType.character:
					EnsureMainMenuOnCharacter(mainGuid, title, icon, checker);
					break;
				case MenuType.HideVolume:
					EnsureMainMenuOnHideVolume(mainGuid, title, icon);
					break;
				}
				subMenuEntries.Add(mainGuid, new List<ItemArgs>());
			}
		}

		public static void EnsureMainMenuItem(string mainGuid, MenuType type, string title, Sprite icon)
		{
			if (!subMenuEntries.ContainsKey(mainGuid))
			{
				switch (type)
				{
				case MenuType.character:
					EnsureMainMenuOnCharacter(mainGuid, title, icon);
					break;
				case MenuType.HideVolume:
					EnsureMainMenuOnHideVolume(mainGuid, title, icon);
					break;
				}
				subMenuEntries.Add(mainGuid, new List<ItemArgs>());
			}
		}

		private static void EnsureMainMenuOnHideVolume(string mainGuid, string title, Sprite icon)
		{
			RadialUIPlugin.AddOnHideVolume(mainGuid, NewMainMenu(mainGuid, title, icon), Reporter);
			openMenuType = MenuType.HideVolume;
		}

		private static void EnsureMainMenuOnCharacter(string mainGuid, string title, Sprite icon, Func<NGuid, NGuid, bool> checker = null)
		{
			RadialUIPlugin.AddCustomButtonOnCharacter(mainGuid, NewMainMenu(mainGuid, title, icon), checker);
			openMenuType = MenuType.character;
		}

		public static ItemArgs NewMainMenu(string mainGuid, string title, Sprite icon)
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: 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_003a: Expected O, but got Unknown
			return new ItemArgs
			{
				Action = delegate(MapMenuItem mmi, object obj)
				{
					DisplaySubmenu(mmi, obj, mainGuid);
				},
				Icon = icon,
				Title = title,
				CloseMenuOnActivate = false
			};
		}

		[Obsolete]
		public static void CreateSubMenuItem(string mainGuid, string title, Sprite icon, Action<CreatureGuid, string, MapMenuItem> callback, bool closeMenu)
		{
			CreateSubMenuItem(mainGuid, title, icon, callback, closeMenu, null);
		}

		[Obsolete]
		public static void CreateSubMenuItem(string mainGuid, string title, Sprite icon, Action<CreatureGuid, string, MapMenuItem> callback)
		{
			CreateSubMenuItem(mainGuid, title, icon, callback, closeMenu: true, null);
		}

		public static void CreateSubMenuItem(string mainGuid, string title, Sprite icon, Action<CreatureGuid, string, MapMenuItem> callback, bool closeMenu = true, Func<bool> checker = null)
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			if (!subMenuEntries.ContainsKey(mainGuid))
			{
				RadialUIPlugin.logger.LogWarning((object)("Main radial menu '" + mainGuid + "' does not exits. Use EnsureMainMenuItem() before adding sub-menu items."));
				return;
			}
			ItemArgs val = new ItemArgs
			{
				Action = delegate(MapMenuItem mmi, object obj)
				{
					//IL_0006: Unknown result type (might be due to invalid IL or missing references)
					callback(radialAsset, mainGuid, mmi);
				},
				Icon = icon,
				Title = title,
				CloseMenuOnActivate = closeMenu
			};
			subMenuEntries[mainGuid].Add(val);
			if (checker != null)
			{
				subMenuChecker.Add(val, checker);
			}
		}

		public static void CreateSubMenuItem(string mainGuid, string title, Sprite icon, Action<HideVolumeItem, string, MapMenuItem> callback, bool closeMenu = true, Func<bool> checker = null)
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			if (!subMenuEntries.ContainsKey(mainGuid))
			{
				RadialUIPlugin.logger.LogWarning((object)("Main radial menu '" + mainGuid + "' does not exits. Use EnsureMainMenuItem() before adding sub-menu items."));
				return;
			}
			ItemArgs val = new ItemArgs
			{
				Action = delegate(MapMenuItem mmi, object obj)
				{
					callback(radialHideVolume, mainGuid, mmi);
				},
				Icon = icon,
				Title = title,
				CloseMenuOnActivate = closeMenu
			};
			subMenuEntries[mainGuid].Add(val);
			if (checker != null)
			{
				subMenuChecker.Add(val, checker);
			}
		}

		public static void CreateSubMenuItem(string mainGuid, ItemArgs item, Action<HideVolumeItem, string, MapMenuItem> callback = null, Func<bool> checker = null)
		{
			if (!subMenuEntries.ContainsKey(mainGuid))
			{
				RadialUIPlugin.logger.LogWarning((object)("Main radial menu '" + mainGuid + "' does not exits. Use EnsureMainMenuItem() before adding sub-menu items."));
				return;
			}
			if (callback != null)
			{
				item.Action = delegate(MapMenuItem mmi, object obj)
				{
					callback(radialHideVolume, mainGuid, mmi);
				};
			}
			subMenuEntries[mainGuid].Add(item);
			if (checker != null)
			{
				subMenuChecker.Add(item, checker);
			}
		}

		[Obsolete]
		public static Sprite GetIconFromFile(string fileName)
		{
			return null;
		}

		private static bool Reporter(NGuid selected, NGuid radial)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			radialAsset = new CreatureGuid(radial);
			return true;
		}

		private static bool Reporter(HideVolumeItem item)
		{
			radialHideVolume = item;
			return true;
		}

		private static void DisplaySubmenu(MapMenuItem mmi, object obj, string mainGuid)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = ((openMenuType == MenuType.character) ? (((Component)Talespire.RadialMenus.GetTargetCreature()).transform.position + Vector3.up * Talespire.RadialMenus.GetHeightDiff()) : ((openMenuType != MenuType.HideVolume) ? float3.op_Implicit(GMBlockInteractMenuBoardTool.block.WorldPosition) : Talespire.RadialMenus.GetRadialTargetHideVolume()));
			MapMenu val2 = MapMenuManager.OpenMenu(val, true);
			foreach (ItemArgs item in subMenuEntries[mainGuid])
			{
				if (!subMenuChecker.ContainsKey(item) || subMenuChecker[item]())
				{
					val2.AddItem(item);
				}
			}
		}
	}
	public static class Checkers
	{
		public static bool HasOwnership(NGuid selected, NGuid targeted)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return CreatureManager.PlayerCanControlCreature(LocalPlayer.Id, new CreatureGuid(targeted));
		}

		public static bool CanAttack(NGuid selected, NGuid targeted)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return selected != targeted;
		}
	}
	public static class Talespire
	{
		public static class RadialMenus
		{
			private static BindingFlags bindFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

			public static List<MapMenu> GetAllOpen()
			{
				return ((object)SingletonBehaviour<MapMenuManager>.Instance).GetType().GetField("_allOpenMenus", bindFlags).GetValue(SingletonBehaviour<MapMenuManager>.Instance) as List<MapMenu>;
			}

			public static NGuid GetTargetCreatureId()
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				CreatureBoardAsset targetCreature = GetTargetCreature();
				if ((Object)(object)targetCreature == (Object)null)
				{
					return NGuid.Empty;
				}
				return targetCreature.CreatureId.Value;
			}

			public static float GetHeightDiff()
			{
				CreatureMenuBoardTool creatureMenuBoardTool = GetCreatureMenuBoardTool();
				if ((Object)(object)creatureMenuBoardTool == (Object)null)
				{
					return 0f;
				}
				return (float)((object)creatureMenuBoardTool).GetType().GetField("_hitHeightDif", bindFlags).GetValue(creatureMenuBoardTool);
			}

			public static CreatureBoardAsset GetTargetCreature()
			{
				CreatureMenuBoardTool creatureMenuBoardTool = GetCreatureMenuBoardTool();
				object? value = ((object)creatureMenuBoardTool).GetType().GetField("_selectedCreature", bindFlags).GetValue(creatureMenuBoardTool);
				return (CreatureBoardAsset)((value is CreatureBoardAsset) ? value : null);
			}

			public static HideVolumeItem GetSelectedHideVolumeItem()
			{
				GMHideVolumeMenuBoardTool gMHideVolumeMenuBoardTool = GetGMHideVolumeMenuBoardTool();
				object? value = ((object)gMHideVolumeMenuBoardTool).GetType().GetField("_selectedVolume", bindFlags).GetValue(gMHideVolumeMenuBoardTool);
				return (HideVolumeItem)((value is HideVolumeItem) ? value : null);
			}

			public static Vector3 GetRadialTargetHideVolume()
			{
				//IL_0021: Unknown result type (might be due to invalid IL or missing references)
				GMHideVolumeMenuBoardTool gMHideVolumeMenuBoardTool = GetGMHideVolumeMenuBoardTool();
				return (Vector3)((object)gMHideVolumeMenuBoardTool).GetType().GetField("_selectedPos", bindFlags).GetValue(gMHideVolumeMenuBoardTool);
			}

			public static CreatureMenuBoardTool GetCreatureMenuBoardTool()
			{
				Object obj = Object.FindObjectOfType(typeof(CreatureMenuBoardTool));
				return (CreatureMenuBoardTool)(object)((obj is CreatureMenuBoardTool) ? obj : null);
			}

			public static GMHideVolumeMenuBoardTool GetGMHideVolumeMenuBoardTool()
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Expected O, but got Unknown
				return (GMHideVolumeMenuBoardTool)Object.FindObjectOfType(typeof(GMHideVolumeMenuBoardTool));
			}
		}
	}
}
namespace RadialUI.Placeables_Menu_Patches
{
	[HarmonyPatch(typeof(InteractivePlaceableMenuBoardTool), "Begin")]
	internal sealed class InteractivePlaceableMenuBoardToolPatch
	{
		internal static void Postfix()
		{
		}
	}
}
namespace RadialUI.HideVolume_Menu_Patches
{
	[HarmonyPatch(typeof(GMHideVolumeMenuBoardTool), "Begin")]
	internal sealed class HideVolumeMenuPatch
	{
		internal static bool Prefix(HideVolumeItem ____selectedVolume)
		{
			RadialUIPlugin.lastHideVolume = ____selectedVolume;
			return true;
		}

		internal static void Postfix(HideVolumeItem ____selectedVolume, Vector3 ____selectedPos, ref GMHideVolumeMenuBoardTool __instance)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			MapMenu val = MapMenuManager.OpenMenu(____selectedPos, true);
			Action<MapMenuItem, object> menuItemAction = Reflections.GetMenuItemAction<GMHideVolumeMenuBoardTool>("ToggleTiles", __instance);
			Action<MapMenu, object> menuAction = Reflections.GetMenuAction<GMHideVolumeMenuBoardTool>("FilterMenu", __instance);
			Action<MapMenuItem, object> menuItemAction2 = Reflections.GetMenuItemAction<GMHideVolumeMenuBoardTool>("DeleteBlock", __instance);
			if (menuItemAction != null && RadialUIPlugin._removeOnHideVolume.CanAdd("Toggle Visibility"))
			{
				val.AddItem(menuItemAction, "Toggle Visibility", "", "", Icons.GetIconSprite("toggle_hide"), (object)null, true, false, 1f);
			}
			if (menuAction != null && RadialUIPlugin._removeOnHideVolume.CanAdd("Filters"))
			{
				val.AddMenuItem((MenuType)3, menuAction, "Filters", "", "", Icons.GetIconSprite("filter"), (object)null, true, false, 1f);
			}
			if (menuItemAction2 != null && RadialUIPlugin._removeOnHideVolume.CanAdd("Delete"))
			{
				val.AddItem(menuItemAction2, "Delete", "", "", Icons.GetIconSprite("trashbin"), (object)null, true, true, 1f);
			}
			val.AddItems(RadialUIPlugin._onHideVolumeCallback, ____selectedVolume);
		}
	}
}
namespace RadialUI.Extensions
{
	public static class Mapmenu
	{
		internal static void AddItems(this MapMenu map, Dictionary<string, (ItemArgs, Func<NGuid, NGuid, bool>)> list, NGuid targetId)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			NGuid miniId = LocalClient.SelectedCreatureId.Value;
			foreach (string item in list.Keys.Where((string key) => list[key].Item2 == null || list[key].Item2(miniId, targetId)))
			{
				list[item].Item1.Obj = miniId;
				map.AddItem(list[item].Item1);
			}
		}

		internal static void AddItems(this MapMenu map, Dictionary<string, (ItemArgs, Func<HideVolumeItem, bool>)> list, HideVolumeItem selectedVolume)
		{
			foreach (string item in list.Keys.Where((string key) => list[key].Item2 == null || list[key].Item2(selectedVolume)))
			{
				map.AddItem(list[item].Item1);
			}
		}

		internal static void AddItems(this MapMenu map, Dictionary<string, (ItemArgs, Func<AtmosphereBlock, bool>)> list, AtmosphereBlock selectedVolume)
		{
			foreach (string item in list.Keys.Where((string key) => list[key].Item2 == null || list[key].Item2(selectedVolume)))
			{
				list[item].Item1.Obj = list[item].Item1.Obj ?? selectedVolume;
				map.AddItem(list[item].Item1);
			}
		}
	}
	public static class RadialExtensions
	{
		private const BindingFlags bindFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

		public static bool CanShow(this Dictionary<string, List<RadialCheckRemove>> listOfRemovers, string menuId, string minid, string targetid)
		{
			return listOfRemovers.Values.SelectMany((List<RadialCheckRemove> l) => l.Where((RadialCheckRemove r) => r.TitleToRemove == menuId && r.ShouldRemoveCallback != null)).All((RadialCheckRemove r) => !r.ShouldRemoveCallback(menuId, minid, targetid));
		}
	}
	internal static class Reflections
	{
		private const BindingFlags bindFlags = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;

		internal static Action<MapMenu, object> GetMenuAction<Tclass>(string method, Tclass o)
		{
			return CreateReusableAction<Tclass, MapMenu, object>(method, o);
		}

		internal static Action<MapMenuItem, object> GetMenuItemAction<Tclass>(string method, Tclass o)
		{
			return CreateReusableAction<Tclass, MapMenuItem, object>(method, o);
		}

		internal static T CallMethod<T, TClass>(string methodName, TClass instance, object[] param = null)
		{
			if (param == null)
			{
				param = new object[0];
			}
			return (T)typeof(TClass).GetMethod(methodName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).Invoke(instance, param);
		}

		internal static void CallMethod<TClass>(string methodName, TClass instance, object[] param = null)
		{
			if (param == null)
			{
				param = new object[0];
			}
			typeof(TClass).GetMethod(methodName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).Invoke(instance, param);
		}

		internal static Action<Tp1, Tp2> CreateReusableAction<TClass, Tp1, Tp2>(string methodName, TClass instance)
		{
			MethodInfo method = typeof(TClass).GetMethod(methodName, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic);
			if (method == null)
			{
				RadialUIPlugin.logger.LogDebug((object)$"Method {methodName} for {instance.GetType()} was not found.");
				return null;
			}
			return Caller;
			void Caller(Tp1 param1, Tp2 param2)
			{
				method.Invoke(instance, new object[2] { param1, param2 });
			}
		}
	}
}
namespace RadialUI.CreatureGroupMenuPatches
{
	[HarmonyPatch(typeof(CreatureGroupMenuBoardTool), "Menu_GMTools")]
	internal sealed class GroupGMToolsSubMenuPatch
	{
		internal static bool Prefix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature, CreatureGroupMenuBoardTool __instance)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = LocalClient.SelectedCreatureId.Value;
			NGuid value2 = ____selectedCreature.CreatureId.Value;
			Action<MapMenu, object> menuAction = Reflections.GetMenuAction<CreatureGroupMenuBoardTool>("Menu_SetSize", __instance);
			Action<MapMenu, object> menuAction2 = Reflections.GetMenuAction<CreatureGroupMenuBoardTool>("BaseColor_Menu", __instance);
			if (menuAction != null && RadialUIPlugin._removeOnSubmenuGm.CanAdd("Set Size", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddMenuItem((MenuType)3, menuAction, "Set Size", "", "", Icons.GetIconSprite("creaturesize"), (object)null, true, false, 1f);
			}
			if (menuAction2 != null && RadialUIPlugin._removeOnSubmenuGm.CanAdd("BaseColor", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddMenuItem((MenuType)3, menuAction2, "BaseColor", "", "", Icons.GetIconSprite("basecolor"), (object)null, true, false, 1f);
			}
			return false;
		}

		internal static void Postfix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature)
		{
			//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)
			map.AddItems(RadialUIPlugin._onGroupSubmenuGm, LocalClient.SelectedCreatureId.Value);
		}
	}
}
namespace RadialUI.Creature_Menu_Patches
{
	[HarmonyPatch(typeof(CreatureMenuBoardTool), "AddStats")]
	internal sealed class AddStatsMenuPatch
	{
		internal static bool Prefix(ref MapMenu mapMenu, CreatureBoardAsset ____selectedCreature, CreatureMenuBoardTool __instance)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = LocalClient.SelectedCreatureId.Value;
			NGuid value2 = ____selectedCreature.CreatureId.Value;
			Action<MapMenu, object> menuAction = Reflections.GetMenuAction<CreatureMenuBoardTool>("Menu_Stats", __instance);
			if (RadialUIPlugin._removeOnCharacter.CanAdd("HP", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				mapMenu.AddStat("HP", ____selectedCreature.CreatureId, -1);
			}
			if (menuAction != null && RadialUIPlugin._removeOnCharacter.CanAdd("Stats", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				mapMenu.AddMenuItem((MenuType)2, menuAction, "Stats", "", "", Icons.GetIconSprite("stats"), (object)null, true, false, 1f);
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(CreatureMenuBoardTool), "Attack_Menu")]
	internal sealed class AttacksSubMenuPatch
	{
		internal static bool Prefix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature, CreatureMenuBoardTool __instance)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = LocalClient.SelectedCreatureId.Value;
			NGuid value2 = ____selectedCreature.CreatureId.Value;
			Action<MapMenuItem, object> menuItemAction = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("HitPlayer", __instance);
			Action<MapMenuItem, object> menuItemAction2 = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("MagicMissile", __instance);
			Action<MapMenuItem, object> menuItemAction3 = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("RedLaser", __instance);
			Action<MapMenuItem, object> menuItemAction4 = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("GreenLaser", __instance);
			if (menuItemAction != null && RadialUIPlugin._removeOnSubmenuAttacks.CanAdd("Hit", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction, "Attack", "", "", Icons.GetIconSprite("Attacks"), (object)____selectedCreature, true, true, 1f);
			}
			if (menuItemAction2 != null && RadialUIPlugin._removeOnSubmenuAttacks.CanAdd("Magic Missile", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction2, "Magic Missile", "", "", Icons.GetIconSprite("MagicMissile"), (object)____selectedCreature, true, true, 1f);
			}
			if (menuItemAction3 != null && RadialUIPlugin._removeOnSubmenuAttacks.CanAdd("RedLaser", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction3, "Red Laser", "", "", Icons.GetIconSprite("RedLaser"), (object)____selectedCreature, true, true, 1f);
			}
			if (menuItemAction4 != null && RadialUIPlugin._removeOnSubmenuAttacks.CanAdd("GreenLaser", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction4, "Green Laser", "", "", Icons.GetIconSprite("GreenLaser"), (object)____selectedCreature, true, true, 1f);
			}
			return false;
		}

		internal static void Postfix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = ____selectedCreature.CreatureId.Value;
			map.AddItems(RadialUIPlugin._onSubmenuAttacks, value);
		}
	}
	[HarmonyPatch(typeof(CreatureMenuBoardTool), "Begin")]
	internal sealed class CreatureRootMenuPatch
	{
		internal static MapMenu map;

		internal static void Postfix(CreatureBoardAsset ____selectedCreature, CreatureMenuBoardTool __instance, float ____hitHeightDif)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: 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_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: 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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0528: Unknown result type (might be due to invalid IL or missing references)
			//IL_052d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			NGuid val = (RadialUIPlugin.lastCreature = ____selectedCreature.CreatureId.Value);
			val = LocalClient.SelectedCreatureId.Value;
			NGuid value = ____selectedCreature.CreatureId.Value;
			map = MapMenuManager.OpenMenu(((Component)____selectedCreature).transform.position + Vector3.up * ____hitHeightDif, true);
			Action<MapMenu, object> menuAction = Reflections.GetMenuAction<CreatureMenuBoardTool>("Attack_Menu", __instance);
			if (LocalClient.SelectedCreatureId != default(CreatureGuid) && LocalClient.SelectedCreatureId != ____selectedCreature.CreatureId && menuAction != null && RadialUIPlugin._removeOnCharacter.CanAdd("Attacks", ((object)(NGuid)(ref val)).ToString(), ((object)(NGuid)(ref value)).ToString()))
			{
				map.AddMenuItem(Reflections.CallMethod<MenuType, CreatureMenuBoardTool>("AttackMenuStyle", __instance), menuAction, "Attacks", "", "", Icons.GetIconSprite("Attacks"), (object)null, true, false, 1f);
			}
			if (CreatureManager.PlayerCanControlCreature(LocalPlayer.Id, ____selectedCreature.CreatureId))
			{
				Action<MapMenu, object> menuAction2 = Reflections.GetMenuAction<CreatureMenuBoardTool>("Emote_Menu", __instance);
				Action<MapMenu, object> menuAction3 = Reflections.GetMenuAction<CreatureMenuBoardTool>("StatusEmote_Menu", __instance);
				Action<MapMenuItem, object> menuItemAction = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("Menu_ToggleTorch", __instance);
				if (menuAction2 != null && RadialUIPlugin._removeOnCharacter.CanAdd("Emotes", ((object)(NGuid)(ref val)).ToString(), ((object)(NGuid)(ref value)).ToString()))
				{
					map.AddMenuItem(Reflections.CallMethod<MenuType, CreatureMenuBoardTool>("EmoteMenuStyle", __instance), menuAction2, "Emotes", "", "", Icons.GetIconSprite("emote"), (object)null, true, false, 1f);
				}
				if (menuAction3 != null && RadialUIPlugin._removeOnCharacter.CanAdd("Status", ((object)(NGuid)(ref val)).ToString(), ((object)(NGuid)(ref value)).ToString()))
				{
					map.AddMenuItem(Reflections.CallMethod<MenuType, CreatureMenuBoardTool>("StatusEmoteMenuStyle", __instance), menuAction3, "Status", "", "", Icons.GetIconSprite("status_emote"), (object)null, true, false, 1f);
				}
				if (menuItemAction != null && RadialUIPlugin._removeOnCharacter.CanAdd("Torch", ((object)(NGuid)(ref val)).ToString(), ((object)(NGuid)(ref value)).ToString()))
				{
					map.AddToggleItem(____selectedCreature.TorchEnabled, menuItemAction, "Disable Torch", "Enable Torch", "", "", Icons.GetIconSprite("torch"), (object)null, true, 1f);
				}
				if (____selectedCreature.Link != null)
				{
					Action<MapMenu, object> menuAction4 = Reflections.GetMenuAction<CreatureMenuBoardTool>("LinkMenu", __instance);
					if (menuAction4 != null && RadialUIPlugin._removeOnCharacter.CanAdd("Link", ((object)(NGuid)(ref val)).ToString(), ((object)(NGuid)(ref value)).ToString()))
					{
						map.AddMenuItem((MenuType)2, menuAction4, "Link", "", "", Icons.GetIconSprite("link"), (object)null, true, false, 1f);
					}
				}
				if (LocalClient.IsInGmMode)
				{
					Action<MapMenuItem, object> menuItemAction2 = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("HideCreature", __instance);
					Action<MapMenu, object> menuAction5 = Reflections.GetMenuAction<CreatureMenuBoardTool>("Menu_GMTools", __instance);
					Action<MapMenu, object> menuAction6 = Reflections.GetMenuAction<CreatureMenuBoardTool>("Menu_KillMenu", __instance);
					Action<MapMenuItem, object> menuItemAction3 = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("ToggleFlying", __instance);
					if (menuItemAction2 != null && RadialUIPlugin._removeOnCharacter.CanAdd("Hide", ((object)(NGuid)(ref val)).ToString(), ((object)(NGuid)(ref value)).ToString()))
					{
						map.AddToggleItem(____selectedCreature.IsExplicitlyHidden, menuItemAction2, "Reveal", "Hide", "", "", Icons.GetIconSprite("creaturehide"), (object)null, true, 1f);
					}
					if (menuAction5 != null && RadialUIPlugin._removeOnCharacter.CanAdd("GM Tools", ((object)(NGuid)(ref val)).ToString(), ((object)(NGuid)(ref value)).ToString()))
					{
						map.AddMenuItem((MenuType)2, menuAction5, "GM Tools", "", "", Icons.GetIconSprite("dungeonmaster"), (object)null, true, false, 1f);
					}
					if (menuAction6 != null && RadialUIPlugin._removeOnCharacter.CanAdd("KillMenu", ((object)(NGuid)(ref val)).ToString(), ((object)(NGuid)(ref value)).ToString()))
					{
						map.AddMenuItem((MenuType)3, menuAction6, "KillMenu", "", "", Icons.GetIconSprite("remove"), (object)null, true, false, 1f);
					}
					if (menuItemAction3 != null && RadialUIPlugin._removeOnCharacter.CanAdd("Fly Toggle", ((object)(NGuid)(ref val)).ToString(), ((object)(NGuid)(ref value)).ToString()))
					{
						map.AddToggleItem(____selectedCreature.Flying, menuItemAction3, "Disable Flying", " Enable Flying", "", "", Icons.GetIconSprite("fly"), (object)null, true, 1f);
					}
				}
				Action<MapMenu, object> menuAction7 = Reflections.GetMenuAction<CreatureMenuBoardTool>("Morphs_Menu", __instance);
				if (menuAction7 != null && RadialUIPlugin._removeOnCharacter.CanAdd("Morphs", ((object)(NGuid)(ref val)).ToString(), ((object)(NGuid)(ref value)).ToString()))
				{
					map.AddMenuItem((MenuType)3, menuAction7, "Morphs", "", "", Icons.GetIconSprite("character"), (object)null, true, false, 1f);
				}
				Reflections.CallMethod<CreatureMenuBoardTool>("AddStats", __instance, new object[1] { map });
			}
			map.AddItems(RadialUIPlugin._onCharacterCallback, ____selectedCreature.CreatureId.Value);
		}
	}
	[HarmonyPatch(typeof(CreatureMenuBoardTool), "Emote_Menu")]
	internal sealed class EmotesSubMenuPatch
	{
		internal static bool Prefix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature, List<ActionTimeline> ____emotes, CreatureMenuBoardTool __instance)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = LocalClient.SelectedCreatureId.Value;
			NGuid value2 = ____selectedCreature.CreatureId.Value;
			Action<MapMenuItem, object> menuItemAction = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("CallEmote", __instance);
			if (menuItemAction == null)
			{
				return false;
			}
			for (int i = 0; i < ____emotes.Count; i++)
			{
				ActionTimeline val = ____emotes[i];
				if (RadialUIPlugin._removeOnSubmenuEmotes.CanAdd(((Object)val).name, ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
				{
					map.AddItem(menuItemAction, val.DisplayName, "", "", Icons.GetIconSprite(val.IconName), (object)((Object)val).name, false, false, 1f);
				}
			}
			return false;
		}

		internal static void Postfix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = ____selectedCreature.CreatureId.Value;
			map.AddItems(RadialUIPlugin._onSubmenuEmotes, value);
		}
	}
	[HarmonyPatch(typeof(CreatureMenuBoardTool), "Menu_GMTools")]
	internal sealed class GMToolsSubMenuPatch
	{
		internal static bool Prefix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature, CreatureMenuBoardTool __instance)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = LocalClient.SelectedCreatureId.Value;
			NGuid value2 = ____selectedCreature.CreatureId.Value;
			Action<MapMenu, object> menuAction = Reflections.GetMenuAction<CreatureMenuBoardTool>("Menu_SetCreaturePlayerPermission", __instance);
			Action<MapMenuItem, object> menuItemAction = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("Menu_RenameCreature", __instance);
			Action<MapMenuItem, object> menuItemAction2 = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("Menu_MakeNotUnique", __instance);
			Action<MapMenuItem, object> menuItemAction3 = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("Menu_MakeUnique", __instance);
			Action<MapMenu, object> menuAction2 = Reflections.GetMenuAction<CreatureMenuBoardTool>("Menu_SetSize", __instance);
			Action<MapMenu, object> menuAction3 = Reflections.GetMenuAction<CreatureMenuBoardTool>("BaseColor_Menu", __instance);
			MenuType val = (MenuType)((CampaignSessionManager.PlayersInfo.Count >= 20) ? 2 : 3);
			if (menuAction != null && RadialUIPlugin._removeOnSubmenuGm.CanAdd("", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddMenuItem(val, menuAction, "Player Permission", "", "", Icons.GetIconSprite("permission"), (object)null, true, false, 1f);
			}
			if (menuItemAction != null && RadialUIPlugin._removeOnSubmenuGm.CanAdd("Rename", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction, "Rename", "", "", Icons.GetIconSprite("rename"), (object)null, true, false, 1f);
			}
			if (menuItemAction2 != null && ____selectedCreature.IsUnique && RadialUIPlugin._removeOnSubmenuGm.CanAdd("Make Not Unique", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction2, "Make Not Unique", "", "", Icons.GetIconSprite("dungeonmaster"), (object)null, true, true, 1f);
			}
			else if (menuItemAction3 != null && RadialUIPlugin._removeOnSubmenuGm.CanAdd("Make Unique", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction3, "Make Unique", "", "", Icons.GetIconSprite("dungeonmaster"), (object)null, true, true, 1f);
			}
			if (menuAction2 != null && RadialUIPlugin._removeOnSubmenuGm.CanAdd("Set Size", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddMenuItem((MenuType)3, menuAction2, "Set Size", "", "", Icons.GetIconSprite("creaturesize"), (object)null, true, false, 1f);
			}
			if (menuAction3 != null && RadialUIPlugin._removeOnSubmenuGm.CanAdd("BaseColor", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddMenuItem((MenuType)3, menuAction3, "BaseColor", "", "", Icons.GetIconSprite("basecolor"), (object)null, true, false, 1f);
			}
			return false;
		}

		internal static void Postfix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = ____selectedCreature.CreatureId.Value;
			map.AddItems(RadialUIPlugin._onSubmenuGm, value);
		}
	}
	[HarmonyPatch(typeof(CreatureMenuBoardTool), "Menu_KillMenu")]
	internal sealed class KillSubMenuPatch
	{
		internal static bool Prefix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature, CreatureMenuBoardTool __instance)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = LocalClient.SelectedCreatureId.Value;
			NGuid value2 = ____selectedCreature.CreatureId.Value;
			Action<MapMenuItem, object> menuItemAction = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("Action_Kill", __instance);
			if (menuItemAction != null && RadialUIPlugin._removeOnSubmenuKill.CanShow("Kill Creature", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction, "Kill Creature", "", "", Icons.GetIconSprite("remove"), (object)____selectedCreature, true, true, 1f);
			}
			return false;
		}

		internal static void Postfix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = ____selectedCreature.CreatureId.Value;
			map.AddItems(RadialUIPlugin._onSubmenuKill, value);
		}
	}
	[HarmonyPatch(typeof(CreatureMenuBoardTool), "Menu_SetSize")]
	internal sealed class SizeSubMenuPatch
	{
		internal static bool Prefix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature, CreatureMenuBoardTool __instance)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = LocalClient.SelectedCreatureId.Value;
			NGuid value2 = ____selectedCreature.CreatureId.Value;
			Action<MapMenuItem, object> menuItemAction = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("Menu_Scale", __instance);
			if (menuItemAction == null)
			{
				return false;
			}
			if (RadialUIPlugin._removeOnSubmenuSize.CanAdd("0.5x0.5", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction, "0.5x0.5", "", "", Icons.GetIconSprite("05x05"), (object)0.5f, true, true, 1f);
			}
			if (RadialUIPlugin._removeOnSubmenuSize.CanAdd("1x1", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction, "1x1", "", "", Icons.GetIconSprite("1x1"), (object)1f, true, true, 1f);
			}
			if (RadialUIPlugin._removeOnSubmenuSize.CanAdd("2x2", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction, "2x2", "", "", Icons.GetIconSprite("2x2"), (object)2f, true, true, 1f);
			}
			if (RadialUIPlugin._removeOnSubmenuSize.CanAdd("3x3", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction, "3x3", "", "", Icons.GetIconSprite("3x3"), (object)3f, true, true, 1f);
			}
			if (RadialUIPlugin._removeOnSubmenuSize.CanAdd("4x4", ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
			{
				map.AddItem(menuItemAction, "4x4", "", "", Icons.GetIconSprite("4x4"), (object)4f, true, true, 1f);
			}
			return false;
		}

		internal static void Postfix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = ____selectedCreature.CreatureId.Value;
			map.AddItems(RadialUIPlugin._onSubmenuSize, value);
		}
	}
	[HarmonyPatch(typeof(CreatureMenuBoardTool), "Menu_Stats")]
	internal sealed class StatSubMenuPatch
	{
		internal static bool Prefix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = LocalClient.SelectedCreatureId.Value;
			NGuid value2 = ____selectedCreature.CreatureId.Value;
			string[] statNames = CampaignSessionManager.StatNames;
			for (int i = 0; i < statNames.Length; i++)
			{
				if (RadialUIPlugin._hideStat.CanAdd(i.ToString(), ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
				{
					map.AddStat(statNames[i], ____selectedCreature.CreatureId, i);
				}
			}
			return false;
		}

		internal static void Postfix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = ____selectedCreature.CreatureId.Value;
			map.AddItems(RadialUIPlugin._onStatCallback, value);
		}
	}
	[HarmonyPatch(typeof(CreatureMenuBoardTool), "StatusEmote_Menu")]
	internal sealed class StatusSubMenuPatch
	{
		internal static bool Prefix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature, List<ActionTimeline> ____statusEmotes, CreatureMenuBoardTool __instance)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = LocalClient.SelectedCreatureId.Value;
			NGuid value2 = ____selectedCreature.CreatureId.Value;
			Action<MapMenuItem, object> menuItemAction = Reflections.GetMenuItemAction<CreatureMenuBoardTool>("CallStatusEmote", __instance);
			if (menuItemAction == null)
			{
				return false;
			}
			for (int i = 0; i < ____statusEmotes.Count; i++)
			{
				ActionTimeline val = ____statusEmotes[i];
				if (RadialUIPlugin._removeOnSubmenuStatusEmotes.CanAdd(((Object)val).name, ((object)(NGuid)(ref value)).ToString(), ((object)(NGuid)(ref value2)).ToString()))
				{
					bool flag = ____selectedCreature.IsPersistantEmoteEnabled(____statusEmotes[i].ActionTimelineId);
					map.AddToggleItem(flag, menuItemAction, val.DisplayName, "", "", "", Icons.GetIconSprite(val.IconName), (object)____statusEmotes[i], false, 1f);
				}
			}
			return false;
		}

		internal static void Postfix(MapMenu map, object obj, CreatureBoardAsset ____selectedCreature)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			NGuid value = ____selectedCreature.CreatureId.Value;
			map.AddItems(RadialUIPlugin._onSubmenuStatusEmotes, value);
		}
	}
	[HarmonyPatch(typeof(GMBlockInteractMenuBoardTool), "Begin")]
	internal sealed class GMBlockMenuPatch
	{
		internal static void Postfix(ref GMBlockInteractMenuBoardTool __instance)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			Action<MapMenuItem, object> menuItemAction = Reflections.GetMenuItemAction<GMBlockInteractMenuBoardTool>("DeleteBlock", __instance);
			MapMenu val = MapMenuManager.OpenMenu(float3.op_Implicit(GMBlockInteractMenuBoardTool.block.WorldPosition), true);
			GMBlockInteractMenuBoardTool.block.OnOpenMenu(val);
			if (menuItemAction != null && RadialUIPlugin._removeOnGMBlock.CanAdd("Delete", null, null))
			{
				val.AddItem(menuItemAction, "Delete", "", "", Icons.GetIconSprite("delete"), (object)null, true, true, 1f);
			}
		}
	}
	[HarmonyPatch(typeof(GMBlockButtonAtmosphere), "OnOpenMenu")]
	internal sealed class GMBlockButtonPatch
	{
		internal static bool Prefix(ref MapMenu map, ref GMBlockButtonAtmosphere __instance)
		{
			Action<MapMenuItem, object> menuItemAction = Reflections.GetMenuItemAction<GMBlockButtonAtmosphere>("OnApply", __instance);
			Action<MapMenuItem, object> menuItemAction2 = Reflections.GetMenuItemAction<GMBlockButtonAtmosphere>("OnEdit", __instance);
			if (menuItemAction != null && RadialUIPlugin._removeOnGMBlock.CanAdd("Apply", null, null))
			{
				map.AddItem(menuItemAction, "Apply", "", "", Icons.GetIconSprite("apply"), (object)null, true, true, 1f);
			}
			if (menuItemAction2 != null && RadialUIPlugin._removeOnGMBlock.CanAdd("Edit", null, null))
			{
				map.AddItem(menuItemAction2, "Edit", "", "", Icons.GetIconSprite("edit"), (object)null, true, true, 1f);
			}
			return false;
		}

		internal static void Postfix(MapMenu map, GMDataBlockBase ____base)
		{
			map.AddItems(RadialUIPlugin._onGMBlock, ____base.AtmosphereBlock);
		}
	}
}