Decompiled source of DetailedLevels v1.7.3

DetailedLevels.dll

Decompiled a week ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Versioning;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using DetailedLevels.Features;
using DetailedLevels.Tools;
using HarmonyLib;
using JetBrains.Annotations;
using Microsoft.CodeAnalysis;
using ServerSync;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("DetailedLevels")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DetailedLevels")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("f302fe77-1481-495a-84b9-5ba829a4cf2b")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace DetailedLevels
{
	public enum SkillsSortOrder
	{
		None,
		AlphabeticalAscending,
		AlphabeticalDescending,
		LevelAscending,
		LevelDescending
	}
	public enum SkillValuesFormat
	{
		Decimals,
		Percentage
	}
	public enum KillStatsGroupingFormat
	{
		ByInitialLetter,
		AllTogether
	}
	internal class ConfigurationFile
	{
		private static ConfigEntry<bool> _serverConfigLocked = null;

		public static ConfigEntry<bool> debug;

		public static ConfigEntry<KeyCode> hotKey;

		public static ConfigEntry<int> numberOfDecimals;

		public static ConfigEntry<int> skillUpMessageAfterMultipleLevel;

		public static ConfigEntry<int> skillUpBigMessageAfterMultipleLevel;

		public static ConfigEntry<Color> colorSkillBackground;

		public static ConfigEntry<bool> saveSkillBuffs;

		public static ConfigEntry<bool> saveSkillsOrder;

		public static ConfigEntry<SkillsSortOrder> saveSkillsOrderValue;

		public static ConfigEntry<SkillValuesFormat> skillValuesFormat;

		public static ConfigEntry<KillStatsGroupingFormat> killStatsGroupingFormat;

		public static ConfigEntry<string> deathPenaltyText;

		public static ConfigEntry<string> reloadAfterDyingText;

		public static ConfigEntry<string> numberOfDecimalsText;

		public static ConfigEntry<string> skillValuesFormatText;

		public static ConfigEntry<string> skillUpMessageText;

		public static ConfigEntry<string> skillUpBigMessageText;

		public static ConfigEntry<string> skillUpValueText;

		public static ConfigEntry<string> skillsOrderText;

		public static ConfigEntry<string> statsText;

		public static ConfigEntry<string> statsDeathTypesText;

		public static ConfigEntry<string> statsProgressionText;

		public static ConfigEntry<string> statsTravellingText;

		public static ConfigEntry<string> statsOthersText;

		public static ConfigEntry<bool> dayMessageOff;

		private static ConfigFile configFile;

		private static readonly string ConfigFileName = "Turbero.DetailedLevels.cfg";

		private static readonly string ConfigFileFullPath;

		private static readonly ConfigSync ConfigSync;

		internal static void LoadConfig(BaseUnityPlugin plugin)
		{
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			configFile = plugin.Config;
			_serverConfigLocked = config("1 - General", "Lock Configuration", value: true, "If on, the configuration is locked and can be changed by server admins only.");
			ConfigSync.AddLockingConfigEntry<bool>(_serverConfigLocked);
			debug = config("1 - General", "DebugMode", value: false, "Enabling/Disabling the debugging in the console (default = false)", synchronizedSetting: false);
			hotKey = config<KeyCode>("1 - General", "HotKey", (KeyCode)285, "Hot Key to show the skills tab without opening the inventory first (default = F4)", synchronizedSetting: false);
			numberOfDecimals = config("2 - Levels Data", "NumberOfDecimals", 2, "Number of decimals to show in your levels information (default = 2, min = 0, max = 15)", synchronizedSetting: false);
			skillUpMessageAfterMultipleLevel = config("2 - Levels Data", "SkillUpMessageAfterMultipleLevel", 5, "Shows skill up message after the new level is multiple of the indicated level (0 = disabled, default = 5)", synchronizedSetting: false);
			skillUpBigMessageAfterMultipleLevel = config("2 - Levels Data", "SkillUpBigMessageAfterMultipleLevel", 10, "Shows skill up big message after the new level is multiple of the indicated level (0 = disabled, default = 20)", synchronizedSetting: false);
			colorSkillBackground = config<Color>("3 - Config", "ColorSkillBackground", Color.cyan, "Choose the color background for selected skills in the skills dialog: red, green, blue, white, black, yellow, cyan, magenta, gray or grey (default = cyan)", synchronizedSetting: false);
			saveSkillBuffs = config("3 - Config", "SaveSkillBuffs", value: false, "Enable/disable the option to reload tracked skills after dying (default = false)", synchronizedSetting: false);
			saveSkillsOrder = config("3 - Config", "Save Skills Order", value: false, "Enable/disable the option to save the order selected in the skills dialog (default = false)", synchronizedSetting: false);
			saveSkillsOrderValue = config("3 - Config", "Skills Order Value", SkillsSortOrder.None, "Skills Order to use when skills dialog is opened and the save option is enabled (default = None)", synchronizedSetting: false);
			skillValuesFormat = config("3 - Config", "Skill Values Format", SkillValuesFormat.Decimals, "Show the skill number values with decimals or percentage (default = Decimals)", synchronizedSetting: false);
			killStatsGroupingFormat = config("3 - Config", "Kill Stats Gropuing Format", KillStatsGroupingFormat.ByInitialLetter, "Show kill stats grouped by initial letter or all together (default = InitialLetter)", synchronizedSetting: false);
			deathPenaltyText = config("4 - Language", "DeathPenaltyText", "Death Penalty", "Translation for <Death Penalty> text");
			reloadAfterDyingText = config("4 - Language", "ReloadAfterDyingText", "Reload after dying", "Translation for <Reload after dying> text");
			numberOfDecimalsText = config("4 - Language", "NumberOfDecimalsText", "Number of decimals", "Translation for <Number of decimals> text");
			skillValuesFormatText = config("4 - Language", "Skill Values Format Text", "Skill Values Format", "Translation for <Skill Values Format> text");
			skillUpMessageText = config("4 - Language", "SkillUpMessageText", "Skill up message", "Translation for <Skill up message> text");
			skillUpBigMessageText = config("4 - Language", "SkillUpBigMessageText", "Skill up big message", "Translation for <Skill up big message> text");
			skillUpValueText = config("4 - Language", "SkillUpValueText", "Each {0} levels", "Translation for <Each X levels> text");
			skillsOrderText = config("4 - Language", "SkillsOrderText", "Save Skills Order", "Translation for <Save Skills Order> text");
			statsText = config("4 - Language", "StatsText", "Stats", "Translation for <Stats> text");
			statsDeathTypesText = config("4 - Language", "Stats Death Types", "Death Types", "Translation for <Death Types> text (restart game after change)");
			statsProgressionText = config("4 - Language", "StatsProgressionText", "Progression", "Translation for <Progression> text (restart game after change)");
			statsTravellingText = config("4 - Language", "StatsTravellingText", "Travelling", "Translation for <Travelling> text (restart game after change)");
			statsOthersText = config("4 - Language", "StatsOthersText", "Others", "Translation for <Others> text (restart game after change)");
			dayMessageOff = config("5 - Others", "Turn off Day Message", value: false, "If on, the mod will disable the day count message when attempting to display it on the player's screen.");
			SetupWatcher();
		}

		private static void SetupWatcher()
		{
			FileSystemWatcher fileSystemWatcher = new FileSystemWatcher(Paths.ConfigPath, ConfigFileName);
			fileSystemWatcher.Changed += ReadConfigValues;
			fileSystemWatcher.Created += ReadConfigValues;
			fileSystemWatcher.Renamed += ReadConfigValues;
			fileSystemWatcher.IncludeSubdirectories = true;
			fileSystemWatcher.SynchronizingObject = ThreadingHelper.SynchronizingObject;
			fileSystemWatcher.EnableRaisingEvents = true;
		}

		private static void ReadConfigValues(object sender, FileSystemEventArgs e)
		{
			if (!File.Exists(ConfigFileFullPath))
			{
				return;
			}
			try
			{
				Logger.Log("Attempting to reload configuration...");
				configFile.Reload();
				SettingsChanged(null, null);
			}
			catch (Exception arg)
			{
				Logger.LogError($"There was an issue loading {ConfigFileName}, {arg}");
			}
		}

		private static void SettingsChanged(object sender, EventArgs e)
		{
			PlayerSkillupOptionsPatch.updateOptionsTexts();
			PlayerSkillupOptionsPatch.reloadTexts();
			PlayerColorBuffs.refreshAllBlueColors(Player.m_localPlayer);
			SkillTypeCraftStationDescriptionsPatch.updated = false;
		}

		private static ConfigEntry<T> config<T>(string group, string name, T value, string description, bool synchronizedSetting = true)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			return config(group, name, value, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()), synchronizedSetting);
		}

		private static ConfigEntry<T> config<T>(string group, string name, T value, ConfigDescription description, bool synchronizedSetting = true)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			ConfigDescription val = new ConfigDescription(description.Description + (synchronizedSetting ? " [Synced with Server]" : " [Not Synced with Server]"), description.AcceptableValues, description.Tags);
			ConfigEntry<T> val2 = configFile.Bind<T>(group, name, value, val);
			SyncedConfigEntry<T> syncedConfigEntry = ConfigSync.AddConfigEntry<T>(val2);
			syncedConfigEntry.SynchronizedConfig = synchronizedSetting;
			return val2;
		}

		static ConfigurationFile()
		{
			string configPath = Paths.ConfigPath;
			char directorySeparatorChar = Path.DirectorySeparatorChar;
			ConfigFileFullPath = configPath + directorySeparatorChar + ConfigFileName;
			ConfigSync = new ConfigSync("Turbero.DetailedLevels")
			{
				DisplayName = "Detailed Levels",
				CurrentVersion = "1.7.3",
				MinimumRequiredVersion = "1.7.3"
			};
		}
	}
	[BepInPlugin("Turbero.DetailedLevels", "Detailed Levels", "1.7.3")]
	public class DetailedLevels : BaseUnityPlugin
	{
		public const string GUID = "Turbero.DetailedLevels";

		public const string NAME = "Detailed Levels";

		public const string VERSION = "1.7.3";

		private readonly Harmony harmony = new Harmony("Turbero.DetailedLevels");

		private void Awake()
		{
			ConfigurationFile.LoadConfig((BaseUnityPlugin)(object)this);
			harmony.PatchAll();
		}

		private void onDestroy()
		{
			harmony.UnpatchSelf();
		}

		private void Update()
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)Player.m_localPlayer) || !Object.op_Implicit((Object)(object)InventoryGui.instance))
			{
				return;
			}
			if (Input.GetKeyDown((KeyCode)27) || Input.GetKeyDown((KeyCode)9) || ((Character)Player.m_localPlayer).IsDead())
			{
				hideCustomPanelAndSkillsDialog();
			}
			if (Input.GetKeyDown(ConfigurationFile.hotKey.Value) && Time.timeScale > 0f)
			{
				if (((Component)InventoryGui.instance.m_skillsDialog).gameObject.activeSelf)
				{
					hideCustomPanelAndSkillsDialog();
					InventoryGui.instance.Hide();
				}
				else
				{
					InventoryGui.instance.Show((Container)null, 1);
					WaitForSecondsAsync(0.15f);
				}
			}
		}

		private static void hideCustomPanelAndSkillsDialog()
		{
			if (!((Object)(object)InventoryGui.instance.m_skillsDialog == (Object)null))
			{
				((Component)InventoryGui.instance.m_skillsDialog).gameObject.SetActive(false);
				if (!((Object)(object)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame/CustomSkillOptionsPanel") == (Object)null))
				{
					((Component)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame/CustomSkillOptionsPanel")).gameObject.SetActive(false);
					((Component)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("TabStatsButton")).gameObject.SetActive(false);
					((Component)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("TabKillStatsButton")).gameObject.SetActive(false);
				}
			}
		}

		private static async Task WaitForSecondsAsync(float seconds)
		{
			await Task.Delay((int)(Math.Max(0f, seconds) * 1000f));
			InventoryGui.instance.m_skillsDialog.Setup(Player.m_localPlayer);
			((Component)InventoryGui.instance.m_skillsDialog).gameObject.SetActive(true);
		}
	}
	[HarmonyPatch]
	public class NoWarnings
	{
		[HarmonyPatch(typeof(Debug), "LogWarning", new Type[]
		{
			typeof(object),
			typeof(Object)
		})]
		[HarmonyPrefix]
		private static bool LogWarning(object message, Object context)
		{
			if (message.ToString().Contains("The LiberationSans SDF Font Asset was not found") || message.ToString().Contains("The character used for Ellipsis is not available in font asset"))
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(Localization), "SetLanguage")]
	public class Localization_SetLanguage_Patch
	{
		private static void Postfix(string language)
		{
			//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_003f: Unknown result type (might be due to invalid IL or missing references)
			Logger.Log("Language changed to: " + language);
			foreach (SkillType key in PlayerUtils.skillStatusEffects.Keys)
			{
				int valueSafe = GeneralExtensions.GetValueSafe<SkillType, int>(PlayerUtils.skillStatusEffects, key);
				Player_RaiseSkill_Patch.updateSkillTypeBuff(Player.m_localPlayer, key, valueSafe, forceUpdate: true);
			}
		}
	}
	public static class Logger
	{
		public static ManualLogSource logger = Logger.CreateLogSource("Detailed Levels");

		internal static void Log(object s)
		{
			if (ConfigurationFile.debug.Value)
			{
				logger.LogInfo((object)s?.ToString());
			}
		}

		internal static void LogInfo(object s)
		{
			logger.LogInfo((object)s?.ToString());
		}

		internal static void LogWarning(object s)
		{
			string text = "Detailed Levels 1.7.3: " + ((s != null) ? s.ToString() : "null");
			Debug.LogWarning((object)text);
		}

		internal static void LogError(object s)
		{
			string text = "Detailed Levels 1.7.3: " + ((s != null) ? s.ToString() : "null");
			Debug.LogError((object)text);
		}
	}
}
namespace DetailedLevels.Tools
{
	internal class GameManager
	{
		public static object GetPrivateValue(object obj, string name, BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic)
		{
			return obj.GetType().GetField(name, bindingAttr)?.GetValue(obj);
		}

		public static object GetPrivateMethod(object obj, string name, BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.NonPublic)
		{
			return obj.GetType().GetMethod(name, bindingAttr)?.Invoke(obj, null);
		}

		public static int GetCurrentDay()
		{
			return (int)GetPrivateMethod(EnvMan.instance, "GetCurrentDay");
		}
	}
	[HarmonyPatch(typeof(Player), "Message")]
	internal static class PlayerMessagePatch
	{
		[UsedImplicitly]
		private static bool Prefix(Player __instance, MessageType type, string msg, int amount = 0, Sprite icon = null)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			ZNetView val = (ZNetView)GameManager.GetPrivateValue(__instance, "m_nview");
			if ((Object)(object)val == (Object)null || !val.IsValid())
			{
				return false;
			}
			if ((Object)(object)Player.m_localPlayer == (Object)null)
			{
				return false;
			}
			if (msg == Localization.instance.Localize("$msg_newday", new string[1] { GameManager.GetCurrentDay().ToString() }) && ConfigurationFile.dayMessageOff.Value)
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(MessageHud), "ShowMessage")]
	internal static class MessageHudShowMessagePatch
	{
		[UsedImplicitly]
		private static bool Prefix(MessageHud __instance, MessageType type, string text, int amount = 0, Sprite icon = null)
		{
			if (Hud.IsUserHidden())
			{
				return false;
			}
			if (text == Localization.instance.Localize("$msg_newday", new string[1] { GameManager.GetCurrentDay().ToString() }) && ConfigurationFile.dayMessageOff.Value)
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(Minimap), "AddPin")]
	internal static class MinimapAddPinPatch
	{
		[UsedImplicitly]
		private static void Postfix(Minimap __instance, Vector3 pos, PinType type, string name, bool save, bool isChecked, long ownerID = 0L)
		{
			if (!ConfigurationFile.dayMessageOff.Value)
			{
				return;
			}
			List<PinData> list = (List<PinData>)GameManager.GetPrivateValue(__instance, "m_pins");
			foreach (PinData item in list)
			{
				if (item.m_name == $"$hud_mapday {EnvMan.instance.GetDay(ZNet.instance.GetTimeSeconds())}")
				{
					item.m_name = "";
				}
				else if (item.m_name.Contains("$hud_mapday"))
				{
					item.m_name = "";
				}
			}
		}
	}
	public class CustomSkillOptionsPanel
	{
		private GameObject panel;

		private TextMeshProUGUI titleText;

		private TMP_Text buttonText;

		public CustomSkillOptionsPanel(Transform copyForCloseButton)
		{
			Init(copyForCloseButton);
		}

		private void Init(Transform copyForCloseButton)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Expected O, but got Unknown
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f0: Expected O, but got Unknown
			Transform transform = ((Component)((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame")).transform;
			panel = new GameObject("CustomSkillOptionsPanel", new Type[1] { typeof(RectTransform) });
			panel.SetActive(false);
			panel.transform.SetParent(transform, false);
			RectTransform component = panel.GetComponent<RectTransform>();
			component.sizeDelta = new Vector2(512f, 512f);
			component.anchoredPosition = new Vector2(0f, 0f);
			Image component2 = ((Component)transform.Find("bkg")).GetComponent<Image>();
			Image val = Object.Instantiate<Image>(component2, panel.transform);
			((Object)val).name = "bkg_customskills";
			GameObject gameObject = ((Component)transform.Find("topic")).gameObject;
			GameObject val2 = Object.Instantiate<GameObject>(gameObject, panel.transform);
			((Object)val2).name = "Title";
			titleText = val2.GetComponent<TextMeshProUGUI>();
			((TMP_Text)titleText).text = Localization.instance.Localize("$button_ps_start");
			RectTransform component3 = val2.GetComponent<RectTransform>();
			component3.anchoredPosition = new Vector2(0f, -30f);
			Transform val3 = ((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame/Closebutton");
			GameObject val4 = Object.Instantiate<GameObject>(((Component)val3).gameObject, copyForCloseButton);
			((Object)val4).name = "DLOptionsCloseButton";
			val4.transform.SetParent(panel.transform, false);
			RectTransform component4 = val4.GetComponent<RectTransform>();
			component4.anchoredPosition = new Vector2(0f, 40f);
			buttonText = val4.GetComponentInChildren<TMP_Text>();
			Button component5 = val4.GetComponent<Button>();
			component5.onClick = new ButtonClickedEvent();
			((UnityEvent)component5.onClick).AddListener((UnityAction)delegate
			{
				panel.SetActive(false);
				InventoryGui.instance.m_skillsDialog.Setup(Player.m_localPlayer);
			});
			reloadTexts();
		}

		public GameObject getPanel()
		{
			if ((Object)(object)panel == (Object)null)
			{
				Logger.Log("Recreating gameObject panel...");
				Transform val = ((Component)InventoryGui.instance.m_skillsDialog).transform.Find("SkillsFrame/Closebutton");
				Button component = ((Component)val).GetComponent<Button>();
				Init(((Component)component).transform.parent);
				Logger.Log("gameObject panel recreated.");
			}
			return panel;
		}

		public void reloadTexts()
		{
			((TMP_Text)titleText).text = Localization.instance.Localize("$button_ps_start");
			buttonText.text = Localization.instance.Localize("$menu_close");
		}
	}
	public class CustomSlider
	{
		private readonly GameObject sliderObject;

		private readonly Slider slider;

		private readonly TextMeshProUGUI sliderValue;

		public TextMeshProUGUI sliderLabelDescription;

		public CustomSlider(string name, int maxValue, Vector2 sizeDelta, Vector2 position, int posXIcon, string spriteName, int posXDescription, string description, int posXValue, int initValue, string valueDesc)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Expected O, but got Unknown
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Expected O, but got Unknown
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Expected O, but got Unknown
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Expected O, but got Unknown
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_032f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Expected O, but got Unknown
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d3: Expected O, but got Unknown
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0495: Unknown result type (might be due to invalid IL or missing references)
			//IL_049c: Expected O, but got Unknown
			//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
			sliderObject = new GameObject(name, new Type[1] { typeof(RectTransform) });
			RectTransform component = sliderObject.GetComponent<RectTransform>();
			component.sizeDelta = sizeDelta;
			component.anchoredPosition = position;
			slider = sliderObject.AddComponent<Slider>();
			((Object)slider).name = name;
			slider.minValue = 0f;
			slider.maxValue = maxValue;
			slider.value = initValue;
			typeof(Slider).GetField("m_WholeNumbers", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(slider, true);
			GameObject val = new GameObject("Background", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val.transform.SetParent(sliderObject.transform, false);
			RectTransform component2 = val.GetComponent<RectTransform>();
			component2.anchorMin = new Vector2(0f, 0f);
			component2.anchorMax = new Vector2(1f, 1f);
			component2.sizeDelta = new Vector2(0f, 0f);
			((Graphic)val.GetComponent<Image>()).color = Color.gray;
			GameObject val2 = new GameObject("Fill Area", new Type[1] { typeof(RectTransform) });
			val2.transform.SetParent(sliderObject.transform, false);
			RectTransform component3 = val2.GetComponent<RectTransform>();
			component3.anchorMin = new Vector2(0f, 0.25f);
			component3.anchorMax = new Vector2(1f, 0.75f);
			component3.sizeDelta = new Vector2(0f, 0f);
			GameObject val3 = new GameObject("Fill", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val3.transform.SetParent(val2.transform, false);
			RectTransform component4 = val3.GetComponent<RectTransform>();
			component4.anchorMin = new Vector2(0f, 0f);
			component4.anchorMax = new Vector2(1f, 1f);
			component4.sizeDelta = new Vector2(0f, 0f);
			((Graphic)val3.GetComponent<Image>()).color = Color.green;
			slider.fillRect = component4;
			GameObject val4 = new GameObject("Handle", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val4.transform.SetParent(sliderObject.transform, false);
			RectTransform component5 = val4.GetComponent<RectTransform>();
			component5.sizeDelta = new Vector2(10f, 10f);
			((Graphic)val4.GetComponent<Image>()).color = Color.white;
			((Selectable)slider).targetGraphic = (Graphic)(object)val4.GetComponent<Image>();
			slider.handleRect = component5;
			if (spriteName != null)
			{
				GameObject val5 = new GameObject("Icon");
				Image val6 = val5.AddComponent<Image>();
				val6.sprite = PlayerUtils.getSprite(spriteName);
				RectTransform component6 = val5.GetComponent<RectTransform>();
				((Transform)component6).SetParent(sliderObject.transform, false);
				component6.sizeDelta = new Vector2(25f, 25f);
				component6.anchoredPosition = new Vector2((float)posXIcon, 0f);
			}
			if (description != null)
			{
				GameObject val7 = new GameObject("SliderLabel", new Type[2]
				{
					typeof(RectTransform),
					typeof(TextMeshProUGUI)
				});
				val7.transform.SetParent(sliderObject.transform, false);
				RectTransform component7 = val7.GetComponent<RectTransform>();
				component7.anchoredPosition = new Vector2((float)posXDescription, 0f);
				sliderLabelDescription = val7.GetComponent<TextMeshProUGUI>();
				((TMP_Text)sliderLabelDescription).text = description;
				((TMP_Text)sliderLabelDescription).fontSize = 18f;
				((TMP_Text)sliderLabelDescription).alignment = (TextAlignmentOptions)516;
				((TMP_Text)sliderLabelDescription).font = PlayerUtils.getFontAsset("Valheim-AveriaSansLibre");
			}
			if (initValue >= 0)
			{
				GameObject val8 = new GameObject("SliderValue", new Type[2]
				{
					typeof(RectTransform),
					typeof(TextMeshProUGUI)
				});
				val8.transform.SetParent(sliderObject.transform, false);
				RectTransform component8 = val8.GetComponent<RectTransform>();
				component8.anchoredPosition = new Vector2((float)posXValue, 0f);
				sliderValue = val8.GetComponent<TextMeshProUGUI>();
				((TMP_Text)sliderValue).fontSize = 18f;
				((TMP_Text)sliderValue).font = PlayerUtils.getFontAsset("Valheim-AveriaSansLibre");
				((TMP_Text)sliderValue).alignment = (TextAlignmentOptions)513;
				((TMP_Text)sliderValue).text = valueDesc;
			}
		}

		public GameObject getGameObject()
		{
			return sliderObject;
		}

		public void OnValueChanged(UnityAction<float> call)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			slider.onValueChanged = new SliderEvent();
			((UnityEvent<float>)(object)slider.onValueChanged).AddListener(call);
		}

		public void updateTextValue(string value)
		{
			((TMP_Text)sliderValue).text = value;
		}

		public void updateValue(float value)
		{
			slider.value = value;
		}

		public float getValue()
		{
			return slider.value;
		}
	}
	public class CustomStatsPanel
	{
		private readonly GameObject panel;

		private readonly TextMeshProUGUI statsTopicText;

		private readonly CustomStatsPanelScroll scrollPanel;

		public CustomStatsPanel()
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Expected O, but got Unknown
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Expected O, but got Unknown
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0402: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_0455: Unknown result type (might be due to invalid IL or missing references)
			//IL_0476: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0505: Unknown result type (might be due to invalid IL or missing references)
			//IL_0526: Unknown result type (might be due to invalid IL or missing references)
			//IL_0547: Unknown result type (might be due to invalid IL or missing references)
			//IL_0579: Unknown result type (might be due to invalid IL or missing references)
			//IL_059a: 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_05dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_062f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0650: Unknown result type (might be due to invalid IL or missing references)
			//IL_0671: 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_06b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0706: Unknown result type (might be due to invalid IL or missing references)
			//IL_0727: Unknown result type (might be due to invalid IL or missing references)
			//IL_0774: Unknown result type (might be due to invalid IL or missing references)
			//IL_0795: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0809: Unknown result type (might be due to invalid IL or missing references)
			//IL_082a: Unknown result type (might be due to invalid IL or missing references)
			//IL_084b: Unknown result type (might be due to invalid IL or missing references)
			//IL_086c: Unknown result type (might be due to invalid IL or missing references)
			//IL_089e: Unknown result type (might be due to invalid IL or missing references)
			//IL_08bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0901: Unknown result type (might be due to invalid IL or missing references)
			//IL_0933: Unknown result type (might be due to invalid IL or missing references)
			//IL_0954: Unknown result type (might be due to invalid IL or missing references)
			//IL_0975: Unknown result type (might be due to invalid IL or missing references)
			//IL_0996: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a78: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aca: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b56: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b7f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bc8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c1a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c3b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c83: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d07: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d39: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d5a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d7b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d9c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dbd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0def: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e10: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e31: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e52: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ec6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ee7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f19: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f3a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f7c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fe4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1003: Unknown result type (might be due to invalid IL or missing references)
			//IL_1023: Unknown result type (might be due to invalid IL or missing references)
			//IL_1044: Unknown result type (might be due to invalid IL or missing references)
			//IL_1076: Unknown result type (might be due to invalid IL or missing references)
			//IL_1097: Unknown result type (might be due to invalid IL or missing references)
			//IL_10c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_110b: Unknown result type (might be due to invalid IL or missing references)
			//IL_113d: Unknown result type (might be due to invalid IL or missing references)
			//IL_115e: Unknown result type (might be due to invalid IL or missing references)
			//IL_117f: Unknown result type (might be due to invalid IL or missing references)
			//IL_11a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_11ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_120e: Unknown result type (might be due to invalid IL or missing references)
			GameObject trophiesPanel = InventoryGui.instance.m_trophiesPanel;
			if (!((Object)(object)trophiesPanel == (Object)null))
			{
				SkillsDialog skillsDialog = InventoryGui.instance.m_skillsDialog;
				panel = Object.Instantiate<GameObject>(trophiesPanel, ((Component)skillsDialog).transform);
				((Object)panel).name = "PlayerStatsFrame";
				panel.SetActive(false);
				RectTransform component = panel.GetComponent<RectTransform>();
				component.anchoredPosition = new Vector2(0f, 0f);
				((Object)panel.transform.Find("TrophiesFrame")).name = "MainFrame";
				Transform val = ((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/topic");
				statsTopicText = ((Component)val).GetComponent<TextMeshProUGUI>();
				((TMP_Text)statsTopicText).text = ConfigurationFile.statsText.Value;
				((Object)((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Trophies")).name = "Stats";
				((Object)((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Stats/TrophyListScroll")).name = "StatsListScroll";
				((Object)((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Stats/TrophyList")).name = "StatList";
				Transform val2 = ((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Closebutton");
				Button component2 = ((Component)val2).GetComponent<Button>();
				component2.onClick = new ButtonClickedEvent();
				((UnityEvent)component2.onClick).AddListener((UnityAction)delegate
				{
					Logger.Log("statsCloseButtonButton clicked.");
					panel.SetActive(false);
					PlayerSkillupOptionsPatch.HideTabButtons();
				});
				scrollPanel = new CustomStatsPanelScroll(((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Stats/StatList"));
				Dictionary<PlayerStatType, float> playerDictionaryStats = getPlayerDictionaryStats();
				CustomStatsPanelScroll customStatsPanelScroll = scrollPanel;
				Dictionary<string, float> dictionary = new Dictionary<string, float>();
				PlayerStatType val3 = (PlayerStatType)26;
				dictionary.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)26));
				val3 = (PlayerStatType)4;
				dictionary.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)4));
				customStatsPanelScroll.AddRowToScrollList(dictionary);
				scrollPanel.AddHeaderToScrollList("$menu_combat", (TextAlignmentOptions)514);
				CustomStatsPanelScroll customStatsPanelScroll2 = scrollPanel;
				Dictionary<string, float> dictionary2 = new Dictionary<string, float>();
				val3 = (PlayerStatType)0;
				dictionary2.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)0));
				val3 = (PlayerStatType)10;
				dictionary2.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)10));
				val3 = (PlayerStatType)11;
				dictionary2.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)11));
				val3 = (PlayerStatType)51;
				dictionary2.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)51));
				val3 = (PlayerStatType)50;
				dictionary2.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)50));
				customStatsPanelScroll2.AddRowToScrollList(dictionary2);
				CustomStatsPanelScroll customStatsPanelScroll3 = scrollPanel;
				Dictionary<string, float> dictionary3 = new Dictionary<string, float>();
				val3 = (PlayerStatType)5;
				dictionary3.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)5));
				val3 = (PlayerStatType)6;
				dictionary3.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)6));
				val3 = (PlayerStatType)7;
				dictionary3.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)7));
				val3 = (PlayerStatType)8;
				dictionary3.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)8));
				val3 = (PlayerStatType)9;
				dictionary3.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)9));
				customStatsPanelScroll3.AddRowToScrollList(dictionary3);
				CustomStatsPanelScroll customStatsPanelScroll4 = scrollPanel;
				Dictionary<string, float> dictionary4 = new Dictionary<string, float>();
				val3 = (PlayerStatType)52;
				dictionary4.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)52));
				val3 = (PlayerStatType)53;
				dictionary4.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)53));
				val3 = (PlayerStatType)54;
				dictionary4.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)54));
				customStatsPanelScroll4.AddRowToScrollList(dictionary4);
				CustomStatsPanelScroll customStatsPanelScroll5 = scrollPanel;
				Dictionary<string, float> dictionary5 = new Dictionary<string, float>();
				val3 = (PlayerStatType)15;
				dictionary5.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)15));
				val3 = (PlayerStatType)83;
				dictionary5.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)83));
				val3 = (PlayerStatType)84;
				dictionary5.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)84));
				customStatsPanelScroll5.AddRowToScrollList(dictionary5);
				scrollPanel.AddHeaderToScrollList(ConfigurationFile.statsDeathTypesText.Value, (TextAlignmentOptions)514);
				CustomStatsPanelScroll customStatsPanelScroll6 = scrollPanel;
				Dictionary<string, float> dictionary6 = new Dictionary<string, float>();
				val3 = (PlayerStatType)56;
				dictionary6.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)56));
				val3 = (PlayerStatType)57;
				dictionary6.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)57));
				val3 = (PlayerStatType)58;
				dictionary6.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)58));
				val3 = (PlayerStatType)59;
				dictionary6.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)59));
				val3 = (PlayerStatType)60;
				dictionary6.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)60));
				customStatsPanelScroll6.AddRowToScrollList(dictionary6);
				CustomStatsPanelScroll customStatsPanelScroll7 = scrollPanel;
				Dictionary<string, float> dictionary7 = new Dictionary<string, float>();
				val3 = (PlayerStatType)61;
				dictionary7.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)61));
				val3 = (PlayerStatType)62;
				dictionary7.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)62));
				val3 = (PlayerStatType)63;
				dictionary7.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)63));
				val3 = (PlayerStatType)64;
				dictionary7.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)64));
				val3 = (PlayerStatType)65;
				dictionary7.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)65));
				customStatsPanelScroll7.AddRowToScrollList(dictionary7);
				CustomStatsPanelScroll customStatsPanelScroll8 = scrollPanel;
				Dictionary<string, float> dictionary8 = new Dictionary<string, float>();
				val3 = (PlayerStatType)66;
				dictionary8.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)66));
				val3 = (PlayerStatType)67;
				dictionary8.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)67));
				val3 = (PlayerStatType)68;
				dictionary8.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)68));
				val3 = (PlayerStatType)69;
				dictionary8.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)69));
				val3 = (PlayerStatType)70;
				dictionary8.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)70));
				customStatsPanelScroll8.AddRowToScrollList(dictionary8);
				CustomStatsPanelScroll customStatsPanelScroll9 = scrollPanel;
				Dictionary<string, float> dictionary9 = new Dictionary<string, float>();
				val3 = (PlayerStatType)71;
				dictionary9.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)71));
				val3 = (PlayerStatType)72;
				dictionary9.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)72));
				val3 = (PlayerStatType)73;
				dictionary9.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)73));
				customStatsPanelScroll9.AddRowToScrollList(dictionary9);
				scrollPanel.AddHeaderToScrollList(ConfigurationFile.statsProgressionText.Value, (TextAlignmentOptions)514);
				CustomStatsPanelScroll customStatsPanelScroll10 = scrollPanel;
				Dictionary<string, float> dictionary10 = new Dictionary<string, float>();
				val3 = (PlayerStatType)85;
				dictionary10.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)85));
				val3 = (PlayerStatType)86;
				dictionary10.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)86));
				val3 = (PlayerStatType)87;
				dictionary10.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)87));
				val3 = (PlayerStatType)96;
				dictionary10.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)96));
				customStatsPanelScroll10.AddRowToScrollList(dictionary10);
				CustomStatsPanelScroll customStatsPanelScroll11 = scrollPanel;
				Dictionary<string, float> dictionary11 = new Dictionary<string, float>();
				val3 = (PlayerStatType)88;
				dictionary11.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)88));
				val3 = (PlayerStatType)97;
				dictionary11.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)97));
				val3 = (PlayerStatType)89;
				dictionary11.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)89));
				val3 = (PlayerStatType)98;
				dictionary11.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)98));
				customStatsPanelScroll11.AddRowToScrollList(dictionary11);
				CustomStatsPanelScroll customStatsPanelScroll12 = scrollPanel;
				Dictionary<string, float> dictionary12 = new Dictionary<string, float>();
				val3 = (PlayerStatType)90;
				dictionary12.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)90));
				val3 = (PlayerStatType)99;
				dictionary12.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)99));
				val3 = (PlayerStatType)91;
				dictionary12.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)91));
				val3 = (PlayerStatType)100;
				dictionary12.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)100));
				customStatsPanelScroll12.AddRowToScrollList(dictionary12);
				CustomStatsPanelScroll customStatsPanelScroll13 = scrollPanel;
				Dictionary<string, float> dictionary13 = new Dictionary<string, float>();
				val3 = (PlayerStatType)92;
				dictionary13.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)92));
				val3 = (PlayerStatType)101;
				dictionary13.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)101));
				val3 = (PlayerStatType)93;
				dictionary13.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)93));
				val3 = (PlayerStatType)102;
				dictionary13.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)102));
				customStatsPanelScroll13.AddRowToScrollList(dictionary13);
				CustomStatsPanelScroll customStatsPanelScroll14 = scrollPanel;
				Dictionary<string, float> dictionary14 = new Dictionary<string, float>();
				val3 = (PlayerStatType)94;
				dictionary14.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)94));
				val3 = (PlayerStatType)103;
				dictionary14.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)103));
				val3 = (PlayerStatType)95;
				dictionary14.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)95));
				val3 = (PlayerStatType)104;
				dictionary14.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)104));
				customStatsPanelScroll14.AddRowToScrollList(dictionary14);
				scrollPanel.AddHeaderToScrollList(ConfigurationFile.statsTravellingText.Value, (TextAlignmentOptions)514);
				CustomStatsPanelScroll customStatsPanelScroll15 = scrollPanel;
				Dictionary<string, float> dictionary15 = new Dictionary<string, float>();
				val3 = (PlayerStatType)16;
				dictionary15.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)16), 2));
				val3 = (PlayerStatType)17;
				dictionary15.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)17), 2));
				val3 = (PlayerStatType)18;
				dictionary15.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)18), 2));
				val3 = (PlayerStatType)19;
				dictionary15.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)19), 2));
				val3 = (PlayerStatType)20;
				dictionary15.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)20), 2));
				customStatsPanelScroll15.AddRowToScrollList(dictionary15);
				CustomStatsPanelScroll customStatsPanelScroll16 = scrollPanel;
				Dictionary<string, float> dictionary16 = new Dictionary<string, float>();
				val3 = (PlayerStatType)21;
				dictionary16.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)21), 2));
				val3 = (PlayerStatType)22;
				dictionary16.Add(((object)(PlayerStatType)(ref val3)).ToString(), (float)Math.Round(GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)22), 2));
				val3 = (PlayerStatType)23;
				dictionary16.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)23));
				val3 = (PlayerStatType)3;
				dictionary16.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)3));
				customStatsPanelScroll16.AddRowToScrollList(dictionary16);
				CustomStatsPanelScroll customStatsPanelScroll17 = scrollPanel;
				Dictionary<string, float> dictionary17 = new Dictionary<string, float>();
				val3 = (PlayerStatType)45;
				dictionary17.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)45));
				val3 = (PlayerStatType)46;
				dictionary17.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)46));
				val3 = (PlayerStatType)47;
				dictionary17.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)47));
				customStatsPanelScroll17.AddRowToScrollList(dictionary17);
				scrollPanel.AddHeaderToScrollList("$menu_resources", (TextAlignmentOptions)514);
				CustomStatsPanelScroll customStatsPanelScroll18 = scrollPanel;
				Dictionary<string, float> dictionary18 = new Dictionary<string, float>();
				val3 = (PlayerStatType)35;
				dictionary18.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)35));
				val3 = (PlayerStatType)36;
				dictionary18.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)36));
				val3 = (PlayerStatType)27;
				dictionary18.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)27));
				val3 = (PlayerStatType)28;
				dictionary18.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)28));
				val3 = (PlayerStatType)29;
				dictionary18.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)29));
				customStatsPanelScroll18.AddRowToScrollList(dictionary18);
				CustomStatsPanelScroll customStatsPanelScroll19 = scrollPanel;
				Dictionary<string, float> dictionary19 = new Dictionary<string, float>();
				val3 = (PlayerStatType)30;
				dictionary19.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)30));
				val3 = (PlayerStatType)31;
				dictionary19.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)31));
				val3 = (PlayerStatType)32;
				dictionary19.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)32));
				val3 = (PlayerStatType)33;
				dictionary19.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)33));
				val3 = (PlayerStatType)34;
				dictionary19.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)34));
				customStatsPanelScroll19.AddRowToScrollList(dictionary19);
				CustomStatsPanelScroll customStatsPanelScroll20 = scrollPanel;
				Dictionary<string, float> dictionary20 = new Dictionary<string, float>();
				val3 = (PlayerStatType)37;
				dictionary20.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)37));
				val3 = (PlayerStatType)38;
				dictionary20.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)38));
				val3 = (PlayerStatType)39;
				dictionary20.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)39));
				val3 = (PlayerStatType)40;
				dictionary20.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)40));
				val3 = (PlayerStatType)41;
				dictionary20.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)41));
				customStatsPanelScroll20.AddRowToScrollList(dictionary20);
				CustomStatsPanelScroll customStatsPanelScroll21 = scrollPanel;
				Dictionary<string, float> dictionary21 = new Dictionary<string, float>();
				val3 = (PlayerStatType)42;
				dictionary21.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)42));
				val3 = (PlayerStatType)43;
				dictionary21.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)43));
				val3 = (PlayerStatType)44;
				dictionary21.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)44));
				customStatsPanelScroll21.AddRowToScrollList(dictionary21);
				CustomStatsPanelScroll customStatsPanelScroll22 = scrollPanel;
				Dictionary<string, float> dictionary22 = new Dictionary<string, float>();
				val3 = (PlayerStatType)12;
				dictionary22.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)12));
				val3 = (PlayerStatType)48;
				dictionary22.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)48));
				val3 = (PlayerStatType)49;
				dictionary22.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)49));
				val3 = (PlayerStatType)76;
				dictionary22.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)76));
				val3 = (PlayerStatType)77;
				dictionary22.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)77));
				customStatsPanelScroll22.AddRowToScrollList(dictionary22);
				scrollPanel.AddHeaderToScrollList("$hud_building", (TextAlignmentOptions)514);
				CustomStatsPanelScroll customStatsPanelScroll23 = scrollPanel;
				Dictionary<string, float> dictionary23 = new Dictionary<string, float>();
				val3 = (PlayerStatType)2;
				dictionary23.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)2));
				val3 = (PlayerStatType)1;
				dictionary23.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)1));
				val3 = (PlayerStatType)13;
				dictionary23.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)13));
				val3 = (PlayerStatType)14;
				dictionary23.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)14));
				customStatsPanelScroll23.AddRowToScrollList(dictionary23);
				CustomStatsPanelScroll customStatsPanelScroll24 = scrollPanel;
				Dictionary<string, float> dictionary24 = new Dictionary<string, float>();
				val3 = (PlayerStatType)25;
				dictionary24.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)25));
				val3 = (PlayerStatType)24;
				dictionary24.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)24));
				customStatsPanelScroll24.AddRowToScrollList(dictionary24);
				CustomStatsPanelScroll customStatsPanelScroll25 = scrollPanel;
				Dictionary<string, float> dictionary25 = new Dictionary<string, float>();
				val3 = (PlayerStatType)74;
				dictionary25.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)74));
				val3 = (PlayerStatType)75;
				dictionary25.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)75));
				val3 = (PlayerStatType)82;
				dictionary25.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)82));
				customStatsPanelScroll25.AddRowToScrollList(dictionary25);
				CustomStatsPanelScroll customStatsPanelScroll26 = scrollPanel;
				Dictionary<string, float> dictionary26 = new Dictionary<string, float>();
				val3 = (PlayerStatType)78;
				dictionary26.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)78));
				val3 = (PlayerStatType)79;
				dictionary26.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)79));
				val3 = (PlayerStatType)80;
				dictionary26.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)80));
				val3 = (PlayerStatType)81;
				dictionary26.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)81));
				customStatsPanelScroll26.AddRowToScrollList(dictionary26);
				scrollPanel.AddHeaderToScrollList(ConfigurationFile.statsOthersText.Value, (TextAlignmentOptions)514);
				CustomStatsPanelScroll customStatsPanelScroll27 = scrollPanel;
				Dictionary<string, float> dictionary27 = new Dictionary<string, float>();
				val3 = (PlayerStatType)55;
				dictionary27.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)55));
				val3 = (PlayerStatType)105;
				dictionary27.Add(((object)(PlayerStatType)(ref val3)).ToString(), GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)105));
				customStatsPanelScroll27.AddRowToScrollList(dictionary27);
			}
		}

		private static Dictionary<PlayerStatType, float> getPlayerDictionaryStats()
		{
			//IL_0029: 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)
			PlayerProfile val = (PlayerProfile)(typeof(Game).GetField("m_playerProfile", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(Game.instance));
			return ((int)val != 0) ? val.m_playerStats.m_stats : null;
		}

		public GameObject getPanel()
		{
			return panel;
		}

		public void reloadTexts()
		{
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			((TMP_Text)statsTopicText).text = ConfigurationFile.statsText.Value;
			Dictionary<PlayerStatType, float> playerDictionaryStats = getPlayerDictionaryStats();
			foreach (KeyValuePair<string, TextMeshProUGUI> statsText in scrollPanel.statsTexts)
			{
				((TMP_Text)statsText.Value).text = statsText.Key + ": " + GeneralExtensions.GetValueSafe<PlayerStatType, float>(playerDictionaryStats, (PlayerStatType)Enum.Parse(typeof(PlayerStatType), statsText.Key));
			}
			scrollPanel.reloadHeaderTitles();
		}
	}
	public class CustomStatsPanelKills
	{
		private static readonly List<string> MONSTERS_EXCEPTIONS = new List<string> { "TrainingDummy", "Root", "T.W.I.G." };

		private readonly GameObject panel;

		private readonly TextMeshProUGUI statsTopicText;

		private readonly CustomStatsPanelScroll scrollPanel;

		public CustomStatsPanelKills()
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Expected O, but got Unknown
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Expected O, but got Unknown
			GameObject trophiesPanel = InventoryGui.instance.m_trophiesPanel;
			if (!((Object)(object)trophiesPanel == (Object)null))
			{
				SkillsDialog skillsDialog = InventoryGui.instance.m_skillsDialog;
				panel = Object.Instantiate<GameObject>(trophiesPanel, ((Component)skillsDialog).transform);
				((Object)panel).name = "PlayerStatsFrameKills";
				panel.SetActive(false);
				RectTransform component = panel.GetComponent<RectTransform>();
				component.anchoredPosition = new Vector2(0f, 0f);
				((Object)panel.transform.Find("TrophiesFrame")).name = "MainFrame";
				Transform val = ((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/topic");
				statsTopicText = ((Component)val).GetComponent<TextMeshProUGUI>();
				((TMP_Text)statsTopicText).text = ConfigurationFile.statsText.Value;
				((Object)((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Trophies")).name = "Stats";
				((Object)((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Stats/TrophyListScroll")).name = "StatsListScroll";
				((Object)((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Stats/TrophyList")).name = "StatList";
				scrollPanel = new CustomStatsPanelScroll(((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Stats/StatList"));
				LoadKillStats();
				Transform val2 = ((Component)skillsDialog).transform.Find(((Object)panel).name + "/MainFrame/Closebutton");
				Button component2 = ((Component)val2).GetComponent<Button>();
				component2.onClick = new ButtonClickedEvent();
				((UnityEvent)component2.onClick).AddListener((UnityAction)delegate
				{
					panel.SetActive(false);
					PlayerSkillupOptionsPatch.HideTabButtons();
				});
			}
		}

		private void LoadKillStats()
		{
			Dictionary<string, float> dictionaryKillStats = getDictionaryKillStats();
			Dictionary<string, float> dictionary = new Dictionary<string, float>();
			foreach (KeyValuePair<string, float> item in dictionaryKillStats)
			{
				if (!MONSTERS_EXCEPTIONS.Contains(item.Key))
				{
					string translation = Localization.instance.Localize(item.Key).Replace("<color=orange>", "").Replace("</color>", "");
					int count = dictionary.Keys.ToList().FindAll((string key) => key.Equals(translation) || key.StartsWith(translation + " (")).Count;
					if (count > 0)
					{
						translation = translation + " (" + (count + 1) + ")";
					}
					dictionary.Add(translation, item.Value);
				}
			}
			List<string> list = dictionary.Keys.ToList();
			if (list.Count == 0)
			{
				return;
			}
			list.Sort();
			Dictionary<string, float> dictionary2 = new Dictionary<string, float>();
			if (ConfigurationFile.killStatsGroupingFormat.Value == KillStatsGroupingFormat.AllTogether)
			{
				for (int i = 0; i < list.Count; i++)
				{
					float valueSafe = GeneralExtensions.GetValueSafe<string, float>(dictionary, list[i]);
					if (valueSafe > 0f)
					{
						dictionary2.Add(list[i], valueSafe);
						if (dictionary2.Count == 5)
						{
							scrollPanel.AddRowToScrollList(dictionary2);
							dictionary2 = new Dictionary<string, float>();
						}
					}
				}
				if (dictionary2.Count > 0)
				{
					scrollPanel.AddRowToScrollList(dictionary2);
				}
				return;
			}
			string text = list[0].ToCharArray()[0].ToString() ?? "";
			scrollPanel.AddHeaderToScrollList("          " + text, (TextAlignmentOptions)513);
			for (int j = 0; j < list.Count; j++)
			{
				string text2 = list[j].ToCharArray()[0].ToString() ?? "";
				if (!text2.Equals(text))
				{
					if (dictionary2.Count > 0)
					{
						scrollPanel.AddRowToScrollList(dictionary2);
						dictionary2 = new Dictionary<string, float>();
					}
					text = text2;
					scrollPanel.AddHeaderToScrollList("          " + text, (TextAlignmentOptions)513);
				}
				float valueSafe2 = GeneralExtensions.GetValueSafe<string, float>(dictionary, list[j]);
				if (valueSafe2 > 0f)
				{
					dictionary2.Add(list[j], valueSafe2);
					if (dictionary2.Count == 5)
					{
						scrollPanel.AddRowToScrollList(dictionary2);
						dictionary2 = new Dictionary<string, float>();
					}
				}
			}
			if (dictionary2.Count > 0)
			{
				scrollPanel.AddRowToScrollList(dictionary2);
			}
		}

		private Dictionary<string, float> getDictionaryKillStats()
		{
			//IL_0029: 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)
			PlayerProfile val = (PlayerProfile)(typeof(Game).GetField("m_playerProfile", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(Game.instance));
			return ((int)val != 0) ? val.m_enemyStats : null;
		}

		public GameObject getPanel()
		{
			return panel;
		}

		public void reloadTexts()
		{
			((TMP_Text)statsTopicText).text = ConfigurationFile.statsText.Value;
			scrollPanel.ClearAll();
			LoadKillStats();
			scrollPanel.reloadHeaderTitles();
		}
	}
	public class CustomStatsPanelScroll
	{
		private readonly GameObject content;

		public readonly Dictionary<string, TextMeshProUGUI> statsTexts = new Dictionary<string, TextMeshProUGUI>();

		private readonly Dictionary<string, TextMeshProUGUI> titleTranslations = new Dictionary<string, TextMeshProUGUI>();

		public CustomStatsPanelScroll(Transform parent)
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Expected O, but got Unknown
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Expected O, but got Unknown
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: 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_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Expected O, but got Unknown
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: 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_031d: Expected O, but got Unknown
			//IL_034f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_038a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Expected O, but got Unknown
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Unknown result type (might be due to invalid IL or missing references)
			//IL_0480: Unknown result type (might be due to invalid IL or missing references)
			//IL_0497: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
			InventoryGui instance = InventoryGui.instance;
			GameObject val = new GameObject("CustomStatsPanelScroll", new Type[2]
			{
				typeof(RectTransform),
				typeof(Image)
			});
			val.transform.SetParent(((Component)parent).transform, false);
			Object.Destroy((Object)(object)val.GetComponent<Image>());
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0.5f, 0.5f);
			component.anchorMax = new Vector2(0.5f, 0.5f);
			component.pivot = new Vector2(0.5f, 0.5f);
			component.anchoredPosition = new Vector2(0f, -30f);
			component.sizeDelta = new Vector2(1260f, 590f);
			Image component2 = val.GetComponent<Image>();
			((Graphic)component2).color = new Color(0f, 0f, 0f, 0.6f);
			GameObject val2 = new GameObject("ScrollView", new Type[3]
			{
				typeof(RectTransform),
				typeof(ScrollRect),
				typeof(Image)
			});
			val2.transform.SetParent(val.transform, false);
			Object.Destroy((Object)(object)val2.GetComponent<Image>());
			RectTransform component3 = val2.GetComponent<RectTransform>();
			component3.anchorMin = new Vector2(0f, 0f);
			component3.anchorMax = new Vector2(1f, 1f);
			component3.offsetMin = new Vector2(0f, 0f);
			component3.offsetMax = new Vector2(0f, 0f);
			((Graphic)val2.GetComponent<Image>()).color = new Color(1f, 1f, 1f, 0.05f);
			ScrollRect component4 = val2.GetComponent<ScrollRect>();
			component4.horizontal = false;
			component4.scrollSensitivity = 2000f;
			component4.movementType = (MovementType)2;
			GameObject val3 = new GameObject("Viewport", new Type[3]
			{
				typeof(RectTransform),
				typeof(Mask),
				typeof(Image)
			});
			val3.transform.SetParent(val2.transform, false);
			RectTransform component5 = val3.GetComponent<RectTransform>();
			component5.anchorMin = Vector2.zero;
			component5.anchorMax = Vector2.one;
			component5.offsetMin = Vector2.zero;
			component5.offsetMax = Vector2.zero;
			((Graphic)val3.GetComponent<Image>()).color = new Color(1f, 1f, 1f, 0.05f);
			val3.GetComponent<Mask>().showMaskGraphic = false;
			component4.viewport = component5;
			content = new GameObject("Content", new Type[3]
			{
				typeof(RectTransform),
				typeof(VerticalLayoutGroup),
				typeof(ContentSizeFitter)
			});
			content.transform.SetParent(val3.transform, false);
			RectTransform component6 = content.GetComponent<RectTransform>();
			component6.anchorMin = new Vector2(0f, 1f);
			component6.anchorMax = new Vector2(1f, 1f);
			component6.pivot = new Vector2(0.5f, 1f);
			component6.anchoredPosition = Vector2.zero;
			component6.sizeDelta = new Vector2(0f, 0f);
			VerticalLayoutGroup component7 = content.GetComponent<VerticalLayoutGroup>();
			((HorizontalOrVerticalLayoutGroup)component7).childForceExpandHeight = false;
			((HorizontalOrVerticalLayoutGroup)component7).childForceExpandWidth = true;
			((LayoutGroup)component7).childAlignment = (TextAnchor)0;
			((HorizontalOrVerticalLayoutGroup)component7).spacing = 25f;
			((LayoutGroup)component7).padding = new RectOffset(0, 0, 20, 20);
			ContentSizeFitter component8 = content.GetComponent<ContentSizeFitter>();
			component8.verticalFit = (FitMode)2;
			component4.content = component6;
			GameObject gameObject = ((Component)instance.m_recipeListScroll).gameObject;
			GameObject val4 = Object.Instantiate<GameObject>(gameObject, val.transform);
			((Object)val4).name = "Scrollbar";
			RectTransform component9 = val4.GetComponent<RectTransform>();
			component9.anchorMin = new Vector2(1f, 0f);
			component9.anchorMax = new Vector2(1f, 1f);
			component9.pivot = new Vector2(1f, 1f);
			component9.sizeDelta = new Vector2(11f, 0f);
			component9.anchoredPosition = Vector2.zero;
			Scrollbar component10 = val4.GetComponent<Scrollbar>();
			component10.direction = (Direction)2;
			component4.verticalScrollbar = component10;
			component4.verticalScrollbarVisibility = (ScrollbarVisibility)2;
		}

		public void AddHeaderToScrollList(string title, TextAlignmentOptions textAlignment = 514)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("GroupHeader", new Type[2]
			{
				typeof(RectTransform),
				typeof(TextMeshProUGUI)
			});
			val.transform.SetParent(content.transform, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0.5f, 1f);
			component.anchorMax = new Vector2(0.5f, 1f);
			component.pivot = new Vector2(0.5f, 1f);
			component.anchoredPosition = new Vector2(0f, -10f);
			component.sizeDelta = new Vector2(300f, 30f);
			TextMeshProUGUI component2 = val.GetComponent<TextMeshProUGUI>();
			((TMP_Text)component2).text = Localization.instance.Localize(title);
			titleTranslations.Add(title, component2);
			((TMP_Text)component2).font = InventoryGui.instance.m_recipeName.font;
			((TMP_Text)component2).fontSize = 24f;
			((TMP_Text)component2).alignment = textAlignment;
			((Graphic)component2).color = Color.yellow;
		}

		public void AddRowToScrollList(Dictionary<string, float> entries)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Expected O, but got Unknown
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("StatsRow", new Type[1] { typeof(RectTransform) });
			val.transform.SetParent(content.transform, false);
			RectTransform component = val.GetComponent<RectTransform>();
			component.anchorMin = new Vector2(0f, 1f);
			component.anchorMax = new Vector2(1f, 1f);
			component.pivot = new Vector2(0f, 1f);
			component.sizeDelta = new Vector2(0f, 30f);
			float num = 250f;
			float num2 = 40f;
			int num3 = 0;
			foreach (KeyValuePair<string, float> entry in entries)
			{
				GameObject val2 = new GameObject("Stat", new Type[2]
				{
					typeof(RectTransform),
					typeof(TextMeshProUGUI)
				});
				val2.transform.SetParent(val.transform, false);
				RectTransform component2 = val2.GetComponent<RectTransform>();
				component2.anchorMin = new Vector2(0f, 0.5f);
				component2.anchorMax = new Vector2(0f, 0.5f);
				component2.pivot = new Vector2(0f, 0.5f);
				component2.anchoredPosition = new Vector2(num2 + num * (float)num3, 0f);
				component2.sizeDelta = new Vector2(240f, 25f);
				TextMeshProUGUI component3 = val2.GetComponent<TextMeshProUGUI>();
				((TMP_Text)component3).text = entry.Key + ": " + entry.Value;
				((TMP_Text)component3).font = PlayerUtils.getFontAsset("Valheim-AveriaSansLibre");
				((TMP_Text)component3).fontSize = 18f;
				((Graphic)component3).color = Color.white;
				((TMP_Text)component3).alignment = (TextAlignmentOptions)513;
				statsTexts.Add(entry.Key, component3);
				num3++;
			}
		}

		public void reloadHeaderTitles()
		{
			foreach (KeyValuePair<string, TextMeshProUGUI> titleTranslation in titleTranslations)
			{
				((TMP_Text)titleTranslation.Value).text = Localization.instance.Localize(titleTranslation.Key);
			}
		}

		public void ClearAll()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			Logger.Log("Cleaning scroll content to repaint...");
			foreach (Transform item in content.transform)
			{
				Transform val = item;
				Object.Destroy((Object)(object)((Component)val).gameObject);
			}
			statsTexts.Clear();
			titleTranslations.Clear();
		}
	}
}
namespace DetailedLevels.Features
{
	internal static class CampfireCheck
	{
		[HarmonyPatch(typeof(SEMan), "AddStatusEffect", new Type[]
		{
			typeof(StatusEffect),
			typeof(bool),
			typeof(int),
			typeof(float)
		})]
		public class SEManAddStatusPatch1
		{
			[HarmonyPrefix]
			public static void Postfix(StatusEffect statusEffect, bool resetTime, int itemLevel, float skillLevel, ref Character ___m_character)
			{
				if (SEMan.s_statusEffectCampFire == ((object)statusEffect).GetHashCode() && !campfireCheckActive)
				{
					campfireCheckActive = true;
				}
				Logger.Log("SEMan.AddStatusEffect - SEManAddStatusPatch1");
				Character obj = ___m_character;
				PlayerInventoryChanges.recalculateSkillsAsync((Humanoid)(object)((obj is Humanoid) ? obj : null), null, 0.1f);
			}
		}

		[HarmonyPatch(typeof(SEMan), "AddStatusEffect", new Type[]
		{
			typeof(int),
			typeof(bool),
			typeof(int),
			typeof(float)
		})]
		public class SEManAddStatusPatch2
		{
			[HarmonyPrefix]
			public static void Postfix(int nameHash, bool resetTime, int itemLevel, float skillLevel, ref Character ___m_character)
			{
				if (nameHash == SEMan.s_statusEffectCampFire && !campfireCheckActive)
				{
					campfireCheckActive = true;
					Logger.Log("SEMan.AddStatusEffect - SEManAddStatusPatch2");
					Character obj = ___m_character;
					PlayerInventoryChanges.recalculateSkillsAsync((Humanoid)(object)((obj is Humanoid) ? obj : null), null, 0.1f);
				}
			}
		}

		[HarmonyPatch(typeof(SEMan), "RemoveStatusEffect", new Type[]
		{
			typeof(StatusEffect),
			typeof(bool)
		})]
		public class SEManRemoveStatusPatch1
		{
			[HarmonyPrefix]
			public static void Postfix(StatusEffect se, bool quiet, ref Character ___m_character, ref bool __result)
			{
				if (SEMan.s_statusEffectCampFire == ((object)se).GetHashCode() && campfireCheckActive)
				{
					campfireCheckActive = false;
				}
				Logger.Log("SEMan.RemoveStatusEffect - SEManRemoveStatusPatch1");
				Character obj = ___m_character;
				PlayerInventoryChanges.recalculateSkillsAsync((Humanoid)(object)((obj is Humanoid) ? obj : null), null, 0.1f);
			}
		}

		[HarmonyPatch(typeof(SEMan), "RemoveStatusEffect", new Type[]
		{
			typeof(int),
			typeof(bool)
		})]
		public class SEManRemoveStatusPatch2
		{
			[HarmonyPrefix]
			public static void Postfix(int nameHash, bool quiet, ref Character ___m_character, ref bool __result)
			{
				if (nameHash == SEMan.s_statusEffectCampFire && campfireCheckActive)
				{
					campfireCheckActive = false;
					Logger.Log("SEMan.RemoveStatusEffect - SEManRemoveStatusPatch2");
					Character obj = ___m_character;
					PlayerInventoryChanges.recalculateSkillsAsync((Humanoid)(object)((obj is Humanoid) ? obj : null), null, 0.1f);
				}
			}
		}

		public static bool campfireCheckActive;
	}
	internal static class PlayerColorBuffs
	{
		public static void refreshAllBlueColors(Player player)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			foreach (Skill value in PlayerBuffs.skills.Values)
			{
				float num = PlayerUtils.FindActiveModifierValue(player, value.m_info.m_skill);
				if (!(num > 0f))
				{
					continue;
				}
				string text = Localization.instance.Localize("$skill_" + ((object)(SkillType)(ref value.m_info.m_skill)).ToString().ToLower());
				for (int i = 0; i < ((Transform)Hud.instance.m_statusEffectListRoot).childCount; i++)
				{
					TextMeshProUGUI componentInChildren = ((Component)((Transform)Hud.instance.m_statusEffectListRoot).GetChild(i)).GetComponentInChildren<TextMeshProUGUI>();
					Logger.Log("Finding text " + text + " in " + ((TMP_Text)componentInChildren).text);
					if (((TMP_Text)componentInChildren).text.Contains(text) && ((TMP_Text)componentInChildren).text.Length > text.Length)
					{
						((TMP_Text)componentInChildren).faceColor = new Color32((byte)0, (byte)189, byte.MaxValue, byte.MaxValue);
						Logger.Log("Color updated.");
						break;
					}
				}
			}
		}
	}
	[HarmonyPatch(typeof(InventoryGui), "Show")]
	public static class SkillTypeCraftStationDescriptionsPatch
	{
		public static bool updated;

		public static void Prefix(Container container, int activeGroup)
		{
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Invalid comparison between Unknown and I4
			if (updated)
			{
				return;
			}
			foreach (Recipe recipe in ObjectDB.instance.m_recipes)
			{
				ItemDrop item = recipe.m_item;
				if ((Object)(object)item != (Object)null && (item.m_itemData.HavePrimaryAttack() || item.m_itemData.HaveSecondaryAttack()) && !isInToolList(((Object)item).name))
				{
					SkillType skillType = item.m_itemData.m_shared.m_skillType;
					if ((int)skillType > 0)
					{
						string text = item.m_itemData.m_shared.m_description.Split(new char[1] { '\n' })[0];
						item.m_itemData.m_shared.m_description = text + "\nSkill: $skill_" + ((object)(SkillType)(ref skillType)).ToString().ToLower();
					}
				}
			}
			updated = true;
		}

		private static bool isInToolList(string itemDropName)
		{
			return new List<string> { "Cultivator", "Hoe", "Tankard", "TankardAnniversary", "Tankard_dvergr" }.Contains(itemDropName);
		}
	}
	public static class PlayerBuffs
	{
		public static readonly Dictionary<SkillType, Sprite> sprites = new Dictionary<SkillType, Sprite>();

		public static readonly Dictionary<SkillType, Skill> skills = new Dictionary<SkillType, Skill>();

		public static void AddSkillBuff(Player player, Skill skill, Sprite skillIcon, GameObject skillRow = null)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: 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_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			SEMan sEMan = ((Character)player).GetSEMan();
			float currentSkillLevelProgress = PlayerUtils.GetCurrentSkillLevelProgress(skill);
			float skillLevelModifier = PlayerUtils.FindActiveModifierValue(player, skill.m_info.m_skill);
			Logger.Log("Skill current value: " + currentSkillLevelProgress + ". modifier: " + skillLevelModifier);
			SE_Stats val = ScriptableObject.CreateInstance<SE_Stats>();
			((StatusEffect)val).m_name = "$skill_" + ((object)(SkillType)(ref skill.m_info.m_skill)).ToString().ToLower() + ": " + PlayerUtils.GetSkillValueToShow(currentSkillLevelProgress, skillLevelModifier);
			((StatusEffect)val).m_tooltip = "$skill_" + ((object)(SkillType)(ref skill.m_info.m_skill)).ToString().ToLower() + "_description";
			((StatusEffect)val).m_icon = skillIcon;
			((Object)val).name = PlayerUtils.GetValueForNameHash(skill);
			int num = ((StatusEffect)val).NameHash();
			Logger.Log($"name: {((Object)val).name}, m_name: {((StatusEffect)val).m_name}, nameHash: {num}");
			sEMan.AddStatusEffect((StatusEffect)(object)val, false, 0, 0f);
			if (PlayerUtils.skillStatusEffects.ContainsKey(skill.m_info.m_skill))
			{
				PlayerUtils.skillStatusEffects.Remove(skill.m_info.m_skill);
			}
			PlayerUtils.skillStatusEffects.Add(skill.m_info.m_skill, num);
			Logger.Log("Added buff: " + ((StatusEffect)val).m_name);
			if (!sprites.ContainsKey(skill.m_info.m_skill))
			{
				sprites.Add(skill.m_info.m_skill, skillIcon);
				Logger.Log("Cached sprite for " + ((StatusEffect)val).m_name + " with sprite.name " + ((Object)skillIcon).name);
			}
			if (!skills.ContainsKey(skill.m_info.m_skill))
			{
				skills.Add(skill.m_info.m_skill, skill);
				Logger.Log("Cached skill for " + ((StatusEffect)val).m_name);
			}
			refreshAllBlueColorsAsync(player, 0.1f);
		}

		public static void RemoveSkillBuff(Player player, Skill skill)
		{
			//IL_0013: 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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			SEMan sEMan = ((Character)player).GetSEMan();
			int valueSafe = GeneralExtensions.GetValueSafe<SkillType, int>(PlayerUtils.skillStatusEffects, skill.m_info.m_skill);
			StatusEffect statusEffect = sEMan.GetStatusEffect(valueSafe);
			if ((Object)(object)statusEffect != (Object)null)
			{
				sEMan.RemoveStatusEffect(statusEffect, false);
				PlayerUtils.skillStatusEffects.Remove(skill.m_info.m_skill);
				Logger.Log("Deleted buff: " + statusEffect.m_name);
				sprites.Remove(skill.m_info.m_skill);
				skills.Remove(skill.m_info.m_skill);
				refreshAllBlueColorsAsync(player, 0.1f);
			}
		}

		private static async Task refreshAllBlueColorsAsync(Player player, float seconds)
		{
			await Task.Delay((int)(Math.Max(0f, seconds) * 1000f));
			PlayerColorBuffs.refreshAllBlueColors(player);
		}
	}
	[HarmonyPatch(typeof(SkillsDialog), "Awake")]
	public class PlayerSkillupOptionsPatch
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__16_0;

			public static UnityAction <>9__16_1;

			public static UnityAction<float> <>9__22_0;

			public static UnityAction<float> <>9__23_0;

			public static UnityAction<float> <>9__24_0;

			public static UnityAction<float> <>9__26_0;

			public static UnityAction<float> <>9__27_0;

			public static UnityAction<float> <>9__28_0;

			internal void <Postfix>b__16_0()
			{
				statsPanel.reloadTexts();
				statsPanel.getPanel().SetActive(true);
				statsPanelKills.reloadTexts();
				statsPanelKills.getPanel().SetActive(false);
				tabStatsButtonObject.SetActive(true);
				((Selectable)tabStatsButtonObject.GetComponent<Button>()).interactable = false;
				tabKillStatsButtonObject.SetActive(true);
				((Selectable)tabKillStatsButtonObject.GetComponent<Button>()).interactable = true;
			}

			internal void <Postfix>b__16_1()
			{
				panel.getPanel().SetActive(true);
			}

			internal void <addSaveSwitchButton>b__22_0(float value)
			{
				customSliderSaveSwitch.updateTextValue(value.Equals(1f).ToString());
				ConfigurationFile.saveSkillBuffs.Value = value.Equals(1f);
			}

			internal void <addNumberOfDecimalsSlider>b__23_0(float value)
			{
				Logger.Log("slider changed to " + value);
				customSliderNumberOfDecimals.updateTextValue(value.ToString());
				ConfigurationFile.numberOfDecimals.Value = (int)value;
			}

			internal void <addSkillValueFormatSlider>b__24_0(float value)
			{
				Logger.Log("slider changed to " + value);
				SkillValuesFormat skillValuesFormat = ((value != 0f) ? SkillValuesFormat.Percentage : SkillValuesFormat.Decimals);
				customSliderSkillValuesFormat.updateTextValue(GetSkillValuesFormatRepresentation(skillValuesFormat));
				ConfigurationFile.skillValuesFormat.Value = skillValuesFormat;
			}

			internal void <addSkillUpMessage>b__26_0(float value)
			{
				Logger.Log("message slider changed to " + value);
				customSliderSkillUpMessage.updateTextValue(calculateSkillupSliderValue(value));
				ConfigurationFile.skillUpMessageAfterMultipleLevel.Value = (int)value;
			}

			internal void <addSkillUpBigMessage>b__27_0(float value)
			{
				Logger.Log("bigMessage slider changed to " + value);
				customSliderSkillUpBigMessage.updateTextValue(calculateSkillupSliderValue(value));
				ConfigurationFile.skillUpBigMessageAfterMultipleLevel.Value = (int)value;
			}

			internal void <addSkillsOrderSlider>b__28_0(float value)
			{
				customSliderSaveSkillsOrder.updateTextValue(value.Equals(1f).ToString());
				ConfigurationFile.saveSkillsOrder.Value = value.Equals(1f);
			}
		}

		private static CustomSkillOptionsPanel panel;

		private static readonly Color TITLE_COLOR = new Color(1f, 0.7176f, 0.3603f);

		private static TextMeshProUGUI buttonOptionsText;

		private static TextMeshProUGUI buttonStatsText;

		private static TextMeshProUGUI lossPercentageTextComponent;

		private static TextMeshProUGUI lossPercentageValueComponent;

		private static CustomSlider customSliderSaveSwitch;

		private static CustomSlider customSliderNumberOfDecimals;

		private static CustomSlider customSliderSkillValuesFormat;

		private static CustomSlider customSliderSkillUpMessage;

		private static CustomSlider customSliderSkillUpBigMessage;

		private static CustomSlider customSliderSaveSkillsOrder;

		private static CustomStatsPanel statsPanel;

		private static CustomStatsPanelKills statsPanelKills;

		private static GameObject tabStatsButtonObject;

		private static GameObject tabKillStatsButtonObject;

		private static void Postfix(SkillsDialog __instance)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Expected O, but got Unknown
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Expected O, but got Unknown
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Expected O, but got Unknown
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Expected O, but got Unknown
			Transform val = ((Component)__instance).transform.Find("SkillsFrame/Closebutton");
			((RectTransform)((val is RectTransform) ? val : null)).anchoredPosition = new Vector2(146f, 45f);
			((RectTransform)((val is RectTransform) ? val : null)).sizeDelta = new Vector2(140f, 46f);
			Button component = ((Component)val).GetComponent<Button>();
			GameObject val2 = Object.Instantiate<GameObject>(((Compon