Decompiled source of CheatEnabler v2.4.8

CheatEnabler.dll

Decompiled a week ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading;
using System.Threading.Tasks;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CheatEnabler.Functions;
using CheatEnabler.Functions.DysonSphere;
using CheatEnabler.Patches;
using CheatEnabler.Patches.Factory;
using CheatEnabler.Patches.Tech;
using CommonAPI.Systems;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UXAssist.Common;
using UXAssist.Common.GameConstants;
using UXAssist.Common.ModFeatures;
using UXAssist.Common.Patching;
using UXAssist.Common.Utils;
using UXAssist.Functions;
using UXAssist.Patches.Factory;
using UXAssist.Production;
using UXAssist.UI;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("CheatEnabler")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("DSP MOD - CheatEnabler")]
[assembly: AssemblyFileVersion("2.4.8.0")]
[assembly: AssemblyInformationalVersion("2.4.8+6263775dc1ff9e2a0a22bc6ca6073d2708dda315")]
[assembly: AssemblyProduct("CheatEnabler")]
[assembly: AssemblyTitle("CheatEnabler")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("2.4.8.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace CheatEnabler
{
	[BepInPlugin("org.soardev.cheatenabler", "CheatEnabler", "2.4.8")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class CheatEnabler : BaseUnityPlugin
	{
		public static readonly ManualLogSource Logger = Logger.CreateLogSource("CheatEnabler");

		private void Awake()
		{
			//IL_04d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04dd: Expected O, but got Unknown
			I18N.Init();
			GamePatch.DevShortcutsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "DevShortcuts", false, "Enable DevMode shortcuts");
			GamePatch.AbnormalDisablerEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "DisableAbnormalChecks", false, "disable all abnormal checks");
			TechTweaksPatch.Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "UnlockTech", false, "Upgrade clicked tech by holding key modifiers (Shift/Alt/Ctrl), and downgrade it by holding the same modifiers while downgrade mode is on (toggle it with Caps Lock)");
			global::CheatEnabler.Patches.Factory.FactoryPatch.ImmediateEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "ImmediateBuild", false, "Build immediately");
			global::CheatEnabler.Patches.Factory.FactoryPatch.ArchitectModeEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "Architect", false, "Architect Mode");
			global::CheatEnabler.Patches.Factory.FactoryPatch.NoConditionEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "BuildWithoutCondition", false, "Build without condition");
			global::CheatEnabler.Patches.Factory.FactoryPatch.NoCollisionEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "NoCollision", false, "No collision");
			global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalGeneratorEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "BeltSignalGenerator", false, "Belt signal generator");
			global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalNumberAltFormat = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "BeltSignalNumberFormat", false, "Belt signal number format alternative format (AAAA=generation speed in minutes, B=proliferate points, C=stack count):\n  AAAABC by default\n  BCAAAA as alternative");
			global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalCountGenEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "BeltSignalCountGenerations", true, "Belt signal count generations as production in statistics");
			global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalCountRemEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "BeltSignalCountRemovals", true, "Belt signal count removals as comsumption in statistics");
			global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalCountRecipeEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "BeltSignalCountRecipe", false, "Belt signal count all raws and intermediates in statistics");
			global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalUseProliferatorEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "BeltSignalUseProliferator", false, "Belt signal count proliferators used for raws/intermediates and finished products");
			global::CheatEnabler.Patches.Factory.FactoryPatch.RemovePowerSpaceLimitEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "RemovePowerDistanceLimit", false, "Remove distance limit for wind turbines and geothermals");
			global::CheatEnabler.Patches.Factory.FactoryPatch.BoostWindPowerEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "BoostWindPower", false, "Boost wind power");
			global::CheatEnabler.Patches.Factory.FactoryPatch.BoostSolarPowerEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "BoostSolarPower", false, "Boost solar power");
			global::CheatEnabler.Patches.Factory.FactoryPatch.BoostFuelPowerEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "BoostFuelPower", false, "Boost fuel power");
			global::CheatEnabler.Patches.Factory.FactoryPatch.BoostGeothermalPowerEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "BoostGeothermalPower", false, "Boost geothermal power");
			global::CheatEnabler.Patches.Factory.FactoryPatch.WindTurbinesPowerGlobalCoverageEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "PowerGlobalCoverage", false, "Global power coverage");
			global::CheatEnabler.Patches.Factory.FactoryPatch.ControlPanelRemoteLogisticsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "ControlPanelRemoteLogistics", false, "Retrieve/Place items from/to remote planets on logistics control panel");
			ResourcePatch.InfiniteResourceEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Planet", "AlwaysInfiniteResource", false, "always infinite natural resource");
			ResourcePatch.FastMiningEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Planet", "FastMining", false, "super-fast mining speed");
			PlanetPatch.WaterPumpAnywhereEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Planet", "WaterPumpAnywhere", false, "Can pump water anywhere (while water type is not None)");
			PlanetPatch.TerraformAnywayEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Planet", "TerraformAnyway", false, "Can do terraform without enough soil piless");
			PlayerPatch.InstantHandCraftEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "InstantHandCraft", false, "Enable instant hand-craft");
			PlayerPatch.InstantTeleportEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "InstantTeleport", false, "Enable instant teleport (like that in Sandbox mode)");
			PlayerPatch.WarpWithoutSpaceWarpersEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "WarpWithoutWarper", false, "Enable warp without warper");
			DysonSpherePatch.SkipBulletEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("DysonSphere", "SkipBullet", false, "Skip bullet");
			DysonSpherePatch.FireAllBulletsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("DysonSphere", "FireAllBullets", false, "Fire all bullets at once");
			DysonSpherePatch.SkipAbsorbEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("DysonSphere", "SkipAbsorb", false, "Skip absorption");
			DysonSpherePatch.QuickAbsorbEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("DysonSphere", "QuickAbsorb", false, "Quick absorb");
			DysonSpherePatch.EjectAnywayEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("DysonSphere", "EjectAnyway", false, "Eject anyway");
			DysonSpherePatch.OverclockEjectorEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("DysonSphere", "OverclockEjector", false, "Overclock ejector");
			DysonSpherePatch.OverclockSiloEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("DysonSphere", "OverclockSilo", false, "Overclock silo");
			DysonSpherePatch.UnlockMaxOrbitRadiusEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("DysonSphere", "UnlockMaxOrbitRadius", false, "Unlock Dyson Sphere max orbit radius");
			DysonSpherePatch.UnlockMaxOrbitRadiusValue = ((BaseUnityPlugin)this).Config.Bind<float>("DysonSphere", "MaxOrbitRadiusValue", 10000000f, "Unlocked Dyson Sphere max orbit radius value");
			DysonSphereFunctions.IllegalDysonShellFunctionsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("DysonSphere", "IllegalDysonShellFunctions", false, "Enable illegal dyson shell functions");
			DysonSphereFunctions.ShellsCountForFunctions = ((BaseUnityPlugin)this).Config.Bind<int>("DysonSphere", "ShellsCountForFunctions", 2048, new ConfigDescription("Shells count for various functions", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 99999), Array.Empty<object>()));
			CombatPatch.MechaInvincibleEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Battle", "MechaInvincible", false, "Mecha and Drones/Fleets invincible");
			CombatPatch.BuildingsInvincibleEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Battle", "BuildingsInvincible", false, "Buildings invincible");
			Localization.Register();
			UIConfigWindow.Init();
			ModFeatureRegistry.Discover(Assembly.GetExecutingAssembly());
			I18N.Apply();
		}
	}
	public static class Localization
	{
		public const string CheatEnabler = "CheatEnabler";

		public const string YouAreNotInAnySystem = "You are not in any system.";

		public const string ThereIsNoDysonSphereShellOn0 = "There is no Dyson Sphere shell on \"{0}\".";

		public const string ThereIsNoDysonSphereDataOn0 = "There is no Dyson Sphere data on \"{0}\".";

		public const string ThisWillCompleteAllDysonSphereShellsOn0InstantlyAreYouSure = "This will complete all Dyson Sphere shells on \"{0}\". Are you sure?";

		public const string ThisWillRemoveAllFramesOn0AreYouSure = "This will remove all frames on \"{0}\". Are you sure?";

		public const string NoPrecalculatedShellFoundForRadius0 = "No precalculated shell found for radius {0}.";

		public const string ClearAllMetadataConsumptionDetails = "ClearAllMetadataConsumptionDetails";

		public const string ClearCurrentMetadataConsumptionDetails = "ClearCurrentMetadataConsumptionDetails";

		public const string NoMetadataConsumptionRecord = "NoMetadataConsumptionRecord";

		public const string KEYToggleNoCondition = "KEYToggleNoCondition";

		public const string KEYToggleNoCollision = "KEYToggleNoCollision";

		public const string NoConditionOn = "NoConditionOn";

		public const string NoConditionOff = "NoConditionOff";

		public const string NoCollisionOn = "NoCollisionOn";

		public const string NoCollisionOff = "NoCollisionOff";

		public const string BuildWithoutConditionIsEnabled = "Build without condition is enabled!";

		public const string NoCollisionIsEnabled = "No collision is enabled!";

		public const string Factory = "Factory";

		public const string Planet = "Planet";

		public const string MechaCombat = "Mecha/Combat";

		public const string Cancel = "Cancel";

		public const string OK = "OK";

		public const string BuryAllVeins = "Bury all veins";

		public const string RestoreBuriedVeins = "Restore buried veins";

		public const string ReformEntirePlanet = "Reform entire planet";

		public const string RevertPlanetTerrain = "Revert planet terrain";

		public const string EnableDevShortcuts = "Enable Dev Shortcuts";

		public const string DisableAbnormalChecks = "Disable Abnormal Checks";

		public const string Hotkey = "Hotkey";

		public const string UnlockTechWithKeyModifiers = "Unlock Tech with Key-Modifiers";

		public const string UnlockDowngradeTechWithKeyModifiers = "Quickly upgrade/downgrade tech with key-modifiers";

		public const string TechDowngradeModeOn = "Tech downgrade mode ON!";

		public const string TechDowngradeModeOff = "Tech downgrade mode OFF!";

		public const string TechDowngradeModeWarning = "!!Tech downgrade mode is ON!!";

		public const string TechModifierHelpBody = "Click a tech on the tree while holding:\r\n  Shift: Tech level + 1\r\n  Ctrl: Tech level + 10\r\n  Ctrl + Shift: Tech level + 100\r\n  Alt: Tech level to MAX\r\n\r\nNote: all direct prerequisites will be unlocked as well.\r\n\r\nPress Caps Lock to toggle Tech Downgrade Mode: the key-modifiers above then decrease tech levels and revert the corresponding upgrade values.\r\n  Shift: Tech level - 1\r\n  Ctrl: Tech level - 10\r\n  Ctrl + Shift: Tech level - 100\r\n  Alt: revert to locked (level 0)\r\n(Shift+Alt and Ctrl+Alt do nothing)\r\n\r\nThe features above come from the mod: CheatEnabler";

		public const string PackageResizeSkippedOccupiedCells = "Package resize skipped: occupied cells would be removed";

		public const string TechDowngradeDeliveryOccupied = "Cannot downgrade tech: empty the delivery slots being removed and wait for deliveries to finish";

		public const string TechDowngradeDronesBusy = "Cannot downgrade tech: wait for construction drones to return";

		public const string TechDowngradeFleetsOccupied = "Cannot downgrade tech: recall and empty the fleets being removed";

		public const string TechDowngradeUnsupportedFunction = "Cannot downgrade tech: an unsupported tech function requires a mod update";

		public const string DevShortcuts = "Dev Shortcuts";

		public const string DevShortcutsTips = "Dev Shortcuts Tips";

		public const string UnlockTechWithKeyModifiersTips = "Unlock Tech with Key-Modifiers Tips";

		public const string RemoveAllMetadataConsumptionRecords = "Remove all metadata consumption records";

		public const string RemoveMetadataConsumptionRecordInCurrentGame = "Remove metadata consumption record in current game";

		public const string ClearMetadataFlagWhichBansAchievements = "Clear metadata flag which bans achievements";

		public const string AssignGamesaveToCurrentAccount = "Assign gamesave to current account";

		public const string FinishBuildImmediately = "Finish build immediately";

		public const string ArchitectMode = "Architect mode";

		public const string BuildWithoutCondition = "Build without condition";

		public const string NoCollision = "No collision";

		public const string BeltSignalGenerator = "Belt signal generator";

		public const string CountProliferatorsUsedForRawsIntermediatesAndFinishedProducts = "Count proliferators used for raws/intermediates and finished products";

		public const string CountProliferatorsUsedForRawsIntermediatesAndFinishedProductsTips = "Count proliferators used for raws/intermediates and finished products tips";

		public const string BeltSignalAltFormat = "Belt signal alt format";

		public const string BeltSignalAltFormatTips = "Belt signal alt format tips";

		public const string CountGenerationsAsProductionInStatistics = "Count generations as production in statistics";

		public const string CountRemovalsAsConsumptionInStatistics = "Count removals as consumption in statistics";

		public const string CountAllRawsAndIntermediatesInStatistics = "Count all raws and intermediates in statistics";

		public const string RemovePowerSpaceLimit = "Remove power space limit";

		public const string BoostWindPower = "Boost wind power";

		public const string BoostSolarPower = "Boost solar power";

		public const string BoostFuelPower = "Boost fuel power";

		public const string BoostFuelPower2 = "Boost fuel power 2";

		public const string WindTurbinesDoGlobalPowerCoverage = "Wind Turbines do global power coverage";

		public const string BoostGeothermalPower = "Boost geothermal power";

		public const string RetrievePlaceItemsFromToRemotePlanetsOnLogisticsControlPanel = "Retrieve/Place items from/to remote planets on logistics control panel";

		public const string InfiniteNaturalResources = "Infinite Natural Resources";

		public const string FastMining = "Fast Mining";

		public const string PumpAnywhere = "Pump Anywhere";

		public const string SkipBulletPeriod = "Skip bullet period";

		public const string FireAllBulletsAtOnce = "Fire all bullets at once";

		public const string SkipAbsorptionPeriod = "Skip absorption period";

		public const string QuickAbsorb = "Quick absorb";

		public const string EjectAnyway = "Eject anyway";

		public const string OverclockEjectors = "Overclock Ejectors";

		public const string OverclockSilos = "Overclock Silos";

		public const string UnlockDysonSphereMaxOrbitRadius = "Unlock Dyson Sphere max orbit radius";

		public const string CompleteDysonSphereShellsInstantly = "Complete Dyson Sphere shells instantly";

		public const string RemoveAllFramesOnDysonSphere = "Remove all frames on Dyson Sphere";

		public const string GenerateIllegalDysonShell = "Generate illegal dyson shell";

		public const string GenerateIllegalDysonShell2 = "Generate illegal dyson shell 2";

		public const string KeepMaxProductionShellsAndRemoveOthers = "Keep max production shells and remove others";

		public const string DuplicateShellsFromThatWithHighestProduction = "Duplicate shells from that with highest production";

		public const string GenerateIllegalDysonShellQuickly = "Generate illegal dyson shell quickly";

		public const string ShellsCount = "Shells count";

		public const string WARNINGThisOperationCanBeVerySlowContinue = "WARNING: This operation can be very slow, continue?";

		public const string WARNINGThisOperationIsDANGEROUSContinue = "WARNING: This operation is DANGEROUS, continue?";

		public const string TerraformWithoutEnoughSoilPiles = "Terraform without enough soil piles";

		public const string InstantHandCraft = "Instant hand-craft";

		public const string InstantTeleportLikeThatInSandboxMode = "Instant teleport (like that in Sandbox mode)";

		public const string MechaAndDronesFleetsInvicible = "Mecha and Drones/Fleets invicible";

		public const string BuildingsInvicible = "Buildings invicible";

		public const string EnableWarpWithoutSpaceWarpers = "Enable warp without space warpers";

		public const string TeleportToOuterSpace = "Teleport to outer space";

		public const string TeleportToSelectedAstronomical = "Teleport to selected astronomical";

		public static void Register()
		{
			I18N.Add("CheatEnabler", "CheatEnabler", "作弊器");
			I18N.Add("You are not in any system.", "You are not in any system.", "你不在任何星系中");
			I18N.Add("There is no Dyson Sphere shell on \"{0}\".", "There is no Dyson Sphere shell on \"{0}\".", "“{0}”上没有可建造的戴森壳");
			I18N.Add("There is no Dyson Sphere data on \"{0}\".", "There is no Dyson Sphere data on \"{0}\".", "“{0}”上没有戴森球数据");
			I18N.Add("This will complete all Dyson Sphere shells on \"{0}\". Are you sure?", "This will complete all Dyson Sphere shells on \"{0}\". Are you sure?", "这将完成“{0}”上的所有戴森壳。你确定吗?");
			I18N.Add("This will remove all frames on \"{0}\". Are you sure?", "This will remove all frames on \"{0}\". Are you sure?", "这将移除“{0}”上的所有框架。你确定吗?");
			I18N.Add("No precalculated shell found for radius {0}.", "No precalculated shell found for radius {0}.", "没有找到适合半径 {0} 的预计算壳面");
			I18N.Add("ClearAllMetadataConsumptionDetails", "\r\n            Metadata consumption records of all gamesaves are about to be cleared.\r\n            You will gain following metadata back:\r\n            ", "\r\n            所有存档的元数据消耗记录即将被清除,\r\n            此操作将返还以下元数据:\r\n            ");
			I18N.Add("ClearCurrentMetadataConsumptionDetails", "\r\n            Metadata consumption records of current gamesave are about to be cleared.\r\n            You will gain following metadata back:\r\n            ", "\r\n            当前存档的元数据消耗记录即将被清除,\r\n            此操作将返还以下元数据:\r\n            ");
			I18N.Add("NoMetadataConsumptionRecord", "No metadata consumption records found.", "未找到元数据消耗记录。");
			I18N.Add("KEYToggleNoCondition", "[CE] Toggle No Condition Build", "[CE] 切换无条件建造");
			I18N.Add("KEYToggleNoCollision", "[CE] Toggle No Collision", "[CE] 切换无碰撞");
			I18N.Add("NoConditionOn", "No condition build is enabled!", "无条件建造已开启");
			I18N.Add("NoConditionOff", "No condition build is disabled!", "无条件建造已关闭");
			I18N.Add("NoCollisionOn", "No collision is enabled!", "无碰撞已开启");
			I18N.Add("NoCollisionOff", "No collision is disabled!", "无碰撞已关闭");
			I18N.Add("Build without condition is enabled!", "!!Build without condition is enabled!!", "!!无条件建造已开启!!");
			I18N.Add("No collision is enabled!", "!!No collision is enabled!!", "!!无碰撞已开启!!");
			I18N.Add("Factory", "Factory", "工厂");
			I18N.Add("Planet", "Planet", "行星");
			I18N.Add("Mecha/Combat", "Mecha/Combat", "机甲/战斗");
			I18N.Add("Cancel", "Cancel", "取消");
			I18N.Add("OK", "OK", "确定");
			I18N.Add("Bury all veins", "Bury all veins", "掩埋所有矿脉");
			I18N.Add("Restore buried veins", "Restore buried veins", "还原所有矿脉");
			I18N.Add("Reform entire planet", "Reform entire planet", "铺满星球地基");
			I18N.Add("Revert planet terrain", "Revert planet terrain", "还原星球地形");
			I18N.Add("Enable Dev Shortcuts", "Enable Dev Shortcuts", "开发模式快捷键");
			I18N.Add("Disable Abnormal Checks", "Disable Abnormal Checks", "关闭数据异常检查");
			I18N.Add("Hotkey", "Hotkey", "快捷键");
			I18N.Add("Unlock Tech with Key-Modifiers", "Unlock Tech with Key-Modifiers", "使用组合键点击解锁科技");
			I18N.Add("Quickly upgrade/downgrade tech with key-modifiers", "Quickly upgrade/downgrade tech with key-modifiers", "使用组合键快速升降级科技");
			I18N.Add("Tech downgrade mode ON!", "Tech downgrade mode ON!", "科技降级模式已开启!");
			I18N.Add("Tech downgrade mode OFF!", "Tech downgrade mode OFF!", "科技降级模式已关闭!");
			I18N.Add("!!Tech downgrade mode is ON!!", "!!Tech downgrade mode is ON!!", "!!科技降级模式已开启!!");
			I18N.Add("Click a tech on the tree while holding:\r\n  Shift: Tech level + 1\r\n  Ctrl: Tech level + 10\r\n  Ctrl + Shift: Tech level + 100\r\n  Alt: Tech level to MAX\r\n\r\nNote: all direct prerequisites will be unlocked as well.\r\n\r\nPress Caps Lock to toggle Tech Downgrade Mode: the key-modifiers above then decrease tech levels and revert the corresponding upgrade values.\r\n  Shift: Tech level - 1\r\n  Ctrl: Tech level - 10\r\n  Ctrl + Shift: Tech level - 100\r\n  Alt: revert to locked (level 0)\r\n(Shift+Alt and Ctrl+Alt do nothing)\r\n\r\nThe features above come from the mod: CheatEnabler", "Click a tech on the tree while holding:\r\n  Shift: Tech level + 1\r\n  Ctrl: Tech level + 10\r\n  Ctrl + Shift: Tech level + 100\r\n  Alt: Tech level to MAX\r\n\r\nNote: all direct prerequisites will be unlocked as well.\r\n\r\nPress Caps Lock to toggle Tech Downgrade Mode: the key-modifiers above then decrease tech levels and revert the corresponding upgrade values.\r\n  Shift: Tech level - 1\r\n  Ctrl: Tech level - 10\r\n  Ctrl + Shift: Tech level - 100\r\n  Alt: revert to locked (level 0)\r\n(Shift+Alt and Ctrl+Alt do nothing)\r\n\r\nThe features above come from the mod: CheatEnabler", "按住以下组合键点击科技树:\r\n  Shift:科技等级 +1\r\n  Ctrl:科技等级 +10\r\n  Ctrl + Shift:科技等级 +100\r\n  Alt:科技等级升到最大\r\n\r\n注意:所有直接前置科技也会被解锁。\r\n\r\n按 Caps Lock 开启/关闭科技降级模式:开启后上述组合键变为降低科技等级,并回退对应升级数值。\r\n  Shift:科技等级 -1\r\n  Ctrl:科技等级 -10\r\n  Ctrl + Shift:科技等级 -100\r\n  Alt:直接回退到未解锁(0 级,锁定)\r\n(Shift+Alt 与 Ctrl+Alt 无效果)\r\n\r\n以上功能来源于MOD:CheatEnabler");
			I18N.Add("Package resize skipped: occupied cells would be removed", "Cannot downgrade tech: empty the inventory cells being removed and retry", "无法降级科技:请先清空缩容将移除的机舱格子,再重试");
			I18N.Add("Cannot downgrade tech: empty the delivery slots being removed and wait for deliveries to finish", "Cannot downgrade tech: empty the delivery slots being removed and wait for deliveries to finish", "无法降级科技:请先清空缩容将移除的物流清单格子,并等待配送完成");
			I18N.Add("Cannot downgrade tech: wait for construction drones to return", "Cannot downgrade tech: wait for construction drones to return", "无法降级科技:请等待建设无人机返回");
			I18N.Add("Cannot downgrade tech: recall and empty the fleets being removed", "Cannot downgrade tech: recall and empty the fleets being removed", "无法降级科技:请先召回并清空缩容将移除的编队");
			I18N.Add("Cannot downgrade tech: an unsupported tech function requires a mod update", "Cannot downgrade tech: an unsupported tech function requires a mod update", "无法降级科技:存在尚未支持的科技效果,请更新 MOD 后重试");
			I18N.Add("Dev Shortcuts", "Dev Shortcuts", "开发模式快捷键");
			I18N.Add("Dev Shortcuts Tips", "Caution: Some function may trigger abnormal check!\r\nNumpad 1: Gets all items and extends bag.\r\nNumpad 2: Boosts walk speed, gathering speed and mecha energy restoration.\r\nNumpad 3: Fills planet with foundations and bury all veins.\r\nNumpad 4: +1 construction drone.\r\nNumpad 5: Upgrades drone engine tech to full.\r\nNumpad 6: Unlocks researching tech.\r\nNumpad 7: Unlocks Drive Engine 1.\r\nNumpad 8: Unlocks Drive Engine 2 and maximize energy.\r\nNumpad 9: Unlocks ability to warp.\r\nNumpad 0: No costs for Logistic Storages' output.\r\nLCtrl + T: Unlocks all techs (not upgrades).\r\nLCtrl + Q: Adds 10000 to every metadata.\r\nLCtrl + W: Enters Sandbox Mode.\r\nLCtrl + Shift + W: Leaves Sandbox Mode.\r\nNumpad *: Proliferates items on hand.\r\nNumpad /: Removes proliferations from items on hand.\r\nPageDown: Remembers Pose of game camera.\r\nPageUp: Locks game camera using remembered Pose.", "警告:某些功能可能触发异常检查!\r\n小键盘1:获得所有物品并扩展背包\r\n小键盘2:加快行走速度及采集速度,加快能量恢复速度\r\n小键盘3:将地基铺设整个星球并掩埋所有矿物\r\n小键盘4:建设机器人 +1\r\n小键盘5:建设机器人满级\r\n小键盘6:解锁当前科技\r\n小键盘7:解锁驱动技术I\r\n小键盘8:解锁驱动技术II 最大化能量\r\n小键盘9:机甲曲速解锁\r\n小键盘0:物流站通过传送带出物品无消耗\r\n左Ctrl + T:解锁所有非升级科技\r\n左Ctrl + Q:增加各项元数据10000点\r\n左Ctrl + W:进入沙盒模式\r\n左Ctrl + Shift + W:离开沙盒模式\r\n小键盘乘号 *:给手上物品喷涂增产剂\r\n小键盘除号 /:清除手上物品的增产剂\r\nPageDown:记录摄像机当前的Pose\r\nPageUp:用记录的Pose锁定摄像机");
			I18N.Add("Unlock Tech with Key-Modifiers Tips", "Click tech on tree while holding:\r\n  Shift: Tech level + 1\r\n  Ctrl: Tech level + 10\r\n  Ctrl + Shift: Tech level + 100\r\n  Alt: Tech level to MAX\r\n\r\nNote: all direct prerequisites will be unlocked as well.", "按住以下组合键点击科技树:\r\n  Shift:科技等级+1\r\n  Ctrl:科技等级+10\r\n  Ctrl+Shift:科技等级+100\r\n  Alt:科技等级升到最大\r\n\r\n注意:所有直接前置科技也会被解锁");
			I18N.Add("Remove all metadata consumption records", "Remove all metadata consumption records", "移除所有元数据消耗记录");
			I18N.Add("Remove metadata consumption record in current game", "Remove metadata consumption record in current game", "移除当前存档的元数据消耗记录");
			I18N.Add("Clear metadata flag which bans achievements", "Clear metadata flag which bans achievements in current game", "解除当前存档因使用元数据导致的成就限制");
			I18N.Add("Assign gamesave to current account", "Assign gamesave to current account", "将游戏存档绑定给当前账号");
			I18N.Add("Finish build immediately", "Finish build immediately", "建造秒完成");
			I18N.Add("Architect mode", "Architect mode", "建筑师模式");
			I18N.Add("Build without condition", "Build without condition check", "无条件建造");
			I18N.Add("No collision", "No collision", "无碰撞");
			I18N.Add("Belt signal generator", "Belt signal generator", "传送带信号物品生成");
			I18N.Add("Count proliferators used for raws/intermediates and finished products", "Use proliferators for raws/intermediates and finished products", "原料、中间产物以及成品使用增产剂");
			I18N.Add("Count proliferators used for raws/intermediates and finished products tips", "Following items use extra products: Titanium Alloy, Prism, Frame Material, Proliferator Mk.II, Proliferator Mk.III, Magnetic Coil, Electric Motor, Electromagnetic Turbine, Super-magnetic Ring, Circuit Board, Thruster, Reinforced Thruster, Plasma Exciter, Particle Broadband, Graviton Lens, Quantum Chip, Annihilation Constraint Sphere, Deuteron Fuel Rod, Space Warper, Dyson Sphere Component, Small Carrier Rocket, Electromagnetic Matrix, Structure Matrix, Information Matrix, Gravity Matrix, Universe Matrix\r\nFollowing items does not use proliferators: Casimir Crystal, Energy Matrix\r\nOther items use speed up production.", "以下物品使用额外产出: 钛合金, 棱镜, 框架材料, 增产剂 Mk.II, 增产剂 Mk.III, 磁线圈, 电动机, 电磁涡轮, 超级磁场环, 电路板, 推进器, 加力推进器, 电浆激发器, 粒子宽带, 引力透镜, 量子芯片, 湮灭约束球, 氘核燃料棒, 空间翘曲器, 戴森球组件, 小型运载火箭, 电磁矩阵, 结构矩阵, 信息矩阵, 引力矩阵, 宇宙矩阵\r\n以下物品不使用增产剂: 卡西米尔晶体, 能量矩阵\r\n其他物品使用加速生产");
			I18N.Add("Belt signal alt format", "Belt signal alt format", "传送带信号替换格式");
			I18N.Add("Belt signal alt format tips", "Belt signal number format alternative format:\r\n  AAAABC by default\r\n  BCAAAA as alternative\r\nAAAA=generation speed in minutes, B=proliferate points, C=stack count", "传送带信号物品生成数量格式:\r\n  默认为AAAABC\r\n  勾选替换为BCAAAA\r\nAAAA=生成速度,B=增产点数,C=堆叠数量");
			I18N.Add("Count generations as production in statistics", "Count generations as production in statistics", "统计信息里将生成计算为产物");
			I18N.Add("Count removals as consumption in statistics", "Count removals as consumption in statistics", "统计信息里将移除计算为消耗");
			I18N.Add("Count all raws and intermediates in statistics", "Count all raw materials in statistics", "统计信息里计算所有原料和中间产物");
			I18N.Add("Remove power space limit", "Remove space limit for winds and geothermals", "移除风力发电和地热发电的间距限制");
			I18N.Add("Boost wind power", "Boost wind power(x100,000)", "提升风力发电(x100,000)");
			I18N.Add("Boost solar power", "Boost solar power(x100,000)", "提升太阳能发电(x100,000)");
			I18N.Add("Boost fuel power", "Boost fuel power(x50,000)", "提升燃料发电(x50,000)");
			I18N.Add("Boost fuel power 2", "(x20,000 for deuteron, x10,000 for antimatter)", "(氘核燃料棒x20,000,反物质燃料棒x10,000)");
			I18N.Add("Wind Turbines do global power coverage", "Wind Turbines do global power coverage", "风力涡轮机供电覆盖全球");
			I18N.Add("Boost geothermal power", "Boost geothermal power(x50,000)", "提升地热发电(x50,000)");
			I18N.Add("Retrieve/Place items from/to remote planets on logistics control panel", "Retrieve/Place items from/to remote planets on logistics control panel", "在物流总控面板上可以从非本地行星取放物品");
			I18N.Add("Infinite Natural Resources", "Infinite natural resources", "自然资源采集不消耗");
			I18N.Add("Fast Mining", "Fast mining", "高速采集");
			I18N.Add("Pump Anywhere", "Pump anywhere", "平地抽水");
			I18N.Add("Skip bullet period", "Skip bullet period", "跳过子弹阶段");
			I18N.Add("Fire all bullets at once", "Fire all bullets at once", "一次弹射所有太阳帆");
			I18N.Add("Skip absorption period", "Skip absorption period", "跳过吸收阶段");
			I18N.Add("Quick absorb", "Quick absorb", "快速吸收");
			I18N.Add("Eject anyway", "Eject anyway", "全球弹射");
			I18N.Add("Overclock Ejectors", "Overclock Ejectors (10x)", "高速弹射器(10倍射速)");
			I18N.Add("Overclock Silos", "Overclock Silos (10x)", "高速发射井(10倍射速)");
			I18N.Add("Unlock Dyson Sphere max orbit radius", "Unlock Dyson Sphere max orbit radius", "解锁戴森球最大轨道半径");
			I18N.Add("Complete Dyson Sphere shells instantly", "Complete Dyson Sphere shells instantly", "立即完成戴森壳建造");
			I18N.Add("Remove all frames on Dyson Sphere", "Remove all frames on Dyson Sphere", "移除戴森球上的所有框架");
			I18N.Add("Generate illegal dyson shell", "Generate an illegal dyson shell (!!1st shell layer will be replaced!!)", "生成单层仙术戴森壳(!!会先删除第一层戴森壳!!)");
			I18N.Add("Generate illegal dyson shell 2", "Generate illegal dyson shells for all layers without nodes and shells", "为所有没有节点和壳的层级生成仙术戴森壳");
			I18N.Add("Keep max production shells and remove others", "Keep max production shells and remove others", "保留发电量最高的戴森壳并移除其他戴森壳");
			I18N.Add("Duplicate shells from that with highest production", "Duplicate shells from that with highest production", "从发电量最高的壳复制戴森壳");
			I18N.Add("Generate illegal dyson shell quickly", "Generate illegal dyson shell quickly", "快速生成仙术戴森壳");
			I18N.Add("Shells count", "Shells count", "壳面数量");
			I18N.Add("WARNING: This operation can be very slow, continue?", "WARNING: This operation can be very slow, continue?", "警告:此操作可能非常慢,继续吗?");
			I18N.Add("WARNING: This operation is DANGEROUS, continue?", "WARNING: This operation is DANGEROUS, continue?", "警告:此操作非常危险,继续吗?");
			I18N.Add("Terraform without enough soil piles", "Terraform without enough soil piles", "沙土不够时依然可以整改地形");
			I18N.Add("Instant hand-craft", "Instant hand-craft", "快速手动制造");
			I18N.Add("Instant teleport (like that in Sandbox mode)", "Instant teleport (like that in Sandbox mode)", "快速传送(和沙盒模式一样)");
			I18N.Add("Mecha and Drones/Fleets invicible", "Mecha and Drones/Fleets invicible", "机甲和战斗无人机无敌");
			I18N.Add("Buildings invicible", "Buildings invincible", "建筑无敌");
			I18N.Add("Enable warp without space warpers", "Enable warp without space warpers", "无需空间翘曲器即可曲速飞行");
			I18N.Add("Teleport to outer space", "Teleport to outer space", "传送到外太空");
			I18N.Add("Teleport to selected astronomical", "Teleport to selected astronomical", "传送到选中的天体");
		}
	}
	public static class UIConfigWindow
	{
		private class MaxOrbitRadiusValueMapper : RangeValueMapper<float>
		{
			public MaxOrbitRadiusValueMapper()
				: base(1, 20)
			{
			}

			public override int ValueToIndex(float value)
			{
				int num = Mathf.FloorToInt(value / 500000f);
				if (num < 1)
				{
					num = 1;
				}
				if (num > 20)
				{
					num = 20;
				}
				return num;
			}

			public override float IndexToValue(int index)
			{
				return (float)index * 500000f;
			}
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static Action<MyConfigWindow, RectTransform> <0>__CreateUI;

			public static Action <1>__UpdateUI;

			public static UnityAction <2>__RemoveAllMetadataConsumptions;

			public static UnityAction <3>__RemoveCurrentMetadataConsumptions;

			public static UnityAction <4>__ClearMetadataBanAchievements;

			public static UnityAction <5>__CompleteShellsInstantly;

			public static UnityAction <6>__RemoveAllFrames;

			public static UnityAction <7>__TeleportToOuterSpace;

			public static UnityAction <8>__TeleportToSelectedAstronomical;
		}

		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__6_0;

			public static UnityAction <>9__6_3;

			public static UnityAction <>9__6_4;

			public static UnityAction <>9__6_5;

			public static UnityAction <>9__6_6;

			public static Response <>9__6_16;

			public static UnityAction <>9__6_9;

			public static Response <>9__6_17;

			public static UnityAction <>9__6_10;

			public static Response <>9__6_18;

			public static UnityAction <>9__6_11;

			public static Response <>9__6_19;

			public static UnityAction <>9__6_12;

			public static Response <>9__6_20;

			public static UnityAction <>9__6_13;

			internal void <CreateUI>b__6_0()
			{
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				//IL_000a: Unknown result type (might be due to invalid IL or missing references)
				GameMain.data.account = AccountData.me;
			}

			internal void <CreateUI>b__6_3()
			{
				PlanetFunctions.BuryAllVeins(bury: true);
			}

			internal void <CreateUI>b__6_4()
			{
				PlanetFunctions.BuryAllVeins(bury: false);
			}

			internal void <CreateUI>b__6_5()
			{
				Player mainPlayer = GameMain.mainPlayer;
				if (mainPlayer != null)
				{
					BuildTool_Reform reformTool = mainPlayer.controller.actionBuild.reformTool;
					if (GameMain.localPlanet?.factory != null)
					{
						GameMain.localPlanet.factory.PlanetReformAll(reformTool.brushType, reformTool.brushColor, reformTool.buryVeins);
					}
				}
			}

			internal void <CreateUI>b__6_6()
			{
				if (GameMain.localPlanet?.factory != null)
				{
					GameMain.localPlanet.factory.PlanetReformRevert();
				}
			}

			internal void <CreateUI>b__6_9()
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Expected O, but got Unknown
				string text = Localization.Translate("Generate illegal dyson shell");
				string text2 = Localization.Translate("WARNING: This operation can be very slow, continue?");
				string text3 = Localization.Translate("Cancel");
				string text4 = Localization.Translate("OK");
				object obj = <>9__6_16;
				if (obj == null)
				{
					Response val = delegate
					{
						DysonSphereFunctions.CreateIllegalDysonShellWithMaxOutput();
					};
					<>9__6_16 = val;
					obj = (object)val;
				}
				UIMessageBox.Show(text, text2, text3, text4, 1, (Response)null, (Response)obj);
			}

			internal void <CreateUI>b__6_16()
			{
				DysonSphereFunctions.CreateIllegalDysonShellWithMaxOutput();
			}

			internal void <CreateUI>b__6_10()
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Expected O, but got Unknown
				string text = Localization.Translate("Generate illegal dyson shell 2");
				string text2 = Localization.Translate("WARNING: This operation can be very slow, continue?");
				string text3 = Localization.Translate("Cancel");
				string text4 = Localization.Translate("OK");
				object obj = <>9__6_17;
				if (obj == null)
				{
					Response val = delegate
					{
						DysonSphereFunctions.CreateIllegalDysonShellWithMaxOutputForAllLayers();
					};
					<>9__6_17 = val;
					obj = (object)val;
				}
				UIMessageBox.Show(text, text2, text3, text4, 1, (Response)null, (Response)obj);
			}

			internal void <CreateUI>b__6_17()
			{
				DysonSphereFunctions.CreateIllegalDysonShellWithMaxOutputForAllLayers();
			}

			internal void <CreateUI>b__6_11()
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Expected O, but got Unknown
				string text = Localization.Translate("Keep max production shells and remove others");
				string text2 = Localization.Translate("WARNING: This operation is DANGEROUS, continue?");
				string text3 = Localization.Translate("Cancel");
				string text4 = Localization.Translate("OK");
				object obj = <>9__6_18;
				if (obj == null)
				{
					Response val = delegate
					{
						DysonSphereFunctions.KeepMaxProductionShells();
					};
					<>9__6_18 = val;
					obj = (object)val;
				}
				UIMessageBox.Show(text, text2, text3, text4, 1, (Response)null, (Response)obj);
			}

			internal void <CreateUI>b__6_18()
			{
				DysonSphereFunctions.KeepMaxProductionShells();
			}

			internal void <CreateUI>b__6_12()
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Expected O, but got Unknown
				string text = Localization.Translate("Duplicate shells from that with highest production");
				string text2 = Localization.Translate("WARNING: This operation can be very slow, continue?");
				string text3 = Localization.Translate("Cancel");
				string text4 = Localization.Translate("OK");
				object obj = <>9__6_19;
				if (obj == null)
				{
					Response val = delegate
					{
						DysonSphereFunctions.DuplicateShellsWithHighestProduction();
					};
					<>9__6_19 = val;
					obj = (object)val;
				}
				UIMessageBox.Show(text, text2, text3, text4, 1, (Response)null, (Response)obj);
			}

			internal void <CreateUI>b__6_19()
			{
				DysonSphereFunctions.DuplicateShellsWithHighestProduction();
			}

			internal void <CreateUI>b__6_13()
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Expected O, but got Unknown
				string text = Localization.Translate("Generate illegal dyson shell quickly");
				string text2 = Localization.Translate("WARNING: This operation can be very slow, continue?");
				string text3 = Localization.Translate("Cancel");
				string text4 = Localization.Translate("OK");
				object obj = <>9__6_20;
				if (obj == null)
				{
					Response val = delegate
					{
						DysonSphereFunctions.CreateIllegalDysonShellQuickly(DysonSphereFunctions.ShellsCountForFunctions.Value);
					};
					<>9__6_20 = val;
					obj = (object)val;
				}
				UIMessageBox.Show(text, text2, text3, text4, 1, (Response)null, (Response)obj);
			}

			internal void <CreateUI>b__6_20()
			{
				DysonSphereFunctions.CreateIllegalDysonShellQuickly(DysonSphereFunctions.ShellsCountForFunctions.Value);
			}
		}

		private static RectTransform _windowTrans;

		private static UIButton _resignGameBtn;

		private static UIButton _clearBanBtn;

		public static void Init()
		{
			MyConfigWindow.OnUICreated = (Action<MyConfigWindow, RectTransform>)Delegate.Combine(MyConfigWindow.OnUICreated, new Action<MyConfigWindow, RectTransform>(CreateUI));
			MyConfigWindow.OnUpdateUI = (Action)Delegate.Combine(MyConfigWindow.OnUpdateUI, new Action(UpdateUI));
		}

		private static InputField AddShellsCountInput(MyConfigWindow wnd, float x, float y, RectTransform parent, string objName)
		{
			ConfigEntry<int> config = DysonSphereFunctions.ShellsCountForFunctions;
			int num = Mathf.Clamp(config.Value, 1, 99999);
			if (config.Value != num)
			{
				config.Value = num;
			}
			InputField input = null;
			input = ((MyWindow)wnd).AddInputField(x, y, parent, num.ToString(), 15, objName, (UnityAction<string>)null, (UnityAction<string>)delegate(string value)
			{
				if (!int.TryParse(value, out var result))
				{
					result = config.Value;
				}
				result = Mathf.Clamp(result, 1, 99999);
				config.Value = result;
				input.text = result.ToString();
			});
			input.contentType = (ContentType)2;
			input.characterLimit = 5;
			config.SettingChanged += OnShellsCountChanged;
			((MyWindow)wnd).OnFree += delegate
			{
				config.SettingChanged -= OnShellsCountChanged;
			};
			return input;
			void OnShellsCountChanged(object o, EventArgs e)
			{
				int num2 = Mathf.Clamp(config.Value, 1, 99999);
				if (config.Value != num2)
				{
					config.Value = num2;
				}
				string text = num2.ToString();
				if (input.text != text)
				{
					input.text = text;
				}
			}
		}

		private static void CreateUI(MyConfigWindow wnd, RectTransform trans)
		{
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Expected O, but got Unknown
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Expected O, but got Unknown
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Expected O, but got Unknown
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Expected O, but got Unknown
			//IL_0641: Unknown result type (might be due to invalid IL or missing references)
			//IL_0646: Unknown result type (might be due to invalid IL or missing references)
			//IL_064c: Expected O, but got Unknown
			//IL_0684: Unknown result type (might be due to invalid IL or missing references)
			//IL_0689: Unknown result type (might be due to invalid IL or missing references)
			//IL_068f: Expected O, but got Unknown
			//IL_06c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d2: Expected O, but got Unknown
			//IL_070a: Unknown result type (might be due to invalid IL or missing references)
			//IL_070f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0715: Expected O, but got Unknown
			//IL_08dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e8: Expected O, but got Unknown
			//IL_091c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0921: Unknown result type (might be due to invalid IL or missing references)
			//IL_0927: Expected O, but got Unknown
			//IL_0969: Unknown result type (might be due to invalid IL or missing references)
			//IL_096e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0974: Expected O, but got Unknown
			//IL_09b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bd: Expected O, but got Unknown
			//IL_09fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a00: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a06: Expected O, but got Unknown
			//IL_0a44: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4f: Expected O, but got Unknown
			//IL_0aaa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aaf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab5: Expected O, but got Unknown
			//IL_0be5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf0: Expected O, but got Unknown
			//IL_0c24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c29: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2f: Expected O, but got Unknown
			_windowTrans = trans;
			float num = 0f;
			float num2 = 10f;
			((MyWindowWithTabs)wnd).AddSplitter(trans, 10f);
			((MyWindowWithTabs)wnd).AddTabGroup(trans, "Cheat Enabler", "tab-group-cheatenabler");
			RectTransform val = ((MyWindowWithTabs)wnd).AddTab(_windowTrans, "General");
			MyCheckBox val2 = ((MyWindow)wnd).AddCheckBox(num, num2, val, GamePatch.DevShortcutsEnabled, "Enable Dev Shortcuts", 15);
			num += val2.Width + 5f;
			num2 += 6f;
			((MyWindow)wnd).AddTipsButton2(num, num2, val, "Dev Shortcuts", "Dev Shortcuts Tips", "dev-shortcuts-tips", "tips-button");
			num = 0f;
			num2 += 30f;
			((MyWindow)wnd).AddCheckBox(num, num2, val, GamePatch.AbnormalDisablerEnabled, "Disable Abnormal Checks", 15);
			num2 += 36f;
			val2 = ((MyWindow)wnd).AddCheckBox(num, num2, val, TechTweaksPatch.Enabled, "Quickly upgrade/downgrade tech with key-modifiers", 15);
			num += val2.Width + 5f;
			num2 += 6f;
			((MyWindow)wnd).AddTipsButton2(num, num2, val, "Quickly upgrade/downgrade tech with key-modifiers", "Click a tech on the tree while holding:\r\n  Shift: Tech level + 1\r\n  Ctrl: Tech level + 10\r\n  Ctrl + Shift: Tech level + 100\r\n  Alt: Tech level to MAX\r\n\r\nNote: all direct prerequisites will be unlocked as well.\r\n\r\nPress Caps Lock to toggle Tech Downgrade Mode: the key-modifiers above then decrease tech levels and revert the corresponding upgrade values.\r\n  Shift: Tech level - 1\r\n  Ctrl: Tech level - 10\r\n  Ctrl + Shift: Tech level - 100\r\n  Alt: revert to locked (level 0)\r\n(Shift+Alt and Ctrl+Alt do nothing)\r\n\r\nThe features above come from the mod: CheatEnabler", "unlock-tech-tips", "tips-button");
			num = 0f;
			num2 += 66f;
			float num3 = num;
			float num4 = num2;
			object obj = <>O.<2>__RemoveAllMetadataConsumptions;
			if (obj == null)
			{
				UnityAction val3 = PlayerFunctions.RemoveAllMetadataConsumptions;
				<>O.<2>__RemoveAllMetadataConsumptions = val3;
				obj = (object)val3;
			}
			((MyWindow)wnd).AddButton(num3, num4, 400f, val, "Remove all metadata consumption records", 16, "button-remove-all-metadata-consumption", (UnityAction)obj);
			num2 += 36f;
			float num5 = num;
			float num6 = num2;
			object obj2 = <>O.<3>__RemoveCurrentMetadataConsumptions;
			if (obj2 == null)
			{
				UnityAction val4 = PlayerFunctions.RemoveCurrentMetadataConsumptions;
				<>O.<3>__RemoveCurrentMetadataConsumptions = val4;
				obj2 = (object)val4;
			}
			((MyWindow)wnd).AddButton(num5, num6, 400f, val, "Remove metadata consumption record in current game", 16, "button-remove-current-metadata-consumption", (UnityAction)obj2);
			num2 += 36f;
			float num7 = num;
			float num8 = num2;
			object obj3 = <>O.<4>__ClearMetadataBanAchievements;
			if (obj3 == null)
			{
				UnityAction val5 = PlayerFunctions.ClearMetadataBanAchievements;
				<>O.<4>__ClearMetadataBanAchievements = val5;
				obj3 = (object)val5;
			}
			_clearBanBtn = ((MyWindow)wnd).AddButton(num7, num8, 400f, val, "Clear metadata flag which bans achievements", 16, "button-clear-ban-list", (UnityAction)obj3);
			num = 300f;
			num2 = 10f;
			float num9 = num;
			float num10 = num2;
			object obj4 = <>c.<>9__6_0;
			if (obj4 == null)
			{
				UnityAction val6 = delegate
				{
					//IL_0005: Unknown result type (might be due to invalid IL or missing references)
					//IL_000a: Unknown result type (might be due to invalid IL or missing references)
					GameMain.data.account = AccountData.me;
				};
				<>c.<>9__6_0 = val6;
				obj4 = (object)val6;
			}
			_resignGameBtn = ((MyWindow)wnd).AddButton(num9, num10, 300f, val, "Assign gamesave to current account", 16, "resign-game-btn", (UnityAction)obj4);
			RectTransform val7 = ((MyWindowWithTabs)wnd).AddTab(_windowTrans, "Factory");
			num = 0f;
			num2 = 10f;
			((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.ImmediateEnabled, "Finish build immediately", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.ArchitectModeEnabled, "Architect mode", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.NoConditionEnabled, "Build without condition", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.NoCollisionEnabled, "No collision", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalGeneratorEnabled, "Belt signal generator", 15);
			num += 26f;
			num2 += 26f;
			MyCheckBox cb1 = ((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalCountGenEnabled, "Count generations as production in statistics", 13);
			num2 += 26f;
			MyCheckBox cb2 = ((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalCountRemEnabled, "Count removals as consumption in statistics", 13);
			num2 += 26f;
			MyCheckBox cb3 = ((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalCountRecipeEnabled, "Count all raws and intermediates in statistics", 13);
			num2 += 26f;
			MyCheckBox cb4 = ((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalUseProliferatorEnabled, "Count proliferators used for raws/intermediates and finished products", 13);
			num2 += 6f;
			UIButton tip1 = ((MyWindow)wnd).AddTipsButton2(num + cb4.Width + 5f, num2, val7, "Count proliferators used for raws/intermediates and finished products", "Count proliferators used for raws/intermediates and finished products tips", "count-proliferators-used-for-raws-intermediates-and-finished-products-tips", "tips-button");
			num2 += 20f;
			MyCheckBox cb5 = ((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalNumberAltFormat, "Belt signal alt format", 13);
			num2 += 6f;
			UIButton tip2 = ((MyWindow)wnd).AddTipsButton2(num + cb5.Width + 5f, num2, val7, "Belt signal alt format", "Belt signal alt format tips", "belt-signal-alt-format-tips", "tips-button");
			num = 0f;
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.ControlPanelRemoteLogisticsEnabled, "Retrieve/Place items from/to remote planets on logistics control panel", 15);
			global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalGeneratorEnabled.SettingChanged += OnBeltSignalChanged;
			((MyWindow)wnd).OnFree += delegate
			{
				global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalGeneratorEnabled.SettingChanged -= OnBeltSignalChanged;
			};
			OnBeltSignalChanged(null, null);
			num = 350f;
			num2 = 10f;
			((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.RemovePowerSpaceLimitEnabled, "Remove power space limit", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.WindTurbinesPowerGlobalCoverageEnabled, "Wind Turbines do global power coverage", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.BoostWindPowerEnabled, "Boost wind power", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.BoostSolarPowerEnabled, "Boost solar power", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.BoostGeothermalPowerEnabled, "Boost geothermal power", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val7, global::CheatEnabler.Patches.Factory.FactoryPatch.BoostFuelPowerEnabled, "Boost fuel power", 15);
			num2 += 26f;
			((MyWindow)wnd).AddText2(num + 32f, num2, val7, "Boost fuel power 2", 13, "label");
			RectTransform val8 = ((MyWindowWithTabs)wnd).AddTab(_windowTrans, "Planet");
			num = 0f;
			num2 = 10f;
			((MyWindow)wnd).AddCheckBox(num, num2, val8, ResourcePatch.InfiniteResourceEnabled, "Infinite Natural Resources", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val8, ResourcePatch.FastMiningEnabled, "Fast Mining", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val8, PlanetPatch.WaterPumpAnywhereEnabled, "Pump Anywhere", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val8, PlanetPatch.TerraformAnywayEnabled, "Terraform without enough soil piles", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val8, PlayerPatch.InstantHandCraftEnabled, "Instant hand-craft", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val8, PlayerPatch.InstantTeleportEnabled, "Instant teleport (like that in Sandbox mode)", 15);
			num = 400f;
			num2 = 10f;
			float num11 = num;
			float num12 = num2;
			object obj5 = <>c.<>9__6_3;
			if (obj5 == null)
			{
				UnityAction val9 = delegate
				{
					PlanetFunctions.BuryAllVeins(bury: true);
				};
				<>c.<>9__6_3 = val9;
				obj5 = (object)val9;
			}
			((MyWindow)wnd).AddButton(num11, num12, 200f, val8, "Bury all veins", 16, "button-bury-all", (UnityAction)obj5);
			num2 += 36f;
			float num13 = num;
			float num14 = num2;
			object obj6 = <>c.<>9__6_4;
			if (obj6 == null)
			{
				UnityAction val10 = delegate
				{
					PlanetFunctions.BuryAllVeins(bury: false);
				};
				<>c.<>9__6_4 = val10;
				obj6 = (object)val10;
			}
			((MyWindow)wnd).AddButton(num13, num14, 200f, val8, "Restore buried veins", 16, "button-bury-restore-all", (UnityAction)obj6);
			num2 += 36f;
			float num15 = num;
			float num16 = num2;
			object obj7 = <>c.<>9__6_5;
			if (obj7 == null)
			{
				UnityAction val11 = delegate
				{
					Player mainPlayer = GameMain.mainPlayer;
					if (mainPlayer != null)
					{
						BuildTool_Reform reformTool = mainPlayer.controller.actionBuild.reformTool;
						if (GameMain.localPlanet?.factory != null)
						{
							GameMain.localPlanet.factory.PlanetReformAll(reformTool.brushType, reformTool.brushColor, reformTool.buryVeins);
						}
					}
				};
				<>c.<>9__6_5 = val11;
				obj7 = (object)val11;
			}
			((MyWindow)wnd).AddButton(num15, num16, 200f, val8, "Reform entire planet", 16, "button-reform-all", (UnityAction)obj7);
			num2 += 36f;
			float num17 = num;
			float num18 = num2;
			object obj8 = <>c.<>9__6_6;
			if (obj8 == null)
			{
				UnityAction val12 = delegate
				{
					if (GameMain.localPlanet?.factory != null)
					{
						GameMain.localPlanet.factory.PlanetReformRevert();
					}
				};
				<>c.<>9__6_6 = val12;
				obj8 = (object)val12;
			}
			((MyWindow)wnd).AddButton(num17, num18, 200f, val8, "Revert planet terrain", 16, "button-reform-revert-all", (UnityAction)obj8);
			RectTransform val13 = ((MyWindowWithTabs)wnd).AddTab(_windowTrans, "Dyson Sphere");
			num = 0f;
			num2 = 10f;
			((MyWindow)wnd).AddCheckBox(num, num2, val13, DysonSpherePatch.SkipBulletEnabled, "Skip bullet period", 15);
			num2 += 26f;
			((MyWindow)wnd).AddCheckBox(num + 26f, num2, val13, DysonSpherePatch.FireAllBulletsEnabled, "Fire all bullets at once", 13);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val13, DysonSpherePatch.SkipAbsorbEnabled, "Skip absorption period", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val13, DysonSpherePatch.QuickAbsorbEnabled, "Quick absorb", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val13, DysonSpherePatch.EjectAnywayEnabled, "Eject anyway", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val13, DysonSpherePatch.OverclockEjectorEnabled, "Overclock Ejectors", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val13, DysonSpherePatch.OverclockSiloEnabled, "Overclock Silos", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val13, DysonSpherePatch.UnlockMaxOrbitRadiusEnabled, "Unlock Dyson Sphere max orbit radius", 15);
			num2 += 30f;
			MySlider slider = ((MyWindow)wnd).AddSlider<float>(num + 20f, num2, val13, DysonSpherePatch.UnlockMaxOrbitRadiusValue, (ValueMapper<float>)(object)new MaxOrbitRadiusValueMapper(), "##,#m", 0f).WithSmallerHandle(-40f, 0f);
			DysonSpherePatch.UnlockMaxOrbitRadiusEnabled.SettingChanged += UnlockMaxOrbitRadiusChanged;
			((MyWindow)wnd).OnFree += delegate
			{
				DysonSpherePatch.UnlockMaxOrbitRadiusEnabled.SettingChanged -= UnlockMaxOrbitRadiusChanged;
			};
			UnlockMaxOrbitRadiusChanged(null, null);
			num = 300f;
			num2 = 10f;
			float num19 = num;
			float num20 = num2;
			object obj9 = <>O.<5>__CompleteShellsInstantly;
			if (obj9 == null)
			{
				UnityAction val14 = DysonSphereFunctions.CompleteShellsInstantly;
				<>O.<5>__CompleteShellsInstantly = val14;
				obj9 = (object)val14;
			}
			((MyWindow)wnd).AddButton(num19, num20, 300f, val13, "Complete Dyson Sphere shells instantly", 16, "button-complete-dyson-sphere-shells-instantly", (UnityAction)obj9);
			num2 += 36f;
			float num21 = num;
			float num22 = num2;
			object obj10 = <>O.<6>__RemoveAllFrames;
			if (obj10 == null)
			{
				UnityAction val15 = DysonSphereFunctions.RemoveAllFrames;
				<>O.<6>__RemoveAllFrames = val15;
				obj10 = (object)val15;
			}
			((MyWindow)wnd).AddButton(num21, num22, 300f, val13, "Remove all frames on Dyson Sphere", 16, "button-remove-all-frames-on-dyson-sphere", (UnityAction)obj10);
			num2 += 72f;
			float num23 = num2;
			float num24 = num;
			float num25 = num2;
			object obj11 = <>c.<>9__6_9;
			if (obj11 == null)
			{
				UnityAction val16 = delegate
				{
					//IL_003e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0043: Unknown result type (might be due to invalid IL or missing references)
					//IL_0049: Expected O, but got Unknown
					string text = Localization.Translate("Generate illegal dyson shell");
					string text2 = Localization.Translate("WARNING: This operation can be very slow, continue?");
					string text3 = Localization.Translate("Cancel");
					string text4 = Localization.Translate("OK");
					object obj18 = <>c.<>9__6_16;
					if (obj18 == null)
					{
						Response val24 = delegate
						{
							DysonSphereFunctions.CreateIllegalDysonShellWithMaxOutput();
						};
						<>c.<>9__6_16 = val24;
						obj18 = (object)val24;
					}
					UIMessageBox.Show(text, text2, text3, text4, 1, (Response)null, (Response)obj18);
				};
				<>c.<>9__6_9 = val16;
				obj11 = (object)val16;
			}
			UIButton btn0 = ((MyWindow)wnd).AddButton(num24, num25, 300f, val13, "Generate illegal dyson shell", 16, "button-generate-illegal-dyson-shells", (UnityAction)obj11);
			num2 += 36f;
			float num26 = num;
			float num27 = num2;
			object obj12 = <>c.<>9__6_10;
			if (obj12 == null)
			{
				UnityAction val17 = delegate
				{
					//IL_003e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0043: Unknown result type (might be due to invalid IL or missing references)
					//IL_0049: Expected O, but got Unknown
					string text = Localization.Translate("Generate illegal dyson shell 2");
					string text2 = Localization.Translate("WARNING: This operation can be very slow, continue?");
					string text3 = Localization.Translate("Cancel");
					string text4 = Localization.Translate("OK");
					object obj18 = <>c.<>9__6_17;
					if (obj18 == null)
					{
						Response val24 = delegate
						{
							DysonSphereFunctions.CreateIllegalDysonShellWithMaxOutputForAllLayers();
						};
						<>c.<>9__6_17 = val24;
						obj18 = (object)val24;
					}
					UIMessageBox.Show(text, text2, text3, text4, 1, (Response)null, (Response)obj18);
				};
				<>c.<>9__6_10 = val17;
				obj12 = (object)val17;
			}
			UIButton btn1 = ((MyWindow)wnd).AddButton(num26, num27, 300f, val13, "Generate illegal dyson shell 2", 16, "button-generate-illegal-dyson-shells", (UnityAction)obj12);
			num2 += 36f;
			float num28 = num;
			float num29 = num2;
			object obj13 = <>c.<>9__6_11;
			if (obj13 == null)
			{
				UnityAction val18 = delegate
				{
					//IL_003e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0043: Unknown result type (might be due to invalid IL or missing references)
					//IL_0049: Expected O, but got Unknown
					string text = Localization.Translate("Keep max production shells and remove others");
					string text2 = Localization.Translate("WARNING: This operation is DANGEROUS, continue?");
					string text3 = Localization.Translate("Cancel");
					string text4 = Localization.Translate("OK");
					object obj18 = <>c.<>9__6_18;
					if (obj18 == null)
					{
						Response val24 = delegate
						{
							DysonSphereFunctions.KeepMaxProductionShells();
						};
						<>c.<>9__6_18 = val24;
						obj18 = (object)val24;
					}
					UIMessageBox.Show(text, text2, text3, text4, 1, (Response)null, (Response)obj18);
				};
				<>c.<>9__6_11 = val18;
				obj13 = (object)val18;
			}
			UIButton btn2 = ((MyWindow)wnd).AddButton(num28, num29, 300f, val13, "Keep max production shells and remove others", 16, "button-keep-max-production-shells", (UnityAction)obj13);
			num2 += 36f;
			float num30 = num;
			float num31 = num2;
			object obj14 = <>c.<>9__6_12;
			if (obj14 == null)
			{
				UnityAction val19 = delegate
				{
					//IL_003e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0043: Unknown result type (might be due to invalid IL or missing references)
					//IL_0049: Expected O, but got Unknown
					string text = Localization.Translate("Duplicate shells from that with highest production");
					string text2 = Localization.Translate("WARNING: This operation can be very slow, continue?");
					string text3 = Localization.Translate("Cancel");
					string text4 = Localization.Translate("OK");
					object obj18 = <>c.<>9__6_19;
					if (obj18 == null)
					{
						Response val24 = delegate
						{
							DysonSphereFunctions.DuplicateShellsWithHighestProduction();
						};
						<>c.<>9__6_19 = val24;
						obj18 = (object)val24;
					}
					UIMessageBox.Show(text, text2, text3, text4, 1, (Response)null, (Response)obj18);
				};
				<>c.<>9__6_12 = val19;
				obj14 = (object)val19;
			}
			UIButton btn3 = ((MyWindow)wnd).AddButton(num30, num31, 300f, val13, "Duplicate shells from that with highest production", 16, "button-duplicate-shells-from-the-highest-production", (UnityAction)obj14);
			num2 += 30f;
			InputField input1 = AddShellsCountInput(wnd, num + 20f, num2, val13, "input-shells-count-illegal");
			num2 = num23;
			float num32 = num;
			float num33 = num2;
			object obj15 = <>c.<>9__6_13;
			if (obj15 == null)
			{
				UnityAction val20 = delegate
				{
					//IL_003e: Unknown result type (might be due to invalid IL or missing references)
					//IL_0043: Unknown result type (might be due to invalid IL or missing references)
					//IL_0049: Expected O, but got Unknown
					string text = Localization.Translate("Generate illegal dyson shell quickly");
					string text2 = Localization.Translate("WARNING: This operation can be very slow, continue?");
					string text3 = Localization.Translate("Cancel");
					string text4 = Localization.Translate("OK");
					object obj18 = <>c.<>9__6_20;
					if (obj18 == null)
					{
						Response val24 = delegate
						{
							DysonSphereFunctions.CreateIllegalDysonShellQuickly(DysonSphereFunctions.ShellsCountForFunctions.Value);
						};
						<>c.<>9__6_20 = val24;
						obj18 = (object)val24;
					}
					UIMessageBox.Show(text, text2, text3, text4, 1, (Response)null, (Response)obj18);
				};
				<>c.<>9__6_13 = val20;
				obj15 = (object)val20;
			}
			UIButton btn4 = ((MyWindow)wnd).AddButton(num32, num33, 300f, val13, "Generate illegal dyson shell quickly", 16, "button-generate-illegal-dyson-shells-quickly", (UnityAction)obj15);
			num2 += 30f;
			Text txt2 = ((MyWindow)wnd).AddText2(num, num2, val13, "Shells count", 15, "text-shells-count");
			InputField input2 = AddShellsCountInput(wnd, num + Util.GetPreferredWidth(txt2) + 5f, num2, val13, "input-shells-count-quick");
			DysonSphereFunctions.IllegalDysonShellFunctionsEnabled.SettingChanged += onIllegalDysonShellFunctionsChanged;
			((MyWindow)wnd).OnFree += delegate
			{
				DysonSphereFunctions.IllegalDysonShellFunctionsEnabled.SettingChanged -= onIllegalDysonShellFunctionsChanged;
			};
			onIllegalDysonShellFunctionsChanged(null, null);
			RectTransform val21 = ((MyWindowWithTabs)wnd).AddTab(_windowTrans, "Mecha/Combat");
			num = 0f;
			num2 = 10f;
			((MyWindow)wnd).AddCheckBox(num, num2, val21, CombatPatch.MechaInvincibleEnabled, "Mecha and Drones/Fleets invicible", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val21, CombatPatch.BuildingsInvincibleEnabled, "Buildings invicible", 15);
			num2 += 36f;
			((MyWindow)wnd).AddCheckBox(num, num2, val21, PlayerPatch.WarpWithoutSpaceWarpersEnabled, "Enable warp without space warpers", 15);
			num = 400f;
			num2 = 10f;
			float num34 = num;
			float num35 = num2;
			object obj16 = <>O.<7>__TeleportToOuterSpace;
			if (obj16 == null)
			{
				UnityAction val22 = PlayerFunctions.TeleportToOuterSpace;
				<>O.<7>__TeleportToOuterSpace = val22;
				obj16 = (object)val22;
			}
			((MyWindow)wnd).AddButton(num34, num35, 200f, val21, "Teleport to outer space", 16, "button-teleport-to-outer-space", (UnityAction)obj16);
			num2 += 36f;
			float num36 = num;
			float num37 = num2;
			object obj17 = <>O.<8>__TeleportToSelectedAstronomical;
			if (obj17 == null)
			{
				UnityAction val23 = PlayerFunctions.TeleportToSelectedAstronomical;
				<>O.<8>__TeleportToSelectedAstronomical = val23;
				obj17 = (object)val23;
			}
			((MyWindow)wnd).AddButton(num36, num37, 200f, val21, "Teleport to selected astronomical", 16, "button-teleport-to-selected-astronomical", (UnityAction)obj17);
			void OnBeltSignalChanged(object o, EventArgs e)
			{
				bool value = global::CheatEnabler.Patches.Factory.FactoryPatch.BeltSignalGeneratorEnabled.Value;
				((Component)cb1).gameObject.SetActive(value);
				((Component)cb2).gameObject.SetActive(value);
				((Component)cb3).gameObject.SetActive(value);
				((Component)cb4).gameObject.SetActive(value);
				((Component)cb5).gameObject.SetActive(value);
				((Component)tip1).gameObject.SetActive(value);
				((Component)tip2).gameObject.SetActive(value);
			}
			void UnlockMaxOrbitRadiusChanged(object o, EventArgs e)
			{
				((Behaviour)slider.slider).enabled = DysonSpherePatch.UnlockMaxOrbitRadiusEnabled.Value;
			}
			void onIllegalDysonShellFunctionsChanged(object o, EventArgs e)
			{
				bool value = DysonSphereFunctions.IllegalDysonShellFunctionsEnabled.Value;
				((Component)btn0).gameObject.SetActive(value);
				((Component)btn1).gameObject.SetActive(value);
				((Component)btn2).gameObject.SetActive(value);
				((Component)btn3).gameObject.SetActive(value);
				((Component)input1).gameObject.SetActive(value);
				((Component)btn4).gameObject.SetActive(!value);
				((Component)txt2).gameObject.SetActive(!value);
				((Component)input2).gameObject.SetActive(!value);
			}
		}

		private static void UpdateUI()
		{
			UpdateButtons();
		}

		private static void UpdateButtons()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_resignGameBtn == (Object)null || (Object)(object)_clearBanBtn == (Object)null)
			{
				return;
			}
			GameData data = GameMain.data;
			if (data == null)
			{
				return;
			}
			bool flag = data.account != AccountData.me;
			if (((Component)_resignGameBtn).gameObject.activeSelf != flag)
			{
				((Component)_resignGameBtn).gameObject.SetActive(flag);
			}
			GameHistoryData history = data.history;
			if (history != null)
			{
				bool hasUsedPropertyBanAchievement = history.hasUsedPropertyBanAchievement;
				if (((Component)_clearBanBtn).gameObject.activeSelf != hasUsedPropertyBanAchievement)
				{
					((Component)_clearBanBtn).gameObject.SetActive(hasUsedPropertyBanAchievement);
				}
			}
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "org.soardev.cheatenabler";

		public const string PLUGIN_NAME = "CheatEnabler";

		public const string PLUGIN_VERSION = "2.4.8";
	}
}
namespace CheatEnabler.Patches
{
	[ModFeature("Combat")]
	public static class CombatPatch
	{
		private class MechaInvincible : PatchImpl<MechaInvincible>
		{
			[HarmonyTranspiler]
			[HarmonyPatch(/*Could not decode attribute arguments.*/)]
			private static IEnumerable<CodeInstruction> Player_get_invincible_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Expected O, but got Unknown
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003b: Expected O, but got Unknown
				CodeMatcher val = new CodeMatcher(instructions, generator);
				val.Start().RemoveInstructions(val.Length).Insert((CodeInstruction[])(object)new CodeInstruction[2]
				{
					new CodeInstruction(OpCodes.Ldc_I4_1, (object)null),
					new CodeInstruction(OpCodes.Ret, (object)null)
				});
				return val.InstructionEnumeration();
			}

			[HarmonyTranspiler]
			[HarmonyPatch(typeof(SkillSystem), "DamageGroundObjectByLocalCaster")]
			[HarmonyPatch(typeof(SkillSystem), "DamageGroundObjectByRemoteCaster")]
			[HarmonyPatch(typeof(SkillSystem), "DamageObject")]
			private static IEnumerable<CodeInstruction> SkillSystem_DamageObject_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator, MethodBase __originalMethod)
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Expected O, but got Unknown
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0045: Expected O, but got Unknown
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_006c: Expected O, but got Unknown
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: Expected O, but got Unknown
				//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a8: Expected O, but got Unknown
				CodeMatcher val = new CodeMatcher(instructions, generator);
				val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[4]
				{
					new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction ci) => CodeInstructionExtensions.IsLdarg(ci, (int?)null)), (string)null),
					new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(SkillTargetLocal), "type"), (string)null),
					new CodeMatch((OpCode?)OpCodes.Ldc_I4_6, (object)null, (string)null),
					new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction ci) => ci.opcode == OpCodes.Bne_Un || ci.opcode == OpCodes.Bne_Un_S), (string)null)
				});
				val.Repeat((Action<CodeMatcher>)delegate(CodeMatcher m)
				{
					//IL_0015: Unknown result type (might be due to invalid IL or missing references)
					//IL_001b: Expected O, but got Unknown
					//IL_0042: Unknown result type (might be due to invalid IL or missing references)
					//IL_0048: Expected O, but got Unknown
					m.Advance(4).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[2]
					{
						new CodeInstruction(OpCodes.Ldc_I4_0, (object)null),
						new CodeInstruction(OpCodes.Starg_S, (object)((__originalMethod.Name == "DamageObject") ? 1 : 2))
					});
				}, (Action<string>)null);
				return val.InstructionEnumeration();
			}
		}

		private class BuildingsInvincible : PatchImpl<BuildingsInvincible>
		{
			[HarmonyTranspiler]
			[HarmonyPatch(typeof(SkillSystem), "DamageGroundObjectByLocalCaster")]
			[HarmonyPatch(typeof(SkillSystem), "DamageGroundObjectByRemoteCaster")]
			private static IEnumerable<CodeInstruction> SkillSystem_DamageObject_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0032: Unknown result type (might be due to invalid IL or missing references)
				//IL_0038: Expected O, but got Unknown
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Expected O, but got Unknown
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_0087: Expected O, but got Unknown
				//IL_0095: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Expected O, but got Unknown
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ba: Expected O, but got Unknown
				//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cd: Expected O, but got Unknown
				CodeMatcher val = new CodeMatcher(instructions, generator);
				val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[4]
				{
					new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction ci) => CodeInstructionExtensions.IsLdarg(ci, (int?)null)), (string)null),
					new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(SkillTargetLocal), "type"), (string)null),
					new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction ci) => ci.opcode == OpCodes.Brtrue || ci.opcode == OpCodes.Brtrue_S), (string)null),
					new CodeMatch((OpCode?)OpCodes.Ldarg_1, (object)null, (string)null)
				}).Advance(3).Insert((CodeInstruction[])(object)new CodeInstruction[2]
				{
					new CodeInstruction(OpCodes.Ldc_I4_0, (object)null),
					new CodeInstruction(OpCodes.Starg_S, (object)2)
				});
				return val.InstructionEnumeration();
			}
		}

		public static ConfigEntry<bool> MechaInvincibleEnabled;

		public static ConfigEntry<bool> BuildingsInvincibleEnabled;

		public static void Init()
		{
			MechaInvincibleEnabled.SettingChanged += delegate
			{
				PatchImpl<MechaInvincible>.Enable(MechaInvincibleEnabled.Value);
			};
			BuildingsInvincibleEnabled.SettingChanged += delegate
			{
				PatchImpl<BuildingsInvincible>.Enable(BuildingsInvincibleEnabled.Value);
			};
		}

		public static void Start()
		{
			PatchImpl<MechaInvincible>.Enable(MechaInvincibleEnabled.Value);
			PatchImpl<BuildingsInvincible>.Enable(BuildingsInvincibleEnabled.Value);
		}

		public static void Uninit()
		{
			PatchImpl<BuildingsInvincible>.Enable(false);
			PatchImpl<MechaInvincible>.Enable(false);
		}
	}
	[ModFeature("DysonSphere")]
	public class DysonSpherePatch : PatchImpl<DysonSpherePatch>
	{
		private class SkipBulletPatch : PatchImpl<SkipBulletPatch>
		{
			private struct DysonSailCache
			{
				public DysonSail Sail;

				public int OrbitId;

				public void FromData(in VectorLF3 delta1, in VectorLF3 delta2, int orbitId)
				{
					Sail.px = (float)delta1.x;
					Sail.py = (float)delta1.y;
					Sail.pz = (float)delta1.z;
					Sail.vx = (float)delta2.x;
					Sail.vy = (float)delta2.y;
					Sail.vz = (float)delta2.z;
					Sail.gs = 1f;
					OrbitId = orbitId;
				}
			}

			private static long _sailLifeTime;

			private static DysonSailCache[][] _sailsCache;

			private static int[] _sailsCacheLen;

			private static int[] _sailsCacheCapacity;

			private static bool _fireAllBullets;

			public static void SetFireAllBullets(bool value)
			{
				_fireAllBullets = value;
			}

			protected override void OnEnable()
			{
				UpdateSailLifeTime();
				UpdateSailsCacheForThisGame();
				GameLogic.OnGameBegin = (Action)Delegate.Combine(GameLogic.OnGameBegin, new Action(OnGameBegin));
			}

			protected override void OnDisable()
			{
				GameLogic.OnGameBegin = (Action)Delegate.Remove(GameLogic.OnGameBegin, new Action(OnGameBegin));
			}

			private static void UpdateSailLifeTime()
			{
				if (GameMain.history != null)
				{
					_sailLifeTime = (long)(GameMain.history.solarSailLife * 60f + 0.1f);
				}
			}

			private static void UpdateSailsCacheForThisGame()
			{
				if (GameMain.data?.galaxy != null)
				{
					int starCount = GameMain.data.galaxy.starCount;
					_sailsCache = new DysonSailCache[starCount][];
					_sailsCacheLen = new int[starCount];
					_sailsCacheCapacity = new int[starCount];
					Array.Clear(_sailsCacheLen, 0, starCount);
					Array.Clear(_sailsCacheCapacity, 0, starCount);
				}
			}

			private static void SetSailsCacheCapacity(int index, int capacity)
			{
				DysonSailCache[] array = new DysonSailCache[capacity];
				int num = _sailsCacheLen[index];
				if (num > 0)
				{
					Array.Copy(_sailsCache[index], array, num);
				}
				_sailsCache[index] = array;
				_sailsCacheCapacity[index] = capacity;
			}

			private static void OnGameBegin()
			{
				UpdateSailsCacheForThisGame();
				UpdateSailLifeTime();
			}

			[HarmonyPostfix]
			[HarmonyPatch(typeof(GameHistoryData), "UnlockTechFunction")]
			private static void GameHistoryData_SetForNewGame_Postfix(int func)
			{
				if (func == 12)
				{
					UpdateSailLifeTime();
				}
			}

			[HarmonyTranspiler]
			[HarmonyPatch(typeof(EjectorComponent), "InternalUpdate")]
			private static IEnumerable<CodeInstruction> EjectorComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_002d: Expected O, but got Unknown
				//IL_0056: Unknown result type (might be due to invalid IL or missing references)
				//IL_005c: Expected O, but got Unknown
				//IL_007d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0083: Expected O, but got Unknown
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00be: Expected O, but got Unknown
				//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cc: Expected O, but got Unknown
				//IL_00da: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e0: Expected O, but got Unknown
				//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f4: Expected O, but got Unknown
				//IL_0101: Unknown result type (might be due to invalid IL or missing references)
				//IL_0107: Expected O, but got Unknown
				//IL_0124: Unknown result type (might be due to invalid IL or missing references)
				//IL_012a: Expected O, but got Unknown
				CodeMatcher val = new CodeMatcher(instructions, generator);
				val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
				{
					new CodeMatch((OpCode?)OpCodes.Ldc_R4, (object)10f, (string)null)
				}).Advance(2);
				int pos = val.Pos;
				val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[2]
				{
					new CodeMatch((OpCode?)OpCodes.Ldc_I4_M1, (object)null, (string)null),
					new CodeMatch((OpCode?)OpCodes.Stfld, (object)AccessTools.Field(typeof(EjectorComponent), "direction"), (string)null)
				}).Advance(2);
				int pos2 = val.Pos;
				val.Start().Advance(pos).RemoveInstructions(pos2 - pos)
					.Insert((CodeInstruction[])(object)new CodeInstruction[6]
					{
						new CodeInstruction(OpCodes.Ldarg_0, (object)null),
						new CodeInstruction(OpCodes.Ldarg_3, (object)null),
						new CodeInstruction(OpCodes.Ldloc_S, (object)9),
						new CodeInstruction(OpCodes.Ldloc_S, (object)11),
						new CodeInstruction(OpCodes.Ldarg_S, (object)6),
						new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(SkipBulletPatch), "AddDysonSail", (Type[])null, (Type[])null))
					});
				return val.InstructionEnumeration();
			}

			private static void AddDysonSail(ref EjectorComponent ejector, DysonSwarm swarm, VectorLF3 uPos, VectorLF3 endVec, int[] consumeRegister)
			{
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				//IL_001a: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				//IL_0025: Unknown result type (might be due to invalid IL or missing references)
				//IL_0026: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: 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)
				//IL_0042: Unknown result type (might be due to invalid IL or missing references)
				//IL_0047: Unknown result type (might be due to invalid IL or missing references)
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_0078: Unknown result type (might be due to invalid IL or missing references)
				//IL_0185: Unknown result type (might be due to invalid IL or missing references)
				//IL_0195: Unknown result type (might be due to invalid IL or missing references)
				//IL_019a: 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_011b: 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_0130: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: Unknown result type (might be due to invalid IL or missing references)
				int index = swarm.starData.index;
				int orbitId = ejector.orbitId;
				VectorLF3 delta = endVec - swarm.starData.uPosition;
				VectorLF3 delta2 = VectorLF3.Cross(endVec - uPos, VectorLF3.op_Implicit(swarm.orbits[orbitId].up));
				VectorLF3 val = ((VectorLF3)(ref delta2)).normalized * Math.Sqrt(swarm.dysonSphere.gravity / swarm.orbits[orbitId].radius);
				int bulletCount = ejector.bulletCount;
				lock (swarm)
				{
					DysonSailCache[] array = _sailsCache[index];
					int num = _sailsCacheLen[index];
					if (array == null)
					{
						SetSailsCacheCapacity(index, 256);
						array = _sailsCache[index];
					}
					if (_fireAllBullets)
					{
						int num2 = _sailsCacheCapacity[index];
						int num3 = num + bulletCount;
						if (num3 > num2)
						{
							do
							{
								num2 *= 2;
							}
							while (num3 > num2);
							SetSailsCacheCapacity(index, num2);
							array = _sailsCache[index];
						}
						_sailsCacheLen[index] = num + bulletCount;
						int num4 = num + bulletCount;
						for (int i = num; i < num4; i++)
						{
							ref DysonSailCache reference = ref array[i];
							delta2 = val + RandomTable.SphericNormal(ref swarm.randSeed, 0.5);
							reference.FromData(in delta, in delta2, orbitId);
						}
					}
					else
					{
						int num5 = _sailsCacheCapacity[index];
						if (num >= num5)
						{
							SetSailsCacheCapacity(index, num5 * 2);
							array = _sailsCache[index];
						}
						_sailsCacheLen[index] = num + 1;
						ref DysonSailCache reference2 = ref array[num];
						delta2 = val + RandomTable.SphericNormal(ref swarm.randSeed, 0.5);
						reference2.FromData(in delta, in delta2, orbitId);
					}
				}
				if (_fireAllBullets)
				{
					if (!ejector.incUsed)
					{
						ejector.incUsed = ejector.bulletInc >= bulletCount;
					}
					ejector.bulletInc = 0;
					ejector.bulletCount = 0;
					lock (consumeRegister)
					{
						consumeRegister[ejector.bulletId] += bulletCount;
					}
				}
				else
				{
					int num6 = ejector.bulletInc / bulletCount;
					if (!ejector.incUsed)
					{
						ejector.incUsed = num6 > 0;
					}
					ejector.bulletInc -= num6;
					ejector.bulletCount = bulletCount - 1;
					if (ejector.bulletCount == 0)
					{
						ejector.bulletInc = 0;
					}
					lock (consumeRegister)
					{
						consumeRegister[ejector.bulletId]++;
					}
				}
				ejector.time = ejector.coldSpend;
				ejector.direction = -1;
			}

			[HarmonyPrefix]
			[HarmonyPatch(typeof(DysonSwarm), "GameTick")]
			public static void DysonSwarm_GameTick_Prefix(DysonSwarm __instance, long time)
			{
				//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
				int index = __instance.starData.index;
				int num = _sailsCacheLen[index];
				if (num == 0)
				{
					return;
				}
				_sailsCacheLen[index] = 0;
				DysonSailCache[] array = _sailsCache[index];
				long num2 = time + _sailLifeTime;
				int num3 = num - 1;
				if (_instantAbsorb)
				{
					DysonSphere dysonSphere = __instance.dysonSphere;
					DysonSphereLayer[] layersSorted = dysonSphere.layersSorted;
					int layerCount = dysonSphere.layerCount;
					int[] productRegister = dysonSphere.productRegister;
					int[] consumeRegister = dysonSphere.consumeRegister;
					if (layerCount > 0)
					{
						int num4 = ((int)time >> 4) % layerCount;
						for (int num5 = layerCount - 1; num5 >= 0; num5--)
						{
							DysonSphereLayer obj = layersSorted[(num4 + num5) % layerCount];
							DysonNode[] nodePool = obj.nodePool;
							int num6 = obj.nodeCursor - 1;
							if (num6 > 0)
							{
								int num7 = (int)time % num6;
								for (int num8 = num6; num8 > 0; num8--)
								{
									int num9 = (num7 + num8) % num6 + 1;
									DysonNode val = nodePool[num9];
									if (val != null && val.id == num9 && val.sp >= val.spMax)
									{
										while (val.cpReqOrder > 0)
										{
											val.cpOrdered++;
											if (val.ConstructCp() == null)
											{
												break;
											}
											if (num3 == 0)
											{
												productRegister[11901] += num;
												consumeRegister[11901] += num;
												productRegister[11903] += num;
												__instance.dysonSphere.needRecalculatePower = true;
												return;
											}
											num3--;
										}
									}
								}
							}
						}
					}
					int num10 = num - 1 - num3;
					if (num10 > 0)
					{
						productRegister[11901] += num10;
						consumeRegister[11901] += num10;
						productRegister[11903] += num10;
						__instance.dysonSphere.needRecalculatePower = true;
					}
				}
				while (num3 >= 0)
				{
					__instance.AddSolarSail(array[num3].Sail, array[num3].OrbitId, num2);
					num3--;
				}
			}
		}

		private class SkipAbsorbPatch : PatchImpl<SkipAbsorbPatch>
		{
			protected override void OnEnable()
			{
				_instantAbsorb = QuickAbsorbEnabled.Value && PatchImpl<QuickAbsorbPatch>.GetHarmony() != null;
			}

			protected override void OnDisable()
			{
				_instantAbsorb = QuickAbsorbEnabled.Value && PatchImpl<QuickAbsorbPatch>.GetHarmony() != null;
			}

			[HarmonyTranspiler]
			[HarmonyPatch(typeof(DysonSwarm), "AbsorbSail")]
			private static IEnumerable<CodeInstruction> DysonSwarm_AbsorbSail_Transpiler2(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_003e: Expected O, but got Unknown
				//IL_0069: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Expected O, but got Unknown
				//IL_0077: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Expected O, but got Unknown
				//IL_0085: Unknown result type (might be due to invalid IL or missing references)
				//IL_008b: Expected O, but got Unknown
				//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Expected O, but got Unknown
				//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ce: Expected O, but got Unknown
				CodeMatcher val = new CodeMatcher(instructions, generator);
				generator.DefineLabel();
				val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
				{
					new CodeMatch((OpCode?)OpCodes.Stfld, (object)AccessTools.Field(typeof(ExpiryOrder), "index"), (string)null)
				}).Advance(1).RemoveInstructions(val.Length - val.Pos)
					.Insert((CodeInstruction[])(object)new CodeInstruction[6]
					{
						new CodeInstruction(OpCodes.Ldarg_0, (object)null),
						new CodeInstruction(OpCodes.Ldarg_1, (object)null),
						new CodeInstruction(OpCodes.Ldloc_1, (object)null),
						Transpilers.EmitDelegate<Action<DysonSwarm, DysonNode, int>>((Action<DysonSwarm, DysonNode, int>)delegate(DysonSwarm swarm, DysonNode node, int index)
						{
							if (node.ConstructCp() != null)
							{
								swarm.dysonSphere.productRegister[11903]++;
								swarm.dysonSphere.needRecalculatePower = true;
							}
							swarm.RemoveSolarSail(index);
						}),
						new CodeInstruction(OpCodes.Ldc_I4_1, (object)null),
						new CodeInstruction(OpCodes.Ret, (object)null)
					});
				return val.InstructionEnumeration();
			}
		}

		private class QuickAbsorbPatch : PatchImpl<QuickAbsorbPatch>
		{
			protected override void OnEnable()
			{
				_instantAbsorb = SkipAbsorbEnabled.Value && PatchImpl<SkipAbsorbPatch>.GetHarmony() != null;
			}

			protected override void OnDisable()
			{
				_instantAbsorb = SkipAbsorbEnabled.Value && PatchImpl<SkipAbsorbPatch>.GetHarmony() != null;
			}

			[HarmonyTranspiler]
			[HarmonyPatch(typeof(DysonSphereLayer), "GameTick")]
			private static IEnumerable<CodeInstruction> DysonSphereLayer_GameTick_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_001c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Expected O, but got Unknown
				//IL_002a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0030: Expected O, but got Unknown
				//IL_004d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0053: Expected O, but got Unknown
				//IL_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Expected O, but got Unknown
				//IL_0094: Unknown result type (might be due to invalid IL or missing references)
				//IL_009a: Expected O, but got Unknown
				//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c1: Expected O, but got Unknown
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00da: Expected O, but got Unknown
				CodeMatcher val = new CodeMatcher(instructions, generator);
				val.Start().InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[3]
				{
					new CodeInstruction(OpCodes.Ldarg_0, (object)null),
					new CodeInstruction(OpCodes.Ldarg_1, (object)null),
					new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(QuickAbsorbPatch), "DoAbsorb", (Type[])null, (Type[])null))
				}).MatchForward(false, (CodeMatch[])(object)new CodeMatch[3]
				{
					new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null),
					new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(DysonSphereLayer), "dysonSphere"), (string)null),
					new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(DysonSphere), "swarm"), (string)null)
				})
					.Insert((CodeInstruction[])(object)new CodeInstruction[1]
					{
						new CodeInstruction(OpCodes.Ret, (object)null)
					});
				return val.InstructionEnumeration();
			}

			private static void DoAbsorb(DysonSphereLayer layer, long gameTick)
			{
				int num = layer.nodeCursor - 1;
				if (num <= 0)
				{
					return;
				}
				DysonNode[] nodePool = layer.nodePool;
				DysonSwarm swarm = layer.dysonSphere.swarm;
				int num2 = ((int)gameTick >> 6) % num;
				for (int num3 = num - ((int)gameTick & 0x3F); num3 > 0; num3 -= 64)
				{
					int num4 = (num2 + num3) % num + 1;
					DysonNode val = nodePool[num4];
					if (val != null && val.id == num4 && val.sp >= val.spMax)
					{
						for (int num5 = val.cpReqOrder; num5 > 0; num5--)
						{
							if (!swarm.AbsorbSail(val, gameTick))
							{
								return;
							}
						}
					}
				}
			}
		}

		private class EjectAnywayPatch : PatchImpl<EjectAnywayPatch>
		{
			[HarmonyTranspiler]
			[HarmonyPatch(typeof(EjectorComponent), "InternalUpdate")]
			private static IEnumerable<CodeInstruction> EjectorComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_0037: Unknown result type (might be due to invalid IL or missing references)
				//IL_003d: Expected O, but got Unknown
				//IL_0062: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Expected O, but got Unknown
				//IL_0089: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Expected O, but got Unknown
				//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00df: Expected O, but got Unknown
				//IL_0108: Unknown result type (might be due to invalid IL or missing references)
				//IL_010e: Expected O, but got Unknown
				//IL_012f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0135: Expected O, but got Unknown
				CodeMatcher val = new CodeMatcher(instructions, generator);
				val.End().MatchBack(false, (CodeMatch[])(object)new CodeMatch[1]
				{
					new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction instr) => instr.opcode == OpCodes.Ldc_R8 && Math.Abs((double)instr.operand - 0.08715574) < 1E-08), (string)null)
				});
				int num = val.Pos - 3;
				val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[2]
				{
					new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null),
					new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(EjectorComponent), "bulletCount"), (string)null)
				});
				int pos = val.Pos;
				val.Start().Advance(num).RemoveInstructions(pos - num)
					.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
					{
						new CodeMatch((Func<CodeInstruction, bool>)((CodeInstruction ci) => CodeInstructionExtensions.IsStloc(ci, (LocalBuilder)null)), (string)null)
					})
					.Advance(1);
				num = val.Pos;
				val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[2]
				{
					new CodeMatch((OpCode?)OpCodes.Ldarg_0, (object)null, (string)null),
					new CodeMatch((OpCode?)OpCodes.Ldfld, (object)AccessTools.Field(typeof(EjectorComponent), "autoOrbit"), (string)null)
				});
				pos = val.Pos;
				val.Start().Advance(num).RemoveInstructions(pos - num);
				return val.InstructionEnumeration();
			}
		}

		private class OverclockEjector : PatchImpl<OverclockEjector>
		{
			[HarmonyTranspiler]
			[HarmonyPatch(typeof(EjectorComponent), "InternalUpdate")]
			private static IEnumerable<CodeInstruction> EjectComponent_InternalUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator generator)
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Expected O, but got Unknown
				//IL_001e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0024: Expected O, but got Unknown
				//IL_003d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Expected O, but got Unknown
				//IL_004b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0051: Expected O, but got Unknown
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0080: Expected O, but got Unknown
				CodeMatcher val = new CodeMatcher(instructions, generator);
				val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
				{
					new CodeMatch((OpCode?)OpCodes.Stloc_1, (object)null, (string)null)
				}).InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[2]
				{
					new CodeInstruction(OpCodes.Ldc_I4_S, (object)10),
					new CodeInstruction(OpCodes.Mul, (object)null)
				}).Advance(1);
				int pos = val.Pos;
				val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1]
				{
					new CodeMatch((OpCode?)OpCodes.Stloc_1, (object)null, (string)null)
				}).Advance(1);
				int pos2 = val.Pos;
				val.Start().Advance(pos).RemoveInstructions(pos2 - pos);
				return val.InstructionEnumeration();
			}

			[HarmonyTranspiler]
			[HarmonyPatch(typeof(UIEjectorWindow), "_OnUpdate")]
			private static IEnumerable<CodeInstruction> UIEjectAndSiloWindow__OnUpdate_Transpiler(IEnumerable<CodeInstruction> instructions, ILGenera