Decompiled source of UXAssist v1.6.3

UXAssist.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CommonAPI;
using CommonAPI.Systems;
using DSPWeb;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UXAssist.Common;
using UXAssist.Common.Config;
using UXAssist.Common.GameConstants;
using UXAssist.Common.ModCompat;
using UXAssist.Common.ModFeatures;
using UXAssist.Common.Patching;
using UXAssist.Common.Utils;
using UXAssist.Functions;
using UXAssist.Functions.Factory;
using UXAssist.Functions.UI;
using UXAssist.ModsCompat;
using UXAssist.Patches;
using UXAssist.Patches.Factory;
using UXAssist.Patches.Logistics;
using UXAssist.Production;
using UXAssist.UI;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Serialization;
using UnityEngine.UI;
using crecheng.DSPModSave;

[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("UXAssist")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("DSP MOD - UXAssist")]
[assembly: AssemblyFileVersion("1.6.3.0")]
[assembly: AssemblyInformationalVersion("1.6.3+6263775dc1ff9e2a0a22bc6ca6073d2708dda315")]
[assembly: AssemblyProduct("UXAssist")]
[assembly: AssemblyTitle("UXAssist")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.6.3.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 UXAssist
{
	public static class UIConfigWindow
	{
		private class OcMapper : MyWindow.ValueMapper<int>
		{
			public override int Min => 0;

			public override int Max => 40;

			public override string FormatValue(string format, int value)
			{
				if (value != 0)
				{
					return base.FormatValue(format, value);
				}
				return Localization.Translate("max");
			}
		}

		private class AngleMapper : MyWindow.ValueMapper<float>
		{
			public override int Min => 0;

			public override int Max => 20;

			public override float IndexToValue(int index)
			{
				return (float)index - 10f;
			}

			public override int ValueToIndex(float value)
			{
				return Mathf.RoundToInt(value + 10f);
			}
		}

		private class DistanceMapper : MyWindow.ValueMapper<double>
		{
			public override int Min => 1;

			public override int Max => 40;

			public override double IndexToValue(int index)
			{
				return (double)index * 0.5;
			}

			public override int ValueToIndex(double value)
			{
				return Mathf.RoundToInt((float)(value * 2.0));
			}
		}

		private class DistanceMapperHive : MyWindow.ValueMapper<double>
		{
			public override int Min => 1;

			public override int Max => 50;

			public override double IndexToValue(int index)
			{
				return (double)index * 0.1;
			}

			public override int ValueToIndex(double value)
			{
				return Mathf.RoundToInt((float)(value * 10.0));
			}
		}

		private class DistanceMapperCarrier : MyWindow.ValueMapper<double>
		{
			public override int Min => 100;

			public override int Max => 3000;

			public override double IndexToValue(int index)
			{
				return index;
			}

			public override int ValueToIndex(double value)
			{
				return Mathf.RoundToInt((float)value);
			}
		}

		private class EnergyMapper : MyWindow.ValueMapper<double>
		{
			public override int Min => 50;

			public override int Max => 1000;

			public override double IndexToValue(int index)
			{
				return index;
			}

			public override int ValueToIndex(double value)
			{
				return Mathf.RoundToInt((float)value);
			}
		}

		private class UpsMapper : MyWindow.ValueMapper<double>
		{
			public override int Min => 1;

			public override int Max => 100;

			public override double IndexToValue(int index)
			{
				return (double)index * 0.1;
			}

			public override int ValueToIndex(double value)
			{
				return Mathf.RoundToInt((float)(value * 10.0));
			}
		}

		private class AutoConfigDispenserChargePowerMapper : MyWindow.RangeValueMapper<int>
		{
			public AutoConfigDispenserChargePowerMapper()
				: base(3, 30)
			{
			}

			public override string FormatValue(string format, int value)
			{
				StringBuilder stringBuilder = new StringBuilder("         ");
				StringBuilderUtility.WriteKMG(stringBuilder, 8, (long)value * 300000L, false, '\u2009', ' ');
				stringBuilder.Append('W');
				return stringBuilder.ToString().Trim();
			}
		}

		private class AutoConfigBattleBaseChargePowerMapper : MyWindow.RangeValueMapper<int>
		{
			public AutoConfigBattleBaseChargePowerMapper()
				: base(4, 40)
			{
			}

			public override string FormatValue(string format, int value)
			{
				StringBuilder stringBuilder = new StringBuilder("         ");
				StringBuilderUtility.WriteKMG(stringBuilder, 8, (long)value * 300000L, false, '\u2009', ' ');
				stringBuilder.Append('W');
				return stringBuilder.ToString().Trim();
			}
		}

		private class AutoConfigPLSChargePowerMapper : MyWindow.RangeValueMapper<int>
		{
			public AutoConfigPLSChargePowerMapper()
				: base(2, 20)
			{
			}

			public override string FormatValue(string format, int value)
			{
				StringBuilder stringBuilder = new StringBuilder("         ");
				StringBuilderUtility.WriteKMG(stringBuilder, 8, (long)value * 3000000L, false, '\u2009', ' ');
				stringBuilder.Append('W');
				return stringBuilder.ToString().Trim();
			}
		}

		private class AutoConfigCarrierMinDeliverMapper : MyWindow.RangeValueMapper<int>
		{
			public AutoConfigCarrierMinDeliverMapper()
				: base(0, 10)
			{
			}

			public override string FormatValue(string format, int value)
			{
				return ((value == 0) ? 1 : (value * 10)).ToString("0\\%");
			}
		}

		private class AutoConfigMinPilerValueMapper : MyWindow.RangeValueMapper<int>
		{
			public AutoConfigMinPilerValueMapper()
				: base(0, 4)
			{
			}

			public override string FormatValue(string format, int value)
			{
				if (value != 0)
				{
					return value.ToString();
				}
				return Localization.Translate("Use tech max for piler").Trim();
			}
		}

		private class AutoConfigILSChargePowerMapper : MyWindow.RangeValueMapper<int>
		{
			public AutoConfigILSChargePowerMapper()
				: base(2, 20)
			{
			}

			public override string FormatValue(string format, int value)
			{
				StringBuilder stringBuilder = new StringBuilder("         ");
				StringBuilderUtility.WriteKMG(stringBuilder, 8, (long)value * 15000000L, false, '\u2009', ' ');
				stringBuilder.Append('W');
				return stringBuilder.ToString().Trim();
			}
		}

		private class AutoConfigILSMaxTripShipMapper : MyWindow.RangeValueMapper<int>
		{
			public AutoConfigILSMaxTripShipMapper()
				: base(1, 41)
			{
			}

			public override string FormatValue(string format, int value)
			{
				if (value > 20)
				{
					if (value <= 40)
					{
						return (value * 2 - 20).ToString("0LY");
					}
					return "∞";
				}
				return value.ToString("0LY");
			}
		}

		private class AutoConfigILSWarperDistanceMapper : MyWindow.RangeValueMapper<int>
		{
			public AutoConfigILSWarperDistanceMapper()
				: base(2, 21)
			{
			}

			public override string FormatValue(string format, int value)
			{
				if (value <= 16)
				{
					if (value > 7)
					{
						if (value <= 13)
						{
							return ((double)value - 4.0).ToString("0.0AU");
						}
						return (value - 4).ToString("0AU");
					}
					return ((double)value * 0.5 - 0.5).ToString("0.0AU");
				}
				if (value <= 20)
				{
					return (value * 2 - 20).ToString("0AU");
				}
				return "60AU";
			}
		}

		private class AutoConfigVeinCollectorHarvestSpeedMapper : MyWindow.RangeValueMapper<int>
		{
			public AutoConfigVeinCollectorHarvestSpeedMapper()
				: base(0, 20)
			{
			}

			public override string FormatValue(string format, int value)
			{
				return (100 + value * 10).ToString("0\\%");
			}
		}

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

			public static Action <1>__UpdateUI;

			public static UnityAction <2>__Toggle;

			public static UnityAction <3>__BuildOrbitalCollectors;

			public static UnityAction <4>__ApplyAllDispenser;

			public static UnityAction <5>__ApplyAllBattleBase;

			public static UnityAction <6>__ApplyAllPLS;

			public static UnityAction <7>__ApplyAllILS;

			public static UnityAction <8>__ApplyAllVeinCollector;

			public static UnityAction <9>__ApplyDispenserChargePower;

			public static UnityAction <10>__ApplyDispenserCourierCount;

			public static UnityAction <11>__ApplyBattleBaseChargePower;

			public static UnityAction <12>__ApplyPLSChargePower;

			public static UnityAction <13>__ApplyPLSTripRangeDrones;

			public static UnityAction <14>__ApplyPLSDroneMinDeliver;

			public static UnityAction <15>__ApplyPLSMinPilerValue;

			public static UnityAction <16>__ApplyPLSDroneCount;

			public static UnityAction <17>__ApplyILSChargePower;

			public static UnityAction <18>__ApplyILSTripRangeDrones;

			public static UnityAction <19>__ApplyILSTripRangeShips;

			public static UnityAction <20>__ApplyILSWarpDistance;

			public static UnityAction <21>__ApplyILSIncludeOrbitCollector;

			public static UnityAction <22>__ApplyILSWarperNecessary;

			public static UnityAction <23>__ApplyILSDroneMinDeliver;

			public static UnityAction <24>__ApplyILSShipMinDeliver;

			public static UnityAction <25>__ApplyILSMinPilerValue;

			public static UnityAction <26>__ApplyILSDroneCount;

			public static UnityAction <27>__ApplyILSShipCount;

			public static UnityAction <28>__ApplyVeinCollectorHarvestSpeed;

			public static UnityAction <29>__ApplyVeinCollectorMinPilerValue;

			public static UnityAction <30>__RemoveCargoStackingTechs;

			public static UnityAction <31>__UnlockAllProtoWithMetadataAndPrompt;
		}

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

			public static UnityAction <>9__22_0;

			public static UnityAction <>9__22_8;

			public static Response <>9__22_17;

			public static UnityAction <>9__22_1;

			public static Response <>9__22_18;

			public static UnityAction <>9__22_2;

			public static Response <>9__22_32;

			public static UnityAction <>9__22_6;

			public static UnityAction <>9__22_7;

			internal void <CreateUI>b__22_0()
			{
				UIFunctions.ShowRecentMilkywayUploadResults();
			}

			internal void <CreateUI>b__22_8()
			{
				GamePatch.GameUpsFactor.Value = 1.0;
			}

			internal void <CreateUI>b__22_1()
			{
				//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("Initialize This Planet");
				string text2 = Localization.Translate("Initialize This Planet Confirm");
				string text3 = Localization.Translate("Cancel");
				string text4 = Localization.Translate("OK");
				object obj = <>9__22_17;
				if (obj == null)
				{
					Response val = delegate
					{
						PlanetFunctions.RecreatePlanet(revertReform: true);
					};
					<>9__22_17 = val;
					obj = (object)val;
				}
				UIMessageBox.Show(text, text2, text3, text4, 2, (Response)null, (Response)obj);
			}

			internal void <CreateUI>b__22_17()
			{
				PlanetFunctions.RecreatePlanet(revertReform: true);
			}

			internal void <CreateUI>b__22_2()
			{
				//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("Dismantle All Buildings");
				string text2 = Localization.Translate("Dismantle All Buildings Confirm");
				string text3 = Localization.Translate("Cancel");
				string text4 = Localization.Translate("OK");
				object obj = <>9__22_18;
				if (obj == null)
				{
					Response val = delegate
					{
						PlanetFunctions.DismantleAll(toBag: false);
					};
					<>9__22_18 = val;
					obj = (object)val;
				}
				UIMessageBox.Show(text, text2, text3, text4, 2, (Response)null, (Response)obj);
			}

			internal void <CreateUI>b__22_18()
			{
				PlanetFunctions.DismantleAll(toBag: false);
			}

			internal void <CreateUI>b__22_6()
			{
				//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("Initialize Dyson Sphere");
				string text2 = Localization.Translate("Initialize Dyson Sphere Confirm");
				string text3 = Localization.Translate("Cancel");
				string text4 = Localization.Translate("OK");
				object obj = <>9__22_32;
				if (obj == null)
				{
					Response val = delegate
					{
						DysonSphereFunctions.InitCurrentDysonLayer(null, -1);
					};
					<>9__22_32 = val;
					obj = (object)val;
				}
				UIMessageBox.Show(text, text2, text3, text4, 2, (Response)null, (Response)obj);
			}

			internal void <CreateUI>b__22_32()
			{
				DysonSphereFunctions.InitCurrentDysonLayer(null, -1);
			}

			internal void <CreateUI>b__22_7()
			{
				GameData data = GameMain.data;
				if (data != null && data.gameDesc.isCombatMode)
				{
					UIGame uiGame = UIRoot.instance.uiGame;
					uiGame.ShutPlayerInventory();
					uiGame.CloseEnemyBriefInfo();
					uiGame.OpenCommunicatorWindow(5);
				}
			}
		}

		private static RectTransform _windowTrans;

		private static RectTransform _dysonTab;

		private static UIButton _dysonInitBtn;

		private static Text _quickMinerText;

		private static readonly UIButton[] DysonLayerBtn = (UIButton[])(object)new UIButton[10];

		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 void CreateUI(MyConfigWindow wnd, RectTransform trans)
		{
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Expected O, but got Unknown
			//IL_0a4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a5a: Expected O, but got Unknown
			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Expected O, but got Unknown
			//IL_0b1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b21: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b27: Expected O, but got Unknown
			//IL_0b63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6e: Expected O, but got Unknown
			//IL_0c3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c42: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c48: Expected O, but got Unknown
			//IL_1504: Unknown result type (might be due to invalid IL or missing references)
			//IL_150e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1549: Unknown result type (might be due to invalid IL or missing references)
			//IL_1553: Expected O, but got Unknown
			//IL_1c17: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c22: Expected O, but got Unknown
			//IL_1c40: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c45: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c4b: Expected O, but got Unknown
			//IL_1c69: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c6e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c74: Expected O, but got Unknown
			//IL_1c92: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c97: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c9d: Expected O, but got Unknown
			//IL_1cb9: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cbe: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cc4: Expected O, but got Unknown
			//IL_1d18: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d1d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d23: Expected O, but got Unknown
			//IL_1d84: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d89: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d8f: Expected O, but got Unknown
			//IL_1ded: Unknown result type (might be due to invalid IL or missing references)
			//IL_1df2: Unknown result type (might be due to invalid IL or missing references)
			//IL_1df8: Expected O, but got Unknown
			//IL_1e56: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e5b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e61: Expected O, but got Unknown
			//IL_1ec5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1eca: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ed0: Expected O, but got Unknown
			//IL_1f2e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f33: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f39: Expected O, but got Unknown
			//IL_1f97: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f9c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fa2: Expected O, but got Unknown
			//IL_2003: Unknown result type (might be due to invalid IL or missing references)
			//IL_2008: Unknown result type (might be due to invalid IL or missing references)
			//IL_200e: Expected O, but got Unknown
			//IL_206c: Unknown result type (might be due to invalid IL or missing references)
			//IL_2071: Unknown result type (might be due to invalid IL or missing references)
			//IL_2077: Expected O, but got Unknown
			//IL_20db: Unknown result type (might be due to invalid IL or missing references)
			//IL_20e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_20e6: Expected O, but got Unknown
			//IL_2144: Unknown result type (might be due to invalid IL or missing references)
			//IL_2149: Unknown result type (might be due to invalid IL or missing references)
			//IL_214f: Expected O, but got Unknown
			//IL_21e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_21e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_21ef: Expected O, but got Unknown
			//IL_225d: Unknown result type (might be due to invalid IL or missing references)
			//IL_2262: Unknown result type (might be due to invalid IL or missing references)
			//IL_2268: Expected O, but got Unknown
			//IL_2286: Unknown result type (might be due to invalid IL or missing references)
			//IL_228b: Unknown result type (might be due to invalid IL or missing references)
			//IL_2291: Expected O, but got Unknown
			//IL_22ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_22f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_22fa: Expected O, but got Unknown
			//IL_2358: Unknown result type (might be due to invalid IL or missing references)
			//IL_235d: Unknown result type (might be due to invalid IL or missing references)
			//IL_2363: Expected O, but got Unknown
			//IL_23c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_23c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_23cc: Expected O, but got Unknown
			//IL_242d: Unknown result type (might be due to invalid IL or missing references)
			//IL_2432: Unknown result type (might be due to invalid IL or missing references)
			//IL_2438: Expected O, but got Unknown
			//IL_2499: Unknown result type (might be due to invalid IL or missing references)
			//IL_249e: Unknown result type (might be due to invalid IL or missing references)
			//IL_24a4: Expected O, but got Unknown
			//IL_2502: Unknown result type (might be due to invalid IL or missing references)
			//IL_2507: Unknown result type (might be due to invalid IL or missing references)
			//IL_250d: Expected O, but got Unknown
			//IL_256b: Unknown result type (might be due to invalid IL or missing references)
			//IL_2570: Unknown result type (might be due to invalid IL or missing references)
			//IL_2576: Expected O, but got Unknown
			//IL_2b06: Unknown result type (might be due to invalid IL or missing references)
			//IL_2b0b: Unknown result type (might be due to invalid IL or missing references)
			//IL_2b11: Expected O, but got Unknown
			//IL_2b9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_2ba7: Expected O, but got Unknown
			//IL_2d57: Unknown result type (might be due to invalid IL or missing references)
			//IL_2d5c: Unknown result type (might be due to invalid IL or missing references)
			//IL_2d62: Expected O, but got Unknown
			//IL_2d9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_2da3: Unknown result type (might be due to invalid IL or missing references)
			//IL_2da9: Expected O, but got Unknown
			//IL_2de9: Unknown result type (might be due to invalid IL or missing references)
			//IL_2dee: Unknown result type (might be due to invalid IL or missing references)
			//IL_2df4: Expected O, but got Unknown
			_windowTrans = trans;
			wnd.AddTabGroup(trans, "UXAssist", "tab-group-uxassist");
			RectTransform parent = wnd.AddTab(trans, "General");
			float num = 0f;
			float num2 = 10f;
			wnd.AddCheckBox(num, num2, parent, GamePatch.EnableWindowResizeEnabled, "Enable game window resize");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent, GamePatch.LoadLastWindowRectEnabled, "Remeber window position and size on last exit");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent, GamePatch.ConvertSavesFromPeaceEnabled, "Convert old saves to Combat Mode on loading");
			MyCheckBox myCheckBox;
			if (WindowFunctions.ProfileName != null)
			{
				num2 += 36f;
				myCheckBox = wnd.AddCheckBox(num, num2, parent, GamePatch.ProfileBasedSaveFolderEnabled, "Profile-based save folder");
				wnd.AddTipsButton2(myCheckBox.Width + 5f, num2 + 6f, parent, "Profile-based save folder", "Profile-based save folder tips", "btn-profile-based-save-folder-tips");
				num2 += 36f;
				myCheckBox = wnd.AddCheckBox(num, num2, parent, GamePatch.ProfileBasedOptionEnabled, "Profile-based option");
				wnd.AddTipsButton2(myCheckBox.Width + 5f, num2 + 6f, parent, "Profile-based option", "Profile-based option tips", "btn-profile-based-option-tips");
				num2 += 36f;
				wnd.AddText2(num + 2f, num2, parent, "Default profile name", 15, "text-default-profile-name");
				num2 += 24f;
				wnd.AddInputField(num + 2f, num2, 200f, parent, GamePatch.DefaultProfileName, 15, "input-profile-save-folder");
				num2 += 18f;
			}
			num2 += 36f;
			MyConfigWindow myConfigWindow = wnd;
			float x = num;
			float y = num2;
			object obj = <>c.<>9__22_0;
			if (obj == null)
			{
				UnityAction val = delegate
				{
					UIFunctions.ShowRecentMilkywayUploadResults();
				};
				<>c.<>9__22_0 = val;
				obj = (object)val;
			}
			myConfigWindow.AddButton(x, y, 200f, parent, "Show recent milkyway upload results", 16, "button-show-recent-milkyway-upload-results", (UnityAction)obj);
			Text text;
			if (!BulletTimeWrapper.HasBulletTime)
			{
				num2 += 36f;
				text = wnd.AddText2(num + 2f, num2, parent, "Logical Frame Rate", 15, "game-frame-rate");
				num += global::UXAssist.UI.Util.GetPreferredWidth(text) + 7f;
				wnd.AddSlider(num, num2 + 6f, parent, GamePatch.GameUpsFactor, new UpsMapper(), "0.0x", 100f).WithSmallerHandle();
				MyConfigWindow myConfigWindow2 = wnd;
				float x2 = num + 104f;
				float y2 = num2 + 6f;
				object obj2 = <>c.<>9__22_8;
				if (obj2 == null)
				{
					UnityAction val2 = delegate
					{
						GamePatch.GameUpsFactor.Value = 1.0;
					};
					<>c.<>9__22_8 = val2;
					obj2 = (object)val2;
				}
				((RectTransform)((Component)myConfigWindow2.AddFlatButton(x2, y2, parent, "Reset", 13, "reset-game-frame-rate", (UnityAction)obj2)).transform).sizeDelta = new Vector2(40f, 20f);
				num = 0f;
			}
			num2 += 36f;
			text = wnd.AddText2(num + 2f, num2, parent, "Process priority", 15, "process-priority");
			wnd.AddComboBox(num + 7f + global::UXAssist.UI.Util.GetPreferredWidth(text), num2, parent).WithItems("High", "Above Normal", "Normal", "Below Normal", "Idle").WithSize(100f, 0f)
				.WithConfigEntry(WindowFunctions.ProcessPriority);
			RectTransform parent2 = wnd.AddTab(trans, "Factory");
			num = 0f;
			num2 = 10f;
			wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.RemoveSomeConditionEnabled, "Remove some build conditions");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.RemoveBuildRangeLimitEnabled, "Remove build range limit");
			num2 += 36f;
			myCheckBox = wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.NightLightEnabled, "Night Light");
			num += myCheckBox.Width + 5f + 10f;
			text = wnd.AddText2(num, num2 + 2f, parent2, "Angle X:", 13, "text-nightlight-angle-x");
			num += global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f;
			wnd.AddSlider(num, num2 + 7f, parent2, FactoryConfigProvider.NightLightAngleX, new AngleMapper(), "0", 60f).WithSmallerHandle();
			num += 70f;
			text = wnd.AddText2(num, num2 + 2f, parent2, "Y:", 13, "text-nightlight-angle-y");
			wnd.AddSlider(num + global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f, num2 + 7f, parent2, FactoryConfigProvider.NightLightAngleY, new AngleMapper(), "0", 60f).WithSmallerHandle();
			num = 0f;
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.LargerAreaForUpgradeAndDismantleEnabled, "Larger area for upgrade and dismantle");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.LargerAreaForTerraformEnabled, "Larger area for terraform");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.OffGridBuildingEnabled, "Off-grid building and stepped rotation");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.CutConveyorBeltEnabled, "Cut conveyor belt (with shortcut key)");
			num2 += 36f;
			myCheckBox = wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.TreatStackingAsSingleEnabled, "Treat stack items as single in monitor components");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.QuickBuildAndDismantleLabsEnabled, "Quick build and dismantle stacking labs");
			num2 += 36f;
			MyCheckBox myCheckBox2 = wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.TankFastFillInAndTakeOutEnabled, "Fast fill in to and take out from tanks");
			num += myCheckBox2.Width + 5f;
			text = wnd.AddText2(num, num2 + 2f, parent2, "Speed Ratio", 13, "text-tank-fast-fill-speed-ratio");
			MySlider tankSlider = wnd.AddSlider(num + global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f, num2 + 7f, parent2, FactoryConfigProvider.TankFastFillInAndTakeOutMultiplier, new int[8] { 2, 5, 10, 20, 50, 100, 500, 1000 }, "G", 100f).WithSmallerHandle();
			FactoryConfigProvider.TankFastFillInAndTakeOutEnabled.SettingChanged += TankSettingChanged;
			wnd.OnFree += delegate
			{
				FactoryConfigProvider.TankFastFillInAndTakeOutEnabled.SettingChanged -= TankSettingChanged;
			};
			TankSettingChanged(null, null);
			num = 0f;
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.DoNotRenderEntitiesEnabled, "Do not render factory entities");
			num2 += 27f;
			MyCheckBox hideSortersCheckBox = wnd.AddCheckBox(num + 20f, num2, parent2, FactoryConfigProvider.DoNotRenderEntitiesHideSortersEnabled, "Hide sorters too", 13);
			FactoryConfigProvider.DoNotRenderEntitiesEnabled.SettingChanged += DoNotRenderEntitiesEnabledChanged;
			wnd.OnFree += delegate
			{
				FactoryConfigProvider.DoNotRenderEntitiesEnabled.SettingChanged -= DoNotRenderEntitiesEnabledChanged;
			};
			DoNotRenderEntitiesEnabledChanged(null, null);
			num2 += 36f;
			myCheckBox = wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.ShortcutKeysForBlueprintCopyEnabled, "Shortcut keys for Blueprint Copy mode");
			wnd.AddTipsButton2(num + myCheckBox.Width + 5f, num2 + 6f, parent2, "Shortcut keys for Blueprint Copy mode", "Shortcut keys for Blueprint Copy mode tips", "shortcut-keys-for-blueprint-copy-mode-tips");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.BeltSignalsForBuyOutEnabled, "Belt signals for buy out dark fog items automatically");
			num2 += 36f;
			myCheckBox = wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.ProtectVeinsFromExhaustionEnabled, "Protect veins from exhaustion");
			wnd.AddTipsButton2(num + myCheckBox.Width + 5f, num2 + 6f, parent2, "Protect veins from exhaustion", "Protect veins from exhaustion tips", "protect-veins-tips");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.DragBuildPowerPolesEnabled, "Drag building power poles in maximum connection range");
			num2 += 27f;
			MyCheckBox alternatelyCheckBox = wnd.AddCheckBox(num + 20f, num2, parent2, FactoryConfigProvider.DragBuildPowerPolesAlternatelyEnabled, "Build Tesla Tower and Wireless Power Tower alternately", 13);
			FactoryConfigProvider.DragBuildPowerPolesEnabled.SettingChanged += AlternatelyCheckBoxChanged;
			wnd.OnFree += delegate
			{
				FactoryConfigProvider.DragBuildPowerPolesEnabled.SettingChanged -= AlternatelyCheckBoxChanged;
			};
			AlternatelyCheckBoxChanged(null, null);
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.AutoConstructButtonEnabled, "Auto-construct button");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.PressShiftToTakeWholeBeltItemsEnabled, "Ctrl+Shift+Click to pick items from whole belts");
			num2 += 27f;
			MyCheckBox includeBranches = wnd.AddCheckBox(num + 10f, num2, parent2, FactoryConfigProvider.PressShiftToTakeWholeBeltItemsIncludeBranches, "Include branches of belts", 13);
			num2 += 27f;
			MyCheckBox includeInserters = wnd.AddCheckBox(num + 10f, num2, parent2, FactoryConfigProvider.PressShiftToTakeWholeBeltItemsIncludeInserters, "Include connected inserters", 13);
			FactoryConfigProvider.PressShiftToTakeWholeBeltItemsEnabled.SettingChanged += PressShiftToTakeWholeBeltItemsEnabledChanged;
			wnd.OnFree += delegate
			{
				FactoryConfigProvider.PressShiftToTakeWholeBeltItemsEnabled.SettingChanged -= PressShiftToTakeWholeBeltItemsEnabledChanged;
			};
			PressShiftToTakeWholeBeltItemsEnabledChanged(null, null);
			num = 400f;
			num2 = 10f;
			MyConfigWindow myConfigWindow3 = wnd;
			float x3 = num;
			float y3 = num2;
			object obj3 = <>c.<>9__22_1;
			if (obj3 == null)
			{
				UnityAction val3 = 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 text3 = Localization.Translate("Initialize This Planet");
					string text4 = Localization.Translate("Initialize This Planet Confirm");
					string text5 = Localization.Translate("Cancel");
					string text6 = Localization.Translate("OK");
					object obj37 = <>c.<>9__22_17;
					if (obj37 == null)
					{
						Response val39 = delegate
						{
							PlanetFunctions.RecreatePlanet(revertReform: true);
						};
						<>c.<>9__22_17 = val39;
						obj37 = (object)val39;
					}
					UIMessageBox.Show(text3, text4, text5, text6, 2, (Response)null, (Response)obj37);
				};
				<>c.<>9__22_1 = val3;
				obj3 = (object)val3;
			}
			myConfigWindow3.AddButton(x3, y3, parent2, "Initialize This Planet", 16, "button-init-planet", (UnityAction)obj3);
			num2 += 24f;
			wnd.AddCheckBox(num + 10f, num2, parent2, PlanetFunctions.ReturnBuildingsOnInitializeEnabled, "Return buildings to player when initializing planet", 13);
			num2 += 24f;
			wnd.AddCheckBox(num + 10f, num2, parent2, PlanetFunctions.ReturnLogisticStorageItemsOnInitializeEnabled, "Return logistic storage items to player when initializing planet", 13);
			num2 += 24f;
			wnd.AddCheckBox(num + 10f, num2, parent2, PlanetFunctions.ReturnBeltAFactoryItemsOnInitializeEnabled, "Return belt and factory items to player when initializing planet", 13);
			num2 += 36f;
			MyConfigWindow myConfigWindow4 = wnd;
			float x4 = num;
			float y4 = num2;
			object obj4 = <>c.<>9__22_2;
			if (obj4 == null)
			{
				UnityAction val4 = 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 text3 = Localization.Translate("Dismantle All Buildings");
					string text4 = Localization.Translate("Dismantle All Buildings Confirm");
					string text5 = Localization.Translate("Cancel");
					string text6 = Localization.Translate("OK");
					object obj37 = <>c.<>9__22_18;
					if (obj37 == null)
					{
						Response val39 = delegate
						{
							PlanetFunctions.DismantleAll(toBag: false);
						};
						<>c.<>9__22_18 = val39;
						obj37 = (object)val39;
					}
					UIMessageBox.Show(text3, text4, text5, text6, 2, (Response)null, (Response)obj37);
				};
				<>c.<>9__22_2 = val4;
				obj4 = (object)val4;
			}
			myConfigWindow4.AddButton(x4, y4, parent2, "Dismantle All Buildings", 16, "button-dismantle-all", (UnityAction)obj4);
			num2 += 36f;
			MyConfigWindow myConfigWindow5 = wnd;
			float x5 = num;
			float y5 = num2;
			object obj5 = <>O.<2>__Toggle;
			if (obj5 == null)
			{
				UnityAction val5 = QuickMinerBuild.Toggle;
				<>O.<2>__Toggle = val5;
				obj5 = (object)val5;
			}
			_quickMinerText = ((Component)((Component)myConfigWindow5.AddButton(x5, y5, 240f, parent2, "Quick build Mining Machines", 16, "button-quick-miners", (UnityAction)obj5)).transform.Find("button-text")).GetComponent<Text>();
			Localizer component = ((Component)_quickMinerText).GetComponent<Localizer>();
			if ((Object)(object)component != (Object)null)
			{
				Object.DestroyImmediate((Object)(object)component);
			}
			wnd.AddTipsButton2(num + 250f, num2 + 6f, parent2, "Quick build Mining Machines", "Quick build Mining Machines tips", "quick-miners-tips");
			num2 += 30f;
			wnd.AddCheckBox(num + 10f, num2, parent2, QuickMinerBuild.AllowVeinReform, "Allow restoring/burying veins", 13);
			num2 += 36f;
			MyConfigWindow myConfigWindow6 = wnd;
			float x6 = num;
			float y6 = num2;
			object obj6 = <>O.<3>__BuildOrbitalCollectors;
			if (obj6 == null)
			{
				UnityAction val6 = PlanetFunctions.BuildOrbitalCollectors;
				<>O.<3>__BuildOrbitalCollectors = val6;
				obj6 = (object)val6;
			}
			myConfigWindow6.AddButton(x6, y6, 200f, parent2, "Quick build Orbital Collectors", 16, "button-init-planet", (UnityAction)obj6);
			num2 += 30f;
			text = wnd.AddText2(num + 10f, num2, parent2, "Maximum count to build", 15, "text-oc-build-count");
			wnd.AddSlider(num + 10f + global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f, num2 + 6f, parent2, PlanetFunctions.OrbitalCollectorMaxBuildCount, new OcMapper(), "G", 160f);
			num2 += 18f;
			num2 += 36f;
			myCheckBox = wnd.AddCheckBox(num, num2, parent2, FactoryConfigProvider.TweakBuildingBufferEnabled, "Tweak building buffers");
			wnd.AddTipsButton2(num + myCheckBox.Width + 5f, num2 + 6f, parent2, "Tweak building buffers", "Tweak building buffers tips", "tweak-building-buffers-tips");
			num2 += 27f;
			text = wnd.AddText2(num + 20f, num2, parent2, "Assembler buffer time multiplier(in seconds)", 13);
			float num3 = global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f;
			num2 += 27f;
			text = wnd.AddText2(num + 20f, num2, parent2, "Assembler buffer minimum multiplier", 13);
			float num4 = global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f;
			num2 += 27f;
			text = wnd.AddText2(num + 20f, num2, parent2, "Buffer count for assembling in labs", 13);
			float num5 = global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f;
			num2 += 27f;
			text = wnd.AddText2(num + 20f, num2, parent2, "Extra buffer count for Self-evolution Labs", 13);
			float num6 = global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f;
			num2 += 27f;
			text = wnd.AddText2(num + 20f, num2, parent2, "Buffer count for researching in labs", 13);
			float num7 = global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f;
			num2 += 27f;
			text = wnd.AddText2(num + 20f, num2, parent2, "Ray Receiver Graviton Lens buffer count", 13);
			float num8 = global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f;
			num2 += 27f;
			text = wnd.AddText2(num + 20f, num2, parent2, "Ejector Solar Sails buffer count", 13);
			float num9 = global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f;
			num2 += 27f;
			text = wnd.AddText2(num + 20f, num2, parent2, "Silo Rockets buffer count", 13);
			float num10 = global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f;
			num2 -= 189f;
			float num11 = Mathf.Max(new float[8] { num3, num4, num5, num6, num7, num8, num9, num10 }) + 20f;
			MySlider assemblerBufferTimeMultiplierSlider = wnd.AddSlider(num + num11, num2 + 5f, parent2, FactoryConfigProvider.AssemblerBufferTimeMultiplier, new MyWindow.RangeValueMapper<int>(2, 10), "0", 120f).WithSmallerHandle();
			num2 += 27f;
			MySlider assemblerBufferMininumMultiplierSlider = wnd.AddSlider(num + num11, num2 + 5f, parent2, FactoryConfigProvider.AssemblerBufferMininumMultiplier, new MyWindow.RangeValueMapper<int>(2, 10), "0", 120f).WithSmallerHandle();
			num2 += 27f;
			MySlider labBufferMaxCountForAssembleSlider = wnd.AddSlider(num + num11, num2 + 5f, parent2, FactoryConfigProvider.LabBufferMaxCountForAssemble, new MyWindow.RangeValueMapper<int>(2, 20), "0", 120f).WithSmallerHandle();
			num2 += 27f;
			MySlider labBufferExtraCountForAdvancedAssembleSlider = wnd.AddSlider(num + num11, num2 + 5f, parent2, FactoryConfigProvider.LabBufferExtraCountForAdvancedAssemble, new MyWindow.RangeValueMapper<int>(1, 10), "0", 120f).WithSmallerHandle();
			num2 += 27f;
			MySlider labBufferMaxCountForResearchSlider = wnd.AddSlider(num + num11, num2 + 5f, parent2, FactoryConfigProvider.LabBufferMaxCountForResearch, new MyWindow.RangeValueMapper<int>(2, 20), "0", 120f).WithSmallerHandle();
			num2 += 27f;
			MySlider receiverBufferCountSlider = wnd.AddSlider(num + num11, num2 + 5f, parent2, FactoryConfigProvider.ReceiverBufferCount, new MyWindow.RangeValueMapper<int>(1, 20), "0", 120f).WithSmallerHandle();
			num2 += 27f;
			MySlider ejectorBufferCountSlider = wnd.AddSlider(num + num11, num2 + 5f, parent2, FactoryConfigProvider.EjectorBufferCount, new MyWindow.RangeValueWithMultiplierMapper<int>(1, 80, 5), "0", 120f).WithSmallerHandle();
			num2 += 27f;
			MySlider siloBufferCountSlider = wnd.AddSlider(num + num11, num2 + 5f, parent2, FactoryConfigProvider.SiloBufferCount, new MyWindow.RangeValueMapper<int>(1, 40), "0", 120f).WithSmallerHandle();
			FactoryConfigProvider.TweakBuildingBufferEnabled.SettingChanged += TweakBuildingBufferChanged;
			wnd.OnFree += delegate
			{
				FactoryConfigProvider.TweakBuildingBufferEnabled.SettingChanged -= TweakBuildingBufferChanged;
			};
			TweakBuildingBufferChanged(null, null);
			RectTransform tab3 = wnd.AddTab(trans, "Logistics");
			num = 0f;
			num2 = 10f;
			myCheckBox = wnd.AddCheckBox(num, num2, tab3, LogisticsConfigProvider.LogisticsCapacityTweaksEnabled, "Enhance control for logistic storage capacities");
			wnd.AddTipsButton2(num + myCheckBox.Width + 5f, num2 + 6f, tab3, "Enhance control for logistic storage capacities", "Enhance control for logistic storage capacities tips", "enhanced-logistic-capacities-tips");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, tab3, LogisticsConfigProvider.AllowOverflowInLogisticsEnabled, "Allow overflow for Logistic Stations and Advanced Mining Machines");
			num2 += 30f;
			wnd.AddCheckBox(num, num2, tab3, LogisticsConfigProvider.GreaterPowerUsageInLogisticsEnabled, "Increase maximum power usage in Logistic Stations and Advanced Mining Machines");
			num2 += 36f;
			myCheckBox = wnd.AddCheckBox(num, num2, tab3, LogisticsConfigProvider.LogisticsConstrolPanelImprovementEnabled, "Logistics Control Panel Improvement");
			wnd.AddTipsButton2(num + myCheckBox.Width + 5f, num2 + 6f, tab3, "Logistics Control Panel Improvement", "Logistics Control Panel Improvement tips", "lcp-improvement-tips");
			num2 += 36f;
			MyCheckBox realtimeLogisticsInfoPanelCheckBox = wnd.AddCheckBox(num, num2, tab3, LogisticsConfigProvider.RealtimeLogisticsInfoPanelEnabled, "Real-time logistic stations info panel");
			num2 += 27f;
			MyCheckBox realtimeLogisticsInfoPanelBarsCheckBox = wnd.AddCheckBox(num + 20f, num2, tab3, LogisticsConfigProvider.RealtimeLogisticsInfoPanelBarsEnabled, "Show status bars for storage items", 13);
			if (AuxilaryfunctionWrapper.ShowStationInfo != null)
			{
				AuxilaryfunctionWrapper.ShowStationInfo.SettingChanged += RealtimeLogisticsInfoPanelChanged;
				wnd.OnFree += delegate
				{
					AuxilaryfunctionWrapper.ShowStationInfo.SettingChanged -= RealtimeLogisticsInfoPanelChanged;
				};
			}
			LogisticsConfigProvider.RealtimeLogisticsInfoPanelEnabled.SettingChanged += RealtimeLogisticsInfoPanelChanged;
			wnd.OnFree += delegate
			{
				LogisticsConfigProvider.RealtimeLogisticsInfoPanelEnabled.SettingChanged -= RealtimeLogisticsInfoPanelChanged;
			};
			RealtimeLogisticsInfoPanelChanged(null, null);
			num2 += 36f;
			text = wnd.AddText2(num, num2 + 4f, tab3, "Orbital Collector product limit", 15, "text-orbital-collector-product-limit");
			ConfigEntry<int> productLimitConfig = LogisticsConfigProvider.OrbitalCollectorProductLimit;
			float preferredWidth = global::UXAssist.UI.Util.GetPreferredWidth(text);
			InputField productLimitInput = wnd.AddInputField(num + preferredWidth + 10f, num2, tab3, productLimitConfig.Value.ToString(), 15, "input-orbital-collector-product-limit");
			((UnityEvent<string>)(object)productLimitInput.onEndEdit).AddListener((UnityAction<string>)SetProductLimit);
			productLimitInput.contentType = (ContentType)2;
			productLimitInput.characterValidation = (CharacterValidation)1;
			Transform transform = ((Component)productLimitInput).transform;
			? val7 = ((transform is RectTransform) ? transform : null);
			Transform transform2 = ((Component)productLimitInput).transform;
			((RectTransform)val7).sizeDelta = new Vector2(100f, ((RectTransform)((transform2 is RectTransform) ? transform2 : null)).sizeDelta.y);
			wnd.AddButton(num + preferredWidth + 120f, num2, 130f, tab3, "Apply to universe", 14, "button-apply-orbital-collector-product-limit", (UnityAction)delegate
			{
				SetProductLimit(productLimitInput.text);
				LogisticsPatch.ApplyOrbitalCollectorProductLimitToUniverse();
			});
			productLimitConfig.SettingChanged += ProductLimitChanged;
			wnd.OnFree += delegate
			{
				productLimitConfig.SettingChanged -= ProductLimitChanged;
			};
			num2 += 36f;
			wnd.AddCheckBox(num, num2, tab3, LogisticsConfigProvider.AutoConfigLogisticsEnabled, "Auto-config logistic stations");
			num2 += 26f;
			wnd.AddCheckBox(num + 10f, num2, tab3, LogisticsConfigProvider.AutoConfigLimitAutoReplenishCount, "Limit auto-replenish count to values below", 13).WithSmallerBox();
			num2 += 18f;
			wnd.AddCheckBox(num + 10f, num2, tab3, LogisticsConfigProvider.SetDefaultRemoteLogicToStorage, "Set default remote logic to storage", 13).WithSmallerBox();
			num2 += 16f;
			float num12 = 0f;
			wnd.AddText2(10f, num2, tab3, "Dispenser", 14, "text-dispenser");
			float catY = num2;
			num2 += 18f;
			float num13 = num2;
			num = 20f;
			Text text2 = wnd.AddText2(num, num2, tab3, "Max. Charging Power", 13, "text-dispenser-max-charging-power");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Count of Bots filled", 13, "text-dispenser-count-of-bots-filled");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			wnd.AddText2(10f, num2, tab3, "Battlefield Analysis Base", 14, "text-battlefield-analysis-base");
			float catY2 = num2;
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Max. Charging Power", 13, "text-battlefield-analysis-base-max-charging-power");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			wnd.AddText2(10f, num2, tab3, "PLS", 14, "text-pls");
			float catY3 = num2;
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Max. Charging Power", 13, "text-pls-max-charging-power");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Drone transport range", 13, "text-pls-drone-transport-range");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Min. Load of Drones", 13, "text-pls-min-load-of-drones");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Outgoing integration count", 13, "text-pls-outgoing-integration-count");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Count of Drones filled", 13, "text-pls-count-of-drones-filled");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			wnd.AddText2(10f, num2, tab3, "ILS", 14, "text-ils");
			float catY4 = num2;
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Max. Charging Power", 13, "text-ils-max-charging-power");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Drone transport range", 13, "text-ils-drone-transport-range");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Vessel transport range", 13, "text-ils-vessel-transport-range");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Warp distance", 13, "text-ils-warp-distance");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Min. Load of Drones", 13, "text-ils-min-load-of-drones");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Min. Load of Vessels", 13, "text-ils-min-load-of-vessels");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Outgoing integration count", 13, "text-ils-outgoing-integration-count");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Count of Drones filled", 13, "text-ils-count-of-drones-filled");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Count of Vessels filled", 13, "text-ils-count-of-vessels-filled");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			wnd.AddText2(10f, num2, tab3, "Advanced Mining Machine", 14, "text-amm");
			float catY5 = num2;
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Collecting Speed", 13, "text-amm-collecting-speed");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 += 18f;
			text2 = wnd.AddText2(num, num2, tab3, "Min. Piler Value", 13, "text-amm-min-piler-value");
			num12 = Mathf.Max(num12, global::UXAssist.UI.Util.GetPreferredWidth(text2));
			num2 = num13 + 1f;
			float num14 = num + num12 + 5f + 10f;
			float applyBtnX = num14 + 265f;
			float applyAllBtnX = applyBtnX + 44f - 58f;
			float num15 = applyBtnX + 44f + 12f;
			object obj7 = <>O.<4>__ApplyAllDispenser;
			if (obj7 == null)
			{
				UnityAction val8 = LogisticsPatch.ApplyAllDispenser;
				<>O.<4>__ApplyAllDispenser = val8;
				obj7 = (object)val8;
			}
			AddCategoryApplyButton(catY, "btn-apply-all-dispenser", (UnityAction)obj7);
			object obj8 = <>O.<5>__ApplyAllBattleBase;
			if (obj8 == null)
			{
				UnityAction val9 = LogisticsPatch.ApplyAllBattleBase;
				<>O.<5>__ApplyAllBattleBase = val9;
				obj8 = (object)val9;
			}
			AddCategoryApplyButton(catY2, "btn-apply-all-battle-base", (UnityAction)obj8);
			object obj9 = <>O.<6>__ApplyAllPLS;
			if (obj9 == null)
			{
				UnityAction val10 = LogisticsPatch.ApplyAllPLS;
				<>O.<6>__ApplyAllPLS = val10;
				obj9 = (object)val10;
			}
			AddCategoryApplyButton(catY3, "btn-apply-all-pls", (UnityAction)obj9);
			object obj10 = <>O.<7>__ApplyAllILS;
			if (obj10 == null)
			{
				UnityAction val11 = LogisticsPatch.ApplyAllILS;
				<>O.<7>__ApplyAllILS = val11;
				obj10 = (object)val11;
			}
			AddCategoryApplyButton(catY4, "btn-apply-all-ils", (UnityAction)obj10);
			object obj11 = <>O.<8>__ApplyAllVeinCollector;
			if (obj11 == null)
			{
				UnityAction val12 = LogisticsPatch.ApplyAllVeinCollector;
				<>O.<8>__ApplyAllVeinCollector = val12;
				obj11 = (object)val12;
			}
			AddCategoryApplyButton(catY5, "btn-apply-all-amm", (UnityAction)obj11);
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigDispenserChargePower, new AutoConfigDispenserChargePowerMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY = num2;
			object obj12 = <>O.<9>__ApplyDispenserChargePower;
			if (obj12 == null)
			{
				UnityAction val13 = LogisticsPatch.ApplyDispenserChargePower;
				<>O.<9>__ApplyDispenserChargePower = val13;
				obj12 = (object)val13;
			}
			AddApplyButton(rowY, "btn-apply-dispenser-charge-power", (UnityAction)obj12);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigDispenserCourierCount, new MyWindow.RangeValueMapper<int>(0, 10), "G", 150f, -100f).WithFontSize(13);
			float rowY2 = num2;
			object obj13 = <>O.<10>__ApplyDispenserCourierCount;
			if (obj13 == null)
			{
				UnityAction val14 = LogisticsPatch.ApplyDispenserCourierCount;
				<>O.<10>__ApplyDispenserCourierCount = val14;
				obj13 = (object)val14;
			}
			AddApplyButton(rowY2, "btn-apply-dispenser-courier-count", (UnityAction)obj13);
			num2 += 36f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigBattleBaseChargePower, new AutoConfigBattleBaseChargePowerMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY3 = num2;
			object obj14 = <>O.<11>__ApplyBattleBaseChargePower;
			if (obj14 == null)
			{
				UnityAction val15 = LogisticsPatch.ApplyBattleBaseChargePower;
				<>O.<11>__ApplyBattleBaseChargePower = val15;
				obj14 = (object)val15;
			}
			AddApplyButton(rowY3, "btn-apply-battle-base-charge-power", (UnityAction)obj14);
			num2 += 36f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigPLSChargePower, new AutoConfigPLSChargePowerMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY4 = num2;
			object obj15 = <>O.<12>__ApplyPLSChargePower;
			if (obj15 == null)
			{
				UnityAction val16 = LogisticsPatch.ApplyPLSChargePower;
				<>O.<12>__ApplyPLSChargePower = val16;
				obj15 = (object)val16;
			}
			AddApplyButton(rowY4, "btn-apply-pls-charge-power", (UnityAction)obj15);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigPLSMaxTripDrone, new MyWindow.RangeValueMapper<int>(1, 180), "0°", 150f, -100f).WithFontSize(13);
			float rowY5 = num2;
			object obj16 = <>O.<13>__ApplyPLSTripRangeDrones;
			if (obj16 == null)
			{
				UnityAction val17 = LogisticsPatch.ApplyPLSTripRangeDrones;
				<>O.<13>__ApplyPLSTripRangeDrones = val17;
				obj16 = (object)val17;
			}
			AddApplyButton(rowY5, "btn-apply-pls-trip-range-drones", (UnityAction)obj16);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigPLSDroneMinDeliver, new AutoConfigCarrierMinDeliverMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY6 = num2;
			object obj17 = <>O.<14>__ApplyPLSDroneMinDeliver;
			if (obj17 == null)
			{
				UnityAction val18 = LogisticsPatch.ApplyPLSDroneMinDeliver;
				<>O.<14>__ApplyPLSDroneMinDeliver = val18;
				obj17 = (object)val18;
			}
			AddApplyButton(rowY6, "btn-apply-pls-drone-min-deliver", (UnityAction)obj17);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigPLSMinPilerValue, new AutoConfigMinPilerValueMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY7 = num2;
			object obj18 = <>O.<15>__ApplyPLSMinPilerValue;
			if (obj18 == null)
			{
				UnityAction val19 = LogisticsPatch.ApplyPLSMinPilerValue;
				<>O.<15>__ApplyPLSMinPilerValue = val19;
				obj18 = (object)val19;
			}
			AddApplyButton(rowY7, "btn-apply-pls-min-piler-value", (UnityAction)obj18);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigPLSDroneCount, new MyWindow.RangeValueMapper<int>(0, 50), "G", 150f, -100f).WithFontSize(13);
			float rowY8 = num2;
			object obj19 = <>O.<16>__ApplyPLSDroneCount;
			if (obj19 == null)
			{
				UnityAction val20 = LogisticsPatch.ApplyPLSDroneCount;
				<>O.<16>__ApplyPLSDroneCount = val20;
				obj19 = (object)val20;
			}
			AddApplyButton(rowY8, "btn-apply-pls-drone-count", (UnityAction)obj19);
			num2 += 36f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigILSChargePower, new AutoConfigILSChargePowerMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY9 = num2;
			object obj20 = <>O.<17>__ApplyILSChargePower;
			if (obj20 == null)
			{
				UnityAction val21 = LogisticsPatch.ApplyILSChargePower;
				<>O.<17>__ApplyILSChargePower = val21;
				obj20 = (object)val21;
			}
			AddApplyButton(rowY9, "btn-apply-ils-charge-power", (UnityAction)obj20);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigILSMaxTripDrone, new MyWindow.RangeValueMapper<int>(1, 180), "0°", 150f, -100f).WithFontSize(13);
			float rowY10 = num2;
			object obj21 = <>O.<18>__ApplyILSTripRangeDrones;
			if (obj21 == null)
			{
				UnityAction val22 = LogisticsPatch.ApplyILSTripRangeDrones;
				<>O.<18>__ApplyILSTripRangeDrones = val22;
				obj21 = (object)val22;
			}
			AddApplyButton(rowY10, "btn-apply-ils-trip-range-drones", (UnityAction)obj21);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigILSMaxTripShip, new AutoConfigILSMaxTripShipMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY11 = num2;
			object obj22 = <>O.<19>__ApplyILSTripRangeShips;
			if (obj22 == null)
			{
				UnityAction val23 = LogisticsPatch.ApplyILSTripRangeShips;
				<>O.<19>__ApplyILSTripRangeShips = val23;
				obj22 = (object)val23;
			}
			AddApplyButton(rowY11, "btn-apply-ils-trip-range-ships", (UnityAction)obj22);
			MyCheckBox myCheckBox3 = wnd.AddCheckBox(num15, num2 + 4f, tab3, LogisticsConfigProvider.AutoConfigILSIncludeOrbitCollector, "Include Orbital Collector", 13).WithSmallerBox();
			float rowY12 = num2;
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigILSWarperDistance, new AutoConfigILSWarperDistanceMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY13 = num2;
			object obj23 = <>O.<20>__ApplyILSWarpDistance;
			if (obj23 == null)
			{
				UnityAction val24 = LogisticsPatch.ApplyILSWarpDistance;
				<>O.<20>__ApplyILSWarpDistance = val24;
				obj23 = (object)val24;
			}
			AddApplyButton(rowY13, "btn-apply-ils-warp-distance", (UnityAction)obj23);
			MyCheckBox myCheckBox4 = wnd.AddCheckBox(num15, num2 + 4f, tab3, LogisticsConfigProvider.AutoConfigILSWarperNecessary, "Warpers required", 13).WithSmallerBox();
			float bx = num15 + Mathf.Max(myCheckBox3.Width, myCheckBox4.Width) + 10f;
			object obj24 = <>O.<21>__ApplyILSIncludeOrbitCollector;
			if (obj24 == null)
			{
				UnityAction val25 = LogisticsPatch.ApplyILSIncludeOrbitCollector;
				<>O.<21>__ApplyILSIncludeOrbitCollector = val25;
				obj24 = (object)val25;
			}
			AddApplyButtonAt(bx, rowY12, "btn-apply-ils-include-orbit-collector", (UnityAction)obj24);
			float rowY14 = num2;
			object obj25 = <>O.<22>__ApplyILSWarperNecessary;
			if (obj25 == null)
			{
				UnityAction val26 = LogisticsPatch.ApplyILSWarperNecessary;
				<>O.<22>__ApplyILSWarperNecessary = val26;
				obj25 = (object)val26;
			}
			AddApplyButtonAt(bx, rowY14, "btn-apply-ils-warper-necessary", (UnityAction)obj25);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigILSDroneMinDeliver, new AutoConfigCarrierMinDeliverMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY15 = num2;
			object obj26 = <>O.<23>__ApplyILSDroneMinDeliver;
			if (obj26 == null)
			{
				UnityAction val27 = LogisticsPatch.ApplyILSDroneMinDeliver;
				<>O.<23>__ApplyILSDroneMinDeliver = val27;
				obj26 = (object)val27;
			}
			AddApplyButton(rowY15, "btn-apply-ils-drone-min-deliver", (UnityAction)obj26);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigILSShipMinDeliver, new AutoConfigCarrierMinDeliverMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY16 = num2;
			object obj27 = <>O.<24>__ApplyILSShipMinDeliver;
			if (obj27 == null)
			{
				UnityAction val28 = LogisticsPatch.ApplyILSShipMinDeliver;
				<>O.<24>__ApplyILSShipMinDeliver = val28;
				obj27 = (object)val28;
			}
			AddApplyButton(rowY16, "btn-apply-ils-ship-min-deliver", (UnityAction)obj27);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigILSMinPilerValue, new AutoConfigMinPilerValueMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY17 = num2;
			object obj28 = <>O.<25>__ApplyILSMinPilerValue;
			if (obj28 == null)
			{
				UnityAction val29 = LogisticsPatch.ApplyILSMinPilerValue;
				<>O.<25>__ApplyILSMinPilerValue = val29;
				obj28 = (object)val29;
			}
			AddApplyButton(rowY17, "btn-apply-ils-min-piler-value", (UnityAction)obj28);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigILSDroneCount, new MyWindow.RangeValueMapper<int>(0, 100), "G", 150f, -100f).WithFontSize(13);
			float rowY18 = num2;
			object obj29 = <>O.<26>__ApplyILSDroneCount;
			if (obj29 == null)
			{
				UnityAction val30 = LogisticsPatch.ApplyILSDroneCount;
				<>O.<26>__ApplyILSDroneCount = val30;
				obj29 = (object)val30;
			}
			AddApplyButton(rowY18, "btn-apply-ils-drone-count", (UnityAction)obj29);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigILSShipCount, new MyWindow.RangeValueMapper<int>(0, 10), "G", 150f, -100f).WithFontSize(13);
			float rowY19 = num2;
			object obj30 = <>O.<27>__ApplyILSShipCount;
			if (obj30 == null)
			{
				UnityAction val31 = LogisticsPatch.ApplyILSShipCount;
				<>O.<27>__ApplyILSShipCount = val31;
				obj30 = (object)val31;
			}
			AddApplyButton(rowY19, "btn-apply-ils-ship-count", (UnityAction)obj30);
			num2 += 36f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigVeinCollectorHarvestSpeed, new AutoConfigVeinCollectorHarvestSpeedMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY20 = num2;
			object obj31 = <>O.<28>__ApplyVeinCollectorHarvestSpeed;
			if (obj31 == null)
			{
				UnityAction val32 = LogisticsPatch.ApplyVeinCollectorHarvestSpeed;
				<>O.<28>__ApplyVeinCollectorHarvestSpeed = val32;
				obj31 = (object)val32;
			}
			AddApplyButton(rowY20, "btn-apply-amm-harvest-speed", (UnityAction)obj31);
			num2 += 18f;
			wnd.AddSideSlider(num14, num2, tab3, LogisticsConfigProvider.AutoConfigVeinCollectorMinPilerValue, new AutoConfigMinPilerValueMapper(), "G", 150f, -100f).WithFontSize(13);
			float rowY21 = num2;
			object obj32 = <>O.<29>__ApplyVeinCollectorMinPilerValue;
			if (obj32 == null)
			{
				UnityAction val33 = LogisticsPatch.ApplyVeinCollectorMinPilerValue;
				<>O.<29>__ApplyVeinCollectorMinPilerValue = val33;
				obj32 = (object)val33;
			}
			AddApplyButton(rowY21, "btn-apply-amm-min-piler-value", (UnityAction)obj32);
			num = 0f;
			RectTransform parent3 = wnd.AddTab(trans, "Player/Mecha");
			num = 0f;
			num2 = 10f;
			wnd.AddCheckBox(num, num2, parent3, FactoryConfigProvider.UnlimitInteractiveEnabled, "Unlimited interactive range");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent3, PlanetPatch.PlayerActionsInGlobeViewEnabled, "Enable player actions in globe view");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent3, PlayerPatch.HideTipsForSandsChangesEnabled, "Hide tips for soil piles changes");
			num2 += 36f;
			myCheckBox = wnd.AddCheckBox(num, num2, parent3, PlayerPatch.EnhancedMechaForgeCountControlEnabled, "Enhanced count control for hand-make");
			wnd.AddTipsButton2(num + myCheckBox.Width + 5f, num2 + 6f, parent3, "Enhanced count control for hand-make", "Enhanced count control for hand-make tips", "enhanced-count-control-tips");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent3, PlayerPatch.ShortcutKeysForStarsNameEnabled, "Shortcut keys for showing stars' name");
			num2 += 36f;
			MyCheckBox autoCruiseCheckBox = wnd.AddCheckBox(num, num2, parent3, PlayerPatch.AutoCruiseEnabled, "Enable auto-cruise");
			num2 += 27f;
			MyCheckBox autoStopCheckBox = wnd.AddCheckBox(num + 20f, num2, parent3, PlayerPatch.StopOnArrivalAndInput, "Stop auto-cruise on manual input", 13);
			num2 += 27f;
			MyCheckBox useWarpCheckBox = wnd.AddCheckBox(num + 20f, num2, parent3, PlayerPatch.UseWarper, "Use warp", 13);
			float num16 = 0f;
			num2 += 27f;
			float y7 = num2;
			text = wnd.AddText2(num + 20f, num2, parent3, "Use warp minimal energy", 13, "use-warp-minimal-energy");
			num16 = Mathf.Max(num16, global::UXAssist.UI.Util.GetPreferredWidth(text));
			num2 += 27f;
			float y8 = num2;
			text = wnd.AddText2(num + 20f, num2, parent3, "Distance to use warp", 13, "text-new-navigation-distance-to-warp");
			num16 = Mathf.Max(num16, global::UXAssist.UI.Util.GetPreferredWidth(text));
			num2 += 27f;
			MyCheckBox speedUpCheckBox = wnd.AddCheckBox(num + 20f, num2, parent3, PlayerPatch.UseSpeedUp, "Auto boost", 13);
			num2 += 27f;
			float y9 = num2;
			text = wnd.AddText2(num + 20f, num2, parent3, "Auto boost minimal energy", 13, "auto-boost-minimal-energy");
			num16 = Mathf.Max(num16, global::UXAssist.UI.Util.GetPreferredWidth(text));
			num2 += 27f;
			float y10 = num2;
			text = wnd.AddText2(num + 20f, num2, parent3, "Dark Fog Hive follow distance", 13, "dark-fog-hive-follow-distance");
			num16 = Mathf.Max(num16, global::UXAssist.UI.Util.GetPreferredWidth(text));
			num2 += 27f;
			float y11 = num2;
			text = wnd.AddText2(num + 20f, num2, parent3, "Dark Fog Carrier follow distance", 13, "dark-fog-carrier-follow-distance");
			num16 = Mathf.Max(num16, global::UXAssist.UI.Util.GetPreferredWidth(text));
			float x7 = num + 20f + num16 + 5f;
			MySideSlider warpEnergySlider = wnd.AddSideSlider(x7, y7, parent3, PlayerPatch.UseWarperMinimalEnergy, new EnergyMapper(), "0", 160f, -100f).WithFontSize(13);
			MySideSlider newNavDistanceSlider = wnd.AddSideSlider(x7, y8, parent3, PlayerPatch.UseWarperDistance, new DistanceMapper(), "0.0", 160f, -100f).WithFontSize(13);
			MySideSlider speedUpEnergySlider = wnd.AddSideSlider(x7, y9, parent3, PlayerPatch.UseSpeedUpMinimalEnergy, new EnergyMapper(), "0", 160f, -100f).WithFontSize(13);
			MySideSlider dfHiveSlider = wnd.AddSideSlider(x7, y10, parent3, PlayerPatch.DFHiveFollowDistance, new DistanceMapperHive(), "0.0", 160f, -100f).WithFontSize(13);
			MySideSlider dfCarrierSlider = wnd.AddSideSlider(x7, y11, parent3, PlayerPatch.DFCarrierFollowDistance, new DistanceMapperCarrier(), "0.0", 160f, -100f).WithFontSize(13);
			PlayerPatch.AutoCruiseEnabled.SettingChanged += NavSettingChanged;
			PlayerPatch.UseWarper.SettingChanged += NavSettingChanged;
			PlayerPatch.UseSpeedUp.SettingChanged += NavSettingChanged;
			wnd.OnFree += delegate
			{
				PlayerPatch.AutoCruiseEnabled.SettingChanged -= NavSettingChanged;
			};
			wnd.OnFree += delegate
			{
				PlayerPatch.UseWarper.SettingChanged -= NavSettingChanged;
			};
			wnd.OnFree += delegate
			{
				PlayerPatch.UseSpeedUp.SettingChanged -= NavSettingChanged;
			};
			NavSettingChanged(null, null);
			RectTransform val34 = wnd.AddTab(trans, "Dyson Sphere");
			num = 0f;
			num2 = 10f;
			wnd.AddCheckBox(num, num2, val34, DysonSpherePatch.StopEjectOnNodeCompleteEnabled, "Stop ejectors when available nodes are all filled up");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, val34, DysonSpherePatch.OnlyConstructNodesEnabled, "Construct only structure points but frames");
			num = 400f;
			num2 = 10f;
			MyConfigWindow myConfigWindow7 = wnd;
			float x8 = num;
			float y12 = num2;
			object obj33 = <>c.<>9__22_6;
			if (obj33 == null)
			{
				UnityAction val35 = 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 text3 = Localization.Translate("Initialize Dyson Sphere");
					string text4 = Localization.Translate("Initialize Dyson Sphere Confirm");
					string text5 = Localization.Translate("Cancel");
					string text6 = Localization.Translate("OK");
					object obj37 = <>c.<>9__22_32;
					if (obj37 == null)
					{
						Response val39 = delegate
						{
							DysonSphereFunctions.InitCurrentDysonLayer(null, -1);
						};
						<>c.<>9__22_32 = val39;
						obj37 = (object)val39;
					}
					UIMessageBox.Show(text3, text4, text5, text6, 2, (Response)null, (Response)obj37);
				};
				<>c.<>9__22_6 = val35;
				obj33 = (object)val35;
			}
			_dysonInitBtn = myConfigWindow7.AddButton(x8, y12, val34, "Initialize Dyson Sphere", 16, "init-dyson-sphere", (UnityAction)obj33);
			num2 += 36f;
			wnd.AddText2(num, num2, val34, "Click to dismantle selected layer", 16, "text-dismantle-layer");
			num2 += 27f;
			for (int num17 = 0; num17 < 10; num17++)
			{
				int id = num17 + 1;
				MyFlatButton myFlatButton = wnd.AddFlatButton(num, num2, val34, id.ToString(), 12, "dismantle-layer-" + id, (UnityAction)delegate
				{
					//IL_0049: Unknown result type (might be due to invalid IL or missing references)
					//IL_0053: Expected O, but got Unknown
					StarData star = DysonSphereFunctions.CurrentStarForDysonSystem();
					UIMessageBox.Show(Localization.Translate("Dismantle selected layer"), Localization.Translate("Dismantle selected layer Confirm"), Localization.Translate("Cancel"), Localization.Translate("OK"), 2, (Response)null, (Response)delegate
					{
						DysonSphereFunctions.InitCurrentDysonLayer(star, id);
					});
				}).WithSize(40f, 20f);
				DysonLayerBtn[num17] = myFlatButton.uiButton;
				if (num17 == 4)
				{
					num -= 160f;
					num2 += 20f;
				}
				else
				{
					num += 40f;
				}
			}
			num = 400f;
			num2 += 36f;
			text = wnd.AddText2(num, num2, val34, "Auto Fast Build Speed Multiplier", 15, "text-auto-fast-build-multiplier");
			wnd.AddSlider(num + global::UXAssist.UI.Util.GetPreferredWidth(text) + 5f, num2 + 6f, val34, DysonSpherePatch.AutoConstructMultiplier, new int[7] { 1, 2, 5, 10, 20, 50, 100 }, "0", 100f);
			_dysonTab = val34;
			RectTransform parent4 = wnd.AddTab(trans, "Tech/Combat/UI");
			num = 10f;
			num2 = 10f;
			wnd.AddCheckBox(num, num2, parent4, UIPatch.PlanetVeinUtilizationEnabled, "Planet vein utilization");
			num2 += 72f;
			wnd.AddCheckBox(num, num2, parent4, TechPatch.BatchBuyoutTechEnabled, "Buy out techs with their prerequisites");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent4, TechPatch.SorterCargoStackingEnabled, "Restore upgrades of \"Sorter Cargo Stacking\" on panel");
			num2 += 36f;
			wnd.AddCheckBox(num, num2, parent4, TechPatch.DisableBattleRelatedTechsInPeaceModeEnabled, "Disable battle-related techs in Peace mode");
			num2 += 36f;
			MyConfigWindow myConfigWindow8 = wnd;
			float x9 = num;
			float y13 = num2;
			object obj34 = <>O.<30>__RemoveCargoStackingTechs;
			if (obj34 == null)
			{
				UnityAction val36 = TechFunctions.RemoveCargoStackingTechs;
				<>O.<30>__RemoveCargoStackingTechs = val36;
				obj34 = (object)val36;
			}
			myConfigWindow8.AddButton(x9, y13, 300f, parent4, "Set \"Sorter Cargo Stacking\" to unresearched state", 16, "button-remove-cargo-stacking", (UnityAction)obj34);
			num2 += 36f;
			MyConfigWindow myConfigWindow9 = wnd;
			float x10 = num;
			float y14 = num2;
			object obj35 = <>O.<31>__UnlockAllProtoWithMetadataAndPrompt;
			if (obj35 == null)
			{
				UnityAction val37 = TechFunctions.UnlockAllProtoWithMetadataAndPrompt;
				<>O.<31>__UnlockAllProtoWithMetadataAndPrompt = val37;
				obj35 = (object)val37;
			}
			myConfigWindow9.AddButton(x10, y14, 300f, parent4, "Unlock all techs with metadata", 16, "button-unlock-all-techs-with-metadata", (UnityAction)obj35);
			num2 += 72f;
			MyConfigWindow myConfigWindow10 = wnd;
			float x11 = num;
			float y15 = num2;
			object obj36 = <>c.<>9__22_7;
			if (obj36 == null)
			{
				UnityAction val38 = delegate
				{
					GameData data = GameMain.data;
					if (data != null && data.gameDesc.isCombatMode)
					{
						UIGame uiGame = UIRoot.instance.uiGame;
						uiGame.ShutPlayerInventory();
						uiGame.CloseEnemyBriefInfo();
						uiGame.OpenCommunicatorWindow(5);
					}
				};
				<>c.<>9__22_7 = val38;
				obj36 = (object)val38;
			}
			myConfigWindow10.AddButton(x11, y15, 300f, parent4, "Open Dark Fog Communicator", 16, "button-open-df-communicator", (UnityAction)obj36);
			void AddApplyButton(float rowY22, string objName, UnityAction onClick)
			{
				AddApplyButtonAt(applyBtnX, rowY22, objName, onClick);
			}
			void AddApplyButtonAt(float x12, float num18, string objName, UnityAction onClick)
			{
				wnd.AddFlatButton(x12, num18 + 6f, tab3, "Apply config to planet", 11, objName, onClick).WithSize(44f, 15f).WithFontSize(11)
					.WithTip(Localization.Translate("Apply config to planet tips"));
			}
			void AddCategoryApplyButton(float num18, string objName, UnityAction onClick)
			{
				wnd.AddFlatButton(applyAllBtnX, num18 + 7f, tab3, "Apply all config to planet", 11, objName, onClick).WithSize(58f, 15f).WithFontSize(11)
					.WithTip(Localization.Translate("Apply all config to planet tips"));
			}
			void AlternatelyCheckBoxChanged(object o, EventArgs e)
			{
				alternatelyCheckBox.SetEnable(FactoryConfigProvider.DragBuildPowerPolesEnabled.Value);
			}
			void DoNotRenderEntitiesEnabledChanged(object o, EventArgs e)
			{
				hideSortersCheckBox.SetEnable(FactoryConfigProvider.DoNotRenderEntitiesEnabled.Value);
			}
			void NavSettingChanged(object o, EventArgs e)
			{
				autoCruiseCheckBox.SetEnable(on: true);
				autoStopCheckBox.SetEnable(PlayerPatch.AutoCruiseEnabled.Value);
				useWarpCheckBox.SetEnable(PlayerPatch.AutoCruiseEnabled.Value);
				warpEnergySlider.SetEnable(PlayerPatch.AutoCruiseEnabled.Value && PlayerPatch.UseWarper.Value);
				newNavDistanceSlider.SetEnable(PlayerPatch.AutoCruiseEnabled.Value && PlayerPatch.UseWarper.Value);
				speedUpCheckBox.SetEnable(PlayerPatch.AutoCruiseEnabled.Value);
				speedUpEnergySlider.SetEnable(PlayerPatch.AutoCruiseEnabled.Value && PlayerPatch.UseSpeedUp.Value);
				dfHiveSlider.SetEnable(PlayerPatch.AutoCruiseEnabled.Value);
				dfCarrierSlider.SetEnable(PlayerPatch.AutoCruiseEnabled.Value);
			}
			void PressShiftToTakeWholeBeltItemsEnabledChanged(object o, EventArgs e)
			{
				includeBranches.SetEnable(FactoryConfigProvider.PressShiftToTakeWholeBeltItemsEnabled.Value);
				includeInserters.SetEnable(FactoryConfigProvider.PressShiftToTakeWholeBeltItemsEnabled.Value);
			}
			void ProductLimitChanged(object sender, EventArgs args)
			{
				productLimitInput.text = productLimitConfig.Value.ToString();
			}
			void RealtimeLogisticsInfoPanelChanged(object o, EventArgs e)
			{
				if (AuxilaryfunctionWrapper.ShowStationInfo == null)
				{
					realtimeLogisticsInfoPanelCheckBox.SetEnable(on: true);
					realtimeLogisticsInfoPanelBarsCheckBox.SetEnable(LogisticsConfigProvider.RealtimeLogisticsInfoPanelEnabled.Value);
				}
				else
				{
					bool flag = !AuxilaryfunctionWrapper.ShowStationInfo.Value;
					realtimeLogisticsInfoPanelCheckBox.SetEnable(flag);
					realtimeLogisticsInfoPanelBarsCheckBox.SetEnable(flag & LogisticsConfigProvider.RealtimeLogisticsInfoPanelEnabled.Value);
					if (!flag)
					{
						LogisticsConfigProvider.RealtimeLogisticsInfoPanelEnabled.Value = false;
					}
				}
			}
			void SetProductLimit(string value)
			{
				if (int.TryParse(value, out var result))
				{
					productLimitConfig.Value = Mathf.Clamp(result, 1, 999999);
				}
				productLimitInput.text = productLimitConfig.Value.ToString();
			}
			void TankSettingChanged(object o, EventArgs e)
			{
				tankSlider.SetEnable(FactoryConfigProvider.TankFastFillInAndTakeOutEnabled.Value);
			}
			void TweakBuildingBufferChanged(object o, EventArgs e)
			{
				assemblerBufferTimeMultiplierSlider.SetEnable(FactoryConfigProvider.TweakBuildingBufferEnabled.Value);
				assemblerBufferMininumMultiplierSlider.SetEnable(FactoryConfigProvider.TweakBuildingBufferEnabled.Value);
				labBufferMaxCountForAssembleSlider.SetEnable(FactoryConfigProvider.TweakBuildingBufferEnabled.Value);
				labBufferExtraCountForAdvancedAssembleSlider.SetEnable(FactoryConfigProvider.TweakBuildingBufferEnabled.Value);
				labBufferMaxCountForResearchSlider.SetEnable(FactoryConfigProvider.TweakBuildingBufferEnabled.Value);
				receiverBufferCountSlider.SetEnable(FactoryConfigProvider.TweakBuildingBufferEnabled.Value);
				ejectorBufferCountSlider.SetEnable(FactoryConfigProvider.TweakBuildingBufferEnabled.Value);
				siloBufferCountSlider.SetEnable(FactoryConfigProvider.TweakBuildingBufferEnabled.Value);
			}
		}

		private static void UpdateUI()
		{
			if ((Object)(object)_quickMinerText != (Object)null)
			{
				_quickMinerText.text = Localization.Translate(QuickMinerBuild.IsRunning ? "Cancel miner layout search" : "Quick build Mining Machines");
			}
			UpdateDysonShells();
		}

		private static void UpdateDysonShells()
		{
			if (!((Component)_dysonTab).gameObject.activeSelf)
			{
				return;
			}
			StarData val = DysonSphereFunctions.CurrentStarForDysonSystem();
			if (val == null)
			{
				for (int i = 0; i < 10; i++)
				{
					((Selectable)DysonLayerBtn[i].button).interactable = false;
				}
				return;
			}
			DysonSphere[] array = GameMain.data?.dysonSpheres;
			if (((array != null) ? array[val.index] : null) != null)
			{
				DysonSphere val2 = array[val.index];
				for (int j = 1; j <= 10; j++)
				{
					DysonSphereLayer val3 = val2.layersIdBased[j];
					((Selectable)DysonLayerBtn[j - 1].button).interactable = val3 != null && val3.id == j;
				}
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[CommonAPISubmoduleDependency(new string[] { "CustomKeyBindSystem" })]
	[BepInPlugin("org.soardev.uxassist", "UXAssist", "1.6.3")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class UXAssist : BaseUnityPlugin, IModCanSave
	{
		public static readonly ManualLogSource Logger = Logger.CreateLogSource("UXAssist");

		private static ConfigFile _dummyConfig;

		private Type[] _patches;

		private Type[] _compats;

		private readonly Harmony _harmony = new Harmony("org.soardev.uxassist");

		private const ushort ModSaveVersion = 2;

		private static readonly List<Action<BinaryWriter>> _exporters = new List<Action<BinaryWriter>>();

		private static readonly List<Action<BinaryReader, ushort>> _importers = new List<Action<BinaryReader, ushort>>();

		public static void RegisterExporter(Action<BinaryWriter> e)
		{
			_exporters.Add(e);
		}

		public static void RegisterImporter(Action<BinaryReader, ushort> i)
		{
			_importers.Add(i);
		}

		public void Export(BinaryWriter w)
		{
			w.Write((ushort)2);
			foreach (Action<BinaryWriter> exporter in _exporters)
			{
				exporter(w);
			}
		}

		public void Import(BinaryReader r)
		{
			ushort num = r.ReadUInt16();
			if (num <= 0)
			{
				return;
			}
			foreach (Action<BinaryReader, ushort> importer in _importers)
			{
				importer(r, num);
			}
		}

		public void IntoOtherSave()
		{
		}

		private UXAssist()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			PlanetVeinUtilization.Run(_harmony);
			CommonAPIWrapper.Run(_harmony);
		}

		private void Awake()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Expected O, but got Unknown
			//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d7: Expected O, but got Unknown
			//IL_040f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0419: Expected O, but got Unknown
			//IL_05aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b4: Expected O, but got Unknown
			//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e6: Expected O, but got Unknown
			//IL_060e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0618: Expected O, but got Unknown
			//IL_0640: Unknown result type (might be due to invalid IL or missing references)
			//IL_064a: Expected O, but got Unknown
			//IL_0673: Unknown result type (might be due to invalid IL or missing references)
			//IL_067d: Expected O, but got Unknown
			//IL_06a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06af: Expected O, but got Unknown
			//IL_06da: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e4: Expected O, but got Unknown
			//IL_070c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0716: Expected O, but got Unknown
			//IL_081f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0829: Expected O, but got Unknown
			//IL_0852: Unknown result type (might be due to invalid IL or missing references)
			//IL_085c: Expected O, but got Unknown
			//IL_0884: Unknown result type (might be due to invalid IL or missing references)
			//IL_088e: Expected O, but got Unknown
			//IL_08b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c0: Expected O, but got Unknown
			//IL_08ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f9: Expected O, but got Unknown
			//IL_0922: Unknown result type (might be due to invalid IL or missing references)
			//IL_092c: Expected O, but got Unknown
			//IL_0953: Unknown result type (might be due to invalid IL or missing references)
			//IL_095d: Expected O, but got Unknown
			//IL_0986: Unknown result type (might be due to invalid IL or missing references)
			//IL_0990: Expected O, but got Unknown
			//IL_09b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c2: Expected O, but got Unknown
			//IL_09f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fb: Expected O, but got Unknown
			//IL_0a24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2e: Expected O, but got Unknown
			//IL_0a57: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a61: Expected O, but got Unknown
			//IL_0a8a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a94: Expected O, but got Unknown
			//IL_0abd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac7: Expected O, but got Unknown
			//IL_0aee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af8: Expected O, but got Unknown
			//IL_0b61: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6b: Expected O, but got Unknown
			//IL_0b94: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b9e: Expected O, but got Unknown
			//IL_0bc7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd1: Expected O, but got Unknown
			//IL_0bf8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c02: Expected O, but got Unknown
			//IL_0c31: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c3b: Expected O, but got Unknown
			_dummyConfig = new ConfigFile(Path.Combine(Paths.ConfigPath, "org.soardev.uxassist_dummy.cfg"), false)
			{
				SaveOnConfigSet = false
			};
			GamePatch.EnableWindowResizeEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Game", "EnableWindowResize", false, "Enable game window resize (maximum box and thick frame)");
			GamePatch.LoadLastWindowRectEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Game", "LoadLastWindowRect", false, "Load last window position and size when game starts");
			GamePatch.LastWindowRect = ((BaseUnityPlugin)this).Config.Bind<Vector4>("Game", "LastWindowRect", new Vector4(0f, 0f, 0f, 0f), "Last window position and size");
			GamePatch.ProfileBasedSaveFolderEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Game", "ProfileBasedSaveFolder", false, "Profile-based save folder");
			GamePatch.ProfileBasedOptionEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Game", "ProfileBasedOption", false, "Profile-based option");
			GamePatch.DefaultProfileName = ((BaseUnityPlugin)this).Config.Bind<string>("Game", "DefaultProfileName", "Default", "Default profile name, used when profile-based save folder is enabled. Use original game save folder if matched");
			GamePatch.ConvertSavesFromPeaceEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Game", "ConvertSavesFromPeace", false, "Convert saves from Peace mode to Combat mode on save loading");
			GamePatch.GameUpsFactor = _dummyConfig.Bind<double>("Game", "GameUpsFactor", 1.0, "Game UPS factor (1.0 for normal speed)");
			WindowFunctions.ProcessPriority = ((BaseUnityPlugin)this).Config.Bind<int>("Game", "ProcessPriority", 2, new ConfigDescription("Game process priority\n  0: High  1: Above Normal  2: Normal  3: Below Normal  4: Idle", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 4), Array.Empty<object>()));
			FactoryPatch.UnlimitInteractiveEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "UnlimitInteractive", false, "Unlimit interactive range");
			FactoryPatch.RemoveSomeConditionEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "RemoveSomeBuildConditionCheck", false, "Remove part of build condition checks that does not affect game logic");
			FactoryPatch.NightLightEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "NightLight", false, "Night light");
			FactoryPatch.NightLightAngleX = ((BaseUnityPlugin)this).Config.Bind<float>("Factory", "NightLightAngleX", -8f, "Night light angle X");
			FactoryPatch.NightLightAngleY = ((BaseUnityPlugin)this).Config.Bind<float>("Factory", "NightLightAngleY", -2f, "Night light angle Y");
			PlanetPatch.PlayerActionsInGlobeViewEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Planet", "PlayerActionsInGlobeView", false, "Enable player actions in globe view");
			PlanetFunctions.ReturnBuildingsOnInitializeEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Planet", "ReturnBuildingsOnInitialize", false, "Return buildings to player when initializing planet");
			PlanetFunctions.ReturnLogisticStorageItemsOnInitializeEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Planet", "ReturnLogisticStorageItemsOnInitialize", false, "Return logistic storage items to player when initializing planet");
			PlanetFunctions.ReturnBeltAFactoryItemsOnInitializeEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Planet", "ReturnBeltAFactoryItemsOnInitialize", false, "Return belt and factory items to player when initializing planet");
			QuickMinerBuild.AllowVeinReform = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "QuickMinerAllowVeinReform", false, "Allow quick miner placement to restore and bury veins. When disabled, skip all vein restoration and burial calculations.");
			FactoryPatch.RemoveBuildRangeLimitEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "RemoveBuildRangeLimit", false, "Remove limit for build range and maximum count of drag building belts/buildings\nNote: this does not affect range limit for mecha drones' action");
			FactoryPatch.LargerAreaForUpgradeAndDismantleEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "LargerAreaForUpgradeAndDismantle", false, "Increase maximum area size for upgrade and dismantle to 31x31 (from 11x11)");
			FactoryPatch.LargerAreaForTerraformEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "LargerAreaForTerraform", false, "Increase maximum area size for terraform to 30x30 (from 10x10)\nNote: this may impact game performance while using large area");
			FactoryPatch.OffGridBuildingEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "OffGridBuilding", false, "Enable off grid building and stepped rotation");
			FactoryPatch.TreatStackingAsSingleEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "TreatStackingAsSingle", false, "Treat stack items as single in monitor components");
			FactoryPatch.QuickBuildAndDismantleLabsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "QuickBuildAndDismantleLab", false, "Quick build and dismantle stacking labs");
			FactoryPatch.ProtectVeinsFromExhaustionEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "ProtectVeinsFromExhaustion", false, "Protect veins from exhaustion");
			VeinProtectionPatch.ProtectVeinsFromExhaustion.KeepVeinAmount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "KeepVeinAmount", 1000, new ConfigDescription("Keep veins amount (0 to disable)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10000), Array.Empty<object>())).Value;
			VeinProtectionPatch.ProtectVeinsFromExhaustion.KeepOilSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Factory", "KeepOilSpeed", 1f, new ConfigDescription("Keep minimal oil speed (< 0.1 to disable)", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), Array.Empty<object>())).Value;
			FactoryPatch.DoNotRenderEntitiesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "DoNotRenderEntities", false, "Do not render factory entities");
			FactoryPatch.DoNotRenderEntitiesHideSortersEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "DoNotRenderEntitiesHideSorters", false, "Hide sorters too when not rendering factory entities (leaves only belts visible)");
			FactoryPatch.DragBuildPowerPolesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "DragBuildPowerPoles", false, "Drag building power poles in maximum connection range");
			FactoryPatch.DragBuildPowerPolesAlternatelyEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "DragBuildPowerPolesAlternately", true, "Build Tesla Tower and Wireless Power Tower alternately");
			FactoryPatch.AutoConstructButtonEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AutoConstructButton", false, "Enable auto-construct button");
			FactoryPatch.AutoConstructEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AutoConstruct", false, "Fly toward the building to be constructed automatically");
			FactoryPatch.BeltSignalsForBuyOutEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "BeltSignalsForBuyOut", false, "Belt signals for buy out dark fog items automatically");
			FactoryPatch.TankFastFillInAndTakeOutEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "TankFastFillInAndTakeOut", false, "Fast fill in to and take out from tanks");
			FactoryPatch.TankFastFillInAndTakeOutMultiplier = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "TankFastFillInAndTakeOutMultiplier", 1000, "Speed multiplier for fast filling in to and takeing out from tanks");
			FactoryPatch.CutConveyorBeltEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "CutConveyorBeltShortcut", false, "Cut conveyor belt (with shortcut key)");
			FactoryPatch.TweakBuildingBufferEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "TweakBuildingBuffer", false, "Tweak buffer count for assemblers and power generators");
			FactoryPatch.AssemblerBufferTimeMultiplier = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AssemblerBufferTimeMultiplier", 4, new ConfigDescription("Assembler buffer time multiplier in seconds", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 10), Array.Empty<object>()));
			FactoryPatch.AssemblerBufferMininumMultiplier = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AssemblerBufferMininumMultiplier", 4, new ConfigDescription("Assembler buffer minimum multiplier", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 10), Array.Empty<object>()));
			FactoryPatch.LabBufferMaxCountForAssemble = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "LabBufferMaxCountForAssemble", 6, new ConfigDescription("Buffer count for assembling in labs", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 20), Array.Empty<object>()));
			FactoryPatch.LabBufferExtraCountForAdvancedAssemble = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "LabBufferExtraCountForAdvancedAssemble", 3, new ConfigDescription("Extra buffer count for Self-evolution Labs", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), Array.Empty<object>()));
			FactoryPatch.LabBufferMaxCountForResearch = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "LabBufferMaxCountForResearch", 10, new ConfigDescription("Buffer count for researching in labs", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 20), Array.Empty<object>()));
			FactoryPatch.ReceiverBufferCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "ReceiverBufferCount", 1, new ConfigDescription("Ray Receiver Graviton Lens buffer count", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 20), Array.Empty<object>()));
			FactoryPatch.EjectorBufferCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "EjectorBufferCount", 1, new ConfigDescription("Ejector buffer count", (AcceptableValueBase)(object)new AcceptableValueRange<int>(5, 400), Array.Empty<object>()));
			FactoryPatch.SiloBufferCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "SiloBufferCount", 1, new ConfigDescription("Silo buffer count", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 40), Array.Empty<object>()));
			FactoryPatch.ShortcutKeysForBlueprintCopyEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "DismantleBlueprintSelection", false, "Dismantle blueprint selected buildings");
			FactoryPatch.PressShiftToTakeWholeBeltItemsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "PressShiftToTakeWholeBeltItems", false, "Ctrl+Shift+Click to pick items from whole belts");
			FactoryPatch.PressShiftToTakeWholeBeltItemsIncludeBranches = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "PressShiftToTakeWholeBeltItemsIncludeBranches", false, "Include branches of belts");
			FactoryPatch.PressShiftToTakeWholeBeltItemsIncludeInserters = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "PressShiftToTakeWholeBeltItemsIncludeInserters", false, "Include connected inserters");
			LogisticsPatch.AutoConfigLogisticsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AutoConfigLogistics", false, "Auto-config logistic stations");
			LogisticsPatch.AutoConfigLimitAutoReplenishCount = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AutoConfigLimitAutoReplenishCount", false, "Limit auto-replenish count to config values");
			LogisticsPatch.SetDefaultRemoteLogicToStorage = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AutoConfigSetDefaultRemoteLogicToStorage", false, "Set default remote logic to storage");
			LogisticsPatch.AutoConfigDispenserChargePower = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigDispenserChargePower", 30, new ConfigDescription("LD: Max. Charging Power", (AcceptableValueBase)(object)new AcceptableValueRange<int>(3, 30), Array.Empty<object>()));
			LogisticsPatch.AutoConfigDispenserCourierCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigDispenserCourierCount", 10, new ConfigDescription("LD: Count of Bots filled", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), Array.Empty<object>()));
			LogisticsPatch.AutoConfigBattleBaseChargePower = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigBattleBaseChargePower", 8, new ConfigDescription("Battlefield Analysis Base: Max. Charging Power", (AcceptableValueBase)(object)new AcceptableValueRange<int>(4, 40), Array.Empty<object>()));
			LogisticsPatch.AutoConfigPLSChargePower = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigPLSChargePower", 4, new ConfigDescription("PLS: Max. Charging Power", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 20), Array.Empty<object>()));
			LogisticsPatch.AutoConfigPLSMaxTripDrone = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigPLSMaxTripDrone", 180, new ConfigDescription("PLS: Drone transport range", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 180), Array.Empty<object>()));
			LogisticsPatch.AutoConfigPLSDroneMinDeliver = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigPLSDroneMinDeliver", 10, new ConfigDescription("PLS: Min. Load of Drones", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), Array.Empty<object>()));
			LogisticsPatch.AutoConfigPLSMinPilerValue = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigPLSMinPilerValue", 0, new ConfigDescription("PLS: Outgoing integration count", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 4), Array.Empty<object>()));
			LogisticsPatch.AutoConfigPLSDroneCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigPLSDroneCount", 10, new ConfigDescription("PLS: Count of Drones filled", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 50), Array.Empty<object>()));
			LogisticsPatch.AutoConfigILSChargePower = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSChargePower", 4, new ConfigDescription("ILS: Max. Charging Power", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 20), Array.Empty<object>()));
			LogisticsPatch.AutoConfigILSMaxTripDrone = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSMaxTripDrone", 180, new ConfigDescription("ILS: Drone transport range", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 180), Array.Empty<object>()));
			LogisticsPatch.AutoConfigILSMaxTripShip = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSMaxTripShip", 41, new ConfigDescription("ILS: Vessel transport range", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 41), Array.Empty<object>()));
			LogisticsPatch.AutoConfigILSWarperDistance = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSWarperDistance", 16, new ConfigDescription("ILS: Warp distance", (AcceptableValueBase)(object)new AcceptableValueRange<int>(2, 21), Array.Empty<object>()));
			LogisticsPatch.AutoConfigILSDroneMinDeliver = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSDroneMinDeliver", 10, new ConfigDescription("ILS: Min. Load of Drones", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), Array.Empty<object>()));
			LogisticsPatch.AutoConfigILSShipMinDeliver = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSShipMinDeliver", 10, new ConfigDescription("ILS: Min. Load of Vessels", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), Array.Empty<object>()));
			LogisticsPatch.AutoConfigILSMinPilerValue = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSMinPilerValue", 0, new ConfigDescription("ILS: Outgoing integration count", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 4), Array.Empty<object>()));
			LogisticsPatch.AutoConfigILSIncludeOrbitCollector = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AutoConfigILSIncludeOrbitCollector", true, "ILS: Include Orbital Collector");
			LogisticsPatch.AutoConfigILSWarperNecessary = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AutoConfigILSWarperNecessary", true, "ILS: Warpers required");
			LogisticsPatch.AutoConfigILSDroneCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSDroneCount", 20, new ConfigDescription("ILS: Count of Drones filled", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			LogisticsPatch.AutoConfigILSShipCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigILSShipCount", 10, new ConfigDescription("ILS: Count of Vessels filled", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), Array.Empty<object>()));
			LogisticsPatch.AutoConfigVeinCollectorHarvestSpeed = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigVeinCollectorHarvestSpeed", 20, new ConfigDescription("AMM: Collecting Speed", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 20), Array.Empty<object>()));
			LogisticsPatch.AutoConfigVeinCollectorMinPilerValue = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "AutoConfigVeinCollectorMinPilerValue", 0, new ConfigDescription("AMM: Outgoing integration count", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 4), Array.Empty<object>()));
			LogisticsPatch.OrbitalCollectorProductLimit = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "OrbitalCollectorProductLimit", 20000, new ConfigDescription("Orbital Collector product limit", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 999999), Array.Empty<object>()));
			LogisticsPatch.LogisticsCapacityTweaksEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "LogisticsCapacityTweaks", true, "Logistics capacity related tweaks");
			LogisticsPatch.AllowOverflowInLogisticsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "AllowOverflowInLogistics", false, "Allow overflow in logistic stations");
			LogisticsPatch.GreaterPowerUsageInLogisticsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Build", "GreaterPowerUsageInLogistics", false, "Increase maximum power usage in Logistic Stations and Advanced Mining Machines");
			LogisticsPatch.LogisticsConstrolPanelImprovementEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "LogisticsConstrolPanelImprovement", false, "Logistics control panel improvement");
			LogisticsPatch.RealtimeLogisticsInfoPanelEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "RealtimeLogisticsInfoPanel", false, "Realtime logistics info panel");
			LogisticsPatch.RealtimeLogisticsInfoPanelBarsEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Factory", "RealtimeLogisticsInfoPanelBars", false, "Realtime logistics info panel - Show status bars for storage item");
			PlanetFunctions.OrbitalCollectorMaxBuildCount = ((BaseUnityPlugin)this).Config.Bind<int>("Factory", "OCMaxBuildCount", 0, "Maximum Orbital Collectors to build once, set to 0 to build as many as possible");
			PlayerPatch.EnhancedMechaForgeCountControlEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "EnhancedMechaForgeCountControl", false, "Enhanced count control for hand-make, increases maximum of count to 1000, and you can hold Ctrl/Shift/Alt to change the count rapidly");
			PlayerPatch.HideTipsForSandsChangesEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "HideTipsForGettingSands", false, "Hide tips for getting soil piles");
			PlayerPatch.ShortcutKeysForStarsNameEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Player", "ShortcutKeysFo