Decompiled source of ValHUD v1.6.1

plugins/ValHUD.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.TextCore.LowLevel;
using UnityEngine.UI;
using ValHUD.UI;
using ValHUD.Widgets;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace ValHUD
{
	internal static class ConfigWindowRefresh
	{
		private static bool _pending;

		private static bool _failed;

		private static object _manager;

		private static MethodInfo _rebuild;

		private static MemberInfo _displaying;

		public static void Request()
		{
			if (!_failed)
			{
				_pending = true;
			}
		}

		public static void Tick()
		{
			if (!_pending || _failed)
			{
				return;
			}
			_pending = false;
			try
			{
				if ((_manager != null || Find()) && IsOpen())
				{
					_rebuild.Invoke(_manager, null);
				}
			}
			catch (Exception ex)
			{
				_failed = true;
				Plugin.Log.LogInfo((object)("ValHUD: the settings window cannot be refreshed while open (" + (ex.InnerException ?? ex).Message + "); close and reopen it to see settings that apply again."));
			}
		}

		private static bool Find()
		{
			foreach (PluginInfo value in Chainloader.PluginInfos.Values)
			{
				object instance = value.Instance;
				if (instance == null)
				{
					continue;
				}
				Type type = instance.GetType();
				if (!(type.FullName != "ConfigurationManager.ConfigurationManager"))
				{
					_rebuild = type.GetMethod("BuildSettingList", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null);
					_displaying = (MemberInfo)(((object)type.GetProperty("DisplayingWindow", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)) ?? ((object)type.GetField("DisplayingWindow", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)));
					if (_rebuild == null || _displaying == null)
					{
						break;
					}
					_manager = instance;
					return true;
				}
			}
			_failed = true;
			Plugin.Log.LogInfo((object)"ValHUD: could not find the ConfigurationManager's list-rebuild method; close and reopen the settings window to see settings that apply again.");
			return false;
		}

		private static bool IsOpen()
		{
			object obj = ((_displaying is PropertyInfo propertyInfo) ? propertyInfo.GetValue(_manager, null) : ((FieldInfo)_displaying).GetValue(_manager));
			bool flag = default(bool);
			int num;
			if (obj is bool)
			{
				flag = (bool)obj;
				num = 1;
			}
			else
			{
				num = 0;
			}
			return (byte)((uint)num & (flag ? 1u : 0u)) != 0;
		}
	}
	internal class DivisionRule
	{
		public const string DefaultText = "100:10, 200:20, 25";

		public static readonly DivisionRule Default = Parse("100:10, 200:20, 25");

		private readonly List<float> _limits = new List<float>();

		private readonly List<float> _steps = new List<float>();

		private float _fallback = 25f;

		public float StepFor(float max)
		{
			for (int i = 0; i < _limits.Count; i++)
			{
				if (max <= _limits[i])
				{
					return _steps[i];
				}
			}
			return _fallback;
		}

		public static DivisionRule Parse(string text)
		{
			DivisionRule divisionRule = new DivisionRule();
			bool flag = true;
			string[] array = (text ?? "").Split(new char[1] { ',' });
			for (int i = 0; i < array.Length; i++)
			{
				string text2 = array[i].Trim();
				if (text2.Length != 0)
				{
					string[] array2 = text2.Split(new char[1] { ':' });
					float v3;
					if (array2.Length == 2 && TryF(array2[0], out var v) && TryF(array2[1], out var v2) && v2 > 0f)
					{
						divisionRule._limits.Add(v);
						divisionRule._steps.Add(v2);
					}
					else if (array2.Length == 1 && TryF(array2[0], out v3) && v3 > 0f)
					{
						divisionRule._fallback = v3;
					}
					else
					{
						flag = false;
					}
				}
			}
			divisionRule.SortByLimit();
			if (!flag)
			{
				ManualLogSource log = Plugin.Log;
				if (log != null)
				{
					log.LogWarning((object)("ValHUD: could not read Bar: Division Rule \"" + text + "\", using \"100:10, 200:20, 25\"."));
				}
				if (!(text == "100:10, 200:20, 25"))
				{
					return Parse("100:10, 200:20, 25");
				}
				return divisionRule;
			}
			return divisionRule;
		}

		private void SortByLimit()
		{
			for (int i = 1; i < _limits.Count; i++)
			{
				int num = i;
				while (num > 0 && _limits[num] < _limits[num - 1])
				{
					float value = _limits[num];
					_limits[num] = _limits[num - 1];
					_limits[num - 1] = value;
					float value2 = _steps[num];
					_steps[num] = _steps[num - 1];
					_steps[num - 1] = value2;
					num--;
				}
			}
		}

		private static bool TryF(string s, out float v)
		{
			return float.TryParse(s.Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out v);
		}
	}
	internal sealed class ConfigurationManagerAttributes
	{
		public int? Order;

		public bool? Browsable;

		public bool? HideSettingName;

		public bool? HideDefaultButton;

		public Action<ConfigEntryBase> CustomDrawer;

		public string DispName;
	}
	internal abstract class ElementConfig
	{
		protected readonly ConfigFile Cfg;

		protected readonly string Section;

		private int _order = 1000;

		private readonly Dictionary<ConfigEntryBase, ConfigurationManagerAttributes> _attrs = new Dictionary<ConfigEntryBase, ConfigurationManagerAttributes>();

		public readonly List<ConfigEntryBase> LayoutOnly = new List<ConfigEntryBase>();

		public readonly List<ConfigEntryBase> All = new List<ConfigEntryBase>();

		protected ConfigEntry<float> TextOutlineWidth;

		protected ConfigEntry<float> TextShadowOffset;

		protected ConfigEntry<float> TextShadowSoftness;

		protected ConfigEntry<Color> TextOutlineColor;

		protected ConfigEntry<Color> TextShadowColor;

		protected ConfigEntry<bool> TextShadow;

		protected ConfigEntry<bool> ShadowEnabled;

		protected ConfigEntry<bool> GlowEnabled;

		protected ConfigEntry<Color> ShadowColor;

		protected ConfigEntry<Color> GlowColor;

		protected ConfigEntry<float> ShadowOffsetX;

		protected ConfigEntry<float> ShadowOffsetY;

		protected ConfigEntry<float> GlowSize;

		protected ConfigEntry<float> GlowIntensity;

		private readonly List<(ConfigEntryBase entry, Func<bool> when)> _showRules = new List<(ConfigEntryBase, Func<bool>)>();

		protected ElementConfig(ConfigFile cfg, string section)
		{
			Cfg = cfg;
			Section = section;
		}

		protected ConfigEntry<float> F(string key, float def, float min, float max, string desc, bool layout = false)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			ConfigurationManagerAttributes configurationManagerAttributes = NextOrder();
			ConfigEntry<float> val = Cfg.Bind<float>(Section, key, def, new ConfigDescription(desc, (AcceptableValueBase)(object)new AcceptableValueRange<float>(min, max), new object[1] { configurationManagerAttributes }));
			Track((ConfigEntryBase)(object)val, layout, configurationManagerAttributes);
			return val;
		}

		protected ConfigEntry<int> I(string key, int def, int min, int max, string desc, bool layout = false)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			ConfigurationManagerAttributes configurationManagerAttributes = NextOrder();
			ConfigEntry<int> val = Cfg.Bind<int>(Section, key, def, new ConfigDescription(desc, (AcceptableValueBase)(object)new AcceptableValueRange<int>(min, max), new object[1] { configurationManagerAttributes }));
			Track((ConfigEntryBase)(object)val, layout, configurationManagerAttributes);
			return val;
		}

		protected ConfigEntry<T> B<T>(string key, T def, string desc, bool layout = false)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			ConfigurationManagerAttributes configurationManagerAttributes = NextOrder();
			ConfigEntry<T> val = Cfg.Bind<T>(Section, key, def, new ConfigDescription(desc, (AcceptableValueBase)null, new object[1] { configurationManagerAttributes }));
			Track((ConfigEntryBase)(object)val, layout, configurationManagerAttributes);
			return val;
		}

		private ConfigurationManagerAttributes NextOrder()
		{
			return new ConfigurationManagerAttributes
			{
				Order = _order--
			};
		}

		private void Track(ConfigEntryBase e, bool layout, ConfigurationManagerAttributes attrs)
		{
			All.Add(e);
			_attrs[e] = attrs;
			if (layout)
			{
				LayoutOnly.Add(e);
			}
		}

		protected void Present(params (ConfigEntryBase entry, string name)[] items)
		{
			int num = 1000;
			HashSet<ConfigEntryBase> hashSet = new HashSet<ConfigEntryBase>();
			for (int i = 0; i < items.Length; i++)
			{
				var (val, dispName) = items[i];
				if (val == null)
				{
					continue;
				}
				if (!hashSet.Add(val) || !_attrs.TryGetValue(val, out var value))
				{
					ManualLogSource log = Plugin.Log;
					if (log != null)
					{
						log.LogWarning((object)("ValHUD: [" + Section + "] " + val.Definition.Key + " is listed twice or is not part of this section."));
					}
				}
				else
				{
					value.Order = num--;
					value.DispName = dispName;
				}
			}
			foreach (ConfigEntryBase item in All)
			{
				if (!hashSet.Contains(item))
				{
					_attrs[item].Order = num--;
					ManualLogSource log2 = Plugin.Log;
					if (log2 != null)
					{
						log2.LogWarning((object)("ValHUD: [" + Section + "] " + item.Definition.Key + " has no place in the settings window; it is shown at the bottom."));
					}
				}
			}
		}

		protected void UseEditor(ConfigEntryBase entry, Action<ConfigEntryBase> editor)
		{
			_attrs[entry].CustomDrawer = editor;
		}

		protected void ShowWhen(Func<bool> when, params ConfigEntryBase[] entries)
		{
			foreach (ConfigEntryBase val in entries)
			{
				if (val != null && _attrs.ContainsKey(val))
				{
					_showRules.Add((val, when));
				}
			}
		}

		protected ConfigEntryBase[] AllBut(params ConfigEntryBase[] keep)
		{
			HashSet<ConfigEntryBase> hashSet = new HashSet<ConfigEntryBase>(keep);
			List<ConfigEntryBase> list = new List<ConfigEntryBase>();
			foreach (ConfigEntryBase item in All)
			{
				if (!hashSet.Contains(item))
				{
					list.Add(item);
				}
			}
			return list.ToArray();
		}

		protected static bool Has(ConfigEntry<string> file)
		{
			if (file != null)
			{
				return !string.IsNullOrWhiteSpace(file.Value);
			}
			return false;
		}

		public bool RefreshVisibility()
		{
			bool result = false;
			HashSet<ConfigEntryBase> hashSet = new HashSet<ConfigEntryBase>();
			foreach (var (item, func) in _showRules)
			{
				bool flag;
				try
				{
					flag = func();
				}
				catch
				{
					flag = true;
				}
				if (!flag)
				{
					hashSet.Add(item);
				}
			}
			foreach (var showRule in _showRules)
			{
				ConfigEntryBase item2 = showRule.entry;
				bool? flag2 = (hashSet.Contains(item2) ? new bool?(false) : ((bool?)null));
				if (_attrs[item2].Browsable != flag2)
				{
					_attrs[item2].Browsable = flag2;
					result = true;
				}
			}
			return result;
		}

		protected void ShowEffectRules()
		{
			ShowWhen(() => ShadowEnabled.Value, (ConfigEntryBase)ShadowColor, (ConfigEntryBase)ShadowOffsetX, (ConfigEntryBase)ShadowOffsetY);
		}

		protected void ShowTextRules()
		{
			ShowWhen(() => TextShadow.Value, (ConfigEntryBase)TextShadowColor, (ConfigEntryBase)TextShadowOffset, (ConfigEntryBase)TextShadowSoftness);
		}

		protected void BindText(string what, TextStyle d, string group)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			TextOutlineWidth = F("TextOutlineWidth", d.OutlineWidth, 0f, 1f, "Dark outline around " + what + "; it keeps the text readable on bright backgrounds such as snow. 0 = none, 0.2 = thin, 0.5 = thick.");
			TextOutlineColor = B<Color>("TextOutlineColor", d.OutlineColor, "Color of the outline around " + what + " (see " + group + ": Outline Width).");
			TextShadow = B("TextShadow", d.Shadow, "Drop shadow under " + what + ". " + group + ": Shadow Offset and " + group + ": Shadow Softness shape it.");
			TextShadowColor = B<Color>("TextShadowColor", d.ShadowColor, "Color of the shadow under " + what + "; its alpha (the last two digits) is how dark it is.");
			TextShadowOffset = F("TextShadowOffset", d.ShadowOffset, 0f, 1f, "How far the shadow of " + what + " falls, down and to the right. 0 = right under the text.");
			TextShadowSoftness = F("TextShadowSoftness", d.ShadowSoftness, 0f, 1f, "Blur of the shadow under " + what + ": 0 = sharp, 1 = very soft.");
		}

		protected TextStyle ResolveText(Color color)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: 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_0029: Unknown result type (might be due to invalid IL or missing references)
			//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)
			return new TextStyle
			{
				Color = color,
				OutlineWidth = TextOutlineWidth.Value,
				OutlineColor = TextOutlineColor.Value,
				Shadow = TextShadow.Value,
				ShadowColor = TextShadowColor.Value,
				ShadowOffset = TextShadowOffset.Value,
				ShadowSoftness = TextShadowSoftness.Value
			};
		}

		protected void BindEffects(EffectSpec d, string group, string textGroup)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			ShadowEnabled = B("ShadowEnabled", d.Shadow, "Drop shadow under this element's shape (the texts have their own, see " + textGroup + ": Shadow).");
			ShadowColor = B<Color>("ShadowColor", d.ShadowColor, "Color of the drop shadow; its alpha (the last two digits) is how dark it is.");
			ShadowOffsetX = F("ShadowOffsetX", d.ShadowOffset.x, -30f, 30f, "How far the drop shadow falls sideways (positive = right). It falls the same way on screen even when the element is rotated, vertical or reversed.");
			ShadowOffsetY = F("ShadowOffsetY", d.ShadowOffset.y, -30f, 30f, "How far the drop shadow falls up or down (negative = down).");
			GlowEnabled = B("GlowEnabled", d.Glow, "Soft glow around this element's shape. " + group + ": Glow Color, " + group + ": Glow Size and " + group + ": Glow Intensity shape it.");
			GlowColor = B<Color>("GlowColor", d.GlowColor, "Color of the glow; its alpha (the last two digits) is how strong it is. Example: FFD27F73 = warm gold at about 45 %.");
			GlowSize = F("GlowSize", d.GlowSize, 1f, 80f, "How far the glow spreads out from the edge.");
			GlowIntensity = F("GlowIntensity", d.GlowIntensity, 0f, 3f, "How the glow fades: 1 = evenly from " + group + ": Glow Color to transparent; up to 3 = brighter, with a solid band close to the edge; below 1 = fainter.");
		}

		protected EffectSpec ResolveEffects()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			return new EffectSpec
			{
				Shadow = ShadowEnabled.Value,
				ShadowColor = ShadowColor.Value,
				ShadowOffset = new Vector2(ShadowOffsetX.Value, ShadowOffsetY.Value),
				Glow = GlowEnabled.Value,
				GlowColor = GlowColor.Value,
				GlowSize = GlowSize.Value,
				GlowIntensity = GlowIntensity.Value
			};
		}
	}
	internal class BarConfig : ElementConfig
	{
		public readonly ConfigEntry<bool> ValueShowMax;

		public readonly ConfigEntry<bool> Visible;

		public readonly ConfigEntry<bool> ShowValue;

		public readonly ConfigEntry<bool> ShowIcon;

		public readonly ConfigEntry<bool> ScaleLengthWithMax;

		public readonly ConfigEntry<bool> ShineEnabled;

		public readonly ConfigEntry<bool> Divisions;

		public readonly ConfigEntry<bool> ForceVisible;

		public readonly ConfigEntry<bool> ShowWhenNone;

		public readonly ConfigEntry<bool> AutoHide;

		public readonly ConfigEntry<float> AutoHideDelay;

		public readonly ConfigEntry<float> FadeTime;

		public readonly ConfigEntry<HudAnchor> Anchor;

		public readonly ConfigEntry<float> X;

		public readonly ConfigEntry<float> Y;

		public readonly ConfigEntry<float> Rotation;

		public readonly ConfigEntry<float> Length;

		public readonly ConfigEntry<float> Thickness;

		public readonly ConfigEntry<float> StartSlant;

		public readonly ConfigEntry<float> EndSlant;

		public readonly ConfigEntry<float> ScaleFullAt;

		public readonly ConfigEntry<float> OutlineThickness;

		public readonly ConfigEntry<float> ValueFontSize;

		public readonly ConfigEntry<float> ValueX;

		public readonly ConfigEntry<float> ValueY;

		public readonly ConfigEntry<float> IconX;

		public readonly ConfigEntry<float> IconY;

		public readonly ConfigEntry<float> IconSize;

		public readonly ConfigEntry<float> ShineStrength;

		public readonly ConfigEntry<float> DivisionWidth;

		public readonly ConfigEntry<BarOrientation> Orientation;

		public readonly ConfigEntry<FillDirection> Direction;

		public readonly ConfigEntry<BarEnd> StartShape;

		public readonly ConfigEntry<BarEnd> EndShape;

		public readonly ConfigEntry<GradientDirection> Gradient;

		public readonly ConfigEntry<Color> Color;

		public readonly ConfigEntry<Color> ColorEnd;

		public readonly ConfigEntry<Color> Background;

		public readonly ConfigEntry<Color> OutlineColor;

		public readonly ConfigEntry<Color> TrailColor;

		public readonly ConfigEntry<Color> ValueColor;

		public readonly ConfigEntry<Color> IconColor;

		public readonly ConfigEntry<Color> DivisionColor;

		public readonly ConfigEntry<string> ValueFormat;

		public readonly ConfigEntry<string> IconFile;

		public readonly ConfigEntry<string> DivisionRuleText;

		public readonly ConfigEntry<BarPoint> ValueAttach;

		public readonly ConfigEntry<BarPoint> IconAttach;

		public readonly ConfigEntry<bool> IconShadow;

		public readonly ConfigEntry<bool> IconGlow;

		public readonly ConfigEntry<Color> IconShadowColor;

		public readonly ConfigEntry<Color> IconOutlineColor;

		public readonly ConfigEntry<Color> IconGlowColor;

		public readonly ConfigEntry<float> IconShadowOffsetX;

		public readonly ConfigEntry<float> IconShadowOffsetY;

		public readonly ConfigEntry<float> IconOutlineWidth;

		public readonly ConfigEntry<float> IconGlowSize;

		public readonly ConfigEntry<float> IconGlowIntensity;

		public readonly ConfigEntry<TextAlign> ValueAlign;

		public readonly ConfigEntry<BarStyle> Style;

		public readonly ConfigEntry<float> OrbSize;

		public readonly ConfigEntry<bool> OrbFillByArea;

		public readonly ConfigEntry<bool> OrbTintLiquid;

		public readonly ConfigEntry<string> OrbBackFile;

		public readonly ConfigEntry<string> OrbLiquidFile;

		public readonly ConfigEntry<string> OrbGlassFile;

		public readonly ConfigEntry<string> OrbFrameFile;

		public readonly ConfigEntry<float> OrbFrameScale;

		public readonly ConfigEntry<bool> ShieldShow;

		public readonly ConfigEntry<bool> ShieldPreview;

		public readonly ConfigEntry<Color> ShieldColor;

		public readonly ConfigEntry<Color> ShieldStartColor;

		public readonly ConfigEntry<float> ShieldHeight;

		public readonly ConfigEntry<float> ShieldOpacity;

		public readonly ConfigEntry<float> ShieldStartOpacity;

		public readonly ConfigEntry<float> ShieldGradientLength;

		public readonly ConfigEntry<float> ShieldFrontSlant;

		public readonly ConfigEntry<BarEnd> ShieldFrontShape;

		public readonly ConfigEntry<BarEnd> EnduranceFrontShape;

		public readonly ConfigEntry<string> EnduranceFrameFile;

		public readonly ConfigEntry<float> EnduranceFrameScale;

		public readonly ConfigEntry<bool> ShieldValueShow;

		public readonly ConfigEntry<bool> ShieldIconShow;

		public readonly ConfigEntry<bool> ShieldTextShadow;

		public readonly ConfigEntry<bool> ShieldIconShadow;

		public readonly ConfigEntry<bool> ShieldIconGlow;

		public readonly ConfigEntry<string> ShieldValueFormat;

		public readonly ConfigEntry<string> ShieldIconFile;

		public readonly ConfigEntry<ShieldLabelAttach> ShieldValueAttach;

		public readonly ConfigEntry<float> ShieldValueFontSize;

		public readonly ConfigEntry<float> ShieldValueX;

		public readonly ConfigEntry<float> ShieldValueY;

		public readonly ConfigEntry<float> ShieldValueSpacing;

		public readonly ConfigEntry<float> ShieldTextOutlineWidth;

		public readonly ConfigEntry<float> ShieldTextShadowOffset;

		public readonly ConfigEntry<float> ShieldTextShadowSoftness;

		public readonly ConfigEntry<float> ShieldIconSize;

		public readonly ConfigEntry<float> ShieldIconOutlineWidth;

		public readonly ConfigEntry<float> ShieldIconShadowOffsetX;

		public readonly ConfigEntry<float> ShieldIconShadowOffsetY;

		public readonly ConfigEntry<float> ShieldIconGlowSize;

		public readonly ConfigEntry<float> ShieldIconGlowIntensity;

		public readonly ConfigEntry<Color> ShieldValueColor;

		public readonly ConfigEntry<Color> ShieldTextOutlineColor;

		public readonly ConfigEntry<Color> ShieldTextShadowColor;

		public readonly ConfigEntry<Color> ShieldIconColor;

		public readonly ConfigEntry<Color> ShieldIconOutlineColor;

		public readonly ConfigEntry<Color> ShieldIconShadowColor;

		public readonly ConfigEntry<Color> ShieldIconGlowColor;

		public readonly ConfigEntry<bool> EnduranceShow;

		public readonly ConfigEntry<bool> EndurancePreview;

		public readonly ConfigEntry<bool> EnduranceEdge;

		public readonly ConfigEntry<bool> EnduranceShimmer;

		public readonly ConfigEntry<bool> EnduranceFlash;

		public readonly ConfigEntry<Color> EnduranceColor;

		public readonly ConfigEntry<float> EnduranceOpacity;

		public readonly ConfigEntry<float> EnduranceActiveOpacity;

		public readonly ConfigEntry<float> EnduranceStartOpacity;

		public readonly ConfigEntry<float> EnduranceGradientLength;

		public readonly ConfigEntry<float> EnduranceActiveStartOpacity;

		public readonly ConfigEntry<float> EnduranceActiveGradientLength;

		public readonly ConfigEntry<float> EnduranceFrontSlant;

		public readonly ConfigEntry<float> EnduranceFlashIntensity;

		public readonly ConfigEntry<float> EnduranceFlashTime;

		public BarConfig(ConfigFile cfg, string section, BarSpec d, bool optional = false, string noneText = null, bool shield = false)
			: base(cfg, section)
		{
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0428: Unknown result type (might be due to invalid IL or missing references)
			//IL_046c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0489: Unknown result type (might be due to invalid IL or missing references)
			//IL_04df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0583: Unknown result type (might be due to invalid IL or missing references)
			//IL_0684: Unknown result type (might be due to invalid IL or missing references)
			//IL_0729: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0903: Unknown result type (might be due to invalid IL or missing references)
			//IL_0986: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b8d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dbe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e60: Unknown result type (might be due to invalid IL or missing references)
			Visible = B("Visible", def: true, "Shows this bar. Eitr and adrenaline only appear while your character has some (like the vanilla bars): Show When Empty keeps them on screen empty, and Preview (Fake Value) shows them with a fake value while you design.");
			Style = B("Style", d.Style, "Bar = a straight bar. Orb = a round orb that fills from the bottom up, like in Diablo or Path of Exile; Orb: Size sets how big it is. The Bar and Bar/Orb settings style the orb too (colors, outline, shadow, glow, shine), except the ones marked \"Bar style only\".");
			if (optional)
			{
				ForceVisible = B("ForceVisible", def: false, "Preview for designing your HUD: draws this bar with a fake value (75 % full) instead of your real one, even when your character has none, so you can place and style it. Only the drawing changes; your real values are never touched. Turn it off when you are done. Independent of Show When Empty. Not saved in layouts.");
			}
			if (noneText != null)
			{
				ShowWhenNone = B("ShowWhenNone", def: false, "Keeps this bar on screen, empty, while your character has " + noneText + ". Off = like the vanilla HUD: the bar only appears while your max is above 0. A bar that is at 0 while your max is above 0 stays on screen either way. Auto Hide still applies on top of this. With Bar: Grow With Max on, an empty bar is drawn at its shortest. Independent of Preview (Fake Value).");
			}
			AutoHide = B("AutoHide", d.AutoHide, "Hides this bar while it has nothing to show, like the vanilla stamina bar does. Health, Stamina and Eitr hide when they are full and come back as soon as they drop. Adrenaline hides when it is 0 and appears as soon as you gain some. Off = the bar is always shown. Turn it off while you place and style the bar. Not saved in layouts, so loading a layout never changes it.");
			AutoHideDelay = F("AutoHideDelay", d.AutoHideDelay, 0f, 30f, "Auto Hide only: seconds the bar stays after it becomes full (or empty, for adrenaline) before it starts to fade. Example: 3 = you still see it for 3 seconds. 0 = it starts fading right away. Not saved in layouts.");
			FadeTime = F("FadeTime", d.FadeTime, 0f, 5f, "Auto Hide only: seconds the bar takes to fade out and back in. 0 = it disappears and reappears instantly. Not saved in layouts.");
			Anchor = B("Anchor", d.Anchor, "The screen point this bar is positioned from: a corner, the middle of the top or bottom edge, or the Center. X and Y move the bar away from it. Example: BottomCenter with X = 0 and Y = 100 puts the bar's start in the middle of the screen, 100 above the bottom edge. Picking the nearest corner or edge keeps the bar there on any screen size.", layout: true);
			X = F("X", d.X, -4000f, 4000f, "Horizontal distance from Anchor to the bar's start, the end where the fill begins (positive = right). Every distance is multiplied by General > Scale. With Bar: Fill Direction = Reversed, the start of a horizontal bar is its right end. With Style = Orb, X and Y place the orb's center.", layout: true);
			Y = F("Y", d.Y, -4000f, 4000f, "Vertical distance from Anchor to the bar's start (positive = up). With Bar: Fill Direction = Reversed, the start of a vertical bar is its top end. With Style = Orb, the orb's center.", layout: true);
			Rotation = F("Rotation", d.Rotation, -180f, 180f, "Turns the whole bar, with its value and icon, around its start, in degrees (positive = counter-clockwise). Example: 90 makes a horizontal bar point up; 5 or -5 gives it a slight tilt. An orb turns around its center, and its liquid always stays level.", layout: true);
			Orientation = B("Orientation", d.Orientation, "Horizontal or Vertical. Together with Bar: Fill Direction it sets which way the bar fills: Horizontal + Normal = left to right, Horizontal + Reversed = right to left, Vertical + Normal = bottom to top, Vertical + Reversed = top to bottom. Bar style only.");
			Direction = B("FillDirection", d.Direction, "Normal or Reversed: which end the bar fills from (Bar: Orientation lists the four combinations). Bar: Start Shape is always the end where the fill begins and Bar: End Shape the far end, so a reversed bar keeps its shapes pointing the right way. Bar style only.");
			Length = F("Length", d.Length, 20f, 2000f, "Length of the bar along its fill direction. With Bar: Grow With Max on, this is the longest it gets. Bar style only.");
			Thickness = F("Thickness", d.Thickness, 2f, 200f, "How thick the bar is, across its fill direction. Bar style only.");
			StartShape = B("StartShape", d.StartShape, "Shape of the end where the fill starts: Flat |, Forward /, Backward \\, Notch > (cut into the bar) or Point < (a tip sticking out). Bar: Start Slant sets how far the shape reaches into the bar. Bar style only.");
			StartSlant = F("StartSlant", d.StartSlant, 0f, 300f, "How far the start shape reaches into the bar (0 = flat). For Point and Notch, about half the Bar: Thickness looks balanced. Bar style only.");
			EndShape = B("EndShape", d.EndShape, "Shape of the far end: Flat |, Forward /, Backward \\, Notch < (cut into the bar) or Point > (a tip sticking out). Bar: End Slant sets how far it reaches. Examples: Forward on both ends with the same slant = a parallelogram; Point on both ends = a long hexagon. Bar style only.");
			EndSlant = F("EndSlant", d.EndSlant, 0f, 300f, "How far the far-end shape reaches into the bar (0 = flat). For Point and Notch, about half the Bar: Thickness looks balanced. Bar style only.");
			ScaleLengthWithMax = B("ScaleLengthWithMax", def: false, "Makes the bar grow with your max value, like the vanilla bars: its length is Bar: Length x (max / Bar: Full Length At), never more than Bar: Length. Example: length 600 and full length at 300 with 150 max health = a bar 300 long; from 300 max health on, it stays at 600. Bar style only.");
			ScaleFullAt = F("ScaleFullAt", d.ScaleFullAt, 10f, 2000f, "Bar: Grow With Max only: the max value at which the bar reaches its full Bar: Length. Lower = it reaches full length sooner. Bar style only.");
			OrbSize = F("OrbSize", d.OrbSize, 20f, 800f, "Style = Orb only: the orb's diameter. Like every size, it is multiplied by General > Scale.");
			OrbFillByArea = B("OrbFillByArea", d.OrbFillByArea, "Style = Orb only. Off = the liquid's height follows the value, like in Diablo: at 50 % it reaches the middle, but a round orb at 25 % looks only about 20 % full, and at 10 % about 5 %, so low values look more alarming. On = the amount of liquid you see matches the value exactly (at low values the level sits a little higher).");
			OrbBackFile = B("OrbBackImage", d.OrbBackFile, "Style = Orb only. A PNG in plugins/ValHUD/icons for the empty orb, behind the liquid, e.g. \"orbs/orb-back.png\" (a sample that comes with the mod). It replaces Bar: Background Color. Type a file name, or press Choose to pick one of the PNGs in plugins/ValHUD/icons/orbs (put your own there too). Keep images at 512 px or less: they use video memory (a 512 px image about 1.4 MB, a 2048 px one about 22 MB). Empty = the built-in drawing; a missing file falls back to it too (the log says so).");
			OrbLiquidFile = B("OrbLiquidImage", d.OrbLiquidFile, "Style = Orb only. A PNG for the liquid, revealed from the bottom up as the value changes, like in Diablo, e.g. \"orbs/orb-fill.png\". Crop it to the orb's circle: the level is measured on the whole image. The trail uses the same image, tinted with Bar: Trail Color. Type a file name, or press Choose to pick one of the PNGs in plugins/ValHUD/icons/orbs (put your own there too). Keep images at 512 px or less: they use video memory (a 512 px image about 1.4 MB, a 2048 px one about 22 MB). Empty = the built-in drawing; a missing file falls back to it too (the log says so).");
			OrbTintLiquid = B("OrbTintLiquid", d.OrbTintLiquid, "Orb: Liquid Image only. On = the image is multiplied by Bar: Color, so one grey image serves every bar (red health, blue eitr...). Off = the image keeps its own colors.");
			OrbGlassFile = B("OrbGlassImage", d.OrbGlassFile, "Style = Orb only. A PNG drawn over the liquid for the glass: highlights, reflections, shading, e.g. \"orbs/orb-glass.png\". It replaces Bar: Shine. Type a file name, or press Choose to pick one of the PNGs in plugins/ValHUD/icons/orbs (put your own there too). Keep images at 512 px or less: they use video memory (a 512 px image about 1.4 MB, a 2048 px one about 22 MB). Empty = the built-in drawing; a missing file falls back to it too (the log says so).");
			OrbFrameFile = B("OrbFrameImage", d.OrbFrameFile, "Style = Orb only. A PNG drawn over the orb (under the value and icon): a frame or ornament around it, e.g. \"orbs/orb-frame.png\". Orb: Frame Size sets its size. Type a file name, or press Choose to pick one of the PNGs in plugins/ValHUD/icons/orbs (put your own there too). Keep it at 512 px or less (video memory). Empty = no frame; a missing file is skipped (the log says so).");
			OrbFrameScale = F("OrbFrameScale", d.OrbFrameScale, 0.5f, 3f, "Orb: Frame Image only: its size as a multiple of Orb: Size. 1 = the size of the orb; 1.25 = a quarter bigger, so a ring around the orb fits outside it.");
			Color = B<Color>("Color", d.Color, "Fill color. With a Bar: Gradient, the color the gradient starts from (Bar: End Color is where it ends). On an orb with Orb: Liquid Image, it tints the image while Orb: Tint Liquid Image is on.");
			ColorEnd = B<Color>("ColorEnd", d.ColorEnd, "Second fill color, only used when Bar: Gradient is not None.");
			Gradient = B("Gradient", d.Gradient, "How Bar: Color and Bar: End Color blend. None = solid Bar: Color. Horizontal = along the bar: Bar: Color at the start, Bar: End Color at the far end (it follows Bar: Fill Direction). Vertical = across the bar's thickness: Bar: Color on one edge, Bar: End Color on the other. On an orb: Vertical = Bar: Color at the top, Bar: End Color at the bottom; Horizontal = Bar: Color on the left, Bar: End Color on the right.");
			Background = B<Color>("BackgroundColor", d.Background, "Color of the empty part of the bar, behind the fill. Colors are RRGGBBAA: the last two digits are the opacity, e.g. 0000008C = black at 55 %, 00000000 = invisible. On an orb, Orb: Back Image replaces it.");
			OutlineThickness = F("OutlineThickness", d.OutlineThickness, 0f, 30f, "A solid line around the whole bar, drawn outside its edge so it never covers the fill (0 = none). Bar: Outline Color sets its color.");
			OutlineColor = B<Color>("OutlineColor", d.OutlineColor, "Color of the outline (see Bar: Outline Width).");
			TrailColor = B<Color>("TrailColor", d.TrailColor, "When you lose health or use stamina, the part you lost stays visible in this color for about half a second, then slides down to the new value (like the vanilla bars). A low alpha makes it subtle; alpha 00 turns it off.");
			Divisions = B("Divisions", d.Divisions, "Draws marks across the bar every N points, like a ruler, so you can read the value at a glance. Bar: Division Rule picks N from the max value. Bar style only.");
			DivisionRuleText = B("DivisionRule", "100:10, 200:20, 25", "How far apart the marks are, depending on the bar's max value. Format: limit:step pairs, then one step for anything above. Example \"100:10, 200:20, 25\": max up to 100 = a mark every 10, up to 200 = every 20, above 200 = every 25. The order of the pairs does not matter. A rule that can't be read falls back to the default (the log says so). Bar style only.");
			DivisionColor = B<Color>("DivisionColor", d.DivisionColor, "Color of the division marks (see Bar: Divisions). Bar style only.");
			DivisionWidth = F("DivisionWidth", d.DivisionWidth, 0.5f, 10f, "Width of each division mark. Bar style only.");
			ShowValue = B("ShowValue", def: true, "Shows the bar's number. Value: Format sets what it says; Value: Attach To, Value: Align, Value: X and Value: Y where it sits.");
			ValueFormat = B("ValueFormat", "{0}", "What the number says: {0} = current value, {1} = max. Examples: \"{0}\" shows 85, \"{0}/{1}\" shows 85/120, \"{0} HP\" shows 85 HP. Any other text is shown as written. A format that can't be used falls back to {0} (the log says so).");
			ValueFontSize = F("ValueFontSize", d.ValueFontSize, 6f, 96f, "Size of the number. The font is General > Numbers: Font.");
			ValueColor = B<Color>("ValueColor", d.Text.Color, "Color of the number.");
			ValueAttach = B("ValueAttach", d.ValueAttach, "Which point of the bar the number is placed from, as seen on screen: Left, Right, Top or Bottom = the middle of that side; Center = the middle of the bar, on top of the fill. It follows the bar as its length changes. Picking one puts the number just outside that side and sets Value: Align to match; Value: X and Value: Y then fine-tune it.");
			ValueAlign = B("ValueAlign", d.ValueAlign, "Which part of the number sits on its point: Left = it starts there and grows to the right, Right = it ends there and grows to the left, Center = centered on it. Example: a number to the right of the bar reads best with Left, one to its left with Right.");
			ValueX = F("ValueX", d.ValueX, -2000f, 2000f, "Moves the number sideways from its Value: Attach To point (positive = right). It turns with the bar's Rotation.");
			ValueY = F("ValueY", d.ValueY, -2000f, 2000f, "Moves the number up or down from its Value: Attach To point (positive = up). It turns with the bar's Rotation.");
			ShowIcon = B("ShowIcon", def: true, "Shows the bar's icon: the PNG in Icon: File, or the built-in one.");
			IconFile = B("IconFile", d.IconFile, "A PNG in plugins/ValHUD/icons, e.g. \"first-aid.png\" (.png can be left out; subfolders work, e.g. \"mine/heart.png\"). Draw it white on a transparent background: Icon: Color tints it. Empty = the built-in icon (a cross, a bolt or a ring). A missing file also falls back to the built-in icon (the log says so).");
			IconSize = F("IconSize", d.IconSize, 2f, 200f, "Size of the icon.");
			IconColor = B<Color>("IconColor", d.IconColor, "Color the icon is tinted with. White keeps a PNG's own colors.");
			IconAttach = B("IconAttach", d.IconAttach, "Which point of the bar the icon is placed from, as seen on screen: Left, Right, Top or Bottom = the middle of that side; Center = the middle of the bar. Picking one puts the icon just outside that side; Icon: X and Icon: Y then fine-tune it.");
			IconX = F("IconX", d.IconX, -2000f, 2000f, "Moves the icon sideways from its Icon: Attach To point (positive = right).");
			IconY = F("IconY", d.IconY, -2000f, 2000f, "Moves the icon up or down from its Icon: Attach To point (positive = up).");
			IconShadow = B("IconShadow", d.IconShadow, "Drop shadow under the icon, separate from the bar's own shadow.");
			IconShadowColor = B<Color>("IconShadowColor", d.IconShadowColor, "Color of the icon's drop shadow.");
			IconShadowOffsetX = F("IconShadowOffsetX", d.IconShadowOffset.x, -20f, 20f, "How far the icon's shadow falls sideways (positive = right).");
			IconShadowOffsetY = F("IconShadowOffsetY", d.IconShadowOffset.y, -20f, 20f, "How far the icon's shadow falls up or down (negative = down).");
			IconOutlineWidth = F("IconOutlineWidth", d.IconOutlineWidth, 0f, 10f, "A solid line around the icon's own shape (it follows the drawing, not a box). 0 = none. PNG icons only.");
			IconOutlineColor = B<Color>("IconOutlineColor", d.IconOutlineColor, "Color of the icon's outline.");
			IconGlow = B("IconGlow", d.IconGlow, "A soft glow around the icon's own shape, separate from the bar's glow. PNG icons only.");
			IconGlowColor = B<Color>("IconGlowColor", d.IconGlowColor, "Color of the icon's glow; its alpha (the last two digits) is how strong it is.");
			IconGlowSize = F("IconGlowSize", d.IconGlowSize, 1f, 40f, "How far the icon's glow spreads.");
			IconGlowIntensity = F("IconGlowIntensity", d.IconGlowIntensity, 0f, 3f, "How the icon's glow fades: 1 = soft; up to 3 = brighter and more solid near the icon; below 1 = fainter.");
			BindText("the value", d.Text, "Value");
			BindEffects(d.Fx, "Bar/Orb", "Value");
			ShineEnabled = B("ShineEnabled", d.Fx.Shine, "A glossy look on the fill: a light band across the top and a soft shade along the bottom, like glass. On an orb: a highlight over its upper part and a soft shade around its rim, which stay still while the liquid moves. Orb: Glass Image replaces it.");
			ShineStrength = F("ShineStrength", d.Fx.ShineStrength, 0f, 1f, "How strong the shine is: 0 = none, 1 = strongest.");
			if (shield)
			{
				ShieldShow = B("ShieldShow", def: true, "Shows the Rune Shield of the mod Path of Valheiman over this bar or orb: a layer that takes damage before your health does, and recharges. It is measured against its own maximum: a full shield fills the whole bar or orb, half a shield fills half. Nothing is drawn while you have no shield, or if that mod isn't installed. Not an extra bar: it covers part of the health, so Shield: Height (bars), its colors and the Shield opacities decide how much of the health stays visible. On an orb it is a second liquid over the health, rising from the bottom like it.");
				ShieldColor = B<Color>("ShieldColor", d.ShieldColor, "The marked end of the shield's gradient: the far end of a bar, the top of an orb's liquid. Only its RGB matters (the alpha digits are ignored): how solid it is comes from Shield: End Opacity. The gradient goes from Shield: Start Color to this one along the shield itself, so it looks the same however full the shield is.  On an orb with Orb: Liquid Image, the shield uses that image too, with the same gradient. When it takes a hit, the part it lost stays visible in Bar: Trail Color for a moment, like health.");
				ShieldOpacity = F("ShieldOpacity", d.ShieldOpacity, 0f, 1f, "How solid the END of the shield's gradient is (the far end of a bar, the top of an orb's liquid), on bars and orbs: 1 = fully solid, 0 = invisible. It is independent of the alpha digits of the color, which are ignored. It also scales the part of the shield that was just lost (Bar: Trail Color).");
				ShieldHeight = F("ShieldHeight", d.ShieldHeight, 0.1f, 1f, "How much of the bar's thickness the shield covers, as a strip along its lower edge: 0.4 = the lower 40 %, so your health stays readable above it. 1 = the whole bar. Bar style only.");
				ShieldPreview = B("ShieldPreview", def: false, "Preview for designing your HUD: draws the shield at 60 % even if you have none, or if Path of Valheiman isn't installed, so you can style it. Only the drawing changes. Turn it off when you are done. Not saved in layouts.");
				ShieldStartColor = B<Color>("ShieldStartColor", d.ShieldStartColor, "The start of the shield's gradient: the start of a bar, the bottom of an orb's liquid. By default the same blue as Shield: End Color but almost transparent, so the shield fades in and your health shows through at its start. Make it equal to the end color for a flat shield. Only its RGB matters: how solid it is comes from Shield: Start Opacity.");
				ShieldStartOpacity = F("ShieldStartOpacity", d.ShieldStartOpacity, 0f, 1f, "How solid the START of the shield's gradient is (the start of a bar, the bottom of an orb's liquid): 0 = fully transparent, 1 = fully solid. Independent of the color's alpha digits, which are ignored. Put it equal to Shield: End Opacity for a flat shield.");
				ShieldGradientLength = F("ShieldGradientLength", d.ShieldGradientLength, 0.05f, 1f, "How much of the shield the gradient takes up, counted from its far end (a bar's end, an orb's liquid surface): 1 = the whole shield fades from the start color to the end color; 0.2 = only the last 20 % changes and the other 80 % stays the start color (near transparent by default), so the color shows just near the edge.");
				ShieldFrontShape = B("ShieldFrontShape", d.ShieldFrontShape, "Shape of the line where the shield ends (and where its trail starts): Flat | is a straight cut; Point > an arrow tip like a bar's end; Forward / and Backward \\ lean; Notch < cuts inward. Bar style only.");
				ShieldFrontSlant = F("ShieldFrontSlant", d.ShieldFrontSlant, 0f, 100f, "How far the shield's front shape reaches back from its tip, in px (0 = straight). The shield is a thin strip, so a small value (3 to 10) looks right. Bar style only.");
				ShieldLabelSpec shieldLabelSpec = new ShieldLabelSpec
				{
					Text = d.Text
				};
				ShieldValueShow = B("ShieldValueShow", shieldLabelSpec.ShowText, "Shows the shield's number next to its icon, outside the bar or orb (Shield Value: Attach To says where). Only while you have a shield, or with Shield: Preview. Shield Icon: Show turns the icon on or off.");
				ShieldValueFormat = B("ShieldValueFormat", shieldLabelSpec.Format, "What the shield's number says: {0} = shield left, {1} = its max. Examples: \"{0}\" shows 35, \"{0} / {1}\" shows 35 / 70. Any other text is shown as written.");
				ShieldValueFontSize = F("ShieldValueFontSize", shieldLabelSpec.FontSize, 6f, 96f, "Size of the shield's number. The font is General > Numbers: Font.");
				ShieldValueColor = B<Color>("ShieldValueColor", d.Text.Color, "Color of the shield's number.");
				ShieldValueAttach = B("ShieldValueAttach", shieldLabelSpec.Attach, "Where the shield's icon and number sit, just outside the element: Auto = above an orb (and above its frame), past the far end of a bar (the end its fill grows toward). Left, Right, Top or Bottom = outside that side, as seen on screen; Center = on top of it. Shield Value: X and Shield Value: Y then fine-tune it.");
				ShieldValueX = F("ShieldValueX", shieldLabelSpec.X, -2000f, 2000f, "Moves the shield's icon and number sideways from their place (positive = right).");
				ShieldValueY = F("ShieldValueY", shieldLabelSpec.Y, -2000f, 2000f, "Moves the shield's icon and number up or down from their place (positive = up).");
				ShieldValueSpacing = F("ShieldValueSpacing", shieldLabelSpec.Spacing, 0f, 50f, "Gap between the shield's icon and its number.");
				ShieldTextOutlineWidth = F("ShieldTextOutlineWidth", d.Text.OutlineWidth, 0f, 1f, "Dark outline around the shield's number. 0 = none, 0.2 = thin, 0.5 = thick.");
				ShieldTextOutlineColor = B<Color>("ShieldTextOutlineColor", d.Text.OutlineColor, "Color of the outline around the shield's number.");
				ShieldTextShadow = B("ShieldTextShadow", d.Text.Shadow, "Drop shadow under the shield's number.");
				ShieldTextShadowColor = B<Color>("ShieldTextShadowColor", d.Text.ShadowColor, "Color of the shadow under the shield's number; its alpha (the last two digits) is how dark it is.");
				ShieldTextShadowOffset = F("ShieldTextShadowOffset", d.Text.ShadowOffset, 0f, 1f, "How far the shadow of the shield's number falls, down and to the right.");
				ShieldTextShadowSoftness = F("ShieldTextShadowSoftness", d.Text.ShadowSoftness, 0f, 1f, "Blur of the shadow under the shield's number: 0 = sharp, 1 = very soft.");
				IconLook icon = shieldLabelSpec.Icon;
				ShieldIconShow = B("ShieldIconShow", icon.Show, "Shows the shield's icon next to its number.");
				ShieldIconFile = B("ShieldIconFile", icon.File, "A PNG in plugins/ValHUD/icons for the shield's icon (default shield-star.png). Draw it white on a transparent background: Shield Icon: Color tints it. A missing file falls back to a small diamond (the log says so).");
				ShieldIconSize = F("ShieldIconSize", icon.Size, 2f, 200f, "Size of the shield's icon.");
				ShieldIconColor = B<Color>("ShieldIconColor", icon.Color, "Color the shield's icon is tinted with. White keeps a PNG's own colors.");
				ShieldIconOutlineWidth = F("ShieldIconOutlineWidth", icon.OutlineWidth, 0f, 10f, "A solid line around the shield icon's own shape. 0 = none.");
				ShieldIconOutlineColor = B<Color>("ShieldIconOutlineColor", icon.OutlineColor, "Color of the shield icon's outline.");
				ShieldIconShadow = B("ShieldIconShadow", icon.Shadow, "Drop shadow under the shield's icon.");
				ShieldIconShadowColor = B<Color>("ShieldIconShadowColor", icon.ShadowColor, "Color of the shield icon's drop shadow.");
				ShieldIconShadowOffsetX = F("ShieldIconShadowOffsetX", icon.ShadowOffset.x, -20f, 20f, "How far the shield icon's shadow falls sideways (positive = right).");
				ShieldIconShadowOffsetY = F("ShieldIconShadowOffsetY", icon.ShadowOffset.y, -20f, 20f, "How far the shield icon's shadow falls up or down (negative = down).");
				ShieldIconGlow = B("ShieldIconGlow", icon.Glow, "A soft glow around the shield icon's own shape.");
				ShieldIconGlowColor = B<Color>("ShieldIconGlowColor", icon.GlowColor, "Color of the shield icon's glow; its alpha (the last two digits) is how strong it is.");
				ShieldIconGlowSize = F("ShieldIconGlowSize", icon.GlowSize, 1f, 40f, "How far the shield icon's glow spreads.");
				ShieldIconGlowIntensity = F("ShieldIconGlowIntensity", icon.GlowIntensity, 0f, 3f, "How the shield icon's glow fades: 1 = soft; up to 3 = brighter; below 1 = fainter.");
			}
			ValueShowMax = B("ValueShowMax", def: false, "Also shows the max after the value: 23 / 140 instead of 23. It is added to Value: Format right after {0}, so \"{0} HP\" becomes \"23 / 140 HP\". A Value: Format that already has {1} is left as it is.");
			if (shield)
			{
				EnduranceShow = B("EnduranceShow", def: true, "Shows the Endurance of the mod Path of Valheiman over this bar or orb: a layer that starts where the bar starts and is as long as your Endurance threshold is of your max health. While your health is under that point, part of each hit is prevented. It only appears while you have a threshold (from nodes like Fortitude, strength or carry weight given up); with no such node, or without that mod, nothing is drawn. It covers part of the health, so Endurance: Opacity decides how much of it stays visible. On an orb it is a second liquid in the same amber.");
				EnduranceColor = B<Color>("EnduranceColor", d.EnduranceColor, "Color of the Endurance layer. Only its RGB matters: how solid it is comes from Endurance: Start Opacity, End Opacity and Active Opacity. The default is the amber that Path of Valheiman itself uses.");
				EnduranceOpacity = F("EnduranceOpacity", d.EnduranceOpacity, 0f, 1f, "IDLE look: how solid the layer is at its far end (the top of an orb's liquid) while your health is above the threshold (it is not acting yet). 0 = invisible, 1 = solid. The gradient goes from Endurance: Idle Start Opacity to this one along the layer itself.");
				EnduranceActiveOpacity = F("EnduranceActiveOpacity", d.EnduranceActiveOpacity, 0f, 1f, "ACTIVE look: how solid the layer is at its far end while it is acting (your health is under the threshold, or your rune shield under it if that talent is taken). Put it above the idle End Opacity and the layer gets stronger exactly when it is protecting you.");
				EnduranceActiveStartOpacity = F("EnduranceActiveStartOpacity", d.EnduranceActiveStartOpacity, 0f, 1f, "ACTIVE look: how solid the layer is at its start (the start of a bar, the bottom of an orb's liquid) while it is acting.");
				EnduranceActiveGradientLength = F("EnduranceActiveGradientLength", d.EnduranceActiveGradientLength, 0.05f, 1f, "ACTIVE look: the gradient length while it is acting (see the idle Gradient Length). Different from the idle one and the layer's shape changes when it kicks in.");
				EnduranceStartOpacity = F("EnduranceStartOpacity", d.EnduranceStartOpacity, 0f, 1f, "IDLE look: how solid the layer is at its start (the start of a bar, the bottom of an orb's liquid) while it is not acting. Equal to the idle End Opacity gives a flat layer; lower makes it fade in along its length, like the shield.");
				EnduranceGradientLength = F("EnduranceGradientLength", d.EnduranceGradientLength, 0.05f, 1f, "IDLE look: how much of the layer, counted from its far end, takes the change of opacity from the start's to the end's; the rest stays at the start's. 1 = the whole layer; 0.2 = it changes in the last 20 % and the other 80 % is flat.");
				EnduranceEdge = B("EnduranceEdge", d.EnduranceEdge, "A thin bright line at the end of the layer, so the threshold reads even over a bright fill.");
				EnduranceShimmer = B("EnduranceShimmer", d.EnduranceShimmer, "The layer's brightness swells and fades slowly, like a shimmer. Turn it off for a still layer.");
				EnduranceFrontShape = B("EnduranceFrontShape", d.EnduranceFrontShape, "Shape of the line where the Endurance layer ends (the threshold): Flat | is a straight cut; Point > an arrow tip like a bar's end; Forward / and Backward \\ lean; Notch < cuts inward. The edge line and the flash follow it. Bar style only.");
				EnduranceFrontSlant = F("EnduranceFrontSlant", d.EnduranceFrontSlant, 0f, 300f, "How far the Endurance front shape reaches back from its tip, in px (0 = straight). About half the Bar: Thickness looks balanced. Bar style only.");
				EnduranceFrameFile = B("EnduranceFrameImage", d.EnduranceFrameFile, "Style = Orb only. A PNG that replaces the orb's frame (Orb: Frame Image) while Endurance is acting, i.e. while your health is under the threshold, e.g. \"orbs/orb-frame-endurance.png\". When it stops acting the normal frame comes back. If the orb has no normal frame, this one simply appears while it acts. Empty = the frame never changes. Type a file name, or press Choose to pick one of the PNGs in plugins/ValHUD/icons/orbs (put your own there too). Keep images at 512 px or less: they use video memory (a 512 px image about 1.4 MB, a 2048 px one about 22 MB). Empty = the built-in drawing; a missing file falls back to it too (the log says so).");
				EnduranceFrameScale = F("EnduranceFrameScale", d.EnduranceFrameScale, 0f, 3f, "Size of the Endurance frame as a multiple of Orb: Size (like Orb: Frame Size). 0 = the same size as the normal frame.");
				EnduranceFlash = B("EnduranceFlash", d.EnduranceFlash, "A flash over the layer when a hit takes health while the threshold is acting. Endurance: Flash Intensity and Flash Time shape it.");
				EnduranceFlashIntensity = F("EnduranceFlashIntensity", d.EnduranceFlashIntensity, 0f, 1f, "How bright the flash is at its start: 0 = none, 1 = the layer turns almost white for an instant. Path of Valheiman's own flash is very faint (about 0.14); the default here is easier to see.");
				EnduranceFlashTime = F("EnduranceFlashTime", d.EnduranceFlashTime, 0.05f, 2f, "How long the flash takes to fade out, in seconds.");
				EndurancePreview = B("EndurancePreview", def: false, "Draws the Endurance layer with a fake threshold (45 % of your max health), so you can style it without the mod or a node. Not saved in layouts.");
			}
			Present(((ConfigEntryBase)(object)Visible, "Visible"), ((ConfigEntryBase)(object)Style, "Style"), ((ConfigEntryBase)(object)ShowWhenNone, "Show When Empty"), ((ConfigEntryBase)(object)ForceVisible, "Preview (Fake Value)"), ((ConfigEntryBase)(object)AutoHide, "Auto Hide"), ((ConfigEntryBase)(object)AutoHideDelay, "Auto Hide: Delay"), ((ConfigEntryBase)(object)FadeTime, "Auto Hide: Fade Time"), ((ConfigEntryBase)(object)Anchor, "Anchor"), ((ConfigEntryBase)(object)X, "X"), ((ConfigEntryBase)(object)Y, "Y"), ((ConfigEntryBase)(object)Rotation, "Rotation"), ((ConfigEntryBase)(object)Length, "Bar: Length"), ((ConfigEntryBase)(object)Thickness, "Bar: Thickness"), ((ConfigEntryBase)(object)Orientation, "Bar: Orientation"), ((ConfigEntryBase)(object)Direction, "Bar: Fill Direction"), ((ConfigEntryBase)(object)StartShape, "Bar: Start Shape"), ((ConfigEntryBase)(object)StartSlant, "Bar: Start Slant"), ((ConfigEntryBase)(object)EndShape, "Bar: End Shape"), ((ConfigEntryBase)(object)EndSlant, "Bar: End Slant"), ((ConfigEntryBase)(object)ScaleLengthWithMax, "Bar: Grow With Max"), ((ConfigEntryBase)(object)ScaleFullAt, "Bar: Full Length At"), ((ConfigEntryBase)(object)OrbSize, "Orb: Size"), ((ConfigEntryBase)(object)OrbFillByArea, "Orb: Fill By Area"), ((ConfigEntryBase)(object)OrbBackFile, "Orb: Back Image"), ((ConfigEntryBase)(object)OrbLiquidFile, "Orb: Liquid Image"), ((ConfigEntryBase)(object)OrbTintLiquid, "Orb: Tint Liquid Image"), ((ConfigEntryBase)(object)OrbGlassFile, "Orb: Glass Image"), ((ConfigEntryBase)(object)OrbFrameFile, "Orb: Frame Image"), ((ConfigEntryBase)(object)OrbFrameScale, "Orb: Frame Size"), ((ConfigEntryBase)(object)Color, "Bar: Color"), ((ConfigEntryBase)(object)ColorEnd, "Bar: End Color"), ((ConfigEntryBase)(object)Gradient, "Bar: Gradient"), ((ConfigEntryBase)(object)Background, "Bar: Background Color"), ((ConfigEntryBase)(object)TrailColor, "Bar: Trail Color"), ((ConfigEntryBase)(object)OutlineThickness, "Bar: Outline Width"), ((ConfigEntryBase)(object)OutlineColor, "Bar: Outline Color"), ((ConfigEntryBase)(object)Divisions, "Bar: Divisions"), ((ConfigEntryBase)(object)DivisionRuleText, "Bar: Division Rule"), ((ConfigEntryBase)(object)DivisionColor, "Bar: Division Color"), ((ConfigEntryBase)(object)DivisionWidth, "Bar: Division Width"), ((ConfigEntryBase)(object)ShadowEnabled, "Bar: Shadow"), ((ConfigEntryBase)(object)ShadowColor, "Bar: Shadow Color"), ((ConfigEntryBase)(object)ShadowOffsetX, "Bar: Shadow Offset X"), ((ConfigEntryBase)(object)ShadowOffsetY, "Bar: Shadow Offset Y"), ((ConfigEntryBase)(object)GlowEnabled, "Bar/Orb: Glow"), ((ConfigEntryBase)(object)GlowColor, "Bar/Orb: Glow Color"), ((ConfigEntryBase)(object)GlowSize, "Bar/Orb: Glow Size"), ((ConfigEntryBase)(object)GlowIntensity, "Bar/Orb: Glow Intensity"), ((ConfigEntryBase)(object)ShineEnabled, "Bar: Shine"), ((ConfigEntryBase)(object)ShineStrength, "Bar: Shine Strength"), ((ConfigEntryBase)(object)ShieldShow, "Shield: Show"), ((ConfigEntryBase)(object)ShieldStartColor, "Shield: Start Color"), ((ConfigEntryBase)(object)ShieldColor, "Shield: End Color"), ((ConfigEntryBase)(object)ShieldStartOpacity, "Shield: Start Opacity"), ((ConfigEntryBase)(object)ShieldOpacity, "Shield: End Opacity"), ((ConfigEntryBase)(object)ShieldGradientLength, "Shield: Gradient Length"), ((ConfigEntryBase)(object)ShieldFrontShape, "Shield: Front Shape"), ((ConfigEntryBase)(object)ShieldFrontSlant, "Shield: Front Slant"), ((ConfigEntryBase)(object)ShieldHeight, "Shield: Height"), ((ConfigEntryBase)(object)ShieldPreview, "Shield: Preview (Fake Value)"), ((ConfigEntryBase)(object)ShieldValueShow, "Shield Value: Show"), ((ConfigEntryBase)(object)ShieldValueFormat, "Shield Value: Format"), ((ConfigEntryBase)(object)ShieldValueFontSize, "Shield Value: Font Size"), ((ConfigEntryBase)(object)ShieldValueAttach, "Shield Value: Attach To"), ((ConfigEntryBase)(object)ShieldValueX, "Shield Value: X"), ((ConfigEntryBase)(object)ShieldValueY, "Shield Value: Y"), ((ConfigEntryBase)(object)ShieldValueSpacing, "Shield Value: Icon Gap"), ((ConfigEntryBase)(object)ShieldValueColor, "Shield Value: Color"), ((ConfigEntryBase)(object)ShieldTextOutlineWidth, "Shield Value: Outline Width"), ((ConfigEntryBase)(object)ShieldTextOutlineColor, "Shield Value: Outline Color"), ((ConfigEntryBase)(object)ShieldTextShadow, "Shield Value: Shadow"), ((ConfigEntryBase)(object)ShieldTextShadowColor, "Shield Value: Shadow Color"), ((ConfigEntryBase)(object)ShieldTextShadowOffset, "Shield Value: Shadow Offset"), ((ConfigEntryBase)(object)ShieldTextShadowSoftness, "Shield Value: Shadow Softness"), ((ConfigEntryBase)(object)ShieldIconShow, "Shield Icon: Show"), ((ConfigEntryBase)(object)ShieldIconFile, "Shield Icon: File"), ((ConfigEntryBase)(object)ShieldIconSize, "Shield Icon: Size"), ((ConfigEntryBase)(object)ShieldIconColor, "Shield Icon: Color"), ((ConfigEntryBase)(object)ShieldIconOutlineWidth, "Shield Icon: Outline Width"), ((ConfigEntryBase)(object)ShieldIconOutlineColor, "Shield Icon: Outline Color"), ((ConfigEntryBase)(object)ShieldIconShadow, "Shield Icon: Shadow"), ((ConfigEntryBase)(object)ShieldIconShadowColor, "Shield Icon: Shadow Color"), ((ConfigEntryBase)(object)ShieldIconShadowOffsetX, "Shield Icon: Shadow Offset X"), ((ConfigEntryBase)(object)ShieldIconShadowOffsetY, "Shield Icon: Shadow Offset Y"), ((ConfigEntryBase)(object)ShieldIconGlow, "Shield Icon: Glow"), ((ConfigEntryBase)(object)ShieldIconGlowColor, "Shield Icon: Glow Color"), ((ConfigEntryBase)(object)ShieldIconGlowSize, "Shield Icon: Glow Size"), ((ConfigEntryBase)(object)ShieldIconGlowIntensity, "Shield Icon: Glow Intensity"), ((ConfigEntryBase)(object)EnduranceShow, "Endurance: Show"), ((ConfigEntryBase)(object)EnduranceColor, "Endurance: Color"), ((ConfigEntryBase)(object)EnduranceStartOpacity, "Endurance Idle: Start Opacity"), ((ConfigEntryBase)(object)EnduranceOpacity, "Endurance Idle: End Opacity"), ((ConfigEntryBase)(object)EnduranceGradientLength, "Endurance Idle: Gradient Length"), ((ConfigEntryBase)(object)EnduranceActiveStartOpacity, "Endurance Active: Start Opacity"), ((ConfigEntryBase)(object)EnduranceActiveOpacity, "Endurance Active: End Opacity"), ((ConfigEntryBase)(object)EnduranceActiveGradientLength, "Endurance Active: Gradient Length"), ((ConfigEntryBase)(object)EnduranceFrontShape, "Endurance: Front Shape"), ((ConfigEntryBase)(object)EnduranceFrontSlant, "Endurance: Front Slant"), ((ConfigEntryBase)(object)EnduranceFrameFile, "Endurance: Active Frame Image"), ((ConfigEntryBase)(object)EnduranceFrameScale, "Endurance: Active Frame Size"), ((ConfigEntryBase)(object)EnduranceEdge, "Endurance: Edge Line"), ((ConfigEntryBase)(object)EnduranceShimmer, "Endurance: Shimmer"), ((ConfigEntryBase)(object)EnduranceFlash, "Endurance: Flash"), ((ConfigEntryBase)(object)EnduranceFlashIntensity, "Endurance: Flash Intensity"), ((ConfigEntryBase)(object)EnduranceFlashTime, "Endurance: Flash Time"), ((ConfigEntryBase)(object)EndurancePreview, "Endurance: Preview"), ((ConfigEntryBase)(object)ShowValue, "Value: Show"), ((ConfigEntryBase)(object)ValueFormat, "Value: Format"), ((ConfigEntryBase)(object)ValueShowMax, "Value: Show Max"), ((ConfigEntryBase)(object)ValueFontSize, "Value: Font Size"), ((ConfigEntryBase)(object)ValueAttach, "Value: Attach To"), ((ConfigEntryBase)(object)ValueAlign, "Value: Align"), ((ConfigEntryBase)(object)ValueX, "Value: X"), ((ConfigEntryBase)(object)ValueY, "Value: Y"), ((ConfigEntryBase)(object)ValueColor, "Value: Color"), ((ConfigEntryBase)(object)TextOutlineWidth, "Value: Outline Width"), ((ConfigEntryBase)(object)TextOutlineColor, "Value: Outline Color"), ((ConfigEntryBase)(object)TextShadow, "Value: Shadow"), ((ConfigEntryBase)(object)TextShadowColor, "Value: Shadow Color"), ((ConfigEntryBase)(object)TextShadowOffset, "Value: Shadow Offset"), ((ConfigEntryBase)(object)TextShadowSoftness, "Value: Shadow Softness"), ((ConfigEntryBase)(object)ShowIcon, "Icon: Show"), ((ConfigEntryBase)(object)IconFile, "Icon: File"), ((ConfigEntryBase)(object)IconSize, "Icon: Size"), ((ConfigEntryBase)(object)IconAttach, "Icon: Attach To"), ((ConfigEntryBase)(object)IconX, "Icon: X"), ((ConfigEntryBase)(object)IconY, "Icon: Y"), ((ConfigEntryBase)(object)IconColor, "Icon: Color"), ((ConfigEntryBase)(object)IconOutlineWidth, "Icon: Outline Width"), ((ConfigEntryBase)(object)IconOutlineColor, "Icon: Outline Color"), ((ConfigEntryBase)(object)IconShadow, "Icon: Shadow"), ((ConfigEntryBase)(object)IconShadowColor, "Icon: Shadow Color"), ((ConfigEntryBase)(object)IconShadowOffsetX, "Icon: Shadow Offset X"), ((ConfigEntryBase)(object)IconShadowOffsetY, "Icon: Shadow Offset Y"), ((ConfigEntryBase)(object)IconGlow, "Icon: Glow"), ((ConfigEntryBase)(object)IconGlowColor, "Icon: Glow Color"), ((ConfigEntryBase)(object)IconGlowSize, "Icon: Glow Size"), ((ConfigEntryBase)(object)IconGlowIntensity, "Icon: Glow Intensity"));
			ConfigEntryBase[] array = (ConfigEntryBase[])(object)new ConfigEntryBase[4]
			{
				(ConfigEntryBase)OrbBackFile,
				(ConfigEntryBase)OrbLiquidFile,
				(ConfigEntryBase)OrbGlassFile,
				(ConfigEntryBase)OrbFrameFile
			};
			foreach (ConfigEntryBase entry in array)
			{
				UseEditor(entry, ImagePicker.Draw);
			}
			if (EnduranceFrameFile != null)
			{
				UseEditor((ConfigEntryBase)(object)EnduranceFrameFile, ImagePicker.Draw);
			}
			AddShowRules();
		}

		private void AddShowRules()
		{
			Func<bool> when = () => Style.Value == BarStyle.Bar;
			Func<bool> when2 = () => Style.Value == BarStyle.Orb;
			ShowWhen(() => Visible.Value, AllBut((ConfigEntryBase)Visible));
			ShowWhen(() => AutoHide.Value, (ConfigEntryBase)AutoHideDelay, (ConfigEntryBase)FadeTime);
			ShowWhen(when, (ConfigEntryBase)Orientation, (ConfigEntryBase)Direction, (ConfigEntryBase)Length, (ConfigEntryBase)Thickness, (ConfigEntryBase)StartShape, (ConfigEntryBase)StartSlant, (ConfigEntryBase)EndShape, (ConfigEntryBase)EndSlant, (ConfigEntryBase)ScaleLengthWithMax, (ConfigEntryBase)ScaleFullAt, (ConfigEntryBase)Divisions, (ConfigEntryBase)DivisionRuleText, (ConfigEntryBase)DivisionColor, (ConfigEntryBase)DivisionWidth, (ConfigEntryBase)ShieldHeight, (ConfigEntryBase)ShieldFrontShape, (ConfigEntryBase)ShieldFrontSlant, (ConfigEntryBase)EnduranceFrontShape, (ConfigEntryBase)EnduranceFrontSlant);
			ShowWhen(when2, (ConfigEntryBase)OrbSize, (ConfigEntryBase)OrbFillByArea, (ConfigEntryBase)OrbBackFile, (ConfigEntryBase)OrbLiquidFile, (ConfigEntryBase)OrbTintLiquid, (ConfigEntryBase)OrbGlassFile, (ConfigEntryBase)OrbFrameFile, (ConfigEntryBase)OrbFrameScale, (ConfigEntryBase)EnduranceFrameFile, (ConfigEntryBase)EnduranceFrameScale);
			ShowWhen(() => StartShape.Value != BarEnd.Flat, (ConfigEntryBase)StartSlant);
			ShowWhen(() => EndShape.Value != BarEnd.Flat, (ConfigEntryBase)EndSlant);
			ShowWhen(() => ScaleLengthWithMax.Value, (ConfigEntryBase)ScaleFullAt);
			ShowWhen(() => ElementConfig.Has(OrbLiquidFile), (ConfigEntryBase)OrbTintLiquid);
			ShowWhen(() => ElementConfig.Has(OrbFrameFile), (ConfigEntryBase)OrbFrameScale);
			ShowWhen(() => Gradient.Value != GradientDirection.None, (ConfigEntryBase)ColorEnd);
			ShowWhen(() => Divisions.Value, (ConfigEntryBase)DivisionRuleText, (ConfigEntryBase)DivisionColor, (ConfigEntryBase)DivisionWidth);
			ShowEffectRules();
			ShowWhen(() => GlowEnabled.Value, (ConfigEntryBase)GlowColor, (ConfigEntryBase)GlowSize, (ConfigEntryBase)GlowIntensity);
			ShowWhen(() => ShineEnabled.Value, (ConfigEntryBase)ShineStrength);
			ShowWhen(() => ShowValue.Value, (ConfigEntryBase)ValueFormat, (ConfigEntryBase)ValueShowMax, (ConfigEntryBase)ValueFontSize, (ConfigEntryBase)ValueAttach, (ConfigEntryBase)ValueAlign, (ConfigEntryBase)ValueX, (ConfigEntryBase)ValueY, (ConfigEntryBase)ValueColor, (ConfigEntryBase)TextOutlineWidth, (ConfigEntryBase)TextOutlineColor, (ConfigEntryBase)TextShadow, (ConfigEntryBase)TextShadowColor, (ConfigEntryBase)TextShadowOffset, (ConfigEntryBase)TextShadowSoftness);
			ShowTextRules();
			ShowWhen(() => ShowIcon.Value, (ConfigEntryBase)IconFile, (ConfigEntryBase)IconSize, (ConfigEntryBase)IconAttach, (ConfigEntryBase)IconX, (ConfigEntryBase)IconY, (ConfigEntryBase)IconColor, (ConfigEntryBase)IconOutlineWidth, (ConfigEntryBase)IconOutlineColor, (ConfigEntryBase)IconShadow, (ConfigEntryBase)IconShadowColor, (ConfigEntryBase)IconShadowOffsetX, (ConfigEntryBase)IconShadowOffsetY, (ConfigEntryBase)IconGlow, (ConfigEntryBase)IconGlowColor, (ConfigEntryBase)IconGlowSize, (ConfigEntryBase)IconGlowIntensity);
			ShowWhen(() => IconShadow.Value, (ConfigEntryBase)IconShadowColor, (ConfigEntryBase)IconShadowOffsetX, (ConfigEntryBase)IconShadowOffsetY);
			ShowWhen(() => IconGlow.Value, (ConfigEntryBase)IconGlowColor, (ConfigEntryBase)IconGlowSize, (ConfigEntryBase)IconGlowIntensity);
			if (ShieldShow != null)
			{
				ShowWhen(() => ShieldShow.Value, (ConfigEntryBase)ShieldStartColor, (ConfigEntryBase)ShieldColor, (ConfigEntryBase)ShieldStartOpacity, (ConfigEntryBase)ShieldOpacity, (ConfigEntryBase)ShieldGradientLength, (ConfigEntryBase)ShieldFrontShape, (ConfigEntryBase)ShieldFrontSlant, (ConfigEntryBase)ShieldHeight, (ConfigEntryBase)ShieldPreview, (ConfigEntryBase)ShieldValueShow, (ConfigEntryBase)ShieldValueFormat, (ConfigEntryBase)ShieldValueFontSize, (ConfigEntryBase)ShieldValueAttach, (ConfigEntryBase)ShieldValueX, (ConfigEntryBase)ShieldValueY, (ConfigEntryBase)ShieldValueSpacing, (ConfigEntryBase)ShieldValueColor, (ConfigEntryBase)ShieldTextOutlineWidth, (ConfigEntryBase)ShieldTextOutlineColor, (ConfigEntryBase)ShieldTextShadow, (ConfigEntryBase)ShieldTextShadowColor, (ConfigEntryBase)ShieldTextShadowOffset, (ConfigEntryBase)ShieldTextShadowSoftness, (ConfigEntryBase)ShieldIconShow, (ConfigEntryBase)ShieldIconFile, (ConfigEntryBase)ShieldIconSize, (ConfigEntryBase)ShieldIconColor, (ConfigEntryBase)ShieldIconOutlineWidth, (ConfigEntryBase)ShieldIconOutlineColor, (ConfigEntryBase)ShieldIconShadow, (ConfigEntryBase)ShieldIconShadowColor, (ConfigEntryBase)ShieldIconShadowOffsetX, (ConfigEntryBase)ShieldIconShadowOffsetY, (ConfigEntryBase)ShieldIconGlow, (ConfigEntryBase)ShieldIconGlowColor, (ConfigEntryBase)ShieldIconGlowSize, (ConfigEntryBase)ShieldIconGlowIntensity);
				ShowWhen(() => ShieldFrontShape.Value != BarEnd.Flat, (ConfigEntryBase)ShieldFrontSlant);
				ShowWhen(() => ShieldValueShow.Value || ShieldIconShow.Value, (ConfigEntryBase)ShieldValueAttach, (ConfigEntryBase)ShieldValueX, (ConfigEntryBase)ShieldValueY);
				ShowWhen(() => ShieldValueShow.Value && ShieldIconShow.Value, (ConfigEntryBase)ShieldValueSpacing);
				ShowWhen(() => ShieldValueShow.Value, (ConfigEntryBase)ShieldValueFormat, (ConfigEntryBase)ShieldValueFontSize, (ConfigEntryBase)ShieldValueColor, (ConfigEntryBase)ShieldTextOutlineWidth, (ConfigEntryBase)ShieldTextOutlineColor, (ConfigEntryBase)ShieldTextShadow, (ConfigEntryBase)ShieldTextShadowColor, (ConfigEntryBase)ShieldTextShadowOffset, (ConfigEntryBase)ShieldTextShadowSoftness);
				ShowWhen(() => ShieldTextShadow.Value, (ConfigEntryBase)ShieldTextShadowColor, (ConfigEntryBase)ShieldTextShadowOffset, (ConfigEntryBase)ShieldTextShadowSoftness);
				ShowWhen(() => ShieldIconShow.Value, (ConfigEntryBase)ShieldIconFile, (ConfigEntryBase)ShieldIconSize, (ConfigEntryBase)ShieldIconColor, (ConfigEntryBase)ShieldIconOutlineWidth, (ConfigEntryBase)ShieldIconOutlineColor, (ConfigEntryBase)ShieldIconShadow, (ConfigEntryBase)ShieldIconShadowColor, (ConfigEntryBase)ShieldIconShadowOffsetX, (ConfigEntryBase)ShieldIconShadowOffsetY, (ConfigEntryBase)ShieldIconGlow, (ConfigEntryBase)ShieldIconGlowColor, (ConfigEntryBase)ShieldIconGlowSize, (ConfigEntryBase)ShieldIconGlowIntensity);
				ShowWhen(() => ShieldIconShadow.Value, (ConfigEntryBase)ShieldIconShadowColor, (ConfigEntryBase)ShieldIconShadowOffsetX, (ConfigEntryBase)ShieldIconShadowOffsetY);
				ShowWhen(() => ShieldIconGlow.Value, (ConfigEntryBase)ShieldIconGlowColor, (ConfigEntryBase)ShieldIconGlowSize, (ConfigEntryBase)ShieldIconGlowIntensity);
			}
			if (EnduranceShow != null)
			{
				ShowWhen(() => EnduranceShow.Value, (ConfigEntryBase)EnduranceColor, (ConfigEntryBase)EnduranceStartOpacity, (ConfigEntryBase)EnduranceOpacity, (ConfigEntryBase)EnduranceGradientLength, (ConfigEntryBase)EnduranceActiveStartOpacity, (ConfigEntryBase)EnduranceActiveOpacity, (ConfigEntryBase)EnduranceActiveGradientLength, (ConfigEntryBase)EnduranceFrontShape, (ConfigEntryBase)EnduranceFrontSlant, (ConfigEntryBase)EnduranceFrameFile, (ConfigEntryBase)EnduranceFrameScale, (ConfigEntryBase)EnduranceEdge, (ConfigEntryBase)EnduranceShimmer, (ConfigEntryBase)EnduranceFlash, (ConfigEntryBase)EnduranceFlashIntensity, (ConfigEntryBase)EnduranceFlashTime, (ConfigEntryBase)EndurancePreview);
				ShowWhen(() => EnduranceFrontShape.Value != BarEnd.Flat, (ConfigEntryBase)EnduranceFrontSlant);
				ShowWhen(() => ElementConfig.Has(EnduranceFrameFile), (ConfigEntryBase)EnduranceFrameScale);
				ShowWhen(() => EnduranceFlash.Value, (ConfigEntryBase)EnduranceFlashIntensity, (ConfigEntryBase)EnduranceFlashTime);
			}
		}

		public BarSpec Resolve()
		{
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_0313: Unknown result type (might be due to invalid IL or missing references)
			//IL_0318: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_0347: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_066b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0670: Unknown result type (might be due to invalid IL or missing references)
			//IL_068d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0692: Unknown result type (might be due to invalid IL or missing references)
			//IL_06af: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_074b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0750: Unknown result type (might be due to invalid IL or missing references)
			BarSpec barSpec = new BarSpec
			{
				Visible = Visible.Value,
				ShowValue = ShowValue.Value,
				ShowIcon = ShowIcon.Value,
				AutoHide = AutoHide.Value,
				AutoHideDelay = AutoHideDelay.Value,
				FadeTime = FadeTime.Value,
				ValueFormat = ValueFormat.Value,
				ValueShowMax = ValueShowMax.Value,
				ScaleLengthWithMax = ScaleLengthWithMax.Value,
				ScaleFullAt = ScaleFullAt.Value,
				Gradient = Gradient.Value,
				TrailColor = TrailColor.Value,
				IconFile = IconFile.Value,
				Divisions = Divisions.Value,
				DivisionRule = DivisionRule.Parse(DivisionRuleText.Value),
				IconShadow = IconShadow.Value,
				IconShadowColor = IconShadowColor.Value,
				IconShadowOffset = new Vector2(IconShadowOffsetX.Value, IconShadowOffsetY.Value),
				IconOutlineWidth = IconOutlineWidth.Value,
				IconOutlineColor = IconOutlineColor.Value,
				IconGlow = IconGlow.Value,
				IconGlowColor = IconGlowColor.Value,
				IconGlowSize = IconGlowSize.Value,
				IconGlowIntensity = IconGlowIntensity.Value,
				DivisionColor = DivisionColor.Value,
				DivisionWidth = DivisionWidth.Value
			};
			barSpec.Fx = ResolveEffects();
			barSpec.Fx.Shine = ShineEnabled.Value;
			barSpec.Fx.ShineStrength = ShineStrength.Value;
			barSpec.Anchor = Anchor.Value;
			barSpec.X = X.Value;
			barSpec.Y = Y.Value;
			barSpec.Rotation = Rotation.Value;
			barSpec.Orientation = Orientation.Value;
			barSpec.Direction = Direction.Value;
			barSpec.Length = Length.Value;
			barSpec.Thickness = Thickness.Value;
			barSpec.StartShape = StartShape.Value;
			barSpec.StartSlant = StartSlant.Value;
			barSpec.EndShape = EndShape.Value;
			barSpec.EndSlant = EndSlant.Value;
			barSpec.ValueFontSize = ValueFontSize.Value;
			barSpec.Color = Color.Value;
			barSpec.ColorEnd = ColorEnd.Value;
			barSpec.Background = Background.Value;
			barSpec.OutlineColor = OutlineColor.Value;
			barSpec.OutlineThickness = OutlineThickness.Value;
			barSpec.Text = ResolveText(ValueColor.Value);
			barSpec.IconColor = IconColor.Value;
			barSpec.IconSize = IconSize.Value;
			barSpec.ValueAttach = ValueAttach.Value;
			barSpec.ValueAlign = ValueAlign.Value;
			barSpec.ValueX = ValueX.Value;
			barSpec.ValueY = ValueY.Value;
			barSpec.IconAttach = IconAttach.Value;
			barSpec.IconX = IconX.Value;
			barSpec.IconY = IconY.Value;
			barSpec.Style = Style.Value;
			barSpec.OrbSize = OrbSize.Value;
			barSpec.OrbFillByArea = OrbFillByArea.Value;
			barSpec.OrbBackFile = OrbBackFile.Value;
			barSpec.OrbLiquidFile = OrbLiquidFile.Value;
			barSpec.OrbTintLiquid = OrbTintLiquid.Value;
			barSpec.OrbGlassFile = OrbGlassFile.Value;
			barSpec.OrbFrameFile = OrbFrameFile.Value;
			barSpec.OrbFrameScale = OrbFrameScale.Value;
			if (ShieldShow != null)
			{
				barSpec.ShieldShow = ShieldShow.Value;
				barSpec.ShieldColor = ShieldColor.Value;
				barSpec.ShieldStartColor = ShieldStartColor.Value;
				barSpec.ShieldHeight = ShieldHeight.Value;
				barSpec.ShieldOpacity = ShieldOpacity.Value;
				barSpec.ShieldStartOpacity = ShieldStartOpacity.Value;
				barSpec.ShieldGradientLength = ShieldGradientLength.Value;
				barSpec.ShieldFrontShape = ShieldFrontShape.Value;
				barSpec.ShieldFrontSlant = ShieldFrontSlant.Value;
				barSpec.ShieldLabel = new ShieldLabelSpec
				{
					ShowText = ShieldValueShow.Value,
					Format = ShieldValueFormat.Value,
					FontSize = ShieldValueFontSize.Value,
					Attach = ShieldValueAttach.Value,
					X = ShieldValueX.Value,
					Y = ShieldValueY.Value,
					Spacing = ShieldValueSpacing.Value,
					Text = new TextStyle
					{
						Color = ShieldValueColor.Value,
						OutlineWidth = ShieldTextOutlineWidth.Value,
						OutlineColor = ShieldTextOutlineColor.Value,
						Shadow = ShieldTextShadow.Value,
						ShadowColor = ShieldTextShadowColor.Value,
						ShadowOffset = ShieldTextShadowOffset.Value,
						ShadowSoftness = ShieldTextShadowSoftness.Value
					},
					Icon = new IconLook
					{
						Show = ShieldIconShow.Value,
						File = ShieldIconFile.Value,
						Size = ShieldIconSize.Value,
						Color = ShieldIconColor.Value,
						OutlineWidth = ShieldIconOutlineWidth.Value,
						OutlineColor = ShieldIconOutlineColor.Value,
						Shadow = ShieldIconShadow.Value,
						ShadowColor = ShieldIconShadowColor.Value,
						ShadowOffset = new Vector2(ShieldIconShadowOffsetX.Value, ShieldIconShadowOffsetY.Value),
						Glow = ShieldIconGlow.Value,
						GlowColor = ShieldIconGlowColor.Value,
						GlowSize = ShieldIconGlowSize.Value,
						GlowIntensity = ShieldIconGlowIntensity.Value
					}
				};
			}
			if (EnduranceShow != null)
			{
				barSpec.EnduranceShow = EnduranceShow.Value;
				barSpec.EnduranceColor = EnduranceColor.Value;
				barSpec.EnduranceOpacity = EnduranceOpacity.Value;
				barSpec.EnduranceActiveOpacity = EnduranceActiveOpacity.Value;
				barSpec.EnduranceStartOpacity = EnduranceStartOpacity.Value;
				barSpec.EnduranceGradientLength = EnduranceGradientLength.Value;
				barSpec.EnduranceFrameFile = EnduranceFrameFile.Value;
				barSpec.EnduranceFrameScale = EnduranceFrameScale.Value;
				barSpec.EnduranceFrontShape = EnduranceFrontShape.Value;
				barSpec.EnduranceFrontSlant = EnduranceFrontSlant.Value;
				barSpec.EnduranceActiveStartOpacity = EnduranceActiveStartOpacity.Value;
				barSpec.EnduranceActiveGradientLength = EnduranceActiveGradientLength.Value;
				barSpec.EnduranceEdge = EnduranceEdge.Value;
				barSpec.EnduranceShimmer = EnduranceShimmer.Value;
				barSpec.EnduranceFlash = EnduranceFlash.Value;
				barSpec.EnduranceFlashIntensity = EnduranceFlashIntensity.Value;
				barSpec.EnduranceFlashTime = EnduranceFlashTime.Value;
			}
			return barSpec;
		}

		public void ResetValuePlacement()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Max(4f, ValueFontSize.Value * 0.3f);
			Vector2 val = Outward(ValueAttach.Value);
			ValueX.Value = val.x * num;
			ValueY.Value = val.y * (num + ValueFontSize.Value * 0.5f);
			ValueAlign.Value = ((!(val.x > 0f)) ? ((!(val.x < 0f)) ? TextAlign.Center : TextAlign.Right) : TextAlign.Left);
		}

		public void ResetIconPlacement()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Max(4f, ValueFontSize.Value * 0.3f) + IconSize.Value * 0.5f;
			Vector2 val = Outward(IconAttach.Value);
			IconX.Value = val.x * num;
			IconY.Value = val.y * num;
		}

		public void ApplyStyleDefaults()
		{
			if (Style.Value == BarStyle.Orb)
			{
				ValueAttach.Value = BarPoint.Center;
				ValueAlign.Value = TextAlign.Center;
				ValueX.Value = 0f;
				ValueY.Value = 0f;
				IconAttach.Value = BarPoint.Center;
				IconX.Value = 0f;
				IconY.Value = Mathf.Round(OrbSize.Value * 0.27f);
			}
			else
			{
				BarSpec barSpec = new BarSpec
				{
					Orientation = Orientation.Value,
					Direction = Direction.Value,
					ValueFontSize = ValueFontSize.Value,
					IconSize = IconSize.Value
				};
				LayoutDefaults.PlaceBarContent(barSpec);
				ValueAttach.Value = barSpec.ValueAttach;
				ValueAlign.Value = barSpec.ValueAlign;
				ValueX.Value = barSpec.ValueX;
				ValueY.Value = barSpec.ValueY;
				IconAttach.Value = barSpec.IconAttach;
				IconX.Value = barSpec.IconX;
				IconY.Value = barSpec.IconY;
			}
		}

		private static Vector2 Outward(BarPoint p)
		{
			//IL_001c: 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_0022: 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_002e: Unknown result type (might be due to invalid IL or missing references)
			return (Vector2)(p switch
			{
				BarPoint.Left => Vector2.left, 
				BarPoint.Right => Vector2.right, 
				BarPoint.Top => Vector2.up, 
				BarPoint.Bottom => Vector2.down, 
				_ => Vector2.zero, 
			});
		}

		public static void CopyGeometry(BarSpec from, BarSpec to)
		{
			to.Anchor = from.Anchor;
			to.X = from.X;
			to.Y = from.Y;
			to.Rotation = from.Rotation;
			to.Orientation = from.Orientation;
			to.Direction = from.Direction;
			to.Length = from.Length;
			to.Thickness = from.Thickness;
			to.StartShape = from.StartShape;
			to.StartSlant = from.StartSlant;
			to.EndShape = from.EndShape;
			to.EndSlant = from.EndSlant;
			to.ValueFontSize = from.ValueFontSize;
			to.ValueAttach = from.ValueAttach;
			to.ValueAlign = from.ValueAlign;
			to.ValueX = from.ValueX;
			to.ValueY = from.ValueY;
			to.IconAttach = from.IconAttach;
			to.IconX = from.IconX;
			to.IconY = from.IconY;
			to.IconSize = from.IconSize;
		}
	}
	internal class PowerGlowConfig : ElementConfig
	{
		public readonly string Key;

		public readonly ConfigEntry<bool> UseOwnGlow;

		public readonly ConfigEntry<Color> Tint;

		public readonly ConfigEntry<Color> OutlineColor;

		public readonly ConfigEntry<float> Radius;

		public readonly ConfigEntry<float> Strength;

		public readonly ConfigEntry<float> OutlineWidth;

		public PowerGlowConfig(ConfigFile cfg, string section, string key, string boss, Color tint, float radius, float strength, float outlineWidth, Color outlineColor)
			: base(cfg, section)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			Key = key;
			UseOwnGlow = B("UseOwnGlow", def: true, "On: while " + boss + "'s power is selected, its glow uses the Glow: Color, Glow: Size and Glow: Intensity below. Off: it uses 05. Forsaken Power > Slot: Glow Color, Size and Intensity. Either way the glow only shows when 05. Forsaken Power has Slot: Glow or Slot: Glow When Ready on. Icon: Outline Width and Icon: Outline Color below apply in both cases.");
			Tint = B<Color>("GlowColor", tint, "Glow color for " + boss + "; its alpha (the last two digits) is how strong it is.");
			Radius = F("GlowSize", radius, 1f, 80f, "How far the glow spreads around " + boss + "'s icon.");
			Strength = F("GlowIntensity", strength, 0f, 3f, "How " + boss + "'s glow fades: 1 = evenly to transparent; up to 3 = brighter, with a solid band close to the icon; below 1 = fainter.");
			OutlineWidth = F("OutlineWidth", outlineWidth, 0f, 12f, "A solid line around " + boss + "'s icon, following its shape (0 = none). Helps an icon that gets lost against the slot or the world. It is used whether Use Own Glow is on or off.");
			OutlineColor = B<Color>("OutlineColor", outlineColor, "Color of the line around " + boss + "'s icon (see Icon: Outline Width).");
			Present(((ConfigEntryBase)(object)UseOwnGlow, "Use Own Glow"), ((ConfigEntryBase)(object)Tint, "Glow: Color"), ((ConfigEntryBase)(object)Radius, "Glow: Size"), ((ConfigEntryBase)(object)Strength, "Glow: Intensity"), ((ConfigEntryBase)(object)OutlineWidth, "Icon: Outline Width"), ((ConfigEntryBase)(object)OutlineColor, "Icon: Outline Color"));
			ShowWhen(() => UseOwnGlow.Value, (ConfigEntryBase)Tint, (ConfigEntryBase)Radius, (ConfigEntryBase)Strength);
		}
	}
	internal class SlotConfig : ElementConfig
	{
		private readonly bool _guardian;

		public readonly ConfigEntry<bool> Visible;

		public readonly ConfigEntry<bool> ShowBackground;

		public readonly ConfigEntry<GlowAround> GlowAround;

		public readonly ConfigEntry<bool> ShowName;

		public readonly ConfigEntry<bool> GlowWhenReady;

		public readonly ConfigEntry<bool> ReadyGlowPulse;

		public readonly ConfigEntry<bool> CustomIcons;

		public readonly ConfigEntry<bool> ShowWhenEmpty;

		public readonly ConfigEntry<bool> ApplyStyleToOtherFoods;

		public readonly ConfigEntry<EdibleStyle> EdibleStyle;

		public readonly ConfigEntry<BlinkSpeed> BlinkSpeed;

		public readonly ConfigEntry<float> EdibleOpacity;

		public readonly ConfigEntry<HudAnchor> Anchor;

		public readonly ConfigEntry<float> X;

		public readonly ConfigEntry<float> Y;

		public readonly ConfigEntry<float> Rotation;

		public readonly ConfigEntry<float> Size;

		public readonly ConfigEntry<float> BorderWidth;

		public readonly ConfigEntry<float> IconSize;

		public readonly ConfigEntry<float> IconX;

		public readonly ConfigEntry<float> IconY;

		public readonly ConfigEntry<float> LabelFontSize;

		public readonly ConfigEntry<float> LabelX;

		public readonly ConfigEntry<float> LabelY;

		public readonly ConfigEntry<float> NameFontSize;

		public readonly ConfigEntry<float> NameX;

		public readonly ConfigEntry<float> NameY;

		public readonly ConfigEntry<SlotShape> Shape;

		public readonly ConfigEntry<GradientDirection> Gradient;

		public readonly ConfigEntry<Color> Color;

		public readonly ConfigEntry<Color> ColorEnd;

		public readonly ConfigEntry<Color> BorderColor;

		public readonly ConfigEntry<Color> TextColor;

		public readonly ConfigEntry<Color> EmptyMarkerColor;

		public SlotConfig(ConfigFile cfg, string section, SlotSpec d, bool isGuardian)
			: base(cfg, section)
		{
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_049f: Unknown result type (might be due to invalid IL or missing references)
			_guardian = isGuardian;
			string text = (isGuardian ? "power" : "food");
			string text2 = (isGuardian ? "cooldown" : "timer");
			string text3 = (isGuardian ? "Cooldown" : "Timer");
			string text4 = (isGuardian ? "Text" : "Timer");
			Visible = B("Visible", def: true, "Shows this " + text + " slot.");
			Anchor = B("Anchor", d.Anchor, "The screen point this slot is positioned from: a corner, the middle of the top or bottom edge, or the Center. X and Y move the slot's center away from it. Example: BottomCenter with X = -170 and Y = 220 = left of the middle, 220 above the bottom edge.", layout: true);
			X = F("X", d.X, -4000f, 4000f, "Horizontal distance from Anchor to the slot's center (positive = right). Every distance is multiplied by General > Scale.", layout: true);
			Y = F("Y", d.Y, -4000f, 4000f, "Vertical distance from Anchor to the slot's center (positive = up).", layout: true);
			Rotation = F("Rotation", d.Rotation, -180f, 180f, "Turns the whole slot, with its icon and texts, around its center, in degrees (positive = counter-clockwise).", layout: true);
			Size = F("Size", d.Size, 16f, 600f, "Width and height of the slot. The icon and texts have their own sizes and positions, measured from the slot's center.");
			Shape = B("Shape", d.Shape, "Diamond, Square or Circle.");
			ShowBackground = B("ShowBackground", d.ShowBackground, "Draws the slot's fill and border. Off = only the icon and its texts float on screen; Slot: Glow Around = Icon then makes the glow hug the icon.");
			Color = B<Color>("Color", d.Color, "Fill color. With a Slot: Gradient, the color the gradient starts from (Slot: End Color is where it ends).");
			ColorEnd = B<Color>("ColorEnd", d.ColorEnd, "Second fill color, only used when Slot: Gradient is not None.");
			Gradient = B("Gradient", d.Gradient, "How Slot: Color and Slot: End Color blend. None = solid Slot: Color. Horizontal = Slot: Color on the left, Slot: End Color on the right. Vertical = Slot: Color at the top, Slot: End Color at the bottom (both turn with Rotation).");
			BorderWidth = F("BorderWidth", d.BorderWidth, 0f, 30f, "Thickness of the border, drawn inside the slot's edge (0 = none). The fill shrinks to fit inside it, so a see-through fill is never tinted by the border.");
			BorderColor = B<Color>("BorderColor", d.BorderColor, "Color of the border (see Slot: Border Width).");
			IconSize = F("IconSize", d.IconSize, 2f, 400f, "Size of the " + text + " icon. About 35 to 45 % of Slot: Size fits most shapes.");
			IconX = F("IconX", d.IconX, -1000f, 1000f, "Moves the icon sideways from the slot's center (positive = right).");
			IconY = F("IconY", d.IconY, -1000f, 1000f, "Moves the icon up or down from the slot's center (positive = up).");
			if (isGuardian)
			{
				CustomIcons = B("CustomIcons", d.CustomIcons, "Uses your own picture for a Forsaken power when plugins/ValHUD/icons/powers/<power>.png exists, e.g. GP_Eikthyr.png or GP_TheElder.png. The file names are the same in every game language; the first time you select a power, the log says which name it looks for. The same picture is used for the power's icon in the game's status list (where Rested, Wet... are) while the power is active.");
			}
			TextColor = B<Color>("TextColor", d.Text.Color, "Color of this slot's texts (the " + text2 + (isGuardian ? " and the name)." : ")."));
			LabelFontSize = F("LabelFontSize", d.LabelFontSize, 4f, 120f, "Size of the " + text2 + ". The font is General > Numbers: Font.");
			LabelX = F("LabelX", d.LabelX, -1000f, 1000f, "Moves the " + text2 + " sideways from the slot's center (positive = right).");
			LabelY = F("LabelY", d.LabelY, -1000f, 1000f, "Moves the " + text2 + " up or down from the slot's center (positive = up).");
			if (isGuardian)
			{
				ShowName = B("ShowName", d.ShowName, "Shows the power's name, in the game's language.");
				NameFontSize = F("NameFontSize", d.NameFontSize, 4f, 120f, "Size of the power's name. The font is General > Names: Font.");
				NameX = F("NameX", d.NameX, -1000f, 1000f, "Moves the name sideways from the slot's center (positive = right).");
				NameY = F("NameY", d.NameY, -1000f, 1000f, "Moves the name up or down from the slot's center (positive = up).");
			}
			BindText(isGuardian ? "the cooldown and name" : "the timer", d.Text, text4);
			BindEffects(d.Fx, "Slot", text4);
			GlowAround = B("GlowAround", d.GlowAround, "What the glow follows: Slot = a halo around the slot's shape; Icon = a glow around the icon's own drawing (any PNG or game icon). Icon looks best with Slot: Show Background off.");
			if (isGuardian)
			{
				GlowWhenReady = B("GlowWhenReady", d.GlowWhenReady, "Shows the glow only while the power can be used, as a \"ready\" signal. Slot: Glow shows it all the time and wins over this. If the selected boss has Use Own Glow on (sections 05.a to 05.g), that boss's glow color and size are used.");
				ReadyGlowPulse = B("ReadyGlowPulse", d.ReadyGlowPulse, "Slot: Glow When Ready only: the ready glow pulses slowly (about every 2 seconds) instead of staying still.");
			}
			EmptyMarkerColor = B<Color>("EmptyMarkerColor", d.EmptyMarkerColor, "Color of the thin ring drawn when the slot has no " + text + ". Alpha 00 hides the ring.");
			if (!isGuardian)
			{
				EdibleStyle = B("EdibleStyle", d.EdibleStyle, "How the food icon shows that you can eat that food again (the game allows it when less than half its time is left). Dim = the icon drops to Icon: Dim Opacity. Blink = the icon pulses, with the cycle time set by Icon: Blink Speed. None = the icon never changes.");
				BlinkSpeed = B("BlinkSpeed", d.BlinkSpeed, "Icon: When Edible = Blink only: time of one blink cycle. Vanilla = same as the vanilla HUD (about 1.3 seconds), TwiceVanilla = twice as slow (about 2.5 seconds), ThreeTimesVanilla = three times as slow (about 3.8 seconds).");
				EdibleOpacity = F("EdibleOpacity", d.EdibleOpacity, 0f, 1f, "Icon: When Edible = Dim only: opacity of the icon once the food can be eaten again. 1 = no change, 0.5 = half see-through, 0 = invisible.");
				ShowWhenEmpty = B("ShowWhenEmpty", d.ShowWhenEmpty, "Draws this slot even when it has no food, with the empty ring. Off = the slot only appears while it holds a food.");
				ApplyStyleToOtherFoods = B("ApplyStyleToOtherFoods", def: false, "Button: switch it on to copy this slot's whole look (shape, size, colors, icon, texts and effects) to the other food slots. Visible, Anchor, X and Y are not copied, so every slot keeps its place. It switches itself back off.");
			}
			Present(((ConfigEntryBase)(object)Visible, "Visible"), ((ConfigEntryBase)(object)ShowWhenEmpty, "Show When Empty"), ((ConfigEntryBase)(object)Anchor, "Anchor"), ((ConfigEntryBase)(object)X, "X"), ((ConfigEntryBase)(object)Y, "Y"), ((ConfigEntryBase)(object)Rotation, "Rotation"), ((ConfigEntryBase)(object)ApplyStyleToOtherFoods, "Copy Style To Other Foods"), ((ConfigEntryBase)(object)Shape, "Slot: Shape"), ((ConfigEntryBase)(object)Size, "Slot: Size"), ((ConfigEntryBase)(object)ShowBackground, "Slot: Show Background"), ((ConfigEntryBase)(object)Color, "Slot: Color"), ((ConfigEntryBase)(object)ColorEnd, "Slot: End Color"), ((ConfigEntryBase)(object)Gradient, "Slot: Gradient"), ((ConfigEntryBase)(object)BorderWidth, "Slot: Border Width"), ((ConfigEntryBase)(object)BorderColor, "Slot: Border Color"), ((ConfigEntryBase)(object)EmptyMarkerColor, "Slot: Empty Ring Color"), ((ConfigEntryBase)(object)ShadowEnabled, "Slot: Shadow"), ((ConfigEntryBase)(object)ShadowColor, "Slot: Shadow Color"), ((ConfigEntryBase)(object)ShadowOffsetX, "Slot: Shadow Offset X"), ((ConfigEntryBase)(object)ShadowOffsetY, "Slot: Shadow Offset Y"), ((ConfigEntryBase)(object)GlowEnabled, "Slot: Glow"), ((ConfigEntryBase)(object)GlowColor, "Slot: Glow Color"), ((ConfigEntryBase)(object)GlowSize, "Slot: Glow Size"), ((ConfigEntryBase)(object)GlowIntensity, "Slot: Glow Intensity"), ((ConfigEntryBase)(object)GlowAround, "Slot: Glow Around"), ((ConfigEntryBase)(object)GlowWhenReady, "Slot: Glow When Ready"), ((ConfigEntryBase)(object)ReadyGlowPulse, "Slot: Ready Glow Pulse"), ((ConfigEntryBase)(object)LabelFontSize, text3 + ": Font Size"), ((ConfigEntryBase)(object)LabelX, text3 + ": X"), ((ConfigEntryBase)(object)LabelY, text3 + ": Y"), ((ConfigEntryBase)(object)ShowName, "Name: Show"), ((ConfigEntryBase)(object)NameFontSize, "Name: Font Size"), ((ConfigEntryBase)(object)NameX, "Name: X"), ((ConfigEntryBase)(object)NameY, "Name: Y"), ((ConfigEntryBase)(object)TextColor, text4 + ": Color"), ((ConfigEntryBase)(object)TextOutlineWidth, text4 + ": Outline Width"), ((ConfigEntryBase)(object)TextOutlineColor, text4 + ": Outline Color"), ((ConfigEntryBase)(object)TextShadow, text4 + ": Shadow"), ((ConfigEntryBase)(object)TextShadowColor, text4 + ": Shadow Color"), ((ConfigEntryBase)(object)TextShadowOffset, text4 + ": Shadow Offset"), ((ConfigEntryBase)(object)TextShadowSoftness, text4 + ": Shadow Softness"), ((ConfigEntryBase)(object)IconSize, "Icon: Size"), ((ConfigEntryBase)(object)IconX, "Icon: X"), ((ConfigEntryBase)(object)IconY, "Icon: Y"), ((ConfigEntryBase)(object)CustomIcons, "Icon: Custom Power Icons"), ((ConfigEntryBase)(object)EdibleStyle, "Icon: When Edible"), ((ConfigEntryBase)(object)BlinkSpeed, "Icon: Blink Speed"), ((ConfigEntryBase)(object)EdibleOpacity, "Icon: Dim Opacity"));
			ShowWhen(() => Visible.Value, AllBut((ConfigEntryBase)Visible));
			ShowWhen(() => ShowBackground.Value, (ConfigEntryBase)Color, (ConfigEntryBase)ColorEnd, (ConfigEntryBase)Gradient, (ConfigEntryBase)BorderWidth, (ConfigEntryBase)BorderColor);
			ShowWhen(() => Gradient.Value != GradientDirection.None, (ConfigEntryBase)ColorEnd);
			ShowEffectRules();
			Func<bool> when = () => GlowEnabled.Value || (GlowWhenReady != null && GlowWhenReady.Value);
			ShowWhen(when, (ConfigEntryBase)GlowColor, (ConfigEntryBase)GlowSize, (ConfigEntryBase)GlowIntensity, (ConfigEntryBase)GlowAround);
			if (GlowWhenReady != null)
			{
				ShowWhen(() => GlowWhenReady.Value, (ConfigEntryBase)ReadyGlowPulse);
			}
			if (ShowName != null)
			{
				ShowWhen(() => ShowName.Value, (ConfigEntryBase)NameFontSize, (ConfigEntryBase)NameX, (ConfigEntryBase)NameY);
			}
			ShowTextRules();
			if (EdibleStyle != null)
			{
				ShowWhen(() => EdibleStyle.Value == ValHUD.EdibleStyle.Blink, (ConfigEntryBase)BlinkSpeed);
				ShowWhen(() => EdibleStyle.Value == ValHUD.EdibleStyle.Dim, (ConfigEntryBase)EdibleOpacity);
			}
		}

		public SlotSpec Resolve()
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: 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)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: Unknown result type (might be due to invalid IL or missing references)
			SlotSpec slotSpec = new SlotSpec
			{
				Visible = Visible.Value,
				ShowName = (ShowName != null && ShowName.Value),
				Gradient = Gradient.Value,
				EmptyMarkerColor = EmptyMarkerColor.Value,
				EdibleStyle = ((EdibleStyle != null) ? EdibleStyle.Value : ValHUD.EdibleStyle.None),
				EdibleOpacity = ((EdibleOpacity != null) ? EdibleOpacity.Value : 1f),
				BlinkSpeed = ((BlinkSpeed != null) ? BlinkSpeed.Value : ValHUD.BlinkSpeed.Vanilla),
				ShowWhenEmpty = (ShowWhenEmpty == null || ShowWhenEmpty.Value)