Decompiled source of MarsarahTweaks v1.2.0

MarsarahTweaks.dll

Decompiled 2 days 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 BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using JetBrains.Annotations;
using MarsarahTweaks.Patches.Features;
using MarsarahTweaks.Patches.Grind;
using MarsarahTweaks.Patches.QOL;
using MarsarahTweaks.Patches.UI;
using Microsoft.CodeAnalysis;
using ServerSync;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("MarsarahTweaks")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MarsarahTweaks")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("831fc141-e3fa-4e67-9d2f-5e56cf6f3935")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MarsarahTweaks
{
	public static class ConfigManager
	{
		public static class ConfigSections
		{
			public const string Main = "1 - Main";

			public const string GrindReduction = "2 - Grind Reduction (Synced with Server)";

			public const string Features = "3 - Features (Synced with Server)";

			public const string QOL = "4 - QOL (Synced with Server)";

			public const string UI = "5 - UI (Synced with Server)";
		}

		public struct ConfigMetadata
		{
			public string Name;

			public string Description;

			public ConfigMetadata(string name, string description)
			{
				Name = name;
				Description = description;
			}
		}

		public static class Configs
		{
			public static readonly ConfigMetadata ServerConfig = new ConfigMetadata("Lock Configuration", "If on, only server admins can change the configuration.");

			public static readonly ConfigMetadata DoubleBronzeCrafting = new ConfigMetadata("1 - Double Bronze Crafting", "Doubles the amount of crafted Bronze at the Forge");

			public static readonly ConfigMetadata GearRecipeAmountsModifications = new ConfigMetadata("2 - Cheaper Gear Recipe Amounts", "Reduces costs for crafting and upgrading gear for metal. Balances other resources amounts");

			public static readonly ConfigMetadata GearRecipeMaterialsModifications = new ConfigMetadata("3 - Alternate Gear Recipe Materials", "Modifies gear recipe materials for some items (more materials from current respective biomes)");

			public static readonly ConfigMetadata BuildPieceAmountsModifications = new ConfigMetadata("4 - Cheaper Build Pieces Amounts", "Reduces costs for build pieces");

			public static readonly ConfigMetadata BuildPieceMaterialsModifications = new ConfigMetadata("5 - Alternate Build Pieces Materials", "Modifies build pieces materials (This will move the Workbench Toolrack extension from Mountain to Swamp biome)");

			public static readonly ConfigMetadata FoodAndMeadModifications = new ConfigMetadata("6 - Food And Mead Modifications", "Modifies food and mead recipes costs, crafted amounts and stacks. (Toggling mid-game requires CLIENT relog for food stacks)");

			public static readonly ConfigMetadata ProgressionHalt = new ConfigMetadata("01 - Automatic Progression Halt", "Creatures and objects do not drop any items unless the previous biome boss has been defeated. (Toggling mid-game requires CLIENT relog or reloading area)");

			public static readonly ConfigMetadata ProgressionHaltOceanElder = new ConfigMetadata("02 - Halt Ocean Behind Elder", "Ocean resources are halted by The Elder instead of the default Bonemass. Requires Progression Halt Enabled. (Toggling mid-game requires CLIENT relog or reloading area)");

			public static readonly ConfigMetadata LinenCapeModifications = new ConfigMetadata("03 - Early Linen Cape", "Renames the Linen Cape to Fine Cape, moves it to the Swamp biome, and adds poison resist to it. (Toggling mid-game requires CLIENT relog if the item is equipped)");

			public static readonly ConfigMetadata GearSpeedModifications = new ConfigMetadata("04 - Gear Speed Modifications", "Removes speed penalty for heavy and mage armors; adds speed bonus to light armor. (Toggling mid-game requires CLIENT relog)");

			public static readonly ConfigMetadata ForsakenPowersModifications = new ConfigMetadata("05 - Forsaken Powers Modifications", "Reduce Forsaken Powers cooldowns and increase durations (different for each power)");

			public static readonly ConfigMetadata CharacterSpeedModifications = new ConfigMetadata("06 - Faster Character Speed", "Faster character jog, walk, swim and crouch speeds (run excluded)");

			public static readonly ConfigMetadata StatusEffectsModifications = new ConfigMetadata("07 - Shorter Wet And Potion Cooldowns", "Wet effect and potions cooldown timers reduced");

			public static readonly ConfigMetadata LessStaminaModifications = new ConfigMetadata("08 - Less Stamina Usage", "Stamina use of all actions is reduced by 15%");

			public static readonly ConfigMetadata ExtraArmorStatsModifications = new ConfigMetadata("09 - Extra Armor Stats", "Heavy armor provides extra HP, light armor provides extra stamina, mage armor provides extra eitr");

			public static readonly ConfigMetadata DeathRaiserModifications = new ConfigMetadata("10 - Better Death Raiser", "Adds a secondary attack that spawns archer skeletons. Primary attack will only spawn melee skeletons");

			public static readonly ConfigMetadata DeathRaiserSummonsModifications = new ConfigMetadata("11 - Better Summoned Skeletons", "Increases summoned skeleton speed and add better looking gear according to Death Raiser level (stats not affected). (Toggling mid-game requires CLIENT relog for speed changes)");

			public static readonly ConfigMetadata FrostStaffModifications = new ConfigMetadata("12 - Better Frost Staff Accuracy", "Improves Staff of Frost Accuracy");

			public static readonly ConfigMetadata CrossbowsReloadModifications = new ConfigMetadata("13 - Reduced Crossbows Reload Time", "Crossbows Reload Time Reduced by 1s. (Toggling mid-game requires CLIENT relog)");

			public static readonly ConfigMetadata AshlandsEnemiesModifications = new ConfigMetadata("14 - Less Ashlands Enemies", "Numbers and spawn chance reduced for Ashlands enemies. (Toggling mid-game requires reloading area)");

			public static readonly ConfigMetadata GearUpgradeModifications = new ConfigMetadata("15 - Gear Upgrade Unlock", "Gear from Meadows, Black Forest, Mistlands and Ashlands can be upgraded to max level within their respective biomes");

			public static readonly ConfigMetadata PermanentLightsModifications = new ConfigMetadata("16 - Permanent Lights", "Makes all light sources permanent, but the build costs of light source pieces use maximum amount of their respective fuel type");

			public static readonly ConfigMetadata ClearMistlands = new ConfigMetadata("17 - Clear Mistlands after Queen", "Clear Mistlands mist after defeating the Queen. (Disabling mid-game requires CLIENT relog)");

			public static readonly ConfigMetadata CraftableChain = new ConfigMetadata("18 - Craftable Chain", "Chain craftable at Black Forge");

			public static readonly ConfigMetadata BrighterLanterns = new ConfigMetadata("19 - Brighter Lanterns", "Dvergr lanterns are brighter. (Toggling mid-game requires CLIENT relog or reloading area)");

			public static readonly ConfigMetadata WeatherModifications = new ConfigMetadata("20 - Clearer Weather", "Reduces chance for mist and snowstorms in Meadows, Plains, Ocean and Mountains respectively. (Toggling mid-game requires CLIENT relog)");

			public static readonly ConfigMetadata CreatureUnleveler = new ConfigMetadata("21 - Creature Unleveler By Boss", "Increases chance of creatures to spawn with a star or two after defeating their relevant biome boss");

			public static readonly ConfigMetadata MinibossWeight = new ConfigMetadata("22 - Hildir Weight Rewards", "Increases base carry weight by 25 when turning in Hildir chests (for each chest). (Toggling mid-game requires CLIENT relog)");

			public static readonly ConfigMetadata ExtensionsModifications = new ConfigMetadata("23 - Station Extensions Changes", "Decreases space requirement for workstation extensions and increases build distance to workstations (This does not increase workstation radius)");

			public static readonly ConfigMetadata FleeAIModifications = new ConfigMetadata("24 - Stop Running Away", "Boars and Necks won't flee when alerted. (Toggling mid-game only affects new creatures)");

			public static readonly ConfigMetadata TrophyDropsModifications = new ConfigMetadata("25 - Better Trophy Drop Rates", "Increases trophy drop rate for the following creatures: Rancid Remains, Surtling, Draugr Elite, Wraith, Cultist, Fenring, Stone Golem, Deathsquito, Fuling Berserker, Tick, Dverger, Seeker Soldier, Charred Warlock");

			public static readonly ConfigMetadata TougherShips = new ConfigMetadata("26 - Tougher Ships", "Increases Ships HP. Raft: 300 -> 400, Karve: 500 -> 650, Longship: 1000 -> 1250, Drakkar: 3000 -> 4000 (Toggling mid-game requires CLIENT relog or reloading area)");

			public static readonly ConfigMetadata OtherModifications = new ConfigMetadata("28 - Other Section", "Tankard costs reduced and Iron Nails crafting output doubled");

			public static readonly ConfigMetadata LighterMetalWeight = new ConfigMetadata("01 - Lighter Metal Weight", "All metal ore and bars weight decreased to 8. (Toggling mid-game requires CLIENT relog or reloading area)");

			public static readonly ConfigMetadata LargerPickupArea = new ConfigMetadata("02 - Larger Pickup Area", "Item pickup area slightly increased");

			public static readonly ConfigMetadata NoSkillLoss = new ConfigMetadata("03 - No Skill Levels Loss On Death", "Skills won't go down the current level upon death (progress in that skill is still lost). (Toggling mid-game requires CLIENT relog)");

			public static readonly ConfigMetadata LargerBoatExploreRadius = new ConfigMetadata("04 - Larger Boat Explore Radius", "Double explore radius on a boat");

			public static readonly ConfigMetadata BiggerWispRadius = new ConfigMetadata("05 - Bigger Wisp Radius", "Increases wisp radius");

			public static readonly ConfigMetadata FriendlyBallistas = new ConfigMetadata("06 - Friendly Ballistas", "Ballistas won't target players and tame animals");

			public static readonly ConfigMetadata LessFallDamage = new ConfigMetadata("07 - Less Fall Damage", "Fall damage reduced by 40%");

			public static readonly ConfigMetadata FasterResourceDrops = new ConfigMetadata("08 - Faster Resource Drops", "Enemies drop resources faster when dying");

			public static readonly ConfigMetadata FasterEquip = new ConfigMetadata("09 - Faster Equip", "Equipping weapons is instant. Armor equip timers reduced to 1s (from 1s/2s). (Toggling mid-game requires CLIENT relog)");

			public static readonly ConfigMetadata CameraSailingPosition = new ConfigMetadata("10 - Move Camera Up While Sailing", "Moves the camera a bit upwards when sailing to better see in front of the boat");

			public static readonly ConfigMetadata ShorterRestedDelay = new ConfigMetadata("11 - Shorter Rested Delay", "Reduces the amount of time needed to get the rested buff from 20 to 10 seconds (Toggling mid-game requires re-entering the resting area)");

			public static readonly ConfigMetadata MoreUsableFuel = new ConfigMetadata("12 - More Usable Fuel", "Ancient Bark can be used as fuel for Kilns and Withered Bones for Shield Generators");

			public static readonly ConfigMetadata UIMoreLoadingTips = new ConfigMetadata("01 - More Loading Tips", "More loading screen tips");

			public static readonly ConfigMetadata UIInventoryWeightAndSlots = new ConfigMetadata("02 - Show Inventory Weight and Free Slots", "Shows inventory weight and free slots on the bottom left of the screen");

			public static readonly ConfigMetadata UIEnemyDetector = new ConfigMetadata("03 - Show Enemy Detector", "Shows enemy detector on the bottom left of the screen");

			public static readonly ConfigMetadata UIBoatSpeed = new ConfigMetadata("04 - Show Boat Speed", "Shows boat speed when using a boat on the bottom left of the screen");

			public static readonly ConfigMetadata UITimeAndDay = new ConfigMetadata("05 - Show Time And Day", "Shows time and day above the minimap");

			public static readonly ConfigMetadata UITimeAndDay24H = new ConfigMetadata("06 - Time - 24 Hour Format", "Use 24 Hour time format when Show Time And Day is enabled");

			public static readonly ConfigMetadata UISmartBiome = new ConfigMetadata("07 - Smart Biome Indicator", "Shows smart biome text on minimap (colored according to worn armor relative to current biome)");

			public static readonly ConfigMetadata UISummonCounter = new ConfigMetadata("08 - Show Summon Counter", "Shows number of summoned skeletons from the Dead Raiser");

			public static readonly ConfigMetadata UIOnlinePlayers = new ConfigMetadata("09 - Show Online Players", "Shows online players on the bottom right of the screen (Not displayed if only one player is online)");

			public static readonly ConfigMetadata UIOnlinePlayersUnderMinimap = new ConfigMetadata("10 - Show Online Players Under Minimap", "Shows online players under minimap instead of bottom right when Show Online Players is enabled");

			public static readonly ConfigMetadata UIShowOwnedResources = new ConfigMetadata("11 - Show Owned Resources In Build Menu", "Displays the total amount of resources in the player's inventory in addition to the required resource amount for the selected piece in the build menu");

			public static readonly ConfigMetadata UIShowPowerExpiration = new ConfigMetadata("12 - Show Boss Power Expiration Message", "Displays a message in the center of the screen when any Forsaken Power expires");

			public static readonly ConfigMetadata UIPlayerLogoutAnnounce = new ConfigMetadata("13 - Player Logout Announce", "Displays a message when a player logs out in the top-left corner of the screen and in the chat window");

			public static readonly ConfigMetadata UIAshlandsHeatLevel = new ConfigMetadata("14 - Show Heat Meter in Ashlands", "Shows a heat meter at the top-center of the screen when in Ashlands water or lava");

			public static readonly ConfigMetadata UIUseSymbols = new ConfigMetadata("15 - Alternate UI Layout", "Use symbols instead of words in this mod's UI elements (Enemy Counter, Summons Counter, etc). Also repositions the boat speed widget to the minimap");
		}

		private static ConfigFile Config;

		private static readonly ConfigSync configSync = new ConfigSync("Marsarah.MarsarahTweaks")
		{
			DisplayName = "MarsarahTweaks",
			CurrentVersion = "1.2.0",
			MinimumRequiredVersion = "1.2.0"
		};

		public static ConfigEntry<bool> ServerConfigLocked;

		public static ConfigEntry<bool> DoubleBronzeEnabled;

		public static ConfigEntry<bool> GearRecipeAmountsEnabled;

		public static ConfigEntry<bool> GearRecipeMaterialsEnabled;

		public static ConfigEntry<bool> BuildPieceAmountsEnabled;

		public static ConfigEntry<bool> BuildPieceMaterialsEnabled;

		public static ConfigEntry<bool> FoodAndMeadModificationsEnabled;

		public static ConfigEntry<bool> AutomaticProgressionHaltEnabled;

		public static ConfigEntry<bool> HaltOceanBehindElderEnabled;

		public static ConfigEntry<bool> EarlyLinenCapeEnabled;

		public static ConfigEntry<bool> GearSpeedModifiersEnabled;

		public static ConfigEntry<bool> LongerForsakenPowersEnabled;

		public static ConfigEntry<bool> FasterCharacterSpeedEnabled;

		public static ConfigEntry<bool> ShorterStatusEffectsEnabled;

		public static ConfigEntry<bool> LessStaminaUsageEnabled;

		public static ConfigEntry<bool> ExtraArmorStatsEnabled;

		public static ConfigEntry<bool> BetterDeathRaiserEnabled;

		public static ConfigEntry<bool> BetterDeathRaiserSummonsEnabled;

		public static ConfigEntry<bool> BetterFrostStaffAccuracyEnabled;

		public static ConfigEntry<bool> ReducedCrossbowsReloadTimeEnabled;

		public static ConfigEntry<bool> LessAshlandsEnemiesEnabled;

		public static ConfigEntry<bool> GearUpgradeUnlockEnabled;

		public static ConfigEntry<bool> PermanentLightsEnabled;

		public static ConfigEntry<bool> ClearMistlandsEnabled;

		public static ConfigEntry<bool> CraftableChainEnabled;

		public static ConfigEntry<bool> BrighterLanternsEnabled;

		public static ConfigEntry<bool> ClearerWeatherEnabled;

		public static ConfigEntry<bool> CreatureUnlevelerEnabled;

		public static ConfigEntry<bool> MinibossWeightEnabled;

		public static ConfigEntry<bool> ExtensionsChangesEnabled;

		public static ConfigEntry<bool> NoFleeEnabled;

		public static ConfigEntry<bool> BetterTrophyDropsEnabled;

		public static ConfigEntry<bool> TougherShipsEnabled;

		public static ConfigEntry<bool> OtherEnabled;

		public static ConfigEntry<bool> LighterMetalWeightEnabled;

		public static ConfigEntry<bool> LargerPickupAreaEnabled;

		public static ConfigEntry<bool> NoSkillLowerOnDeathEnabled;

		public static ConfigEntry<bool> LargerBoatExploreRadiusEnabled;

		public static ConfigEntry<bool> BiggerWispRadiusEnabled;

		public static ConfigEntry<bool> FriendlyBallistasEnabled;

		public static ConfigEntry<bool> LessFallDamageEnabled;

		public static ConfigEntry<bool> FasterResourceDropsEnabled;

		public static ConfigEntry<bool> FasterEquipEnabled;

		public static ConfigEntry<bool> CameraUpWhenSailingEnabled;

		public static ConfigEntry<bool> ShorterRestedDelayEnabled;

		public static ConfigEntry<bool> MoreUsableFuelEnabled;

		public static ConfigEntry<bool> MoreLoadingTipsEnabled;

		public static ConfigEntry<bool> ShowInventoryWeightAndSlots;

		public static ConfigEntry<bool> ShowEnemyDetector;

		public static ConfigEntry<bool> ShowBoatSpeed;

		public static ConfigEntry<bool> ShowTimeAndDay;

		public static ConfigEntry<bool> TimeFormat24H;

		public static ConfigEntry<bool> ShowSmartBiome;

		public static ConfigEntry<bool> ShowSummonCounter;

		public static ConfigEntry<bool> ShowOnlinePlayers;

		public static ConfigEntry<bool> OnlinePlayersUnderMinimap;

		public static ConfigEntry<bool> ShowOwnedResources;

		public static ConfigEntry<bool> ShowBossExpirationMessage;

		public static ConfigEntry<bool> AnnouncePlayerLogout;

		public static ConfigEntry<bool> ShowHeatLevelInAshlands;

		public static ConfigEntry<bool> UseSymbolsForUI;

		private static string ConfigFileName => "Marsarah.MarsarahTweaks.cfg";

		private static string ConfigFileFullPath
		{
			get
			{
				string configPath = Paths.ConfigPath;
				char directorySeparatorChar = Path.DirectorySeparatorChar;
				return configPath + directorySeparatorChar + ConfigFileName;
			}
		}

		public static void Init(ConfigFile configFile)
		{
			Config = configFile;
			ServerConfigLocked = CreateConfig("1 - Main", Configs.ServerConfig.Name, defaultValue: true, Configs.ServerConfig.Description);
			configSync.AddLockingConfigEntry<bool>(ServerConfigLocked);
			DoubleBronzeEnabled = CreateConfig("2 - Grind Reduction (Synced with Server)", Configs.DoubleBronzeCrafting.Name, defaultValue: true, Configs.DoubleBronzeCrafting.Description);
			GearRecipeAmountsEnabled = CreateConfig("2 - Grind Reduction (Synced with Server)", Configs.GearRecipeAmountsModifications.Name, defaultValue: true, Configs.GearRecipeAmountsModifications.Description);
			GearRecipeMaterialsEnabled = CreateConfig("2 - Grind Reduction (Synced with Server)", Configs.GearRecipeMaterialsModifications.Name, defaultValue: true, Configs.GearRecipeMaterialsModifications.Description);
			BuildPieceAmountsEnabled = CreateConfig("2 - Grind Reduction (Synced with Server)", Configs.BuildPieceAmountsModifications.Name, defaultValue: true, Configs.BuildPieceAmountsModifications.Description);
			BuildPieceMaterialsEnabled = CreateConfig("2 - Grind Reduction (Synced with Server)", Configs.BuildPieceMaterialsModifications.Name, defaultValue: true, Configs.BuildPieceMaterialsModifications.Description);
			FoodAndMeadModificationsEnabled = CreateConfig("2 - Grind Reduction (Synced with Server)", Configs.FoodAndMeadModifications.Name, defaultValue: true, Configs.FoodAndMeadModifications.Description);
			AutomaticProgressionHaltEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.ProgressionHalt.Name, defaultValue: true, Configs.ProgressionHalt.Description);
			HaltOceanBehindElderEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.ProgressionHaltOceanElder.Name, defaultValue: false, Configs.ProgressionHaltOceanElder.Description);
			EarlyLinenCapeEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.LinenCapeModifications.Name, defaultValue: true, Configs.LinenCapeModifications.Description);
			GearSpeedModifiersEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.GearSpeedModifications.Name, defaultValue: true, Configs.GearSpeedModifications.Description);
			LongerForsakenPowersEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.ForsakenPowersModifications.Name, defaultValue: true, Configs.ForsakenPowersModifications.Description);
			FasterCharacterSpeedEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.CharacterSpeedModifications.Name, defaultValue: true, Configs.CharacterSpeedModifications.Description);
			ShorterStatusEffectsEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.StatusEffectsModifications.Name, defaultValue: true, Configs.StatusEffectsModifications.Description);
			LessStaminaUsageEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.LessStaminaModifications.Name, defaultValue: true, Configs.LessStaminaModifications.Description);
			ExtraArmorStatsEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.ExtraArmorStatsModifications.Name, defaultValue: true, Configs.ExtraArmorStatsModifications.Description);
			BetterDeathRaiserEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.DeathRaiserModifications.Name, defaultValue: true, Configs.DeathRaiserModifications.Description);
			BetterDeathRaiserSummonsEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.DeathRaiserSummonsModifications.Name, defaultValue: true, Configs.DeathRaiserSummonsModifications.Description);
			BetterFrostStaffAccuracyEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.FrostStaffModifications.Name, defaultValue: true, Configs.FrostStaffModifications.Description);
			ReducedCrossbowsReloadTimeEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.CrossbowsReloadModifications.Name, defaultValue: true, Configs.CrossbowsReloadModifications.Description);
			LessAshlandsEnemiesEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.AshlandsEnemiesModifications.Name, defaultValue: true, Configs.AshlandsEnemiesModifications.Description);
			GearUpgradeUnlockEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.GearUpgradeModifications.Name, defaultValue: true, Configs.GearUpgradeModifications.Description);
			PermanentLightsEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.PermanentLightsModifications.Name, defaultValue: true, Configs.PermanentLightsModifications.Description);
			ClearMistlandsEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.ClearMistlands.Name, defaultValue: true, Configs.ClearMistlands.Description);
			CraftableChainEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.CraftableChain.Name, defaultValue: true, Configs.CraftableChain.Description);
			BrighterLanternsEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.BrighterLanterns.Name, defaultValue: true, Configs.BrighterLanterns.Description);
			ClearerWeatherEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.WeatherModifications.Name, defaultValue: true, Configs.WeatherModifications.Description);
			CreatureUnlevelerEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.CreatureUnleveler.Name, defaultValue: true, Configs.CreatureUnleveler.Description);
			MinibossWeightEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.MinibossWeight.Name, defaultValue: true, Configs.MinibossWeight.Description);
			ExtensionsChangesEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.ExtensionsModifications.Name, defaultValue: true, Configs.ExtensionsModifications.Description);
			NoFleeEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.FleeAIModifications.Name, defaultValue: true, Configs.FleeAIModifications.Description);
			BetterTrophyDropsEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.TrophyDropsModifications.Name, defaultValue: true, Configs.TrophyDropsModifications.Description);
			TougherShipsEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.TougherShips.Name, defaultValue: true, Configs.TougherShips.Description);
			OtherEnabled = CreateConfig("3 - Features (Synced with Server)", Configs.OtherModifications.Name, defaultValue: true, Configs.OtherModifications.Description);
			LighterMetalWeightEnabled = CreateConfig("4 - QOL (Synced with Server)", Configs.LighterMetalWeight.Name, defaultValue: true, Configs.LighterMetalWeight.Description);
			LargerPickupAreaEnabled = CreateConfig("4 - QOL (Synced with Server)", Configs.LargerPickupArea.Name, defaultValue: true, Configs.LargerPickupArea.Description);
			NoSkillLowerOnDeathEnabled = CreateConfig("4 - QOL (Synced with Server)", Configs.NoSkillLoss.Name, defaultValue: true, Configs.NoSkillLoss.Description);
			LargerBoatExploreRadiusEnabled = CreateConfig("4 - QOL (Synced with Server)", Configs.LargerBoatExploreRadius.Name, defaultValue: true, Configs.LargerBoatExploreRadius.Description);
			BiggerWispRadiusEnabled = CreateConfig("4 - QOL (Synced with Server)", Configs.BiggerWispRadius.Name, defaultValue: true, Configs.BiggerWispRadius.Description);
			FriendlyBallistasEnabled = CreateConfig("4 - QOL (Synced with Server)", Configs.FriendlyBallistas.Name, defaultValue: true, Configs.FriendlyBallistas.Description);
			LessFallDamageEnabled = CreateConfig("4 - QOL (Synced with Server)", Configs.LessFallDamage.Name, defaultValue: true, Configs.LessFallDamage.Description);
			FasterResourceDropsEnabled = CreateConfig("4 - QOL (Synced with Server)", Configs.FasterResourceDrops.Name, defaultValue: true, Configs.FasterResourceDrops.Description);
			FasterEquipEnabled = CreateConfig("4 - QOL (Synced with Server)", Configs.FasterEquip.Name, defaultValue: true, Configs.FasterEquip.Description);
			CameraUpWhenSailingEnabled = CreateConfig("4 - QOL (Synced with Server)", Configs.CameraSailingPosition.Name, defaultValue: true, Configs.CameraSailingPosition.Description);
			ShorterRestedDelayEnabled = CreateConfig("4 - QOL (Synced with Server)", Configs.ShorterRestedDelay.Name, defaultValue: true, Configs.ShorterRestedDelay.Description);
			MoreUsableFuelEnabled = CreateConfig("4 - QOL (Synced with Server)", Configs.MoreUsableFuel.Name, defaultValue: true, Configs.MoreUsableFuel.Description);
			MoreLoadingTipsEnabled = CreateConfig("5 - UI (Synced with Server)", Configs.UIMoreLoadingTips.Name, defaultValue: true, Configs.UIMoreLoadingTips.Description);
			ShowInventoryWeightAndSlots = CreateConfig("5 - UI (Synced with Server)", Configs.UIInventoryWeightAndSlots.Name, defaultValue: true, Configs.UIInventoryWeightAndSlots.Description);
			ShowEnemyDetector = CreateConfig("5 - UI (Synced with Server)", Configs.UIEnemyDetector.Name, defaultValue: true, Configs.UIEnemyDetector.Description);
			ShowBoatSpeed = CreateConfig("5 - UI (Synced with Server)", Configs.UIBoatSpeed.Name, defaultValue: true, Configs.UIBoatSpeed.Description);
			ShowTimeAndDay = CreateConfig("5 - UI (Synced with Server)", Configs.UITimeAndDay.Name, defaultValue: true, Configs.UITimeAndDay.Description);
			TimeFormat24H = CreateConfig("5 - UI (Synced with Server)", Configs.UITimeAndDay24H.Name, defaultValue: false, Configs.UITimeAndDay24H.Description);
			ShowSmartBiome = CreateConfig("5 - UI (Synced with Server)", Configs.UISmartBiome.Name, defaultValue: true, Configs.UISmartBiome.Description);
			ShowSummonCounter = CreateConfig("5 - UI (Synced with Server)", Configs.UISummonCounter.Name, defaultValue: true, Configs.UISummonCounter.Description);
			ShowOnlinePlayers = CreateConfig("5 - UI (Synced with Server)", Configs.UIOnlinePlayers.Name, defaultValue: true, Configs.UIOnlinePlayers.Description);
			OnlinePlayersUnderMinimap = CreateConfig("5 - UI (Synced with Server)", Configs.UIOnlinePlayersUnderMinimap.Name, defaultValue: false, Configs.UIOnlinePlayersUnderMinimap.Description);
			ShowOwnedResources = CreateConfig("5 - UI (Synced with Server)", Configs.UIShowOwnedResources.Name, defaultValue: true, Configs.UIShowOwnedResources.Description);
			ShowBossExpirationMessage = CreateConfig("5 - UI (Synced with Server)", Configs.UIShowPowerExpiration.Name, defaultValue: true, Configs.UIShowPowerExpiration.Description);
			AnnouncePlayerLogout = CreateConfig("5 - UI (Synced with Server)", Configs.UIPlayerLogoutAnnounce.Name, defaultValue: true, Configs.UIPlayerLogoutAnnounce.Description);
			ShowHeatLevelInAshlands = CreateConfig("5 - UI (Synced with Server)", Configs.UIAshlandsHeatLevel.Name, defaultValue: true, Configs.UIAshlandsHeatLevel.Description);
			UseSymbolsForUI = CreateConfig("5 - UI (Synced with Server)", Configs.UIUseSymbols.Name, defaultValue: true, Configs.UIUseSymbols.Description);
			SetupWatcher();
		}

		private static ConfigEntry<T> CreateConfig<T>(string group, string name, T defaultValue, string description, bool synchronizedSetting = true)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			ConfigEntry<T> val = Config.Bind<T>(group, name, defaultValue, new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()));
			SyncedConfigEntry<T> syncedConfigEntry = configSync.AddConfigEntry<T>(val);
			syncedConfigEntry.SynchronizedConfig = synchronizedSetting;
			val.SettingChanged += delegate
			{
				OnConfigChanged(name);
			};
			return val;
		}

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

		private static void ReadConfigValues(object sender, FileSystemEventArgs e)
		{
			if (!File.Exists(ConfigFileFullPath))
			{
				return;
			}
			try
			{
				Config.Reload();
			}
			catch
			{
				MarsarahTweaks.LogError("There was an issue loading " + ConfigFileName);
			}
		}

		private static void OnConfigChanged(string configName)
		{
			Config.Save();
			if ((Object)(object)ObjectDB.instance == (Object)null || (Object)(object)ZNetScene.instance == (Object)null || (Object)(object)ZNet.instance == (Object)null)
			{
				return;
			}
			if (!ZNet.instance.IsDedicated())
			{
				if (configName == Configs.DoubleBronzeCrafting.Name)
				{
					DoubleBronzeCrafting.UpdateDoubleBronzeCrafting(ObjectDB.instance, wasChanged: true);
				}
				else
				{
					string text = configName;
					if (text == Configs.GearRecipeAmountsModifications.Name)
					{
						GearRecipeChanges.UpdateGearRecipes(ObjectDB.instance, amountsWasChanged: true, materialsWasChanged: false);
					}
					else
					{
						string text2 = configName;
						if (text2 == Configs.GearRecipeMaterialsModifications.Name)
						{
							GearRecipeChanges.UpdateGearRecipes(ObjectDB.instance, amountsWasChanged: false, materialsWasChanged: true);
						}
						else
						{
							string text3 = configName;
							if (text3 == Configs.BuildPieceAmountsModifications.Name)
							{
								BuildPieceChanges.UpdateBuildPieces(ZNetScene.instance, amountsWasChanged: true, materialsWasChanged: false);
							}
							else
							{
								string text4 = configName;
								if (text4 == Configs.BuildPieceMaterialsModifications.Name)
								{
									BuildPieceChanges.UpdateBuildPieces(ZNetScene.instance, amountsWasChanged: false, materialsWasChanged: true);
								}
								else
								{
									string text5 = configName;
									if (text5 == Configs.FoodAndMeadModifications.Name)
									{
										FoodAndMeadChanges.UpdateFoodAndMead(ObjectDB.instance, wasModified: true);
									}
									else
									{
										string text6 = configName;
										if (text6 == Configs.LinenCapeModifications.Name)
										{
											GearRecipeChanges.UpdateLinenCapeRecipe(ObjectDB.instance, wasChanged: true);
											EarlyLinenCape.UpdateLinenCapeStats(wasChanged: true);
										}
										else
										{
											string text7 = configName;
											if (text7 == Configs.GearSpeedModifications.Name)
											{
												GearSpeedChanges.UpdateGearSpeed(ObjectDB.instance, wasChanged: true);
											}
											else
											{
												string text8 = configName;
												if (text8 == Configs.ForsakenPowersModifications.Name)
												{
													ForsakenPowersChanges.UpdateForsakenPowers(ObjectDB.instance, wasChanged: true);
												}
												else
												{
													string text9 = configName;
													if (text9 == Configs.CharacterSpeedModifications.Name)
													{
														if ((Object)(object)Player.m_localPlayer != (Object)null)
														{
															CharacterSpeedChanges.UpdateCharacterSpeed((Character)(object)Player.m_localPlayer, wasChanged: true);
														}
													}
													else
													{
														string text10 = configName;
														if (text10 == Configs.StatusEffectsModifications.Name)
														{
															StatusEffectChanges.UpdateStatusEffects(ObjectDB.instance, wasChanged: true);
														}
														else
														{
															string text11 = configName;
															if (text11 == Configs.GearUpgradeModifications.Name)
															{
																GearUpgradeChanges.UpdateGearRecipeUnlock(ObjectDB.instance, wasChanged: true);
																if (ShowSmartBiome.Value)
																{
																	UISmartBiome.UpdateBiomeWeights();
																}
															}
															else
															{
																string text12 = configName;
																if (text12 == Configs.PermanentLightsModifications.Name)
																{
																	PermanentLightsChanges.UpdateLightBuildPiecesAmounts(ZNetScene.instance, wasChanged: true);
																}
																else
																{
																	string text13 = configName;
																	if (text13 == Configs.CraftableChain.Name)
																	{
																		CraftableChain.UpdateChainRecipe(ObjectDB.instance, wasChanged: true);
																	}
																	else
																	{
																		string text14 = configName;
																		if (text14 == Configs.BrighterLanterns.Name)
																		{
																			BrighterLanterns.UpdateLanterns(ZNetScene.instance);
																		}
																		else
																		{
																			string text15 = configName;
																			if (text15 == Configs.TougherShips.Name)
																			{
																				TougherShipsChanges.UpdateShipHP(ZNetScene.instance, wasChanged: true);
																			}
																			else
																			{
																				string text16 = configName;
																				if (text16 == Configs.OtherModifications.Name)
																				{
																					OtherChanges.UpdateOthers(ObjectDB.instance, wasChanged: true);
																				}
																				else
																				{
																					string text17 = configName;
																					if (text17 == Configs.LighterMetalWeight.Name)
																					{
																						LighterMetalWeight.UpdateLighterMetalWeight(ObjectDB.instance, wasChanged: true);
																					}
																					else
																					{
																						string text18 = configName;
																						if (text18 == Configs.LargerPickupArea.Name)
																						{
																							if ((Object)(object)Player.m_localPlayer != (Object)null)
																							{
																								LargerPickupAreaChanges.UpdatePickupArea(Player.m_localPlayer, wasChanged: true);
																							}
																						}
																						else
																						{
																							string text19 = configName;
																							if (text19 == Configs.UIInventoryWeightAndSlots.Name)
																							{
																								UIController.UpdateUIPositions();
																							}
																							else
																							{
																								string text20 = configName;
																								if (text20 == Configs.UIEnemyDetector.Name)
																								{
																									UIController.UpdateUIPositions();
																								}
																								else
																								{
																									string text21 = configName;
																									if (text21 == Configs.UIBoatSpeed.Name)
																									{
																										UIController.UpdateUIPositions();
																									}
																									else
																									{
																										string text22 = configName;
																										if (text22 == Configs.UISmartBiome.Name)
																										{
																											UISmartBiome.UpdateBiomeWeights();
																										}
																									}
																								}
																							}
																						}
																					}
																				}
																			}
																		}
																	}
																}
															}
														}
													}
												}
											}
										}
									}
								}
							}
						}
					}
				}
			}
			if (configName == Configs.AshlandsEnemiesModifications.Name)
			{
				SpawnSystem val = Object.FindObjectOfType<SpawnSystem>();
				if (val != null)
				{
					AshlandsEnemiesChanges.UpdateAshlandsSpawns(val);
				}
				return;
			}
			string text23 = configName;
			if (text23 == Configs.CreatureUnleveler.Name)
			{
				SpawnSystem val2 = Object.FindObjectOfType<SpawnSystem>();
				if (val2 != null)
				{
					CreatureUnleveler.ApplyCreatureLevelChanges(val2);
				}
			}
			else
			{
				string text24 = configName;
				if (text24 == Configs.MoreUsableFuel.Name)
				{
					MoreUsableFuel.UpdateMoreUsableFuel();
				}
			}
		}
	}
	[BepInPlugin("Marsarah.MarsarahTweaks", "MarsarahTweaks", "1.2.0")]
	public class MarsarahTweaks : BaseUnityPlugin
	{
		internal const string ModName = "MarsarahTweaks";

		internal const string ModVersion = "1.2.0";

		internal const string Author = "Marsarah";

		public const string ModGUID = "Marsarah.MarsarahTweaks";

		private static readonly bool showLogs = true;

		private readonly Harmony harmony = new Harmony("Marsarah.MarsarahTweaks");

		private void Awake()
		{
			ConfigManager.Init(((BaseUnityPlugin)this).Config);
			UISmartBiome.UpdateBiomeWeights();
			harmony.PatchAll();
		}

		private void Update()
		{
			UIController.UpdateUIDisplay();
		}

		private void OnDestroy()
		{
			((BaseUnityPlugin)this).Config.Save();
		}

		public static void LogInfo(string log, bool header = false, bool footer = false)
		{
			if (showLogs)
			{
				if (header)
				{
					Debug.Log((object)"===================================================");
				}
				Debug.Log((object)("[Marsarah Tweaks] : " + log));
				if (footer)
				{
					Debug.Log((object)"===================================================");
				}
			}
		}

		public static void LogWarn(string log, bool header = false, bool footer = false)
		{
			if (showLogs)
			{
				if (header)
				{
					Debug.Log((object)"===================================================");
				}
				Debug.LogWarning((object)("[Marsarah Tweaks] : " + log));
				if (footer)
				{
					Debug.Log((object)"===================================================");
				}
			}
		}

		public static void LogError(string log, bool header = false, bool footer = false)
		{
			if (showLogs)
			{
				if (header)
				{
					Debug.Log((object)"===================================================");
				}
				Debug.LogError((object)("[Marsarah Tweaks] : " + log));
				if (footer)
				{
					Debug.Log((object)"===================================================");
				}
			}
		}
	}
}
namespace MarsarahTweaks.Patches
{
	public static class GlobalKeyChecker
	{
		[HarmonyPatch(typeof(ZoneSystem), "Update")]
		private class BossStatusUpdate_Patch
		{
			private static void Postfix(ZoneSystem __instance)
			{
				UpdateDefeatedStates(__instance);
				EikthyrDefeated = CheckGlobalKey("defeated_eikthyr");
				ElderDefeated = CheckGlobalKey("defeated_gdking");
				BonemassDefeated = CheckGlobalKey("defeated_bonemass");
				ModerDefeated = CheckGlobalKey("defeated_dragon");
				YagluthDefeated = CheckGlobalKey("defeated_goblinking");
				QueenDefeated = CheckGlobalKey("defeated_queen");
				FaderDefeated = CheckGlobalKey("defeated_fader");
				BrennaDefeated = CheckGlobalKey("hildir1");
				GeirrhafaDefeated = CheckGlobalKey("hildir2");
				ThungrNZilDefeated = CheckGlobalKey("hildir3");
			}
		}

		public static bool EikthyrDefeated = false;

		public static bool ElderDefeated = false;

		public static bool BonemassDefeated = false;

		public static bool ModerDefeated = false;

		public static bool YagluthDefeated = false;

		public static bool QueenDefeated = false;

		public static bool FaderDefeated = false;

		public static bool BrennaDefeated = false;

		public static bool GeirrhafaDefeated = false;

		public static bool ThungrNZilDefeated = false;

		private static readonly Dictionary<string, bool> globalKeyStates = new Dictionary<string, bool>
		{
			{ "defeated_eikthyr", false },
			{ "defeated_gdking", false },
			{ "defeated_bonemass", false },
			{ "defeated_dragon", false },
			{ "defeated_goblinking", false },
			{ "defeated_queen", false },
			{ "defeated_fader", false },
			{ "hildir1", false },
			{ "hildir2", false },
			{ "hildir3", false }
		};

		private static readonly Dictionary<string, string> bossToGlobalKey = new Dictionary<string, string>
		{
			{ "Eikthyr", "defeated_eikthyr" },
			{ "The Elder", "defeated_gdking" },
			{ "Bonemass", "defeated_bonemass" },
			{ "Moder", "defeated_dragon" },
			{ "Yagluth", "defeated_goblinking" },
			{ "The Queen", "defeated_queen" },
			{ "Fader", "defeated_fader" },
			{ "Brenna", "hildir1" },
			{ "Geirrhafa", "hildir2" },
			{ "ThungrNZil", "hildir3" }
		};

		private static void UpdateDefeatedStates(ZoneSystem zoneSystem)
		{
			List<string> globalKeys = zoneSystem.GetGlobalKeys();
			foreach (string item in globalKeyStates.Keys.ToList())
			{
				bool flag = globalKeys.Contains(item);
				if (globalKeyStates[item] != flag)
				{
					globalKeyStates[item] = flag;
				}
			}
		}

		private static bool CheckGlobalKey(string globalKey)
		{
			return globalKeyStates.ContainsKey(globalKey) && globalKeyStates[globalKey];
		}

		public static bool IsBossDefeated(string boss)
		{
			if (bossToGlobalKey.TryGetValue(boss, out var value))
			{
				return CheckGlobalKey(value);
			}
			MarsarahTweaks.LogWarn("[Warning] IsBossDefeated called with unknown boss: " + boss);
			return false;
		}
	}
}
namespace MarsarahTweaks.Patches.UI
{
	internal class UIAshlandsHeatLevel : UIController
	{
		[HarmonyPatch(typeof(Character), "UpdateLava")]
		public class GetHeatLevel_Patch
		{
			private static void Postfix(Character __instance, ref float ___m_lavaHeatLevel)
			{
				if ((!((Object)(object)ZNet.instance != (Object)null) || !ZNet.instance.IsDedicated()) && ConfigManager.ShowHeatLevelInAshlands.Value && UIController.showUI && __instance is Player)
				{
					heatThreshold = __instance.m_heatLevelFirstDamageThreshold;
					currentHeat = ___m_lavaHeatLevel;
				}
			}
		}

		[HarmonyPatch(typeof(Hud), "Update")]
		private static class HeatLevelHUDUpdate_Patch
		{
			private static Image heatBarFill;

			private static Image heatBarBGImage;

			private static GameObject UIHeatBarArea;

			private static Text heatBarText;

			private static TextMeshProUGUI heatBarEmojiTMP;

			private static void Postfix(Hud __instance)
			{
				//IL_0126: Unknown result type (might be due to invalid IL or missing references)
				//IL_012b: 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_0148: Unknown result type (might be due to invalid IL or missing references)
				//IL_016c: 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_0178: Unknown result type (might be due to invalid IL or missing references)
				//IL_0153: Unknown result type (might be due to invalid IL or missing references)
				//IL_0155: Unknown result type (might be due to invalid IL or missing references)
				//IL_0165: Unknown result type (might be due to invalid IL or missing references)
				//IL_017d: Unknown result type (might be due to invalid IL or missing references)
				//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
				if (((Object)(object)ZNet.instance != (Object)null && ZNet.instance.IsDedicated()) || (Object)(object)__instance == (Object)null)
				{
					return;
				}
				if (ConfigManager.ShowHeatLevelInAshlands.Value)
				{
					CreateUI(__instance);
					if (!Object.op_Implicit((Object)(object)Player.m_localPlayer) || !((Object)(object)heatBarFill != (Object)null) || !(heatThreshold > 0f))
					{
						return;
					}
					bool flag = !IsUIHidden() && !IsLoadScreenActive(__instance);
					if (UIHeatBarArea.activeSelf != flag)
					{
						UIHeatBarArea.SetActive(flag);
					}
					heatBarFill.fillAmount = Mathf.Clamp01(currentHeat / heatThreshold);
					if ((Object)(object)heatBarText != (Object)null)
					{
						float num = Mathf.Clamp01(currentHeat / heatThreshold) * 100f;
						heatBarText.text = $"{num:0}%";
					}
					float fillAmount = heatBarFill.fillAmount;
					Color yellow = Color.yellow;
					Color val = default(Color);
					((Color)(ref val))..ctor(1f, 0.549019f, 0f);
					Color red = Color.red;
					Color color = ((fillAmount < 0.5f) ? Color.Lerp(yellow, val, fillAmount * 2f) : Color.Lerp(val, red, (fillAmount - 0.5f) * 2f));
					if (fillAmount > 0.8f)
					{
						float a = 0.6f + 0.4f * Mathf.Sin(Time.time * 4f);
						color.a = a;
					}
					else
					{
						color.a = 0.8f;
					}
					((Graphic)heatBarFill).color = color;
					if (heatBarFill.fillAmount == 0f)
					{
						if ((Object)(object)heatBarFill != (Object)null)
						{
							((Behaviour)heatBarFill).enabled = false;
						}
						if ((Object)(object)heatBarBGImage != (Object)null)
						{
							((Behaviour)heatBarBGImage).enabled = false;
						}
						if ((Object)(object)heatBarText != (Object)null)
						{
							((Behaviour)heatBarText).enabled = false;
						}
						if ((Object)(object)heatBarEmojiTMP != (Object)null)
						{
							((Behaviour)heatBarEmojiTMP).enabled = false;
							((TMP_Text)heatBarEmojiTMP).text = "";
						}
					}
					else
					{
						if ((Object)(object)heatBarFill != (Object)null)
						{
							((Behaviour)heatBarFill).enabled = UIController.showUI;
						}
						if ((Object)(object)heatBarBGImage != (Object)null)
						{
							((Behaviour)heatBarBGImage).enabled = UIController.showUI;
						}
						if ((Object)(object)heatBarText != (Object)null)
						{
							((Behaviour)heatBarText).enabled = UIController.showUI;
						}
						if ((Object)(object)heatBarEmojiTMP != (Object)null)
						{
							((Behaviour)heatBarEmojiTMP).enabled = UIController.showUI;
							((TMP_Text)heatBarEmojiTMP).text = "\ud83d\udd25";
						}
					}
				}
				else
				{
					if ((Object)(object)heatBarFill != (Object)null)
					{
						((Behaviour)heatBarFill).enabled = false;
					}
					if ((Object)(object)heatBarBGImage != (Object)null)
					{
						((Behaviour)heatBarBGImage).enabled = false;
					}
					if ((Object)(object)heatBarText != (Object)null)
					{
						((Behaviour)heatBarText).enabled = false;
					}
					if ((Object)(object)heatBarEmojiTMP != (Object)null)
					{
						((Behaviour)heatBarEmojiTMP).enabled = false;
					}
				}
			}

			private static void CreateUI(Hud hud)
			{
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_004a: Expected O, but got Unknown
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0102: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Expected O, but got Unknown
				//IL_0138: Unknown result type (might be due to invalid IL or missing references)
				//IL_0145: Unknown result type (might be due to invalid IL or missing references)
				//IL_0152: Unknown result type (might be due to invalid IL or missing references)
				//IL_015f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0183: Unknown result type (might be due to invalid IL or missing references)
				//IL_019f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a6: Expected O, but got Unknown
				//IL_01d5: 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)
				//IL_01f9: 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_029d: Unknown result type (might be due to invalid IL or missing references)
				//IL_02af: 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_02c9: 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_02e5: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)UIHeatBarArea != (Object)null))
				{
					Vector2 sizeDelta = default(Vector2);
					((Vector2)(ref sizeDelta))..ctor(200f, 25f);
					int fontSize = 13;
					int fontSize2 = 10;
					string fontName = "AveriaSansLibre-Bold";
					string fontName2 = "NotoEmoji-Regular";
					UIHeatBarArea = new GameObject("HeatBar");
					UIHeatBarArea.layer = 5;
					UIHeatBarArea.transform.SetParent(hud.m_rootObject.transform.parent, false);
					RectTransform val = UIHeatBarArea.AddComponent<RectTransform>();
					val.anchorMin = new Vector2(0.5f, 0.5f);
					val.anchorMax = new Vector2(0.5f, 0.5f);
					val.pivot = new Vector2(0.5f, 0.5f);
					val.anchoredPosition = new Vector2(0f, 350f);
					val.sizeDelta = sizeDelta;
					UIHeatBarArea.transform.localScale = Vector3.one;
					GameObject val2 = new GameObject("HeatBarBackground");
					val2.transform.SetParent(UIHeatBarArea.transform, false);
					heatBarBGImage = val2.AddComponent<Image>();
					RectTransform component = val2.GetComponent<RectTransform>();
					component.anchorMin = Vector2.zero;
					component.anchorMax = Vector2.one;
					component.offsetMin = Vector2.zero;
					component.offsetMax = Vector2.zero;
					((Graphic)heatBarBGImage).color = new Color(0f, 0f, 0f, 0.4f);
					((Behaviour)heatBarBGImage).enabled = false;
					GameObject val3 = new GameObject("HeatBarFill");
					val3.transform.SetParent(UIHeatBarArea.transform, false);
					heatBarFill = val3.AddComponent<Image>();
					RectTransform component2 = val3.GetComponent<RectTransform>();
					component2.anchorMin = Vector2.zero;
					component2.anchorMax = Vector2.one;
					component2.offsetMin = new Vector2(3f, 3f);
					component2.offsetMax = new Vector2(-3f, -3f);
					Sprite sprite = ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).FirstOrDefault((Func<Sprite, bool>)((Sprite s) => ((Object)s).name == "bar_monster_hp_5"));
					heatBarFill.sprite = sprite;
					heatBarFill.type = (Type)3;
					heatBarFill.fillMethod = (FillMethod)0;
					heatBarFill.fillOrigin = 0;
					heatBarFill.fillAmount = 0f;
					((Behaviour)heatBarFill).enabled = false;
					heatBarText = UIController.CreateTextObject("HeatText", UIHeatBarArea, Color.white, fontName, fontSize, (TextAnchor)4, new Vector2(0f, 0f), sizeDelta);
					heatBarEmojiTMP = UIController.CreateTMPTextObject("HeatEmojiTMP", UIHeatBarArea, Color.red, fontName2, fontSize2, (TextAlignmentOptions)4100, new Vector2(-2f, 0f), sizeDelta);
				}
			}

			private static Sprite GenerateWhiteSprite()
			{
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_0009: Expected O, but got Unknown
				//IL_000c: 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_0042: Unknown result type (might be due to invalid IL or missing references)
				Texture2D val = new Texture2D(1, 1);
				val.SetPixel(0, 0, Color.white);
				val.Apply();
				return Sprite.Create(val, new Rect(0f, 0f, 1f, 1f), new Vector2(0.5f, 0.5f));
			}

			private static bool IsLoadScreenActive(Hud hud)
			{
				return Object.op_Implicit((Object)(object)Hud.instance) && Object.op_Implicit((Object)(object)hud.m_loadingScreen) && ((Component)hud.m_loadingScreen).gameObject.activeSelf;
			}

			private static bool IsUIHidden()
			{
				return Hud.IsUserHidden();
			}
		}

		private static float heatThreshold;

		private static float currentHeat;
	}
	internal class UIBoatSpeed : UIController
	{
		[HarmonyPatch(typeof(Ship), "GetSpeed")]
		private class ShowBoatSpeed_Patch
		{
			private static void Prefix(Ship __instance, ref Rigidbody ___m_body)
			{
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				if ((!((Object)(object)ZNet.instance != (Object)null) || !ZNet.instance.IsDedicated()) && ConfigManager.ShowBoatSpeed.Value)
				{
					if (Object.op_Implicit((Object)(object)__instance) && __instance.HasPlayerOnboard())
					{
						boatSpeed = Vector3.Dot(___m_body.velocity, ((Component)__instance).transform.forward);
					}
					if (Traverse.Create((object)__instance).Method("HaveControllingPlayer", Array.Empty<object>()).GetValue<bool>())
					{
						showBoatSpeedUI = true;
					}
					else
					{
						showBoatSpeedUI = false;
					}
				}
			}
		}

		[HarmonyPatch(typeof(Hud), "Update")]
		private static class BoatSpeedHUDUpdate_Patch
		{
			private static void Postfix(Hud __instance)
			{
				//IL_017a: 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)
				if (((Object)(object)ZNet.instance != (Object)null && ZNet.instance.IsDedicated()) || (Object)(object)__instance == (Object)null)
				{
					return;
				}
				if (ConfigManager.ShowBoatSpeed.Value)
				{
					CreateTextBasedUI(__instance);
					CreateSymbolBasedUI(__instance);
					if (!ConfigManager.UseSymbolsForUI.Value)
					{
						GameObject uIBoatArea = UIBoatArea;
						if (uIBoatArea != null)
						{
							uIBoatArea.SetActive(showBoatSpeedUI && UIController.showUI);
						}
						GameObject uIBoatArea2 = UIBoatArea2;
						if (uIBoatArea2 != null)
						{
							uIBoatArea2.SetActive(false);
						}
						if (showBoatSpeedUI && UIController.showUI)
						{
							((Graphic)UIBoatText).color = GetColorFromSpeed(boatSpeed);
							UIBoatText.text = ((boatSpeed > 0f) ? boatSpeed.ToString("0.00") : ("R " + Math.Abs(boatSpeed).ToString("0.00")));
							UIBoatTextTitle.text = "Boat speed";
						}
					}
					else
					{
						GameObject uIBoatArea3 = UIBoatArea;
						if (uIBoatArea3 != null)
						{
							uIBoatArea3.SetActive(false);
						}
						GameObject uIBoatArea4 = UIBoatArea2;
						if (uIBoatArea4 != null)
						{
							uIBoatArea4.SetActive(showBoatSpeedUI && UIController.showUI);
						}
						if (showBoatSpeedUI && UIController.showUI)
						{
							((Graphic)UIBoatText2).color = GetColorFromSpeed(boatSpeed);
							UIBoatText2.text = ((boatSpeed > 0f) ? boatSpeed.ToString("0.00") : ("R " + Math.Abs(boatSpeed).ToString("0.00")));
							((TMP_Text)UIBoatEmojiTMP).text = "⛵";
						}
					}
				}
				else
				{
					CreateTextBasedUI(__instance);
					CreateSymbolBasedUI(__instance);
					GameObject uIBoatArea5 = UIBoatArea;
					if (uIBoatArea5 != null)
					{
						uIBoatArea5.SetActive(false);
					}
					GameObject uIBoatArea6 = UIBoatArea2;
					if (uIBoatArea6 != null)
					{
						uIBoatArea6.SetActive(false);
					}
				}
			}

			private static void CreateTextBasedUI(Hud hud)
			{
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_007b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0085: Expected O, but got Unknown
				//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00db: Unknown result type (might be due to invalid IL or missing references)
				//IL_0130: 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_014e: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a6: 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)
				//IL_01e0: 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_01fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_020c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0211: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)UIBoatArea != (Object)null) || !((Object)(object)UIBoatText != (Object)null) || !((Object)(object)UIBoatTextTitle != (Object)null))
				{
					int fontSize = 16;
					string fontName = "AveriaSansLibre-Bold";
					Vector2 val = default(Vector2);
					((Vector2)(ref val))..ctor(155f, 30f);
					Vector2 sizeDelta = default(Vector2);
					if (!ConfigManager.UseSymbolsForUI.Value)
					{
						sizeDelta = val;
					}
					else
					{
						((Vector2)(ref sizeDelta))..ctor(155f, 30f);
					}
					UIBoatArea = new GameObject("BoatArea");
					UIBoatArea.layer = 5;
					UIBoatArea.transform.SetParent(((Component)hud.m_healthPanel).transform);
					RectTransform val2 = UIBoatArea.AddComponent<RectTransform>();
					val2.anchorMin = new Vector2(1f, 1f);
					val2.anchorMax = new Vector2(1f, 1f);
					val2.anchoredPosition = new Vector2((ConfigManager.ShowInventoryWeightAndSlots.Value && ConfigManager.ShowEnemyDetector.Value) ? 203f : ((ConfigManager.ShowInventoryWeightAndSlots.Value || ConfigManager.ShowEnemyDetector.Value) ? 100f : (-40f)), -230f);
					val2.sizeDelta = sizeDelta;
					UIBoatArea.transform.localScale = Vector3.one;
					Sprite sprite = ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).FirstOrDefault((Func<Sprite, bool>)((Sprite tempSprite) => ((Object)tempSprite).name == "InputFieldBackground"));
					Image val3 = UIBoatArea.AddComponent<Image>();
					((Graphic)val3).color = new Color(0f, 0f, 0f, 0.4f);
					val3.sprite = sprite;
					val3.type = (Type)1;
					UIBoatTextTitle = UIController.CreateTextObject("BoatTextTitle", UIBoatArea, Color.white, fontName, fontSize, (TextAnchor)4, new Vector2(-25f, 0f), val);
					UIBoatText = UIController.CreateTextObject("BoatText", UIBoatArea, Color.white, fontName, fontSize, (TextAnchor)4, new Vector2(45f, 0f), sizeDelta);
				}
			}

			private static void CreateSymbolBasedUI(Hud hud)
			{
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: Expected O, but got Unknown
				//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0108: Unknown result type (might be due to invalid IL or missing references)
				//IL_0119: 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_0137: Unknown result type (might be due to invalid IL or missing references)
				//IL_018f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0200: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)UIBoatArea2 != (Object)null) || !((Object)(object)UIBoatText2 != (Object)null) || !((Object)(object)UIBoatEmojiTMP != (Object)null))
				{
					int num = 16;
					string fontName = "AveriaSansLibre-Bold";
					string fontName2 = "NotoEmoji-Regular";
					Vector2 sizeDelta = default(Vector2);
					((Vector2)(ref sizeDelta))..ctor(80f, 30f);
					float num2 = -283f;
					float num3 = -225f;
					if (AppDomain.CurrentDomain.GetAssemblies().Any((Assembly a) => a.GetName().Name == "MinimalStatusEffects"))
					{
						num3 = -55f;
					}
					UIBoatArea2 = new GameObject("BoatArea2");
					UIBoatArea2.layer = 5;
					UIBoatArea2.transform.SetParent(hud.m_rootObject.transform);
					RectTransform val = UIBoatArea2.AddComponent<RectTransform>();
					val.anchorMin = new Vector2(1f, 1f);
					val.anchorMax = new Vector2(1f, 1f);
					val.anchoredPosition = new Vector2(num2, num3);
					val.sizeDelta = sizeDelta;
					UIBoatArea2.transform.localScale = Vector3.one;
					Sprite sprite = ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).FirstOrDefault((Func<Sprite, bool>)((Sprite tempSprite) => ((Object)tempSprite).name == "InputFieldBackground"));
					Image val2 = UIBoatArea2.AddComponent<Image>();
					((Graphic)val2).color = new Color(0f, 0f, 0f, 0.4f);
					val2.sprite = sprite;
					val2.type = (Type)1;
					UIBoatText2 = UIController.CreateTextObject("BoatText2", UIBoatArea2, Color.white, fontName, num, (TextAnchor)5, new Vector2(-4f, 0f), sizeDelta);
					UIBoatEmojiTMP = UIController.CreateTMPTextObject("BoatEmojiTMP", UIBoatArea2, Color.white, fontName2, num + 4, (TextAlignmentOptions)4097, new Vector2(4f, 0f), sizeDelta);
				}
			}

			private static Color GetColorFromSpeed(float speed)
			{
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_0054: Unknown result type (might be due to invalid IL or missing references)
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: 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_0049: Unknown result type (might be due to invalid IL or missing references)
				if (speed < 2.5f)
				{
					return Color.red;
				}
				if (speed < 5f)
				{
					return new Color(1f, 0.549019f, 0f);
				}
				if (speed < 7.5f)
				{
					return Color.yellow;
				}
				return Color.green;
			}
		}

		private static float boatSpeed;

		private static bool showBoatSpeedUI;

		internal static GameObject UIBoatArea;

		private static Text UIBoatText;

		private static Text UIBoatTextTitle;

		internal static GameObject UIBoatArea2;

		private static Text UIBoatText2;

		private static TextMeshProUGUI UIBoatEmojiTMP;
	}
	internal class UIBossPowerExpiration
	{
		[HarmonyPatch(typeof(StatusEffect), "Stop")]
		public class StatusEffectStopPatch
		{
			public static void Postfix(StatusEffect __instance)
			{
				if (!ConfigManager.ShowBossExpirationMessage.Value)
				{
					return;
				}
				Character character = __instance.m_character;
				if (!((Object)(object)character == (Object)null) && character.IsPlayer() && character.IsOwner())
				{
					string name = ((Object)__instance).name;
					if (name.Contains("GP_"))
					{
						string text = Localization.instance.Localize(__instance.m_name);
						character.Message((MessageType)2, text + " Power Expired", 0, (Sprite)null);
					}
				}
			}
		}
	}
	internal class UIController
	{
		public static bool showUI = true;

		public static bool showPlayerList = true;

		public static void UpdateUIDisplay()
		{
			if (Input.GetKeyDown((KeyCode)277))
			{
				showUI = !showUI;
			}
			if (Input.GetKeyDown((KeyCode)278))
			{
				showPlayerList = !showPlayerList;
			}
		}

		public static Text CreateTextObject(string name, GameObject parent, Color textColor, string fontName, int fontSize, TextAnchor alignment, Vector2 position, Vector2 sizeDelta)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(name);
			val.layer = 5;
			val.transform.SetParent(parent.transform);
			RectTransform val2 = val.AddComponent<RectTransform>();
			val2.anchoredPosition = position;
			val2.sizeDelta = sizeDelta;
			((Transform)val2).localScale = Vector3.one;
			Text val3 = val.AddComponent<Text>();
			((Graphic)val3).color = textColor;
			val3.font = ((IEnumerable<Font>)Resources.FindObjectsOfTypeAll<Font>()).FirstOrDefault((Func<Font, bool>)((Font f) => ((Object)f).name == fontName));
			val3.fontSize = fontSize;
			val3.alignment = alignment;
			Outline val4 = val.AddComponent<Outline>();
			((Shadow)val4).effectColor = Color.black;
			((Shadow)val4).effectDistance = new Vector2(1f, -1f);
			((Shadow)val4).useGraphicAlpha = true;
			((MonoBehaviour)val4).useGUILayout = true;
			return val3;
		}

		public static TextMeshProUGUI CreateTMPTextObject(string name, GameObject parent, Color textColor, string fontName, int fontSize, TextAlignmentOptions alignment, Vector2 position, Vector2 sizeDelta)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			//IL_0038: 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)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_00d5: Expected O, but got Unknown
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(name);
			val.layer = 5;
			val.transform.SetParent(parent.transform, false);
			RectTransform val2 = val.AddComponent<RectTransform>();
			val2.anchoredPosition = position;
			val2.sizeDelta = sizeDelta;
			((Transform)val2).localScale = Vector3.one;
			TextMeshProUGUI val3 = val.AddComponent<TextMeshProUGUI>();
			((Graphic)val3).color = textColor;
			((TMP_Text)val3).font = ((IEnumerable<TMP_FontAsset>)Resources.FindObjectsOfTypeAll<TMP_FontAsset>()).FirstOrDefault((Func<TMP_FontAsset, bool>)((TMP_FontAsset f) => ((Object)f).name == fontName));
			((TMP_Text)val3).fontSize = fontSize;
			((TMP_Text)val3).alignment = alignment;
			((TMP_Text)val3).text = "";
			if ((Object)(object)((TMP_Text)val3).font != (Object)null && (Object)(object)((TMP_Text)val3).fontMaterial != (Object)null)
			{
				((TMP_Text)val3).fontMaterial = new Material(((TMP_Text)val3).fontMaterial);
				if (((TMP_Text)val3).fontMaterial.HasProperty(ShaderUtilities.ID_OutlineWidth) && ((TMP_Text)val3).fontMaterial.HasProperty(ShaderUtilities.ID_OutlineColor))
				{
					((TMP_Text)val3).fontMaterial.SetFloat(ShaderUtilities.ID_OutlineWidth, 0.125f);
					((TMP_Text)val3).fontMaterial.SetColor(ShaderUtilities.ID_OutlineColor, Color.black);
				}
			}
			return val3;
		}

		public static void UpdateUIPositions()
		{
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
			if (!ConfigManager.UseSymbolsForUI.Value)
			{
				float num = -45f;
				float num2 = -230f;
				bool flag = (Object)(object)UIInventoryWeightAndSlots.UIInventoryArea != (Object)null && ConfigManager.ShowInventoryWeightAndSlots.Value;
				bool flag2 = (Object)(object)UIEnemyDetector.UIEnemyArea != (Object)null && ConfigManager.ShowEnemyDetector.Value;
				bool flag3 = (Object)(object)UIBoatSpeed.UIBoatArea != (Object)null && ConfigManager.ShowBoatSpeed.Value;
				if (flag)
				{
					num += 115f;
					if (!flag2 && flag3)
					{
						num += 30f;
					}
				}
				if (flag2)
				{
					UIEnemyDetector.UIEnemyArea.GetComponent<RectTransform>().anchoredPosition = new Vector2(num, num2);
					num += 133f;
				}
				if (flag3)
				{
					UIBoatSpeed.UIBoatArea.GetComponent<RectTransform>().anchoredPosition = new Vector2(num, num2);
				}
			}
			else
			{
				float num3 = -10f;
				float num4 = -230f;
				bool flag4 = (Object)(object)UIInventoryWeightAndSlots.UIWeightBarArea != (Object)null && (Object)(object)UIInventoryWeightAndSlots.UISlotsArea != (Object)null && ConfigManager.ShowInventoryWeightAndSlots.Value;
				bool flag5 = (Object)(object)UIEnemyDetector.UIEnemyArea2 != (Object)null && (Object)(object)UIEnemyDetector.UIFriendlyArea != (Object)null && ConfigManager.ShowEnemyDetector.Value;
				if (flag4)
				{
					num3 += 132f;
				}
				else if (flag5)
				{
					num3 -= 55f;
				}
				if (flag5)
				{
					UIEnemyDetector.UIEnemyArea2.GetComponent<RectTransform>().anchoredPosition = new Vector2(num3, num4);
					UIEnemyDetector.UIFriendlyArea.GetComponent<RectTransform>().anchoredPosition = new Vector2(num3 + 54f, num4);
				}
			}
		}
	}
	internal class UIEnemyDetector : UIController
	{
		[HarmonyPatch(typeof(Player), "Update")]
		private class EnemyDetector_PlayerPatch
		{
			private static void Prefix(ref Player ___m_localPlayer)
			{
				//IL_005a: 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_008e: Invalid comparison between Unknown and I4
				if (((Object)(object)ZNet.instance != (Object)null && ZNet.instance.IsDedicated()) || (Object)(object)___m_localPlayer == (Object)null || !ConfigManager.ShowEnemyDetector.Value)
				{
					return;
				}
				int num = 0;
				int num2 = 0;
				List<Character> list = new List<Character>();
				Character.GetCharactersInRange(((Component)___m_localPlayer).transform.position, 30f, list);
				foreach (Character item in list)
				{
					if ((int)item.GetFaction() == 10 && (Object)(object)item.GetBaseAI() != (Object)null && !item.GetBaseAI().IsAggravated())
					{
						num2++;
					}
					if (item.m_name.ToString() == "Human" || item.m_name.ToString() == "$enemy_deer" || item.m_name.ToString() == "$enemy_hare" || item.m_name.ToString() == "$enemy_summonedroot" || item.IsTamed())
					{
						num++;
					}
				}
				numEnemies = list.Count - num - num2;
				numEnemiesPassive = num2;
			}
		}

		[HarmonyPatch(typeof(Hud), "Update")]
		private class EnemyDetector_HUDUpdatePatch
		{
			private static bool lastUseSymbolInsteadOfWords = ConfigManager.UseSymbolsForUI.Value;

			private static void Postfix(Hud __instance)
			{
				//IL_01a5: 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_01b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_0210: Unknown result type (might be due to invalid IL or missing references)
				//IL_0215: Unknown result type (might be due to invalid IL or missing references)
				//IL_021c: Unknown result type (might be due to invalid IL or missing references)
				//IL_023e: Unknown result type (might be due to invalid IL or missing references)
				if (((Object)(object)ZNet.instance != (Object)null && ZNet.instance.IsDedicated()) || (Object)(object)__instance == (Object)null)
				{
					return;
				}
				if (ConfigManager.ShowEnemyDetector.Value)
				{
					CreateTextBasedUI(__instance);
					CreateSymbolBasedUI(__instance);
					if (!ConfigManager.UseSymbolsForUI.Value)
					{
						GameObject uIEnemyArea = UIEnemyArea;
						if (uIEnemyArea != null)
						{
							uIEnemyArea.SetActive(UIController.showUI);
						}
						GameObject uIEnemyArea2 = UIEnemyArea2;
						if (uIEnemyArea2 != null)
						{
							uIEnemyArea2.SetActive(false);
						}
						GameObject uIFriendlyArea = UIFriendlyArea;
						if (uIFriendlyArea != null)
						{
							uIFriendlyArea.SetActive(false);
						}
						if (UIController.showUI)
						{
							((Graphic)UIEnemyText).color = GetColorFromNum(numEnemies);
							if (numEnemiesPassive > 0)
							{
								UIEnemyText.text = "Enemies " + numEnemies + " (" + numEnemiesPassive + ")";
							}
							else
							{
								UIEnemyText.text = "Enemies " + numEnemies;
							}
						}
						return;
					}
					GameObject uIEnemyArea3 = UIEnemyArea;
					if (uIEnemyArea3 != null)
					{
						uIEnemyArea3.SetActive(false);
					}
					GameObject uIEnemyArea4 = UIEnemyArea2;
					if (uIEnemyArea4 != null)
					{
						uIEnemyArea4.SetActive(UIController.showUI);
					}
					GameObject uIFriendlyArea2 = UIFriendlyArea;
					if (uIFriendlyArea2 != null)
					{
						uIFriendlyArea2.SetActive(UIController.showUI && numEnemiesPassive != 0);
					}
					if (UIController.showUI)
					{
						Color colorFromNum = GetColorFromNum(numEnemies);
						((Graphic)UIEnemyText2).color = colorFromNum;
						UIEnemyText2.text = numEnemies.ToString();
						((Graphic)UIEnemyEmojiTMP).color = colorFromNum;
						if (numEnemies < 7)
						{
							((TMP_Text)UIEnemyEmojiTMP).text = "\ud83d\ude08";
						}
						else
						{
							((TMP_Text)UIEnemyEmojiTMP).text = "\ud83d\udc7b";
						}
						Color colorFromNum2 = GetColorFromNum(numEnemiesPassive);
						((Graphic)UIFriendlyText).color = colorFromNum2;
						UIFriendlyText.text = numEnemiesPassive.ToString();
						((Graphic)UIFriendlyEmojiTMP).color = colorFromNum2;
						((TMP_Text)UIFriendlyEmojiTMP).text = "\ud83e\uddd4\u200d";
					}
				}
				else
				{
					CreateTextBasedUI(__instance);
					CreateSymbolBasedUI(__instance);
					GameObject uIEnemyArea5 = UIEnemyArea;
					if (uIEnemyArea5 != null)
					{
						uIEnemyArea5.SetActive(false);
					}
					GameObject uIEnemyArea6 = UIEnemyArea2;
					if (uIEnemyArea6 != null)
					{
						uIEnemyArea6.SetActive(false);
					}
					GameObject uIFriendlyArea3 = UIFriendlyArea;
					if (uIFriendlyArea3 != null)
					{
						uIFriendlyArea3.SetActive(false);
					}
				}
			}

			private static void CreateTextBasedUI(Hud hud)
			{
				//IL_0046: Unknown result type (might be due to invalid IL or missing references)
				//IL_0050: Expected O, but got Unknown
				//IL_008d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0141: Unknown result type (might be due to invalid IL or missing references)
				//IL_0169: Unknown result type (might be due to invalid IL or missing references)
				//IL_017b: 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)
				if (!((Object)(object)UIEnemyArea != (Object)null) || !((Object)(object)UIEnemyText != (Object)null))
				{
					int fontSize = 16;
					string fontName = "AveriaSansLibre-Bold";
					Vector2 sizeDelta = default(Vector2);
					((Vector2)(ref sizeDelta))..ctor(100f, 30f);
					UIEnemyArea = new GameObject("EnemyArea");
					UIEnemyArea.layer = 5;
					UIEnemyArea.transform.SetParent(((Component)hud.m_healthPanel).transform);
					RectTransform val = UIEnemyArea.AddComponent<RectTransform>();
					val.anchorMin = new Vector2(1f, 1f);
					val.anchorMax = new Vector2(1f, 1f);
					val.anchoredPosition = new Vector2(ConfigManager.ShowInventoryWeightAndSlots.Value ? 70f : (-40f), -230f);
					val.sizeDelta = sizeDelta;
					UIEnemyArea.transform.localScale = Vector3.one;
					Sprite sprite = ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).FirstOrDefault((Func<Sprite, bool>)((Sprite tempSprite) => ((Object)tempSprite).name == "InputFieldBackground"));
					Image val2 = UIEnemyArea.AddComponent<Image>();
					((Graphic)val2).color = new Color(0f, 0f, 0f, 0.4f);
					val2.sprite = sprite;
					val2.type = (Type)1;
					UIEnemyText = UIController.CreateTextObject("EnemyText", UIEnemyArea, Color.white, fontName, fontSize, (TextAnchor)4, new Vector2(0f, 0f), sizeDelta);
				}
			}

			private static void CreateSymbolBasedUI(Hud hud)
			{
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Expected O, but got Unknown
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d3: 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_00f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0101: 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_0181: 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_0198: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ad: 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_01da: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e4: Expected O, but got Unknown
				//IL_022b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0242: Unknown result type (might be due to invalid IL or missing references)
				//IL_0252: Unknown result type (might be due to invalid IL or missing references)
				//IL_025f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0270: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0302: Unknown result type (might be due to invalid IL or missing references)
				//IL_0307: Unknown result type (might be due to invalid IL or missing references)
				//IL_031c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0334: Unknown result type (might be due to invalid IL or missing references)
				//IL_0339: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)UIEnemyArea2 != (Object)null) || !((Object)(object)UIEnemyText2 != (Object)null) || !((Object)(object)UIEnemyEmojiTMP != (Object)null))
				{
					int num = 16;
					string fontName = "AveriaSansLibre-Bold";
					Vector2 sizeDelta = default(Vector2);
					((Vector2)(ref sizeDelta))..ctor(50f, 30f);
					float num2 = (ConfigManager.ShowInventoryWeightAndSlots.Value ? 122f : (-65f));
					float num3 = -230f;
					UIEnemyArea2 = new GameObject("EnemyArea2");
					UIEnemyArea2.layer = 5;
					UIEnemyArea2.transform.SetParent(((Component)hud.m_healthPanel).transform);
					RectTransform val = UIEnemyArea2.AddComponent<RectTransform>();
					val.anchorMin = new Vector2(1f, 1f);
					val.anchorMax = new Vector2(1f, 1f);
					val.anchoredPosition = new Vector2(num2, num3);
					val.sizeDelta = sizeDelta;
					UIEnemyArea2.transform.localScale = Vector3.one;
					Sprite sprite = ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).FirstOrDefault((Func<Sprite, bool>)((Sprite tempSprite) => ((Object)tempSprite).name == "InputFieldBackground"));
					Image val2 = UIEnemyArea2.AddComponent<Image>();
					((Graphic)val2).color = new Color(0f, 0f, 0f, 0.4f);
					val2.sprite = sprite;
					val2.type = (Type)1;
					UIEnemyText2 = UIController.CreateTextObject("EnemyText2", UIEnemyArea2, Color.white, fontName, num, (TextAnchor)5, new Vector2(-4f, 0f), sizeDelta);
					UIEnemyEmojiTMP = UIController.CreateTMPTextObject("EnemyEmojiTMP", UIEnemyArea2, Color.green, fontName, num + 4, (TextAlignmentOptions)4097, new Vector2(4f, 0f), sizeDelta);
					UIFriendlyArea = new GameObject("FriendlyArea");
					UIFriendlyArea.layer = 5;
					UIFriendlyArea.transform.SetParent(((Component)hud.m_healthPanel).transform);
					num2 += 54f;
					RectTransform val3 = UIFriendlyArea.AddComponent<RectTransform>();
					val3.anchorMin = new Vector2(1f, 1f);
					val3.anchorMax = new Vector2(1f, 1f);
					val3.anchoredPosition = new Vector2(num2, num3);
					val3.sizeDelta = sizeDelta;
					UIFriendlyArea.transform.localScale = Vector3.one;
					Sprite val4 = ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).FirstOrDefault((Func<Sprite, bool>)((Sprite tempSprite) => ((Object)tempSprite).name == "InputFieldBackground"));
					Image val5 = UIFriendlyArea.AddComponent<Image>();
					((Graphic)val5).color = new Color(0f, 0f, 0f, 0.4f);
					val5.sprite = sprite;
					val5.type = (Type)1;
					UIFriendlyText = UIController.CreateTextObject("FriendlyText", UIFriendlyArea, Color.white, fontName, num, (TextAnchor)5, new Vector2(-4f, 0f), sizeDelta);
					UIFriendlyEmojiTMP = UIController.CreateTMPTextObject("FriendlyEmojiTMP", UIFriendlyArea, Color.green, fontName, num + 4, (TextAlignmentOptions)4097, new Vector2(4f, 0f), sizeDelta);
				}
			}

			private static Color GetColorFromNum(int num)
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: 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)
				if (num < 3)
				{
					return Color.green;
				}
				if (num < 5)
				{
					return Color.yellow;
				}
				if (num < 7)
				{
					return new Color(1f, 0.549019f, 0f);
				}
				return Color.red;
			}
		}

		public static int numEnemies;

		public static int numEnemiesPassive;

		internal static GameObject UIEnemyArea;

		private static Text UIEnemyText;

		internal static GameObject UIEnemyArea2;

		private static Text UIEnemyText2;

		private static TextMeshProUGUI UIEnemyEmojiTMP;

		internal static GameObject UIFriendlyArea;

		private static Text UIFriendlyText;

		private static TextMeshProUGUI UIFriendlyEmojiTMP;
	}
	internal class UIInventoryWeightAndSlots : UIController
	{
		[HarmonyPatch(typeof(Player), "Update")]
		private class InventoryWeightAndSlots_PlayerPatch
		{
			private static void Prefix(ref Player ___m_localPlayer)
			{
				if ((!((Object)(object)ZNet.instance != (Object)null) || !ZNet.instance.IsDedicated()) && !((Object)(object)___m_localPlayer == (Object)null) && ConfigManager.ShowInventoryWeightAndSlots.Value)
				{
					currentWeight = ((Humanoid)___m_localPlayer).GetInventory().GetTotalWeight();
					maxWeight = ___m_localPlayer.GetMaxCarryWeight();
					freeSlots = ((Humanoid)___m_localPlayer).GetInventory().GetEmptySlots();
					freeSlotsPercent = ((Humanoid)___m_localPlayer).GetInventory().SlotsUsedPercentage();
				}
			}
		}

		[HarmonyPatch(typeof(Hud), "Update")]
		private class InventoryWeightAndSlots_HUDUpdatePatch
		{
			private static void Postfix(Hud __instance)
			{
				//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
				//IL_00db: Unknown result type (might be due to invalid IL or missing references)
				//IL_0130: Unknown result type (might be due to invalid IL or missing references)
				//IL_0282: Unknown result type (might be due to invalid IL or missing references)
				//IL_0287: Unknown result type (might be due to invalid IL or missing references)
				//IL_0274: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
				if (((Object)(object)ZNet.instance != (Object)null && ZNet.instance.IsDedicated()) || (Object)(object)__instance == (Object)null)
				{
					return;
				}
				if (ConfigManager.ShowInventoryWeightAndSlots.Value)
				{
					CreateTextBasedUI(__instance);
					CreateSymbolBasedUI(__instance);
					if (!ConfigManager.UseSymbolsForUI.Value)
					{
						GameObject uIInventoryArea = UIInventoryArea;
						if (uIInventoryArea != null)
						{
							uIInventoryArea.SetActive(UIController.showUI);
						}
						GameObject uIWeightBarArea = UIWeightBarArea;
						if (uIWeightBarArea != null)
						{
							uIWeightBarArea.SetActive(false);
						}
						GameObject uIWeightBarEmojiArea = UIWeightBarEmojiArea;
						if (uIWeightBarEmojiArea != null)
						{
							uIWeightBarEmojiArea.SetActive(false);
						}
						GameObject uISlotsArea = UISlotsArea;
						if (uISlotsArea != null)
						{
							uISlotsArea.SetActive(false);
						}
						if (UIController.showUI)
						{
							float percent = currentWeight * 100f / maxWeight;
							((Graphic)UIWeightText).color = GetColorFromPercent(percent);
							UIWeightText.text = currentWeight.ToString("0.0") + "/" + maxWeight.ToString("0");
						}
						if (UIController.showUI)
						{
							((Graphic)UISlotText).color = GetColorFromPercent(freeSlotsPercent);
							UISlotText.text = "(" + freeSlots + ")";
						}
						return;
					}
					GameObject uIInventoryArea2 = UIInventoryArea;
					if (uIInventoryArea2 != null)
					{
						uIInventoryArea2.SetActive(false);
					}
					GameObject uIWeightBarArea2 = UIWeightBarArea;
					if (uIWeightBarArea2 != null)
					{
						uIWeightBarArea2.SetActive(UIController.showUI);
					}
					GameObject uIWeightBarEmojiArea2 = UIWeightBarEmojiArea;
					if (uIWeightBarEmojiArea2 != null)
					{
						uIWeightBarEmojiArea2.SetActive(UIController.showUI);
					}
					GameObject uISlotsArea2 = UISlotsArea;
					if (uISlotsArea2 != null)
					{
						uISlotsArea2.SetActive(UIController.showUI);
					}
					if (UIController.showUI)
					{
						weightBarFill.fillAmount = Mathf.Clamp01(currentWeight / maxWeight);
						float fillAmount = weightBarFill.fillAmount;
						Color colorBlendFromPercent = GetColorBlendFromPercent(fillAmount);
						((Graphic)weightBarFill).color = colorBlendFromPercent;
						if ((Object)(object)UIWeightBarText != (Object)null)
						{
							UIWeightBarText.text = currentWeight.ToString("0.0") + "/" + maxWeight.ToString("0");
						}
						if ((Object)(object)UIWeightBarEmojiTMP != (Object)null)
						{
							((TMP_Text)UIWeightBarEmojiTMP).text = "\ud83c\udfcb\ufe0f";
							((Graphic)UIWeightBarEmojiTMP).color = colorBlendFromPercent;
						}
						Color colorFromPercent = GetColorFromPercent(freeSlotsPercent);
						if ((Object)(object)UISlotsText2 != (Object)null)
						{
							((Graphic)UISlotsText2).color = colorFromPercent;
							UISlotsText2.text = freeSlots.ToString();
						}
						if ((Object)(object)UISlotsEmojiTMP != (Object)null)
						{
							((Graphic)UISlotsEmojiTMP).color = colorFromPercent;
							((TMP_Text)UISlotsEmojiTMP).text = "\ud83c\udf92";
						}
					}
				}
				else
				{
					CreateTextBasedUI(__instance);
					CreateSymbolBasedUI(__instance);
					GameObject uIInventoryArea3 = UIInventoryArea;
					if (uIInventoryArea3 != null)
					{
						uIInventoryArea3.SetActive(false);
					}
					GameObject uIWeightBarArea3 = UIWeightBarArea;
					if (uIWeightBarArea3 != null)
					{
						uIWeightBarArea3.SetActive(false);
					}
					GameObject uIWeightBarEmojiArea3 = UIWeightBarEmojiArea;
					if (uIWeightBarEmojiArea3 != null)
					{
						uIWeightBarEmojiArea3.SetActive(false);
					}
					GameObject uISlotsArea3 = UISlotsArea;
					if (uISlotsArea3 != null)
					{
						uISlotsArea3.SetActive(false);
					}
				}
			}

			private static void CreateTextBasedUI(Hud hud)
			{
				//IL_0053: Unknown result type (might be due to invalid IL or missing references)
				//IL_005d: Expected O, but got Unknown
				//IL_009a: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d2: 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_013b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0163: Unknown result type (might be due to invalid IL or missing references)
				//IL_0175: Unknown result type (might be due to invalid IL or missing references)
				//IL_017a: Unknown result type (might be due to invalid IL or missing references)
				//IL_018f: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)UIInventoryArea != (Object)null) || !((Object)(object)UIWeightText != (Object)null) || !((Object)(object)UISlotText != (Object)null))
				{
					int fontSize = 16;
					string fontName = "AveriaSansLibre-Bold";
					Vector2 sizeDelta = default(Vector2);
					((Vector2)(ref sizeDelta))..ctor(115f, 30f);
					UIInventoryArea = new GameObject("InventoryArea");
					UIInventoryArea.layer = 5;
					UIInventoryArea.transform.SetParent(((Component)hud.m_healthPanel).transform);
					RectTransform val = UIInventoryArea.AddComponent<RectTransform>();
					val.anchorMin = new Vector2(1f, 1f);
					val.anchorMax = new Vector2(1f, 1f);
					val.anchoredPosition = new Vector2(-45f, -230f);
					val.sizeDelta = sizeDelta;
					UIInventoryArea.transform.localScale = Vector3.one;
					Sprite sprite = ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).FirstOrDefault((Func<Sprite, bool>)((Sprite tempSprite) => ((Object)tempSprite).name == "InputFieldBackground"));
					Image val2 = UIInventoryArea.AddComponent<Image>();
					((Graphic)val2).color = new Color(0f, 0f, 0f, 0.4f);
					val2.sprite = sprite;
					val2.type = (Type)1;
					UIWeightText = UIController.CreateTextObject("WeightText", UIInventoryArea, Color.green, fontName, fontSize, (TextAnchor)3, new Vector2(5f, 0f), sizeDelta);
					UISlotText = UIController.CreateTextObject("SlotText", UIInventoryArea, Color.green, fontName, fontSize, (TextAnchor)5, new Vector2(-5f, 0f), sizeDelta);
				}
			}

			private static void CreateSymbolBasedUI(Hud hud)
			{
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Expected O, but got Unknown
				//IL_009e: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fb: Expected O, but got Unknown
				//IL_0127: Unknown result type (might be due to invalid IL or missing references)
				//IL_0134: Unknown result type (might be due to invalid IL or missing references)
				//IL_0141: Unknown result type (might be due to invalid IL or missing references)
				//IL_014e: Unknown result type (might be due to invalid IL or missing references)
				//IL_016f: Unknown result type (might be due to invalid IL or missing references)
				//IL_017f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0186: Expected O, but got Unknown
				//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
				//IL_026c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0276: Expected O, but got Unknown
				//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_0305: Unknown result type (might be due to invalid IL or missing references)
				//IL_0315: Unknown result type (might be due to invalid IL or missing references)
				//IL_031c: Expected O, but got Unknown
				//IL_0348: Unknown result type (might be due to invalid IL or missing references)
				//IL_0355: Unknown result type (might be due to invalid IL or missing references)
				//IL_0362: Unknown result type (might be due to invalid IL or missing references)
				//IL_036f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0390: Unknown result type (might be due to invalid IL or missing references)
				//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_03d1: 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_03ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_0416: Unknown result type (might be due to invalid IL or missing references)
				//IL_0420: Expected O, but got Unknown
				//IL_045f: 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_0487: Unknown result type (might be due to invalid IL or missing references)
				//IL_0494: Unknown result type (might be due to invalid IL or missing references)
				//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_04fe: 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_0538: Unknown result type (might be due to invalid IL or missing references)
				//IL_053d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0553: Unknown result type (might be due to invalid IL or missing references)
				//IL_056b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0570: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)UIWeightBarArea != (Object)null))
				{
					int num = 16;
					string fontName = "AveriaSansLibre-Bold";
					Vector2 sizeDelta = default(Vector2);
					((Vector2)(ref sizeDelta))..ctor(100f, 30f);
					Vector2 sizeDelta2 = default(Vector2);
					((Vector2)(ref sizeDelta2))..ctor(30f, 30f);
					float num2 = -10f;
					float num3 = -230f;
					UIWeightBarArea = new GameObject("WeightAreaBar");
					UIWeightBarArea.layer = 5;
					UIWeightBarArea.transform.SetParent(((Component)hud.m_healthPanel).transform);
					RectTransform val = UIWeightBarArea.AddComponent<RectTransform>();
					val.anchorMin = new Vector2(1f, 1f);
					val.anchorMax = new Vector2(1f, 1f);
					val.anchoredPosition = new Vector2(num2, num3);
					val.sizeDelta = sizeDelta;
					UIWeightBarArea.transform.localScale = Vector3.one;
					GameObject val2 = new GameObject("WeightBarBackground");
					val2.transform.SetParent(UIWeightBarArea.transform, false);
					Image val3 = val2.AddComponent<Image>();
					RectTransform component = val2.GetComponent<RectTransform>();
					component.anchorMin = Vector2.zero;
					component.anchorMax = Vector2.one;
					component.offsetMin = Vector2.zero;
					component.offsetMax = Vector2.zero;
					((Graphic)val3).color = new Color(0f, 0f, 0f, 0.4f);
					GameObject val4 = new GameObject("WeightBarFill");
					val4.transform.SetParent(UIWeightBarArea.transform, false);
					weightBarFill = val4.AddComponent<Image>();
					RectTransform component2 = val4.GetComponent<RectTransform>();
					component2.anchorMin = Vector2.zero;
					component2.anchorMax = Vector2.one;
					component2.offsetMin = new Vector2(3f, 3f);
					component2.offsetMax = new Vector2(-3f, -3f);
					Sprite sprite = ((IEnumerable<Sprite>)Resources.FindObjectsOfTypeAll<Sprite>()).FirstOrDefault((Func<Sprite, bool>)((Sprite s) => ((Object)s).name == "bar_monster_hp_5"));
					weightBarFill.sprite = sprite;
					weightBarFill.type = (Type)3;
					weightBarFill.fillMethod = (FillMethod)0;
					weightBarFill.fillOrigin = 0;
					weightBarFill.fillAmount = 0f;
					UIWeightBarEmojiArea = new GameObject("WeightAreaEmoji");
					UIWeightBarEmojiArea.layer = 5;
					UIWeightBarEmojiArea.transform.SetParent(((Component)hud.m_healthPanel).transform);
					num2 -= 65f;
					RectTransform val5 = UIWeightBarEmojiArea.AddComponent<RectTransform>();
					val5.anchorMin = new Vector2(1f, 1f);
					val5.anchorMax = new Vector2(1f, 1f);
					val5.anchoredPosition = new Vector2(num2, num3);
					val5.sizeDelta = sizeDelta2;
					UIWeightBarEmojiArea.transform.localScale = Vector3.one;
					GameObject val6 = new GameObject("WeightEmojiBackground");
					val6.transform.SetParent(UIWeightBarEmojiArea.transform, false);
					Image val7 = val6.AddComponent<Image>();