Decompiled source of SuperCreatures v1.1.5

SuperCreatures.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using FishNet.Object;
using FishNet.Object.Synchronizing;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace SuperCreatures
{
	public static class PluginInfo
	{
		public const string GUID = "com.howToFish.supercreatures";

		public const string NAME = "SuperCreatures";

		public const string VERSION = "1.1.4";
	}
	public enum ModLanguage
	{
		English,
		Russian
	}
	public enum SlotItemFilter
	{
		All,
		KnivesOnly,
		SnipersOnly,
		AssaultRiflesOnly,
		FishingRodsOnly,
		ShotgunsOnly,
		BoatsOnly
	}
	[BepInPlugin("com.howToFish.supercreatures", "SuperCreatures", "1.1.4")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class SuperCreaturesPlugin : BaseUnityPlugin
	{
		private Harmony _harmony;

		private static bool _modMenuPatched;

		private bool _showMenu;

		private Rect _windowRect = new Rect(30f, 30f, 620f, 640f);

		private int _currentTab;

		private Texture2D _modIcon;

		private bool _isResizing;

		private Vector2 _resizeStartMouse;

		private Vector2 _resizeStartSize;

		private Texture2D _winBgTex;

		private Texture2D _cardBgTex;

		private Texture2D _btnNormalTex;

		private Texture2D _btnHoverTex;

		private Texture2D _btnActiveTex;

		private Texture2D _tabNormalTex;

		private Texture2D _tabActiveTex;

		private Texture2D _accentBadgeTex;

		private Texture2D _legendaryBadgeTex;

		private Texture2D _rareBadgeTex;

		private Texture2D _selectedSkinTex;

		private Texture2D _scrollBgTex;

		private Texture2D _scrollThumbTex;

		private Texture2D _scrollThumbHoverTex;

		private GUIStyle _winStyle;

		private GUIStyle _cardStyle;

		private GUIStyle _titleStyle;

		private GUIStyle _subTitleStyle;

		private GUIStyle _tabStyle;

		private GUIStyle _tabActiveStyle;

		private GUIStyle _labelStyle;

		private GUIStyle _sectionHeaderStyle;

		private GUIStyle _btnStyle;

		private GUIStyle _toggleActiveStyle;

		private GUIStyle _switchOnStyle;

		private GUIStyle _switchOffStyle;

		private Texture2D _switchOnTex;

		private Texture2D _switchTrackOnTex;

		private Texture2D _switchTrackOffTex;

		private Texture2D _switchKnobOnTex;

		private Texture2D _switchKnobOffTex;

		private Texture2D _switchOffTex;

		private GUIStyle _toggleInactiveStyle;

		private GUIStyle _badgeStyle;

		private GUIStyle _gripStyle;

		private GUIStyle _scrollBarStyle;

		private GUIStyle _scrollThumbStyle;

		private GUIStyle _skinBtnStyle;

		private GUIStyle _skinSelectedBtnStyle;

		private Vector2 _scrollPos;

		private Vector2 _skinScrollPos;

		private float _lastToggleTime;

		public static SuperCreaturesPlugin Instance { get; private set; }

		public static ManualLogSource Log
		{
			get
			{
				if (!((Object)(object)Instance != (Object)null))
				{
					return null;
				}
				return ((BaseUnityPlugin)Instance).Logger;
			}
		}

		public static ConfigEntry<ModLanguage> SelectedLanguage { get; private set; }

		public static ConfigEntry<KeyCode> MenuKey { get; private set; }

		public static ConfigEntry<bool> ModEnabled { get; private set; }

		public static ConfigEntry<int> SuperCreatureChance { get; private set; }

		public static ConfigEntry<bool> AlwaysSuper { get; private set; }

		public static ConfigEntry<bool> AllowBosses { get; private set; }

		public static ConfigEntry<SlotItemFilter> ItemFilter { get; private set; }

		public static ConfigEntry<int> SpecificSkinIndex { get; private set; }

		public static ConfigEntry<int> SlotLegendaryChance { get; private set; }

		public static ConfigEntry<int> SlotRareChance { get; private set; }

		public static ConfigEntry<bool> SlotAlwaysLegendary { get; private set; }

		public static ConfigEntry<float> FishingRodWeight { get; private set; }

		public static ConfigEntry<float> SniperWeight { get; private set; }

		public static ConfigEntry<float> KnifeWeight { get; private set; }

		public static ConfigEntry<float> ShotgunWeight { get; private set; }

		public static ConfigEntry<float> FirearmsWeight { get; private set; }

		public static ConfigEntry<float> BoatWeight { get; private set; }

		public static ConfigEntry<float> RareFishMultiplier { get; private set; }

		public static ConfigEntry<float> BossHookMultiplier { get; private set; }

		public static ConfigEntry<bool> ScaleEnabled { get; private set; }

		public static ConfigEntry<bool> ScaleFish { get; private set; }

		public static ConfigEntry<bool> ScaleBirds { get; private set; }

		public static ConfigEntry<bool> ScaleOthers { get; private set; }

		public static ConfigEntry<bool> ScaleBosses { get; private set; }

		public static ConfigEntry<float> MinScale { get; private set; }

		public static ConfigEntry<float> MaxScale { get; private set; }

		public static ConfigEntry<float> BossMinScale { get; private set; }

		public static ConfigEntry<float> BossMaxScale { get; private set; }

		public static ConfigEntry<bool> LogUniform { get; private set; }

		public static ConfigEntry<float> ExtremeBias { get; private set; }

		public static ConfigEntry<bool> JitterEnabled { get; private set; }

		public static ConfigEntry<float> JitterPercent { get; private set; }

		public static ConfigEntry<bool> DynamicSpeed { get; private set; }

		public static ConfigEntry<float> SpeedExponent { get; private set; }

		public static ConfigEntry<float> SpeedMinFloor { get; private set; }

		public static ConfigEntry<bool> DynamicHP { get; private set; }

		public static ConfigEntry<bool> DynamicAudioPitch { get; private set; }

		public static bool IsMenuOpen
		{
			get
			{
				if ((Object)(object)Instance != (Object)null)
				{
					return Instance._showMenu;
				}
				return false;
			}
		}

		public static bool IsRussian
		{
			get
			{
				if (SelectedLanguage != null)
				{
					return SelectedLanguage.Value == ModLanguage.Russian;
				}
				return false;
			}
		}

		public static string T(string en, string ru)
		{
			if (!IsRussian)
			{
				return en;
			}
			return ru;
		}

		private void Awake()
		{
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Expected O, but got Unknown
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Expected O, but got Unknown
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Expected O, but got Unknown
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Expected O, but got Unknown
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c5: Expected O, but got Unknown
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Expected O, but got Unknown
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03df: Expected O, but got Unknown
			//IL_0412: Unknown result type (might be due to invalid IL or missing references)
			//IL_041c: Expected O, but got Unknown
			//IL_044f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0459: Expected O, but got Unknown
			//IL_048c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0496: Expected O, but got Unknown
			//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Expected O, but got Unknown
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_0550: Expected O, but got Unknown
			//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ad: Expected O, but got Unknown
			//IL_05e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ea: Expected O, but got Unknown
			//IL_0635: Unknown result type (might be due to invalid IL or missing references)
			//IL_063f: Expected O, but got Unknown
			Instance = this;
			SelectedLanguage = ((BaseUnityPlugin)this).Config.Bind<ModLanguage>("0. System & Interface", "Language", ModLanguage.English, "Mod language (English or Russian).");
			MenuKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("0. System & Interface", "MenuKey", (KeyCode)286, "Hotkey to toggle the in-game menu.");
			ModEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("1. General", "Enabled", true, "Master toggle for the mod.");
			SuperCreatureChance = ((BaseUnityPlugin)this).Config.Bind<int>("2. Super Creatures (Drip)", "SuperCreatureChance", 50, new ConfigDescription("Chance percentage (0-100%) for caught fish to spawn as Drip variants.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			AlwaysSuper = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Super Creatures (Drip)", "AlwaysSuper", false, "Forces 100% Drip fish on every catch.");
			AllowBosses = ((BaseUnityPlugin)this).Config.Bind<bool>("2. Super Creatures (Drip)", "AllowBosses", false, "Allows bosses to also roll Drip variants.");
			ItemFilter = ((BaseUnityPlugin)this).Config.Bind<SlotItemFilter>("3. Slot Machine (Rarities & Items)", "ItemFilter", SlotItemFilter.All, "Filter slot machine items to a specific category.");
			SpecificSkinIndex = ((BaseUnityPlugin)this).Config.Bind<int>("3. Slot Machine (Rarities & Items)", "SpecificSkinIndex", -1, new ConfigDescription("Force a specific skin ID (-1 for random rarity rolls).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(-1, 30), Array.Empty<object>()));
			SlotLegendaryChance = ((BaseUnityPlugin)this).Config.Bind<int>("3. Slot Machine (Rarities & Items)", "SlotLegendaryChance", 50, new ConfigDescription("Chance (0-100%) to roll Legendary skins.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			SlotRareChance = ((BaseUnityPlugin)this).Config.Bind<int>("3. Slot Machine (Rarities & Items)", "SlotRareChance", 30, new ConfigDescription("Chance (0-100%) to roll Rare skins.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			SlotAlwaysLegendary = ((BaseUnityPlugin)this).Config.Bind<bool>("3. Slot Machine (Rarities & Items)", "SlotAlwaysLegendary", false, "Guarantee Legendary tier skins on every spin.");
			FishingRodWeight = ((BaseUnityPlugin)this).Config.Bind<float>("3. Slot Machine (Rarities & Items)", "FishingRodWeight", 1f, "Weight of fishing rods in rolls.");
			SniperWeight = ((BaseUnityPlugin)this).Config.Bind<float>("3. Slot Machine (Rarities & Items)", "SniperWeight", 1f, "Weight of sniper rifles in rolls.");
			KnifeWeight = ((BaseUnityPlugin)this).Config.Bind<float>("3. Slot Machine (Rarities & Items)", "KnifeWeight", 1f, "Weight of knives in rolls.");
			ShotgunWeight = ((BaseUnityPlugin)this).Config.Bind<float>("3. Slot Machine (Rarities & Items)", "ShotgunWeight", 1f, "Weight of shotguns in rolls.");
			FirearmsWeight = ((BaseUnityPlugin)this).Config.Bind<float>("3. Slot Machine (Rarities & Items)", "FirearmsWeight", 1f, "Weight of assault rifles in rolls.");
			BoatWeight = ((BaseUnityPlugin)this).Config.Bind<float>("3. Slot Machine (Rarities & Items)", "BoatWeight", 1f, "Weight of boat skins in rolls.");
			RareFishMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("4. Fishing Multipliers", "RareFishMultiplier", 1f, new ConfigDescription("Multiplier for rare fish species bite chance.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
			BossHookMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("4. Fishing Multipliers", "BossHookMultiplier", 1f, new ConfigDescription("Multiplier for boss encounter bite chance.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 10f), Array.Empty<object>()));
			ScaleEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Creature Sizing & Chaos", "ScaleEnabled", true, "Master toggle for dynamic creature scaling.");
			ScaleFish = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Creature Sizing & Chaos", "ScaleFish", true, "Scale fish (ocean, swimming, caught).");
			ScaleBirds = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Creature Sizing & Chaos", "ScaleBirds", true, "Scale birds (seagulls, albatrosses).");
			ScaleOthers = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Creature Sizing & Chaos", "ScaleOthers", true, "Scale other creatures (crabs, snails).");
			ScaleBosses = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Creature Sizing & Chaos", "ScaleBosses", true, "Scale bosses with independent multiplier range.");
			MinScale = ((BaseUnityPlugin)this).Config.Bind<float>("5. Creature Sizing & Chaos", "MinScale", 0.1f, new ConfigDescription("Minimum normal creature scale multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 1f), Array.Empty<object>()));
			MaxScale = ((BaseUnityPlugin)this).Config.Bind<float>("5. Creature Sizing & Chaos", "MaxScale", 10f, new ConfigDescription("Maximum normal creature scale multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 25f), Array.Empty<object>()));
			BossMinScale = ((BaseUnityPlugin)this).Config.Bind<float>("5. Creature Sizing & Chaos", "BossMinScale", 0.5f, new ConfigDescription("Minimum boss scale multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.3f, 2f), Array.Empty<object>()));
			BossMaxScale = ((BaseUnityPlugin)this).Config.Bind<float>("5. Creature Sizing & Chaos", "BossMaxScale", 2.5f, new ConfigDescription("Maximum boss scale multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 10f), Array.Empty<object>()));
			LogUniform = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Creature Sizing & Chaos", "LogUniform", true, "Log-uniform distribution (0.1x, 1.0x, 10.0x equally probable).");
			ExtremeBias = ((BaseUnityPlugin)this).Config.Bind<float>("5. Creature Sizing & Chaos", "ExtremeBias", 0.3f, new ConfigDescription("Bias toward extreme tiny or colossal sizes.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>()));
			JitterEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Creature Sizing & Chaos", "JitterEnabled", true, "Per-axis 3D jitter for varied body proportions.");
			JitterPercent = ((BaseUnityPlugin)this).Config.Bind<float>("5. Creature Sizing & Chaos", "JitterPercent", 0.3f, new ConfigDescription("Jitter intensity percentage (e.g. 0.3 = +-30%).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.8f), Array.Empty<object>()));
			DynamicSpeed = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Creature Sizing & Chaos", "DynamicSpeed", true, "Colossal creatures move slower and heavier.");
			SpeedExponent = ((BaseUnityPlugin)this).Config.Bind<float>("5. Creature Sizing & Chaos", "SpeedExponent", 0.5f, new ConfigDescription("Speed reduction curve exponent.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 1f), Array.Empty<object>()));
			SpeedMinFloor = ((BaseUnityPlugin)this).Config.Bind<float>("5. Creature Sizing & Chaos", "SpeedMinFloor", 0.25f, new ConfigDescription("Minimum speed floor factor.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 0.8f), Array.Empty<object>()));
			DynamicHP = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Creature Sizing & Chaos", "DynamicHP", true, "Scale creature HP directly with size.");
			DynamicAudioPitch = ((BaseUnityPlugin)this).Config.Bind<bool>("5. Creature Sizing & Chaos", "DynamicAudioPitch", true, "Adapt audio pitch dynamically based on creature size.");
			try
			{
				_harmony = new Harmony("com.howToFish.supercreatures");
				_harmony.PatchAll();
				((BaseUnityPlugin)this).Logger.LogInfo((object)"SuperCreatures v1.1.4 Harmony patches applied cleanly.");
			}
			catch (Exception ex)
			{
				((BaseUnityPlugin)this).Logger.LogError((object)("SuperCreatures Harmony patching error: " + ex.Message));
			}
			LoadIcon();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"SuperCreatures v1.1.4 initialized. Press [F5] for in-game studio.");
		}

		private void LoadIcon()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			try
			{
				string path = Path.Combine(Paths.PluginPath, "SuperCreatures", "icon.png");
				if (File.Exists(path))
				{
					byte[] array = File.ReadAllBytes(path);
					_modIcon = new Texture2D(2, 2);
					ImageConversion.LoadImage(_modIcon, array);
				}
			}
			catch
			{
			}
		}

		private void Update()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			try
			{
				if (Input.GetKeyDown((KeyCode)286) || (MenuKey != null && Input.GetKeyDown(MenuKey.Value)))
				{
					flag = true;
				}
			}
			catch
			{
			}
			try
			{
				if (!flag)
				{
					Keyboard current = Keyboard.current;
					if (current != null && ((ButtonControl)current.f5Key).wasPressedThisFrame)
					{
						flag = true;
					}
				}
			}
			catch
			{
			}
			if (flag && Time.unscaledTime - _lastToggleTime > 0.15f)
			{
				_lastToggleTime = Time.unscaledTime;
				_showMenu = !_showMenu;
				Cursor.visible = _showMenu;
				Cursor.lockState = (CursorLockMode)(!_showMenu);
				try
				{
					PlayerCamera.ToggleMouse(_showMenu);
				}
				catch
				{
				}
			}
			if (!_showMenu)
			{
				return;
			}
			Cursor.visible = true;
			Cursor.lockState = (CursorLockMode)0;
			if (Input.GetKeyDown((KeyCode)27))
			{
				_showMenu = false;
				Cursor.visible = false;
				Cursor.lockState = (CursorLockMode)1;
				try
				{
					PlayerCamera.ToggleMouse(false);
				}
				catch
				{
				}
				Cursor.visible = false;
				Cursor.lockState = (CursorLockMode)1;
				try
				{
					PlayerCamera.ToggleMouse(false);
				}
				catch
				{
				}
			}
		}

		private Texture2D MakePillTexture(int width, int height, Color bg, Color border, float borderThickness)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(width, height, (TextureFormat)4, false);
			Color[] array = (Color[])(object)new Color[width * height];
			float num = (float)height / 2f;
			for (int i = 0; i < height; i++)
			{
				for (int j = 0; j < width; j++)
				{
					float num2 = Mathf.Clamp((float)j + 0.5f, num, (float)width - num);
					float num3 = num;
					float num4 = (float)j + 0.5f - num2;
					float num5 = (float)i + 0.5f - num3;
					float num6 = Mathf.Sqrt(num4 * num4 + num5 * num5);
					if (num6 <= num - 0.5f)
					{
						if (num6 > num - borderThickness - 0.5f)
						{
							array[i * width + j] = border;
						}
						else
						{
							array[i * width + j] = bg;
						}
					}
					else if (num6 <= num + 0.5f)
					{
						float num7 = Mathf.Clamp01(num + 0.5f - num6);
						Color val2 = ((borderThickness > 0.1f) ? border : bg);
						val2.a *= num7;
						array[i * width + j] = val2;
					}
					else
					{
						array[i * width + j] = Color.clear;
					}
				}
			}
			val.SetPixels(array);
			((Texture)val).wrapMode = (TextureWrapMode)1;
			val.Apply();
			return val;
		}

		private Texture2D MakeCircleTexture(int size, Color color)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: 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)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(size, size, (TextureFormat)4, false);
			Color[] array = (Color[])(object)new Color[size * size];
			float num = (float)size / 2f;
			for (int i = 0; i < size; i++)
			{
				for (int j = 0; j < size; j++)
				{
					float num2 = (float)j + 0.5f - num;
					float num3 = (float)i + 0.5f - num;
					float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3);
					if (num4 <= num - 0.5f)
					{
						array[i * size + j] = color;
					}
					else if (num4 <= num + 0.5f)
					{
						float num5 = Mathf.Clamp01(num + 0.5f - num4);
						Color val2 = color;
						val2.a *= num5;
						array[i * size + j] = val2;
					}
					else
					{
						array[i * size + j] = Color.clear;
					}
				}
			}
			val.SetPixels(array);
			((Texture)val).wrapMode = (TextureWrapMode)1;
			val.Apply();
			return val;
		}

		private Texture2D MakeMonochromeBox(int width, int height, Color bg, Color border, Color topHighlight, int borderThickness)
		{
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Expected O, but got Unknown
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: 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_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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)
			Texture2D val = new Texture2D(width, height, (TextureFormat)4, false);
			Color[] array = (Color[])(object)new Color[width * height];
			for (int i = 0; i < height; i++)
			{
				for (int j = 0; j < width; j++)
				{
					bool num = j < borderThickness || j >= width - borderThickness || i < borderThickness || i >= height - borderThickness;
					bool flag = i >= height - borderThickness - 1 && i < height - borderThickness && j >= borderThickness && j < width - borderThickness;
					if (num)
					{
						array[i * width + j] = border;
						continue;
					}
					if (flag)
					{
						array[i * width + j] = Color.Lerp(bg, topHighlight, 0.6f);
						continue;
					}
					float num2 = (float)i / (float)height;
					Color val2 = Color.Lerp(bg * 0.94f, bg * 1.08f, num2);
					array[i * width + j] = val2;
				}
			}
			val.SetPixels(array);
			((Texture)val).wrapMode = (TextureWrapMode)1;
			val.Apply();
			return val;
		}

		private void InitStyles()
		{
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: 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_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: 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_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0356: Unknown result type (might be due to invalid IL or missing references)
			//IL_036f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0374: Unknown result type (might be due to invalid IL or missing references)
			//IL_0385: Unknown result type (might be due to invalid IL or missing references)
			//IL_0386: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_0394: Unknown result type (might be due to invalid IL or missing references)
			//IL_039e: Expected O, but got Unknown
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b2: Expected O, but got Unknown
			//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Expected O, but got Unknown
			//IL_047b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0485: Expected O, but got Unknown
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0499: Expected O, but got Unknown
			//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b1: Expected O, but got Unknown
			//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c5: Expected O, but got Unknown
			//IL_04dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e6: Expected O, but got Unknown
			//IL_0516: Unknown result type (might be due to invalid IL or missing references)
			//IL_051d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0527: Expected O, but got Unknown
			//IL_055a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0565: Unknown result type (might be due to invalid IL or missing references)
			//IL_056f: Expected O, but got Unknown
			//IL_059e: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a8: Expected O, but got Unknown
			//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bc: Expected O, but got Unknown
			//IL_05ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0617: Unknown result type (might be due to invalid IL or missing references)
			//IL_0624: Unknown result type (might be due to invalid IL or missing references)
			//IL_062e: Expected O, but got Unknown
			//IL_065e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0669: Unknown result type (might be due to invalid IL or missing references)
			//IL_0673: Expected O, but got Unknown
			//IL_06a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bb: Expected O, but got Unknown
			//IL_06de: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e8: Expected O, but got Unknown
			//IL_06f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0704: Expected O, but got Unknown
			//IL_0735: Unknown result type (might be due to invalid IL or missing references)
			//IL_073f: Expected O, but got Unknown
			//IL_0749: Unknown result type (might be due to invalid IL or missing references)
			//IL_0753: Expected O, but got Unknown
			//IL_07af: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ff: Expected O, but got Unknown
			//IL_082f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0840: Unknown result type (might be due to invalid IL or missing references)
			//IL_084a: Expected O, but got Unknown
			//IL_087a: 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_08a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0916: Unknown result type (might be due to invalid IL or missing references)
			//IL_093d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0952: Unknown result type (might be due to invalid IL or missing references)
			//IL_0953: 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_097a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0993: Unknown result type (might be due to invalid IL or missing references)
			//IL_0998: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b0: Expected O, but got Unknown
			//IL_09df: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e9: Expected O, but got Unknown
			//IL_09f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fd: Expected O, but got Unknown
			//IL_0a2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a38: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a42: Expected O, but got Unknown
			//IL_0a71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7b: Expected O, but got Unknown
			//IL_0a85: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8f: Expected O, but got Unknown
			//IL_0abf: 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_0ad4: Expected O, but got Unknown
			//IL_0b03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0d: Expected O, but got Unknown
			//IL_0b17: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b21: Expected O, but got Unknown
			//IL_0b42: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b53: Expected O, but got Unknown
			//IL_0b86: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba7: Expected O, but got Unknown
			//IL_0bce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd8: Expected O, but got Unknown
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Expected O, but got Unknown
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			if ((Object)(object)_winBgTex != (Object)null)
			{
				return;
			}
			try
			{
				if ((Object)(object)GUI.skin != (Object)null && GUI.skin.FindStyle("upbutton") == null)
				{
					GUIStyle item = new GUIStyle(GUIStyle.none)
					{
						name = "upbutton"
					};
					GUIStyle item2 = new GUIStyle(GUIStyle.none)
					{
						name = "downbutton"
					};
					List<GUIStyle> list = new List<GUIStyle>(GUI.skin.customStyles);
					list.Add(item);
					list.Add(item2);
					GUI.skin.customStyles = list.ToArray();
				}
			}
			catch
			{
			}
			LoadIcon();
			Color bg = default(Color);
			((Color)(ref bg))..ctor(0.04f, 0.04f, 0.06f, 0.96f);
			Color bg2 = default(Color);
			((Color)(ref bg2))..ctor(0.09f, 0.09f, 0.12f, 0.92f);
			Color border = default(Color);
			((Color)(ref border))..ctor(0.4f, 0.42f, 0.48f, 0.45f);
			Color white = Color.white;
			Color topHighlight = default(Color);
			((Color)(ref topHighlight))..ctor(0.85f, 0.85f, 0.9f, 0.6f);
			_winBgTex = MakeMonochromeBox(16, 16, bg, border, topHighlight, 1);
			_cardBgTex = MakeMonochromeBox(16, 16, bg2, new Color(0.25f, 0.26f, 0.32f, 0.35f), new Color(0.6f, 0.6f, 0.7f, 0.25f), 1);
			_btnNormalTex = MakeMonochromeBox(16, 16, new Color(0.12f, 0.12f, 0.16f, 0.9f), new Color(0.3f, 0.32f, 0.38f, 0.5f), topHighlight, 1);
			_btnHoverTex = MakeMonochromeBox(16, 16, new Color(0.22f, 0.22f, 0.28f, 0.95f), white, white, 1);
			_btnActiveTex = MakeMonochromeBox(16, 16, white, white, white, 1);
			_tabNormalTex = MakeMonochromeBox(16, 16, new Color(0.07f, 0.07f, 0.1f, 0.8f), new Color(0.2f, 0.22f, 0.28f, 0.4f), topHighlight, 1);
			_tabActiveTex = MakeMonochromeBox(16, 16, new Color(0.95f, 0.95f, 0.98f, 1f), white, white, 1);
			_accentBadgeTex = MakeMonochromeBox(16, 16, new Color(0.2f, 0.22f, 0.28f, 0.9f), border, white, 1);
			_legendaryBadgeTex = MakeMonochromeBox(16, 16, new Color(0.95f, 0.95f, 0.98f, 1f), white, white, 1);
			_rareBadgeTex = MakeMonochromeBox(16, 16, new Color(0.35f, 0.36f, 0.42f, 0.9f), border, white, 1);
			_selectedSkinTex = MakeMonochromeBox(16, 16, new Color(0.9f, 0.9f, 0.95f, 1f), white, white, 1);
			_scrollBgTex = MakeMonochromeBox(8, 8, new Color(0.02f, 0.02f, 0.04f, 0.6f), Color.clear, Color.clear, 0);
			_scrollThumbTex = MakeMonochromeBox(8, 8, new Color(0.3f, 0.32f, 0.38f, 0.8f), new Color(0.5f, 0.52f, 0.6f, 0.85f), topHighlight, 1);
			_scrollThumbHoverTex = MakeMonochromeBox(8, 8, white, white, white, 1);
			_winStyle = new GUIStyle();
			_winStyle.border = new RectOffset(4, 4, 4, 4);
			_winStyle.padding = new RectOffset(16, 16, 14, 14);
			_winStyle.normal.background = _winBgTex;
			_winStyle.hover.background = _winBgTex;
			_winStyle.active.background = _winBgTex;
			_winStyle.focused.background = _winBgTex;
			_winStyle.onNormal.background = _winBgTex;
			_winStyle.onHover.background = _winBgTex;
			_winStyle.onActive.background = _winBgTex;
			_winStyle.onFocused.background = _winBgTex;
			_cardStyle = new GUIStyle();
			_cardStyle.border = new RectOffset(4, 4, 4, 4);
			_cardStyle.padding = new RectOffset(14, 14, 12, 12);
			_cardStyle.margin = new RectOffset(0, 0, 6, 8);
			_cardStyle.normal.background = _cardBgTex;
			_titleStyle = new GUIStyle();
			_titleStyle.fontSize = 16;
			_titleStyle.fontStyle = (FontStyle)1;
			_titleStyle.alignment = (TextAnchor)3;
			_titleStyle.normal.textColor = white;
			_subTitleStyle = new GUIStyle();
			_subTitleStyle.fontSize = 10;
			_subTitleStyle.alignment = (TextAnchor)3;
			_subTitleStyle.normal.textColor = new Color(0.7f, 0.72f, 0.78f);
			_tabStyle = new GUIStyle();
			_tabStyle.fontSize = 12;
			_tabStyle.fontStyle = (FontStyle)1;
			_tabStyle.alignment = (TextAnchor)4;
			_tabStyle.border = new RectOffset(4, 4, 4, 4);
			_tabStyle.padding = new RectOffset(8, 8, 6, 6);
			_tabStyle.normal.background = _tabNormalTex;
			_tabStyle.normal.textColor = new Color(0.75f, 0.78f, 0.85f);
			_tabStyle.hover.background = _btnHoverTex;
			_tabStyle.hover.textColor = white;
			_tabActiveStyle = new GUIStyle(_tabStyle);
			_tabActiveStyle.normal.background = _tabActiveTex;
			_tabActiveStyle.normal.textColor = new Color(0.05f, 0.05f, 0.08f);
			_labelStyle = new GUIStyle();
			_labelStyle.fontSize = 12;
			_labelStyle.alignment = (TextAnchor)3;
			_labelStyle.normal.textColor = new Color(0.92f, 0.94f, 0.98f);
			_sectionHeaderStyle = new GUIStyle();
			_sectionHeaderStyle.fontSize = 12;
			_sectionHeaderStyle.fontStyle = (FontStyle)1;
			_sectionHeaderStyle.margin = new RectOffset(0, 0, 4, 6);
			_sectionHeaderStyle.normal.textColor = white;
			_btnStyle = new GUIStyle();
			_btnStyle.fontSize = 12;
			_btnStyle.fontStyle = (FontStyle)1;
			_btnStyle.alignment = (TextAnchor)4;
			_btnStyle.padding = new RectOffset(10, 10, 6, 6);
			_btnStyle.border = new RectOffset(4, 4, 4, 4);
			_btnStyle.normal.background = _btnNormalTex;
			_btnStyle.hover.background = _btnHoverTex;
			_btnStyle.active.background = _btnActiveTex;
			_btnStyle.normal.textColor = new Color(0.92f, 0.94f, 0.98f);
			_btnStyle.hover.textColor = white;
			_btnStyle.active.textColor = new Color(0.05f, 0.05f, 0.08f);
			_toggleActiveStyle = new GUIStyle(_btnStyle);
			_toggleActiveStyle.normal.background = _tabActiveTex;
			_toggleActiveStyle.normal.textColor = new Color(0.05f, 0.05f, 0.08f);
			_toggleInactiveStyle = new GUIStyle(_btnStyle);
			_toggleInactiveStyle.normal.background = _btnNormalTex;
			_toggleInactiveStyle.normal.textColor = new Color(0.6f, 0.62f, 0.68f);
			_switchTrackOnTex = MakePillTexture(50, 24, new Color(0.92f, 0.94f, 0.98f, 1f), Color.white, 1f);
			_switchTrackOffTex = MakePillTexture(50, 24, new Color(0.1f, 0.1f, 0.14f, 0.95f), new Color(0.35f, 0.38f, 0.45f, 0.8f), 1.5f);
			_switchKnobOnTex = MakeCircleTexture(18, new Color(0.06f, 0.06f, 0.08f, 1f));
			_switchKnobOffTex = MakeCircleTexture(18, new Color(0.9f, 0.92f, 0.96f, 1f));
			_switchOnTex = MakeMonochromeBox(16, 16, white, white, white, 1);
			_switchOffTex = MakeMonochromeBox(16, 16, new Color(0.12f, 0.12f, 0.16f, 0.9f), new Color(0.35f, 0.38f, 0.45f, 0.6f), topHighlight, 1);
			_switchOnStyle = new GUIStyle();
			_switchOnStyle.fontSize = 11;
			_switchOnStyle.fontStyle = (FontStyle)1;
			_switchOnStyle.alignment = (TextAnchor)4;
			_switchOnStyle.border = new RectOffset(4, 4, 4, 4);
			_switchOnStyle.padding = new RectOffset(6, 6, 3, 3);
			_switchOnStyle.normal.background = _switchOnTex;
			_switchOnStyle.normal.textColor = new Color(0.05f, 0.05f, 0.08f);
			_switchOffStyle = new GUIStyle();
			_switchOffStyle.fontSize = 11;
			_switchOffStyle.fontStyle = (FontStyle)1;
			_switchOffStyle.alignment = (TextAnchor)4;
			_switchOffStyle.border = new RectOffset(4, 4, 4, 4);
			_switchOffStyle.padding = new RectOffset(6, 6, 3, 3);
			_switchOffStyle.normal.background = _switchOffTex;
			_switchOffStyle.normal.textColor = new Color(0.65f, 0.68f, 0.75f);
			_badgeStyle = new GUIStyle();
			_badgeStyle.fontStyle = (FontStyle)1;
			_badgeStyle.fontSize = 11;
			_badgeStyle.alignment = (TextAnchor)4;
			_badgeStyle.border = new RectOffset(4, 4, 4, 4);
			_badgeStyle.padding = new RectOffset(6, 6, 2, 2);
			_badgeStyle.normal.background = _accentBadgeTex;
			_badgeStyle.normal.textColor = white;
			_gripStyle = new GUIStyle();
			_gripStyle.fontSize = 14;
			_gripStyle.fontStyle = (FontStyle)1;
			_gripStyle.normal.textColor = new Color(0.5f, 0.52f, 0.6f);
			_gripStyle.alignment = (TextAnchor)8;
			_scrollBarStyle = new GUIStyle();
			_scrollBarStyle.normal.background = _scrollBgTex;
			_scrollBarStyle.fixedWidth = 6f;
			_scrollThumbStyle = new GUIStyle();
			_scrollThumbStyle.normal.background = _scrollThumbTex;
			_scrollThumbStyle.hover.background = _scrollThumbHoverTex;
			_scrollThumbStyle.fixedWidth = 6f;
		}

		private void OnGUI()
		{
			//IL_0020: 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_0041: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			if (_showMenu)
			{
				GUI.depth = -300;
				InitStyles();
				_windowRect = GUI.Window(88419, _windowRect, new WindowFunction(DrawWindow), "", _winStyle);
				HandleResize();
			}
		}

		private void HandleResize()
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Invalid comparison between Unknown and I4
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Invalid comparison between Unknown and I4
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			Event current = Event.current;
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(((Rect)(ref _windowRect)).x + ((Rect)(ref _windowRect)).width - 24f, ((Rect)(ref _windowRect)).y + ((Rect)(ref _windowRect)).height - 24f, 24f, 24f);
			if ((int)current.type == 0 && ((Rect)(ref val)).Contains(current.mousePosition))
			{
				_isResizing = true;
				_resizeStartMouse = current.mousePosition;
				_resizeStartSize = new Vector2(((Rect)(ref _windowRect)).width, ((Rect)(ref _windowRect)).height);
				current.Use();
			}
			else if ((int)current.type == 1 && _isResizing)
			{
				_isResizing = false;
				current.Use();
			}
			else if ((int)current.type == 3 && _isResizing)
			{
				float width = Mathf.Clamp(_resizeStartSize.x + (current.mousePosition.x - _resizeStartMouse.x), 500f, 1000f);
				float height = Mathf.Clamp(_resizeStartSize.y + (current.mousePosition.y - _resizeStartMouse.y), 450f, 950f);
				((Rect)(ref _windowRect)).width = width;
				((Rect)(ref _windowRect)).height = height;
				current.Use();
			}
		}

		private void DrawWindow(int id)
		{
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			if ((Object)(object)_modIcon != (Object)null)
			{
				GUILayout.Label((Texture)(object)_modIcon, (GUILayoutOption[])(object)new GUILayoutOption[2]
				{
					GUILayout.Width(34f),
					GUILayout.Height(34f)
				});
				GUILayout.Space(6f);
			}
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Label("SUPER CREATURES", _titleStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label("v1.1.4", _subTitleStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
			GUILayout.FlexibleSpace();
			if (GUILayout.Button(IsRussian ? "RU" : "EN", _btnStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(44f),
				GUILayout.Height(26f)
			}))
			{
				SelectedLanguage.Value = ((!IsRussian) ? ModLanguage.Russian : ModLanguage.English);
			}
			if (GUILayout.Button("X", _btnStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(30f),
				GUILayout.Height(26f)
			}))
			{
				_showMenu = false;
				Cursor.visible = false;
				Cursor.lockState = (CursorLockMode)1;
				try
				{
					PlayerCamera.ToggleMouse(false);
				}
				catch
				{
				}
				Cursor.visible = false;
				Cursor.lockState = (CursorLockMode)1;
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(8f);
			string[] array = new string[5]
			{
				T("[Drip Fish]", "[Шайни Рыбы]"),
				T("[Size Studio]", "[Размеры]"),
				T("[Slot Machine]", "[Автомат]"),
				T("[Fishing]", "[Рыбалка]"),
				T("[General]", "[Общие]")
			};
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			for (int i = 0; i < array.Length; i++)
			{
				if (GUILayout.Button(array[i], (_currentTab == i) ? _tabActiveStyle : _tabStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
				{
					_currentTab = i;
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(6f);
			_scrollPos = GUILayout.BeginScrollView(_scrollPos, false, true, GUIStyle.none, _scrollBarStyle, Array.Empty<GUILayoutOption>());
			if (_currentTab == 0)
			{
				DrawDripTab();
			}
			else if (_currentTab == 1)
			{
				DrawSizeStudioTab();
			}
			else if (_currentTab == 2)
			{
				DrawSlotMachineTab();
			}
			else if (_currentTab == 3)
			{
				DrawFishingTab();
			}
			else if (_currentTab == 4)
			{
				DrawGeneralTab();
			}
			GUILayout.EndScrollView();
			GUI.Label(new Rect(((Rect)(ref _windowRect)).width - 24f, ((Rect)(ref _windowRect)).height - 20f, 20f, 20f), "//", _gripStyle);
			GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref _windowRect)).width - 70f, 44f));
		}

		private bool DrawToggleSwitch(string label, bool currentValue)
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.Space(3f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label(label, _labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			Rect rect = GUILayoutUtility.GetRect(50f, 24f, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(50f),
				GUILayout.Height(24f)
			});
			Event current = Event.current;
			if ((int)current.type == 0 && ((Rect)(ref rect)).Contains(current.mousePosition))
			{
				currentValue = !currentValue;
				current.Use();
			}
			GUI.DrawTexture(rect, (Texture)(object)(currentValue ? _switchTrackOnTex : _switchTrackOffTex));
			float num = 18f;
			float num2 = ((Rect)(ref rect)).y + (((Rect)(ref rect)).height - num) / 2f;
			float num3 = (currentValue ? (((Rect)(ref rect)).x + ((Rect)(ref rect)).width - num - 3f) : (((Rect)(ref rect)).x + 3f));
			GUI.DrawTexture(new Rect(num3, num2, num, num), (Texture)(object)(currentValue ? _switchKnobOnTex : _switchKnobOffTex));
			GUILayout.EndHorizontal();
			return currentValue;
		}

		private float DrawSlider(string label, float value, float min, float max, string format = "{0:F1}")
		{
			GUILayout.Space(3f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label(label, _labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			GUILayout.Box(string.Format(format, value), _badgeStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(66f),
				GUILayout.Height(22f)
			});
			GUILayout.EndHorizontal();
			return GUILayout.HorizontalSlider(value, min, max, Array.Empty<GUILayoutOption>());
		}

		private int DrawIntSlider(string label, int value, int min, int max, string suffix = "%")
		{
			GUILayout.Space(3f);
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.Label(label, _labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			GUILayout.Box(value + suffix, _badgeStyle, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(66f),
				GUILayout.Height(22f)
			});
			GUILayout.EndHorizontal();
			return (int)GUILayout.HorizontalSlider((float)value, (float)min, (float)max, Array.Empty<GUILayoutOption>());
		}

		private void DrawDripTab()
		{
			GUILayout.BeginVertical(_cardStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(T("SUPER (DRIP) CREATURE SPAWN CONTROL", "НАСТРОЙКИ СУПЕР (DRIP) СУЩЕСТВ"), _sectionHeaderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(4f);
			AlwaysSuper.Value = DrawToggle(T("Always Super / 100% Guaranteed", "Всегда Супер / 100% Гарантия"), AlwaysSuper.Value);
			AllowBosses.Value = DrawToggle(T("Allow Bosses to roll Drip", "Разрешить Боссам становиться Drip"), AllowBosses.Value);
			if (!AlwaysSuper.Value)
			{
				GUILayout.Space(6f);
				GUILayout.Label(T("Drip Spawn Chance: ", "Шанс выпадения Drip: ") + SuperCreatureChance.Value + "%", _labelStyle, Array.Empty<GUILayoutOption>());
				SuperCreatureChance.Value = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)SuperCreatureChance.Value, 0f, 100f, Array.Empty<GUILayoutOption>()));
			}
			GUILayout.EndVertical();
		}

		private void DrawSizeStudioTab()
		{
			GUILayout.BeginVertical(_cardStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(T("CREATURE SIZING & MUTATIONS ENGINE", "ДВИЖОК РАЗМЕРОВ И МУТАЦИЙ"), _sectionHeaderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(4f);
			ScaleEnabled.Value = DrawToggle(T("Master Scale Engine Active", "Включить генератор размеров"), ScaleEnabled.Value);
			if (ScaleEnabled.Value)
			{
				GUILayout.Space(4f);
				GUILayout.Label(T("Instant Presets:", "Быстрые Пресеты:"), _labelStyle, Array.Empty<GUILayoutOption>());
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				if (GUILayout.Button(T("Micro (0.2x)", "Микро (0.2x)"), _btnStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
				{
					MinScale.Value = 0.1f;
					MaxScale.Value = 0.4f;
					BossMinScale.Value = 0.5f;
					BossMaxScale.Value = 0.8f;
					JitterEnabled.Value = false;
				}
				if (GUILayout.Button(T("Natural (0.5-2.5x)", "Натурал (0.5-2.5x)"), _btnStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
				{
					MinScale.Value = 0.5f;
					MaxScale.Value = 2.5f;
					BossMinScale.Value = 0.8f;
					BossMaxScale.Value = 2f;
					JitterEnabled.Value = true;
					JitterPercent.Value = 0.2f;
				}
				if (GUILayout.Button(T("Kaiju (5-15x)", "Кайдзю (5-15x)"), _btnStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
				{
					MinScale.Value = 4f;
					MaxScale.Value = 15f;
					BossMinScale.Value = 2f;
					BossMaxScale.Value = 5f;
					JitterEnabled.Value = true;
					JitterPercent.Value = 0.3f;
				}
				if (GUILayout.Button(T("Meme Chaos", "Мем-Хаос"), _btnStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
				{
					MinScale.Value = 0.05f;
					MaxScale.Value = 20f;
					BossMinScale.Value = 0.5f;
					BossMaxScale.Value = 8f;
					JitterEnabled.Value = true;
					JitterPercent.Value = 0.5f;
					ExtremeBias.Value = 0.6f;
				}
				if (GUILayout.Button(T("Reset", "Сброс"), _btnStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(24f) }))
				{
					MinScale.Value = 0.1f;
					MaxScale.Value = 10f;
					BossMinScale.Value = 0.5f;
					BossMaxScale.Value = 2.5f;
					JitterEnabled.Value = true;
					JitterPercent.Value = 0.3f;
					ExtremeBias.Value = 0.3f;
				}
				GUILayout.EndHorizontal();
				GUILayout.Space(8f);
				GUILayout.Label(T("Scale Categories:", "Категории масштабирования:"), _sectionHeaderStyle, Array.Empty<GUILayoutOption>());
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				ScaleFish.Value = DrawToggle(T("Fish", "Рыбы"), ScaleFish.Value);
				ScaleBirds.Value = DrawToggle(T("Birds", "Птицы"), ScaleBirds.Value);
				ScaleOthers.Value = DrawToggle(T("Others", "Прочие"), ScaleOthers.Value);
				ScaleBosses.Value = DrawToggle(T("Bosses", "Боссы"), ScaleBosses.Value);
				GUILayout.EndHorizontal();
				GUILayout.Space(6f);
				GUILayout.Label(T("Creature Scale Range: ", "Диапазон обычных существ: ") + MinScale.Value.ToString("F2") + "x - " + MaxScale.Value.ToString("F2") + "x", _labelStyle, Array.Empty<GUILayoutOption>());
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				MinScale.Value = GUILayout.HorizontalSlider(MinScale.Value, 0.05f, 1f, Array.Empty<GUILayoutOption>());
				MaxScale.Value = GUILayout.HorizontalSlider(MaxScale.Value, 1f, 25f, Array.Empty<GUILayoutOption>());
				GUILayout.EndHorizontal();
				if (ScaleBosses.Value)
				{
					GUILayout.Space(4f);
					GUILayout.Label(T("Boss Scale Range: ", "Диапазон размеров Боссов: ") + BossMinScale.Value.ToString("F2") + "x - " + BossMaxScale.Value.ToString("F2") + "x", _labelStyle, Array.Empty<GUILayoutOption>());
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					BossMinScale.Value = GUILayout.HorizontalSlider(BossMinScale.Value, 0.3f, 2f, Array.Empty<GUILayoutOption>());
					BossMaxScale.Value = GUILayout.HorizontalSlider(BossMaxScale.Value, 1f, 10f, Array.Empty<GUILayoutOption>());
					GUILayout.EndHorizontal();
				}
				GUILayout.Space(6f);
				LogUniform.Value = DrawToggle(T("Log-Uniform Distribution (Balanced Scale Probability)", "Log-Uniform распределение (Баланс шансов)"), LogUniform.Value);
				GUILayout.Space(2f);
				GUILayout.Label(T("Extreme Size Bias: ", "Смещение к экстремальным размерам: ") + (ExtremeBias.Value * 100f).ToString("F0") + "%", _labelStyle, Array.Empty<GUILayoutOption>());
				ExtremeBias.Value = GUILayout.HorizontalSlider(ExtremeBias.Value, 0f, 1f, Array.Empty<GUILayoutOption>());
				GUILayout.Space(4f);
				JitterEnabled.Value = DrawToggle(T("Per-Axis 3D Jitter (Varied Proportions)", "3D Джиттер формы тела (Необычные пропорции)"), JitterEnabled.Value);
				if (JitterEnabled.Value)
				{
					GUILayout.Label(T("Jitter Amount: +-", "Сила джиттера: +-") + (JitterPercent.Value * 100f).ToString("F0") + "%", _labelStyle, Array.Empty<GUILayoutOption>());
					JitterPercent.Value = GUILayout.HorizontalSlider(JitterPercent.Value, 0.05f, 0.8f, Array.Empty<GUILayoutOption>());
				}
				GUILayout.Space(6f);
				GUILayout.Label(T("Physics & Audio Modifiers:", "Физика и Звуковые Модификаторы:"), _sectionHeaderStyle, Array.Empty<GUILayoutOption>());
				DynamicHP.Value = DrawToggle(T("Dynamic HP (Scales with size)", "Динамическое HP (Здоровье зависит от размера)"), DynamicHP.Value);
				DynamicSpeed.Value = DrawToggle(T("Dynamic Speed (Colossal move heavier)", "Динамическая Скорость (Тяжелые гиганты плывут медленнее)"), DynamicSpeed.Value);
				DynamicAudioPitch.Value = DrawToggle(T("Adaptive Audio Pitch (Micro high / Kaiju deep)", "Адаптивный питч звука (Пищащие микро / Басовые гиганты)"), DynamicAudioPitch.Value);
			}
			GUILayout.EndVertical();
		}

		private void DrawSlotMachineTab()
		{
			GUILayout.BeginVertical(_cardStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(T("REEL OF FORTUNE (SLOT MACHINE) FILTER", "ФИЛЬТР БАРАБАНОВ АВТОМАТА"), _sectionHeaderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(4f);
			string[] array = new string[7]
			{
				T("All Items", "Все Предметы"),
				T("Knives Only", "Только Ножи"),
				T("Snipers Only", "Только Снайперки"),
				T("Assault Rifles Only", "Только Автоматы"),
				T("Fishing Rods Only", "Только Удочки"),
				T("Shotguns Only", "Только Дробовики"),
				T("Boats Only", "Только Лодки")
			};
			for (int i = 0; i < array.Length; i++)
			{
				bool flag = ItemFilter.Value == (SlotItemFilter)i;
				if (GUILayout.Button(array[i], flag ? _toggleActiveStyle : _toggleInactiveStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(26f) }))
				{
					ItemFilter.Value = (SlotItemFilter)i;
				}
			}
			GUILayout.Space(6f);
			SlotAlwaysLegendary.Value = DrawToggle(T("100% Legendary Guarantee", "100% Легендарная гарантия"), SlotAlwaysLegendary.Value);
			if (!SlotAlwaysLegendary.Value)
			{
				GUILayout.Space(4f);
				GUILayout.Label(T("Legendary Drop Chance: ", "Шанс Легендарок: ") + SlotLegendaryChance.Value + "%", _labelStyle, Array.Empty<GUILayoutOption>());
				SlotLegendaryChance.Value = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)SlotLegendaryChance.Value, 0f, 100f, Array.Empty<GUILayoutOption>()));
				GUILayout.Label(T("Rare Drop Chance: ", "Шанс Редких: ") + SlotRareChance.Value + "%", _labelStyle, Array.Empty<GUILayoutOption>());
				SlotRareChance.Value = Mathf.RoundToInt(GUILayout.HorizontalSlider((float)SlotRareChance.Value, 0f, 100f, Array.Empty<GUILayoutOption>()));
			}
			GUILayout.EndVertical();
		}

		private void DrawFishingTab()
		{
			GUILayout.BeginVertical(_cardStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(T("FISHING BITE MULTIPLIERS", "МНОЖИТЕЛИ ПОКЛЁВКИ"), _sectionHeaderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(4f);
			GUILayout.Label(T("Rare Fish Multiplier: ", "Множитель редких рыб: ") + RareFishMultiplier.Value.ToString("F1") + "x", _labelStyle, Array.Empty<GUILayoutOption>());
			RareFishMultiplier.Value = GUILayout.HorizontalSlider(RareFishMultiplier.Value, 0.1f, 10f, Array.Empty<GUILayoutOption>());
			GUILayout.Space(6f);
			GUILayout.Label(T("Boss Encounter Multiplier: ", "Множитель встречи с Боссом: ") + BossHookMultiplier.Value.ToString("F1") + "x", _labelStyle, Array.Empty<GUILayoutOption>());
			BossHookMultiplier.Value = GUILayout.HorizontalSlider(BossHookMultiplier.Value, 0.1f, 10f, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
		}

		private void DrawGeneralTab()
		{
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginVertical(_cardStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Label(T("GENERAL SETTINGS", "ОБЩИЕ НАСТРОЙКИ"), _sectionHeaderStyle, Array.Empty<GUILayoutOption>());
			GUILayout.Space(4f);
			ModEnabled.Value = DrawToggle(T("Mod Enabled (Master Switch)", "Мод Включен (Главный переключатель)"), ModEnabled.Value);
			GUILayout.Space(6f);
			GUILayout.Label(T("In-Game Menu Key: ", "Клавиша вызова меню: ") + ((object)MenuKey.Value/*cast due to .constrained prefix*/).ToString(), _labelStyle, Array.Empty<GUILayoutOption>());
			GUILayout.EndVertical();
		}

		private bool DrawToggle(string label, bool val)
		{
			return DrawToggleSwitch(label, val);
		}

		public static float GenerateCreatureScale(Creature creature, int objectId)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			if (!ScaleEnabled.Value)
			{
				return 1f;
			}
			bool flag = (Object)(object)creature != (Object)null && ((int)creature.BossType != 0 || creature.BossHpMultiplier > 1f);
			bool flag2 = (Object)(object)creature != (Object)null && (Object)(object)((Component)creature).GetComponent<Bird>() != (Object)null;
			bool flag3 = (Object)(object)creature != (Object)null && (Object)(object)((Component)creature).GetComponent<Fish>() != (Object)null;
			bool flag4 = !flag && !flag2 && !flag3;
			if (flag && !ScaleBosses.Value)
			{
				return 1f;
			}
			if (flag2 && !ScaleBirds.Value)
			{
				return 1f;
			}
			if (flag3 && !ScaleFish.Value)
			{
				return 1f;
			}
			if (flag4 && !ScaleOthers.Value)
			{
				return 1f;
			}
			float num = (flag ? BossMinScale.Value : MinScale.Value);
			float num2 = (flag ? BossMaxScale.Value : MaxScale.Value);
			if (num > num2)
			{
				float num3 = num;
				num = num2;
				num2 = num3;
			}
			Random random = new Random(GameInfo.Seed + objectId);
			double num4 = random.NextDouble();
			if (ExtremeBias.Value > 0f)
			{
				double num5 = ExtremeBias.Value;
				if (random.NextDouble() < num5)
				{
					num4 = ((random.NextDouble() < 0.5) ? (random.NextDouble() * 0.15) : (1.0 - random.NextDouble() * 0.15));
				}
			}
			float num8;
			if (LogUniform.Value && num > 0.001f && num2 > 0.001f)
			{
				float num6 = Mathf.Log10(num);
				float num7 = Mathf.Log10(num2);
				num8 = Mathf.Pow(10f, (float)((double)num6 + num4 * (double)(num7 - num6)));
			}
			else
			{
				num8 = (float)((double)num + num4 * (double)(num2 - num));
			}
			return Mathf.Clamp(num8, num, num2);
		}

		public static Vector3 GetJitteredScale(float s, int objectId)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			if (!JitterEnabled.Value || JitterPercent.Value <= 0.01f)
			{
				return Vector3.one * s;
			}
			Random random = new Random(objectId * 1337 + 42);
			float value = JitterPercent.Value;
			float num = 1f + (float)((random.NextDouble() * 2.0 - 1.0) * (double)value);
			float num2 = 1f + (float)((random.NextDouble() * 2.0 - 1.0) * (double)value);
			float num3 = 1f + (float)((random.NextDouble() * 2.0 - 1.0) * (double)value);
			return new Vector3(s * num, s * num2, s * num3);
		}

		public static void ApplyCreatureScaling(Creature creature)
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)creature == (Object)null || !ModEnabled.Value || !ScaleEnabled.Value)
			{
				return;
			}
			float num = ((Item)creature).RandomizedWeight;
			if (num <= 0.01f)
			{
				num = 1f;
			}
			Vector3 jitteredScale = GetJitteredScale(num, ((NetworkBehaviour)creature).ObjectId);
			((Component)creature).transform.localScale = jitteredScale;
			SuperCreatureScaler superCreatureScaler = ((Component)creature).GetComponent<SuperCreatureScaler>();
			if ((Object)(object)superCreatureScaler == (Object)null)
			{
				superCreatureScaler = ((Component)creature).gameObject.AddComponent<SuperCreatureScaler>();
			}
			superCreatureScaler.Initialize(creature, jitteredScale);
			if (DynamicAudioPitch.Value)
			{
				AudioSource[] componentsInChildren = ((Component)creature).GetComponentsInChildren<AudioSource>(true);
				float pitch = Mathf.Clamp(1f / Mathf.Pow(num, 0.35f), 0.6f, 1.8f);
				AudioSource[] array = componentsInChildren;
				foreach (AudioSource val in array)
				{
					if ((Object)(object)val != (Object)null)
					{
						val.pitch = pitch;
					}
				}
			}
			Rigidbody component = ((Component)creature).GetComponent<Rigidbody>();
			if ((Object)(object)component != (Object)null && num > 0.05f)
			{
				component.mass = Mathf.Clamp(component.mass * Mathf.Pow(num, 1.8f), 0.1f, 500f);
			}
		}
	}
	[HarmonyPatch(typeof(CreatureUtils), "GetWeightWithStandardDeviation")]
	public static class CreatureUtils_GetWeight_Patch
	{
		public static bool Prefix(int seed, ref float __result)
		{
			if (SuperCreaturesPlugin.ModEnabled.Value && SuperCreaturesPlugin.ScaleEnabled.Value)
			{
				__result = SuperCreaturesPlugin.GenerateCreatureScale(null, seed);
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(Creature), "OnStartClient")]
	public static class Creature_OnStartClient_Scale_Patch
	{
		public static void Postfix(Creature __instance)
		{
			SuperCreaturesPlugin.ApplyCreatureScaling(__instance);
		}
	}
	[HarmonyPatch(typeof(Creature), "LoadFromSave")]
	public static class Creature_LoadFromSave_Scale_Patch
	{
		public static void Postfix(Creature __instance)
		{
			SuperCreaturesPlugin.ApplyCreatureScaling(__instance);
		}
	}
	[HarmonyPatch(typeof(Creature), "get_MaxHp")]
	public static class Creature_MaxHp_Patch
	{
		public static void Postfix(Creature __instance, ref int __result)
		{
			if (SuperCreaturesPlugin.ModEnabled.Value && SuperCreaturesPlugin.ScaleEnabled.Value && SuperCreaturesPlugin.DynamicHP.Value)
			{
				float randomizedWeight = ((Item)__instance).RandomizedWeight;
				if (randomizedWeight > 0.05f && randomizedWeight != 1f)
				{
					__result = Mathf.Max(1, Mathf.RoundToInt((float)__result * randomizedWeight));
				}
			}
		}
	}
	[HarmonyPatch(typeof(Item), "InitializeBait")]
	public static class Item_InitializeBait_Drip_Patch
	{
		private static FieldInfo _isDripField = typeof(Creature).GetField("_isDrip", BindingFlags.Instance | BindingFlags.NonPublic);

		public static void Prefix(Item __instance)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			if (!SuperCreaturesPlugin.ModEnabled.Value || (Object)(object)__instance == (Object)null)
			{
				return;
			}
			Creature val = (Creature)(object)((__instance is Creature) ? __instance : null);
			if ((Object)(object)val == (Object)null)
			{
				val = ((Component)__instance).GetComponent<Creature>();
			}
			if (!((Object)(object)val != (Object)null) || (((int)val.BossType != 0 || val.BossHpMultiplier > 1f) && !SuperCreaturesPlugin.AllowBosses.Value))
			{
				return;
			}
			bool flag = SuperCreaturesPlugin.AlwaysSuper.Value;
			if (!flag)
			{
				flag = Random.Range(0, 100) < SuperCreaturesPlugin.SuperCreatureChance.Value;
			}
			if (!flag)
			{
				return;
			}
			val.SetDrip();
			try
			{
				if (_isDripField == null)
				{
					_isDripField = typeof(Creature).GetField("_isDrip", BindingFlags.Instance | BindingFlags.NonPublic);
				}
				if (_isDripField != null && _isDripField.GetValue(val) is SyncVar<bool> val2)
				{
					val2.Value = true;
				}
				MeshFilter component = ((Component)val).GetComponent<MeshFilter>();
				if ((Object)(object)component != (Object)null && (Object)(object)((Item)val).DripMesh != (Object)null)
				{
					component.mesh = ((Item)val).DripMesh;
				}
			}
			catch
			{
			}
		}
	}
	[HarmonyPatch(typeof(CreatureManager), "HookItem")]
	public static class CreatureManager_HookItem_Patch
	{
		private static FieldInfo _isDripField = typeof(Creature).GetField("_isDrip", BindingFlags.Instance | BindingFlags.NonPublic);

		public static void Postfix(Item itemPrefab, Bait bait)
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			if (!SuperCreaturesPlugin.ModEnabled.Value)
			{
				return;
			}
			Item val = (((Object)(object)bait != (Object)null && (Object)(object)bait.ItemOnBait != (Object)null) ? bait.ItemOnBait : itemPrefab);
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			Creature component = ((Component)val).GetComponent<Creature>();
			if (!((Object)(object)component != (Object)null) || (((int)component.BossType != 0 || component.BossHpMultiplier > 1f) && !SuperCreaturesPlugin.AllowBosses.Value))
			{
				return;
			}
			bool flag = SuperCreaturesPlugin.AlwaysSuper.Value;
			if (!flag)
			{
				flag = Random.Range(0, 100) < SuperCreaturesPlugin.SuperCreatureChance.Value;
			}
			if (!flag)
			{
				return;
			}
			component.SetDrip();
			try
			{
				if (_isDripField == null)
				{
					_isDripField = typeof(Creature).GetField("_isDrip", BindingFlags.Instance | BindingFlags.NonPublic);
				}
				if (_isDripField != null && _isDripField.GetValue(component) is SyncVar<bool> val2)
				{
					val2.Value = true;
				}
				MeshFilter component2 = ((Component)component).GetComponent<MeshFilter>();
				if ((Object)(object)component2 != (Object)null && (Object)(object)((Item)component).DripMesh != (Object)null)
				{
					component2.mesh = ((Item)component).DripMesh;
				}
			}
			catch
			{
			}
		}
	}
	[HarmonyPatch(typeof(SlotMachineManager), "RollRandom")]
	public static class SlotMachineManager_RollRandom_Patch
	{
		public static void Prefix(Player roller)
		{
			if (SuperCreaturesPlugin.ModEnabled.Value && SuperCreaturesPlugin.SlotAlwaysLegendary.Value)
			{
				SuperCreaturesPlugin.SlotLegendaryChance.Value = 100;
			}
		}
	}
	[HarmonyPatch(typeof(PlayerCamera), "Update")]
	public static class SC_PlayerCamera_Update_Patch
	{
		public static void Postfix()
		{
			if (SuperCreaturesPlugin.IsMenuOpen)
			{
				Cursor.visible = true;
				Cursor.lockState = (CursorLockMode)0;
			}
		}
	}
	[HarmonyPatch(typeof(PlayerCamera), "ToggleMouse")]
	public static class SC_PlayerCamera_ToggleMouse_Patch
	{
		public static bool Prefix(ref bool unlock)
		{
			if (SuperCreaturesPlugin.IsMenuOpen)
			{
				unlock = true;
				Cursor.visible = true;
				Cursor.lockState = (CursorLockMode)0;
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(PlayerCamera), "MouseInput")]
	public static class SC_PlayerCamera_MouseInput_Patch
	{
		public static bool Prefix()
		{
			if (SuperCreaturesPlugin.IsMenuOpen)
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(PlayerInventory), "ScrollSlotInput")]
	public static class SC_PlayerInventory_ScrollSlotInput_Patch
	{
		public static bool Prefix()
		{
			if (SuperCreaturesPlugin.IsMenuOpen)
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(PlayerHolding), "PrimaryInput")]
	public static class SC_PlayerHolding_PrimaryInput_Patch
	{
		public static bool Prefix()
		{
			if (SuperCreaturesPlugin.IsMenuOpen)
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(PlayerHolding), "SecondaryInput")]
	public static class SC_PlayerHolding_SecondaryInput_Patch
	{
		public static bool Prefix()
		{
			if (SuperCreaturesPlugin.IsMenuOpen)
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(PlayerPunching), "PunchInput")]
	public static class SC_PlayerPunching_PunchInput_Patch
	{
		public static bool Prefix()
		{
			if (SuperCreaturesPlugin.IsMenuOpen)
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(FishingRod), "PrimaryInput")]
	public static class SC_FishingRod_PrimaryInput_Patch
	{
		public static bool Prefix()
		{
			if (SuperCreaturesPlugin.IsMenuOpen)
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(FishingRod), "SecondaryInput")]
	public static class SC_FishingRod_SecondaryInput_Patch
	{
		public static bool Prefix()
		{
			if (SuperCreaturesPlugin.IsMenuOpen)
			{
				return false;
			}
			return true;
		}
	}
	[HarmonyPatch(typeof(Item), "PickUp")]
	public static class Item_PickUp_Scale_Patch
	{
		public static void Postfix(Item __instance)
		{
			Creature val = (Creature)(object)((__instance is Creature) ? __instance : null);
			if ((Object)(object)val != (Object)null)
			{
				SuperCreaturesPlugin.ApplyCreatureScaling(val);
			}
		}
	}
	[HarmonyPatch(typeof(Item), "Drop")]
	public static class Item_Drop_Scale_Patch
	{
		public static void Postfix(Item __instance)
		{
			Creature val = (Creature)(object)((__instance is Creature) ? __instance : null);
			if ((Object)(object)val != (Object)null)
			{
				SuperCreaturesPlugin.ApplyCreatureScaling(val);
			}
		}
	}
	[HarmonyPatch(typeof(Fish), "OnDrop")]
	public static class Fish_OnDrop_Scale_Patch
	{
		public static void Postfix(Fish __instance)
		{
			Creature component = ((Component)__instance).GetComponent<Creature>();
			if ((Object)(object)component != (Object)null)
			{
				SuperCreaturesPlugin.ApplyCreatureScaling(component);
			}
		}
	}
	[HarmonyPatch(typeof(PlayerHolding), "SetHeldItem")]
	public static class PlayerHolding_SetHeldItem_Scale_Patch
	{
		public static void Postfix(Item item)
		{
			Creature val = (Creature)(object)((item is Creature) ? item : null);
			if ((Object)(object)val != (Object)null)
			{
				SuperCreaturesPlugin.ApplyCreatureScaling(val);
			}
		}
	}
	[HarmonyPatch(typeof(PlayerInventory), "UpdateHeldItem")]
	public static class PlayerInventory_UpdateHeldItem_Scale_Patch
	{
		public static void Postfix(PlayerInventory __instance)
		{
			try
			{
				if ((Object)(object)__instance.SyncedCurItem != (Object)null)
				{
					Item syncedCurItem = __instance.SyncedCurItem;
					Creature val = (Creature)(object)((syncedCurItem is Creature) ? syncedCurItem : null);
					if ((Object)(object)val != (Object)null)
					{
						SuperCreaturesPlugin.ApplyCreatureScaling(val);
					}
				}
			}
			catch
			{
			}
		}
	}
	public class SuperCreatureScaler : MonoBehaviour
	{
		private Creature _creature;

		private Vector3 _targetScale = Vector3.one;

		private bool _initialized;

		public void Initialize(Creature creature, Vector3 targetScale)
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			_creature = creature;
			_targetScale = targetScale;
			_initialized = true;
			ApplyScale();
		}

		public void ApplyScale()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			if (((Vector3)(ref _targetScale)).sqrMagnitude > 0.001f)
			{
				((Component)this).transform.localScale = _targetScale;
			}
		}

		private void LateUpdate()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			if (_initialized && SuperCreaturesPlugin.ModEnabled.Value && SuperCreaturesPlugin.ScaleEnabled.Value)
			{
				Vector3 val = ((Component)this).transform.localScale - _targetScale;
				if (((Vector3)(ref val)).sqrMagnitude > 0.0001f)
				{
					((Component)this).transform.localScale = _targetScale;
				}
			}
		}
	}
}