Decompiled source of Auxilaryfunction v3.0.4

Auxilaryfunction.dll

Decompiled 2 weeks ago
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using Auxilaryfunction.Models;
using Auxilaryfunction.Patch;
using Auxilaryfunction.Services;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.UI;
using UnityStandardAssets.ImageEffects;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Auxilaryfunction")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Auxilaryfunction")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7fd6fcaf-8a28-43c7-adb5-3c05716882a7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 Auxilaryfunction
{
	[BepInPlugin("cn.blacksnipe.dsp.Auxilaryfunction", "Auxilaryfunction", "3.0.4")]
	public class Auxilaryfunction : BaseUnityPlugin
	{
		private SynchronizationContext _mainContext;

		public static bool autobuildgetitem;

		public static int automovetoPrebuildSecondElapseCounter;

		public static bool autoRemoveRuin;

		public static int autoRemoveRuinId = -1;

		public static bool GameDataImported;

		public static GUIDraw guidraw;

		public static bool HideDarkFogAssaultTip;

		public static bool HideDarkFogMonitor;

		public static int maxCount = 0;

		public static Player player;

		public static List<int> readyresearch;

		public static bool StartAutoMovetoDarkfog;

		public static bool StartAutoMovetounbuilt;

		public static int[,] stationcopyItem = new int[5, 6];

		public static GameObject stationTipRoot;

		public static Light SunLight;

		public static GameObject tipPrefab;

		public static GameObject TrashCanButton;

		public static StorageComponent TrashStorage;

		public static GameObject TrashStorageWindow;

		public static UIStorageWindow uiTrashStorageWindow;

		public bool firstStart;

		public void Start()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Invalid comparison between Unknown and I4
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Invalid comparison between Unknown and I4
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			_mainContext = SynchronizationContext.Current;
			AuxConfig.harmony = new Harmony("cn.blacksnipe.dsp.Auxilaryfunction");
			AuxConfig.harmony.PatchAll(typeof(SkipRenderPatch));
			AuxConfig.harmony.PatchAll(typeof(AuxilaryfunctionPatch));
			AuxilaryTranslate.regallTranslate();
			AuxConfig.BindAll(((BaseUnityPlugin)this).Config);
			if (AuxConfig.closeplayerflyaudio.Value)
			{
				PlayerAudioMutePatch.Enable = true;
			}
			if (AuxConfig.CloseMilestone.Value)
			{
				AuxConfig.originUnlockVolumn = LDB.audios["unlock-1"].Volume;
				LDB.audios["unlock-1"].Volume = 0f;
			}
			AuxConfig.CloseMilestone.SettingChanged += delegate
			{
				LDB.audios["unlock-1"].Volume = (AuxConfig.CloseMilestone.Value ? 0f : AuxConfig.originUnlockVolumn);
				Debug.Log((object)LDB.audios["unlock-1"].Volume);
			};
			AuxConfig.closeplayerflyaudio.SettingChanged += delegate
			{
				PlayerAudioMutePatch.Enable = AuxConfig.closeplayerflyaudio.Value;
			};
			if (AuxConfig.autonavigation_bool.Value)
			{
				PlayerOperationPatch.Enable = true;
			}
			AuxConfig.autonavigation_bool.SettingChanged += delegate
			{
				PlayerOperationPatch.Enable = AuxConfig.autonavigation_bool.Value;
			};
			if (AuxConfig.SunLightOpen.Value)
			{
				SunLightPatch.Enable = AuxConfig.SunLightOpen.Value;
			}
			AuxConfig.SunLightOpen.SettingChanged += delegate
			{
				SunLightPatch.Enable = AuxConfig.SunLightOpen.Value;
			};
			((Vector2)(ref GUIDraw.scrollPosition))[0] = 0f;
			((Vector2)(ref GUIDraw.dysonBluePrintscrollPosition))[0] = 0f;
			KeyboardShortcut value = AuxConfig.QuickKey.Value;
			if ((int)((KeyboardShortcut)(ref value)).MainKey == 50)
			{
				value = AuxConfig.QuickKey.Value;
				if (((KeyboardShortcut)(ref value)).Modifiers.Count() == 1)
				{
					value = AuxConfig.QuickKey.Value;
					if ((int)((KeyboardShortcut)(ref value)).Modifiers.ElementAt(0) == 308)
					{
						AuxConfig.QuickKey.Value = new KeyboardShortcut((KeyCode)308, (KeyCode[])(object)new KeyCode[1] { (KeyCode)50 });
					}
				}
			}
			readyresearch = new List<int>();
			GameObject val = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("Auxilaryfunction.Resources.auxilarypanel")).LoadAsset<GameObject>("AuxilaryPanel");
			GameObject panel = Object.Instantiate<GameObject>(val, ((Component)UIRoot.instance.overlayCanvas).transform);
			guidraw = new GUIDraw(Math.Max(5, Math.Min(AuxConfig.scale.Value, 35)), panel);
			DysonBluePrintDataService.LoadDysonBluePrintData();
			ThreadPool.QueueUserWorkItem(delegate
			{
				SecondEvent();
			});
		}

		private static void FindItemAndMove(int itemId, int itemCount)
		{
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			if (AuxConfig.LocalPlanet == null || AuxConfig.LocalPlanet.factory == null || AuxConfig.LocalPlanet.gasItems != null || (Object)(object)LDB.items == (Object)null || ((ProtoSet<ItemProto>)(object)LDB.items).Select(itemId) == null)
			{
				return;
			}
			int num = player.package.grids.Length;
			int num2 = 0;
			if (player.package.grids[num - 1].count != 0)
			{
				player.package.Sort(true);
			}
			int num3 = num - 1;
			while (num3 >= 0 && player.package.grids[num3].count == 0)
			{
				num3--;
				num2++;
			}
			int num4 = ((ProtoSet<ItemProto>)(object)LDB.items).Select(itemId).StackSize * num2;
			itemCount = ((num4 > itemCount) ? itemCount : num4);
			PlanetFactory factory = AuxConfig.LocalPlanet.factory;
			if (factory.transport != null && factory.transport.stationPool != null)
			{
				int num5 = 0;
				int num6 = 0;
				StationComponent[] stationPool = factory.transport.stationPool;
				int num9 = default(int);
				foreach (StationComponent val in stationPool)
				{
					if (itemCount == 0)
					{
						break;
					}
					if (val != null && val.storage != null)
					{
						int num7 = itemCount;
						int num8 = itemId;
						val.TakeItem(ref num8, ref num7, ref num9);
						num5 += num7;
						itemCount -= num7;
						num6 += num9;
					}
				}
				player.TryAddItemToPackage(itemId, num5, num6, false, 0, false);
			}
			if (factory.factoryStorage == null || factory.factoryStorage.storagePool == null)
			{
				return;
			}
			if (factory.factoryStorage.storagePool != null)
			{
				StorageComponent[] storagePool = factory.factoryStorage.storagePool;
				int num10 = default(int);
				foreach (StorageComponent val2 in storagePool)
				{
					if (itemCount == 0)
					{
						break;
					}
					if (val2 != null)
					{
						int num11 = val2.TakeItem(itemId, itemCount, ref num10);
						itemCount -= num11;
						if (num11 > 0)
						{
							player.TryAddItemToPackage(itemId, num11, num10, false, 0, false);
						}
					}
				}
			}
			if (factory.factoryStorage.tankPool == null)
			{
				return;
			}
			TankComponent[] tankPool = factory.factoryStorage.tankPool;
			foreach (TankComponent val3 in tankPool)
			{
				if (itemCount == 0)
				{
					break;
				}
				if (val3.id > 0 && val3.fluidId > 0 && val3.fluidCount > 0 && itemId == val3.fluidId)
				{
					int num12 = ((val3.fluidCount > itemCount) ? itemCount : val3.fluidCount);
					int num13 = (int)((double)(val3.fluidInc / val3.fluidCount) + 0.5) * num12;
					factory.factoryStorage.tankPool[val3.id].fluidCount -= num12;
					factory.factoryStorage.tankPool[val3.id].fluidInc -= num13;
					itemCount -= num12;
					if (num12 > 0)
					{
						player.TryAddItemToPackage(itemId, num12, num13, false, 0, false);
					}
				}
			}
		}

		private void AutoAddwarp()
		{
			Player obj = player;
			if (((obj != null) ? obj.mecha : null) != null && player.mecha.thrusterLevel >= 3 && !player.mecha.HasWarper())
			{
				int num = 1210;
				int num2 = 20;
				int num3 = default(int);
				player.package.TakeTailItems(ref num, ref num2, ref num3, false);
				if (num > 0 && num2 > 0)
				{
					int num4 = default(int);
					player.mecha.warpStorage.AddItem(num, num2, num3, ref num4, false);
				}
			}
		}

		private void AutoMoveToDarkfog()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Invalid comparison between Unknown and I4
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			autoRemoveRuinId = -1;
			if (GameMain.localPlanet == null || GameMain.mainPlayer == null || (int)GameMain.mainPlayer.movementState != 2 || !StartAutoMovetoDarkfog)
			{
				return;
			}
			EnemyDFGroundSystem enemySystem = GameMain.localPlanet.factory.enemySystem;
			float num = 100000000f;
			DFGBaseComponent val = null;
			for (int i = 1; i < enemySystem.bases.cursor; i++)
			{
				if (enemySystem.bases[i] == null || enemySystem.bases[i].id != i || (!autoRemoveRuin && enemySystem.CheckBaseCanRemoved(i) == 0))
				{
					continue;
				}
				Vector3 val2 = VectorLF3.op_Implicit(GameMain.localPlanet.factory.enemyPool[enemySystem.bases[i].enemyId].pos);
				Vector3 val3;
				if (val != null)
				{
					float num2 = num;
					val3 = val2 - player.position;
					if (!(num2 > ((Vector3)(ref val3)).magnitude))
					{
						continue;
					}
				}
				val = enemySystem.bases[i];
				val3 = val2 - player.position;
				num = ((Vector3)(ref val3)).magnitude;
			}
			if (val != null)
			{
				Vector3 targetPos = VectorLF3.op_Implicit(GameMain.localPlanet.factory.enemyPool[val.enemyId].pos);
				_mainContext.Post(delegate
				{
					//IL_000c: 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)
					GameMain.mainPlayer.Order(OrderNode.MoveTo(((Vector3)(ref targetPos)).normalized * GameMain.localPlanet.realRadius), false);
				}, null);
				if (autoRemoveRuin && enemySystem.CheckBaseCanRemoved(val.id) == 0)
				{
					autoRemoveRuinId = val.ruinId;
				}
			}
		}

		private void AutoMovetounbuilt()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Invalid comparison between Unknown and I4
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			if (!StartAutoMovetounbuilt || GameMain.localPlanet == null || GameMain.mainPlayer == null || (int)GameMain.mainPlayer.movementState != 2)
			{
				return;
			}
			automovetoPrebuildSecondElapseCounter++;
			if ((float)automovetoPrebuildSecondElapseCounter < AuxConfig.automovetoPrebuildSecondElapse.Value)
			{
				return;
			}
			automovetoPrebuildSecondElapseCounter -= (int)AuxConfig.automovetoPrebuildSecondElapse.Value;
			float num = 3000f;
			int lasthasitempd = -1;
			PrebuildData[] prebuildPool = GameMain.localPlanet.factory.prebuildPool;
			foreach (PrebuildData val in prebuildPool)
			{
				if (val.id == 0 || val.itemRequired > 0)
				{
					continue;
				}
				Vector3 val2;
				if (lasthasitempd != -1)
				{
					float num2 = num;
					val2 = val.pos - GameMain.mainPlayer.position;
					if (!(num2 > ((Vector3)(ref val2)).magnitude))
					{
						continue;
					}
				}
				lasthasitempd = val.id;
				val2 = val.pos - GameMain.mainPlayer.position;
				num = ((Vector3)(ref val2)).magnitude;
			}
			if (lasthasitempd == -1)
			{
				bool flag = true;
				PrebuildData[] prebuildPool2 = GameMain.localPlanet.factory.prebuildPool;
				foreach (PrebuildData val3 in prebuildPool2)
				{
					if (val3.id != 0 && val3.protoId != 0 && GameMain.mainPlayer.package.GetItemCount((int)val3.protoId) > 0)
					{
						lasthasitempd = val3.id;
						flag = false;
						_mainContext.Post(delegate
						{
							//IL_0025: Unknown result type (might be due to invalid IL or missing references)
							//IL_0034: Unknown result type (might be due to invalid IL or missing references)
							GameMain.mainPlayer.Order(OrderNode.MoveTo(((Vector3)(ref GameMain.localPlanet.factory.prebuildPool[lasthasitempd].pos)).normalized * GameMain.localPlanet.realRadius), false);
						}, null);
						break;
					}
				}
				if (!flag || !autobuildgetitem)
				{
					return;
				}
				int[] warningCounts = GameMain.data.warningSystem.warningCounts;
				WarningData[] warningPool = GameMain.data.warningSystem.warningPool;
				List<int> list = new List<int>();
				int num3 = 0;
				int num4 = player.package.grids.Length;
				int num5 = num4 - 1;
				while (num5 >= 0 && player.package.grids[num5].count == 0)
				{
					num5--;
					num3++;
				}
				for (int k = 1; k < GameMain.data.warningSystem.warningCursor; k++)
				{
					if (num3 <= 0)
					{
						break;
					}
					if (!list.Contains(warningPool[k].detailId1))
					{
						if (player.package.GetItemCount(warningPool[k].detailId1) > 0)
						{
							break;
						}
						list.Add(warningPool[k].detailId1);
						FindItemAndMove(warningPool[k].detailId1, warningCounts[warningPool[k].signalId]);
					}
				}
			}
			else if (lasthasitempd != -1 && lasthasitempd != 0 && lasthasitempd == GameMain.localPlanet.factory.prebuildPool[lasthasitempd].id)
			{
				_mainContext.Post(delegate
				{
					//IL_0025: Unknown result type (might be due to invalid IL or missing references)
					//IL_0034: Unknown result type (might be due to invalid IL or missing references)
					GameMain.mainPlayer.Order(OrderNode.MoveTo(((Vector3)(ref GameMain.localPlanet.factory.prebuildPool[lasthasitempd].pos)).normalized * GameMain.localPlanet.realRadius), false);
				}, null);
			}
		}

		private void AutoSaveTimeChange()
		{
			if (AuxConfig.autosavetimechange.Value && UIAutoSave.autoSaveTime != (float)AuxConfig.autosavetime.Value)
			{
				Debug.Log((object)"AutoSaveTimeChange");
				DSPGame.globalOption.autoSaveTime = AuxConfig.autosavetime.Value;
				((GameOption)(ref DSPGame.globalOption)).Apply();
				UIAutoSave.autoSaveTime = AuxConfig.autosavetime.Value;
			}
		}

		private void BluePrintoptimize()
		{
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			GUIDraw.blueprintopen = false;
			Player obj = player;
			if (((obj == null) ? null : obj.controller?.actionBuild) == null)
			{
				return;
			}
			PlayerAction_Build actionBuild = player.controller.actionBuild;
			if (actionBuild.blueprintCopyTool != null && ((BuildTool)actionBuild.blueprintCopyTool).active && actionBuild.blueprintCopyTool.bpPool != null)
			{
				GUIDraw.blueprintopen = true;
				BuildTool_BlueprintCopy blueprintCopyTool = actionBuild.blueprintCopyTool;
				if (AuxConfig.BluePrintSelectAll.Value && Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)97))
				{
					EntityData[] entityPool = AuxConfig.LocalPlanet.factory.entityPool;
					foreach (EntityData val in entityPool)
					{
						if (val.id != 0)
						{
							blueprintCopyTool.preSelectObjIds.Add(val.id);
							blueprintCopyTool.selectedObjIds.Add(val.id);
						}
					}
					blueprintCopyTool.RefreshBlueprintData();
					blueprintCopyTool.DeterminePreviews();
				}
				if (AuxConfig.BluePrintDelete.Value && Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)120))
				{
					BuildPreview[] bpPool = blueprintCopyTool.bpPool;
					foreach (BuildPreview val2 in bpPool)
					{
						if (val2 == null || val2.item == null || val2.objId <= 0)
						{
							continue;
						}
						int stationId = AuxConfig.LocalPlanet.factory.entityPool[val2.objId].stationId;
						if (stationId > 0)
						{
							StationComponent val3 = AuxConfig.LocalPlanet.factory.transport.stationPool[stationId];
							for (int k = 0; k < val3.storage.Length; k++)
							{
								int num = player.TryAddItemToPackage(val3.storage[k].itemId, val3.storage[k].count, 0, true, val2.objId, false);
								UIItemup.Up(val3.storage[k].itemId, num);
							}
							val3.storage = (StationStore[])(object)new StationStore[val3.storage.Length];
							val3.needs = new int[val3.needs.Length];
						}
						actionBuild.DoDismantleObject(val2.objId);
					}
					blueprintCopyTool.ClearSelection();
					blueprintCopyTool.ClearPreSelection();
					blueprintCopyTool.ResetBlueprint();
					blueprintCopyTool.ResetBuildPreviews();
					blueprintCopyTool.RefreshBlueprintData();
				}
			}
			if (actionBuild.blueprintPasteTool != null && ((BuildTool)actionBuild.blueprintPasteTool).active && actionBuild.blueprintPasteTool.bpPool != null)
			{
				BuildTool_BlueprintPaste blueprintPasteTool = actionBuild.blueprintPasteTool;
				if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)122))
				{
					blueprintPasteTool.ResetBuildPreviews();
					blueprintPasteTool.ResetStatesOnClose();
					blueprintPasteTool.RefreshBlueprintUI();
					player.controller.OpenBlueprintCopyMode(true);
				}
			}
		}

		private void EnqueueTech()
		{
			int count = readyresearch.Count;
			if (count <= 0)
			{
				return;
			}
			try
			{
				for (int i = 0; i < count; i++)
				{
					if (GameMain.history.techQueueLength >= 7)
					{
						break;
					}
					if (GameMain.history.TechUnlocked(readyresearch[i]))
					{
						readyresearch.RemoveAt(i);
					}
					else if (!GameMain.history.TechInQueue(readyresearch[i]))
					{
						if (!GameMain.history.CanEnqueueTech(readyresearch[i]))
						{
							readyresearch.RemoveAt(i);
						}
						else
						{
							GameMain.history.EnqueueTech(readyresearch[i]);
						}
					}
				}
			}
			catch
			{
			}
		}

		private void GameUpdate()
		{
			if (!GameDataImported)
			{
				player = null;
				firstStart = true;
				readyresearch.Clear();
				SpeedUpPatch.SpeedMultiple = 1f;
				GUIDraw.blueprintopen = false;
				AuxConfig.simulatorrender = false;
				PlayerOperationPatch.FlyStatus = false;
				PlayerOperationPatch.Enable = false;
				return;
			}
			if (GameMain.mainPlayer != null && player == null)
			{
				player = GameMain.mainPlayer;
				player.controller.actionInspect.onInspecteeChange += delegate(EObjectType _, int b)
				{
					if (b > 0)
					{
						guidraw.CloseTrashStorageWindow();
					}
				};
				if (AuxConfig.autonavigation_bool.Value)
				{
					PlayerOperationPatch.Enable = true;
				}
			}
			if (firstStart)
			{
				firstStart = false;
				PlayerOperationPatch.ClearFollow();
				BluePrintBatchModifyBuild.Init();
				return;
			}
			StartAndStopGame();
			BluePrintoptimize();
			SunLightSet();
			if (autoRemoveRuin && autoRemoveRuinId >= 0)
			{
				Player obj = player;
				if (((obj == null) ? null : obj.controller?.actionBuild?.reformTool) != null)
				{
					player.controller.actionBuild.reformTool.RemoveBasePit(autoRemoveRuinId);
				}
			}
			autoRemoveRuinId = -1;
		}

		private void OnGUI()
		{
			guidraw.Draw();
		}

		private void SecondEvent()
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			while (true)
			{
				if (!GameDataImported)
				{
					Thread.Sleep(500);
					continue;
				}
				if (AuxConfig.autoAddwarp.Value)
				{
					AutoAddwarp();
				}
				int value = AuxConfig.auto_add_techid.Value;
				if (AuxConfig.autoaddtech_bool.Value && value > 0 && GameMain.history != null && GameMain.history.techQueueLength == 0)
				{
					TechState val = GameMain.history.techStates[value];
					if (val.curLevel == val.maxLevel)
					{
						value = 0;
						AuxConfig.auto_add_techid.Value = 0;
					}
					else if (val.curLevel < AuxConfig.auto_add_techmaxLevel.Value)
					{
						if (guidraw.AutoUnlockTechInSandBox)
						{
							GameMain.history.UnlockTechUnlimited(value, true);
						}
						else
						{
							GameMain.history.EnqueueTech(value);
						}
					}
				}
				if (AuxConfig.automovetounbuilt.Value)
				{
					try
					{
						AutoMovetounbuilt();
					}
					catch (Exception ex)
					{
						UIMessageBox.Show(AuxConfig.ErrorTitle.getTranslate(), ex.ToString(), Localization.Translate("确定"), 3, (Response)null);
					}
				}
				if (AuxConfig.automovetodarkfog.Value)
				{
					try
					{
						AutoMoveToDarkfog();
					}
					catch (Exception ex2)
					{
						Console.WriteLine(ex2.ToString());
					}
				}
				if (num >= 30)
				{
					try
					{
						TrashFunction();
					}
					catch
					{
					}
					num = 0;
				}
				num++;
				EnqueueTech();
				Thread.Sleep(1000);
			}
		}

		private void StartAndStopGame()
		{
			if (AuxConfig.Quickstop_bool.Value && Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)32))
			{
				GameTickPatch.Enable = !GameTickPatch.Enable;
			}
		}

		private void SunLightSet()
		{
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			if (AuxConfig.SunLightOpen.Value && GameMain.localPlanet != null)
			{
				UniverseSimulator universeSimulator = GameMain.universeSimulator;
				if (!((Object)(object)((universeSimulator == null) ? null : universeSimulator.LocalStarSimulator()?.sunLight) == (Object)null))
				{
					if ((Object)(object)SunLight == (Object)null)
					{
						SunLight = Object.Instantiate<Light>(GameMain.universeSimulator.LocalStarSimulator().sunLight, GameMain.mainPlayer.transform);
						((Behaviour)SunLight).enabled = true;
						((Component)SunLight).transform.position = GameMain.mainPlayer.position + GameMain.mainPlayer.transform.up * 5f;
						((Component)SunLight).transform.rotation = Quaternion.LookRotation(-GameMain.mainPlayer.transform.up);
						((Component)SunLight).transform.localPosition = new Vector3(0f, 5f, 0f);
						((Object)SunLight).name = "PlayerLight";
						SunLight.intensity = 1f;
					}
					if (FactoryModel.whiteMode0)
					{
						((Behaviour)SunLight).enabled = false;
					}
					else
					{
						((Behaviour)SunLight).enabled = true;
					}
					return;
				}
			}
			if ((Object)(object)SunLight != (Object)null)
			{
				Object.Destroy((Object)(object)((Component)SunLight).gameObject);
				SunLight = null;
			}
		}

		private void TrashFunction()
		{
			if (GameMain.data?.trashSystem == null)
			{
				return;
			}
			if (AuxConfig.autoabsorttrash_bool.Value)
			{
				TrashContainer container = GameMain.data.trashSystem.container;
				for (int i = 0; i < container.trashCursor; i++)
				{
					int item = container.trashObjPool[i].item;
					if (item > 0 && container.trashObjPool[i].expire < 0)
					{
						if (AuxConfig.onlygetbuildings.Value && !(((ProtoSet<ItemProto>)(object)LDB.items).Select(item)?.CanBuild ?? false))
						{
							container.RemoveTrash(i);
						}
						else
						{
							container.trashObjPool[i].expire = 35;
						}
					}
				}
			}
			if (AuxConfig.autocleartrash_bool.Value)
			{
				GameMain.data.trashSystem.ClearAllTrash();
			}
		}

		private void Update()
		{
			AutoSaveTimeChange();
			GameUpdate();
			HotkeyService.HandleQuickKeyChange();
			guidraw.GUIUpdate();
		}
	}
	public class AuxilaryfunctionPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(GameLoader), "CreateLoader")]
		public static void GameLoaderCreateLoaderPrefix()
		{
			Auxilaryfunction.GameDataImported = false;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(GameLoader), "SelfDestroy")]
		public static void GameLoaderCreateLoaderPostfix()
		{
			Auxilaryfunction.GameDataImported = true;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(FactorySystem), "NewMinerComponent")]
		public static void NewMinerComponentPatch(ref int __result, FactorySystem __instance)
		{
			if (AuxConfig.auto_supply_station.Value && __instance.factory.entityPool[__instance.minerPool[__result].entityId].protoId == 2316)
			{
				__instance.minerPool[__result].speed = AuxConfig.veincollectorspeed.Value * 1000;
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(UIBlueprintInspector), "Refresh")]
		public static void UIBlueprintInspectorRefresh(bool refreshComponent)
		{
			BluePrintBatchModifyBuild.NeedRefresh = refreshComponent;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(PowerSystem), "NewGeneratorComponent")]
		public static void NewGeneratorComponentPatch(ref int __result, PowerSystem __instance)
		{
			if (__instance.genPool[__result].fuelMask != 4 || !AuxConfig.autosetSomevalue_bool.Value)
			{
				return;
			}
			int value = AuxConfig.auto_supply_starfuelID.Value;
			if (value >= 1803 && value <= 1804)
			{
				int num = default(int);
				short num2 = (short)Auxilaryfunction.player.package.TakeItem(value, AuxConfig.auto_supply_starfuel.Value, ref num);
				if (num2 != 0)
				{
					((PowerGeneratorComponent)(ref __instance.genPool[__result])).SetNewFuel(value, num2, (short)num);
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(PlanetTransport), "NewStationComponent")]
		public static void NewStationComponentPatch(ref StationComponent __result, PlanetTransport __instance)
		{
			if (AuxConfig.auto_supply_station.Value && !__result.isCollector && !__result.isVeinCollector)
			{
				int num = default(int);
				__result.idleDroneCount = Auxilaryfunction.player.package.TakeItem(5001, __result.isStellar ? AuxConfig.auto_supply_drone.Value : ((AuxConfig.auto_supply_drone.Value > 50) ? 50 : AuxConfig.auto_supply_drone.Value), ref num);
				__result.tripRangeDrones = Math.Cos((double)AuxConfig.stationdronedist.Value * Math.PI / 180.0);
				__instance.planet.factory.powerSystem.consumerPool[__result.pcId].workEnergyPerTick = (long)AuxConfig.stationmaxpowerpertick.Value * 16667;
				if (AuxConfig.stationmaxpowerpertick.Value > 60f && !__result.isStellar)
				{
					__instance.planet.factory.powerSystem.consumerPool[__result.pcId].workEnergyPerTick = 1000020L;
				}
				__result.deliveryDrones = ((AuxConfig.DroneStartCarry.Value == 0f) ? 1 : ((int)(AuxConfig.DroneStartCarry.Value * 10f) * 10));
				if (__result.isStellar)
				{
					__result.warperCount = Auxilaryfunction.player.package.TakeItem(1210, AuxConfig.auto_supply_warp.Value, ref num);
					__result.warpEnableDist = AuxConfig.stationwarpdist.Value * 40000.0;
					__result.deliveryShips = ((AuxConfig.ShipStartCarry.Value == 0f) ? 1 : ((int)(AuxConfig.ShipStartCarry.Value * 10f) * 10));
					__result.idleShipCount = Auxilaryfunction.player.package.TakeItem(5002, AuxConfig.auto_supply_ship.Value, ref num);
					__result.tripRangeShips = ((AuxConfig.stationshipdist.Value > 60) ? 24000000000L : (AuxConfig.stationshipdist.Value * 2400000));
					if (GameMain.data.history.TechUnlocked(3404))
					{
						__result.warperCount = Auxilaryfunction.player.package.TakeItem(1210, AuxConfig.auto_supply_warp.Value, ref num);
					}
				}
			}
			if (AuxConfig.auto_supply_station.Value && __result.isVeinCollector)
			{
				__instance.factory.factorySystem.minerPool[__result.minerId].speed = AuxConfig.veincollectorspeed.Value * 1000;
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(PlanetTransport), "NewDispenserComponent")]
		public static void NewDispenserComponentPatch(int __result, PlanetTransport __instance)
		{
			if (AuxConfig.autosetCourier_bool.Value)
			{
				int num = default(int);
				__instance.dispenserPool[__result].idleCourierCount = Auxilaryfunction.player.package.TakeItem(5003, AuxConfig.auto_supply_Courier.Value, ref num);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(UIBlueprintBrowser), "SetCurrentDirectory")]
		public static void UIBlueprintBrowserSetCurrentDirectory(string fullpath)
		{
			if (AuxConfig.SaveLastOpenBluePrintBrowserPathConfig.Value)
			{
				AuxConfig.LastOpenBluePrintBrowserPathConfig.Value = fullpath;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(UIBlueprintBrowser), "_OnOpen")]
		public static void UIBlueprintBrowser_OnOpen(ref UIBlueprintBrowser __instance)
		{
			if (AuxConfig.SaveLastOpenBluePrintBrowserPathConfig.Value && string.IsNullOrEmpty(__instance.openPath) && !string.IsNullOrEmpty(AuxConfig.LastOpenBluePrintBrowserPathConfig.Value))
			{
				__instance.openPath = AuxConfig.LastOpenBluePrintBrowserPathConfig.Value;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(BuildingParameters), "CopyFromFactoryObject")]
		public static void CopyFromFactoryObjectPatch(int objectId, PlanetFactory factory)
		{
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Expected I4, but got Unknown
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Expected I4, but got Unknown
			if (!AuxConfig.stationcopyItem_bool.Value)
			{
				return;
			}
			if (Auxilaryfunction.player != null && (Object)(object)Auxilaryfunction.player.controller != (Object)null && Auxilaryfunction.player.controller.actionBuild != null)
			{
				PlayerAction_Build actionBuild = Auxilaryfunction.player.controller.actionBuild;
				if ((actionBuild.blueprintCopyTool != null || actionBuild.blueprintPasteTool != null) && (((BuildTool)actionBuild.blueprintPasteTool).active || ((BuildTool)actionBuild.blueprintCopyTool).active))
				{
					return;
				}
			}
			EntityData[] entityPool = factory.entityPool;
			if (objectId > entityPool.Length || objectId <= 0)
			{
				return;
			}
			int stationId = entityPool[objectId].stationId;
			if (stationId <= 0)
			{
				return;
			}
			StationComponent val = factory.transport.stationPool[stationId];
			for (int i = 0; i < 5; i++)
			{
				for (int j = 0; j < 6; j++)
				{
					Auxilaryfunction.stationcopyItem[i, j] = 0;
				}
			}
			for (int k = 0; k < val.storage.Length && k < 5; k++)
			{
				if (val.storage[k].itemId > 0)
				{
					Auxilaryfunction.stationcopyItem[k, 0] = val.storage[k].itemId;
					Auxilaryfunction.stationcopyItem[k, 1] = val.storage[k].max;
					Auxilaryfunction.stationcopyItem[k, 2] = (int)val.storage[k].localLogic;
					Auxilaryfunction.stationcopyItem[k, 3] = (int)val.storage[k].remoteLogic;
					Auxilaryfunction.stationcopyItem[k, 4] = val.storage[k].localOrder;
					Auxilaryfunction.stationcopyItem[k, 5] = val.storage[k].remoteOrder;
				}
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(BuildTool_Path), "DeterminePreviews")]
		public static void BuildTool_PathPatch(BuildTool_Path __instance)
		{
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			if (!AuxConfig.KeepBeltHeight.Value || !Input.GetKey((KeyCode)304))
			{
				return;
			}
			PlanetAuxData planetAux = Auxilaryfunction.player.controller.actionBuild.planetAux;
			if (planetAux != null && __instance.altitude == 0)
			{
				if (ObjectIsBeltOrSplitter(__instance, __instance.castObjectId))
				{
					__instance.altitude = Altitude(__instance.castObjectPos, planetAux);
				}
				else if (__instance.startObjectId != 0)
				{
					__instance.altitude = Altitude(__instance.pathPoints[0], planetAux);
				}
			}
		}

		private static int Altitude(Vector3 pos, PlanetAuxData aux)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = aux.Snap(pos, true);
			return (int)Math.Round(Vector3.Distance(pos, val) / 1.3333333f);
		}

		private static bool ObjectIsBeltOrSplitter(BuildTool_Path tool, int objId)
		{
			if (objId == 0)
			{
				return false;
			}
			ItemProto val = ((ProtoSet<ItemProto>)(object)LDB.items).Select((int)((BuildTool)tool).factory.entityPool[Math.Abs(objId)].protoId);
			return val != null && val.prefabDesc != null && (val.prefabDesc.isBelt || val.prefabDesc.isSplitter);
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(BuildingParameters), "PasteToFactoryObject")]
		public static void PasteToFactoryObjectPatch(int objectId, PlanetFactory factory)
		{
			if (!AuxConfig.stationcopyItem_bool.Value)
			{
				return;
			}
			EntityData[] entityPool = factory.entityPool;
			if (objectId > entityPool.Length || objectId <= 0)
			{
				return;
			}
			int stationId = entityPool[objectId].stationId;
			if (stationId <= 0)
			{
				return;
			}
			StationComponent val = factory.transport.stationPool[stationId];
			if (val.isVeinCollector || val.isCollector)
			{
				return;
			}
			for (int i = 0; i < val.storage.Length && i < 5; i++)
			{
				if (Auxilaryfunction.stationcopyItem[i, 0] > 0)
				{
					if (val.storage[i].count > 0 && val.storage[i].itemId != Auxilaryfunction.stationcopyItem[i, 0])
					{
						Auxilaryfunction.player.TryAddItemToPackage(val.storage[i].itemId, val.storage[i].count, 0, false, 0, false);
					}
					factory.transport.SetStationStorage(stationId, i, Auxilaryfunction.stationcopyItem[i, 0], Auxilaryfunction.stationcopyItem[i, 1], (ELogisticStorage)Auxilaryfunction.stationcopyItem[i, 2], (ELogisticStorage)Auxilaryfunction.stationcopyItem[i, 3], Auxilaryfunction.player);
				}
				else
				{
					factory.transport.SetStationStorage(stationId, i, 0, 0, (ELogisticStorage)0, (ELogisticStorage)0, Auxilaryfunction.player);
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(UIVariousPopupCard), "Refresh")]
		public static bool UIVariousPopupCardRefresh(UIVariousPopupCard __instance)
		{
			if (AuxConfig.CloseMilestone.Value && ((ManualBehaviour)__instance).data is MilestoneProto)
			{
				((ManualBehaviour)__instance)._Close();
				return false;
			}
			return true;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(UIGeneralTips), "OnTechUnlocked")]
		public static bool UIGeneralTipsOnTechUnlocked()
		{
			if (AuxConfig.CloseUIGeneralTip.Value)
			{
				return false;
			}
			return true;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(UIAdvisorTip), "RequestAdvisorTip")]
		public static bool UIAdvisorTipRequestAdvisorTip()
		{
			return !AuxConfig.CloseUIAdvisor.Value;
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(UIRandomTip), "_OnOpen")]
		public static void UIBuildMenu_OnOpenPatch(ref UIRandomTip __instance)
		{
			if (AuxConfig.CloseUIRandomTip.Value)
			{
				((ManualBehaviour)__instance)._Close();
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(UITutorialTip), "PopupTutorialTip")]
		public static bool UITutorialTipPopupTutorialTip()
		{
			if (AuxConfig.CloseUITutorialTip.Value)
			{
				return false;
			}
			return true;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(UITechTree), "UpdateScale")]
		public static bool UITechTreeUpdateScalePatch(UITechTree __instance)
		{
			if (AuxConfig.noscaleuitech_bool.Value && ((Object)(object)__instance.selected != (Object)null || (Object)(object)__instance.centerViewNode != (Object)null))
			{
				return false;
			}
			return true;
		}
	}
	public class SkipRenderPatch
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(FactoryModel), "Update")]
		public static bool FactoryModelUpdatePatch()
		{
			return !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(FactoryModel), "LateUpdate")]
		public static bool FactoryModelLateUpdatePatch()
		{
			return !AuxConfig.norender_entity_bool.Value && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(LogisticDroneRenderer), "Draw")]
		public static bool DroneDrawPatch()
		{
			return !AuxConfig.norender_shipdrone_bool.Value && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(LogisticShipUIRenderer), "Draw")]
		public static bool LogisticShipUIRendererDrawPatch()
		{
			return !AuxConfig.norender_shipdrone_bool.Value && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(LogisticCourierRenderer), "Draw")]
		public static bool CourierDrawPatch()
		{
			return !AuxConfig.norender_shipdrone_bool.Value && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(LogisticShipRenderer), "Draw")]
		public static bool ShipDrawPatch()
		{
			return !AuxConfig.norender_shipdrone_bool.Value && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(LabRenderer), "Render")]
		public static bool LabRendererPatch(LabRenderer __instance)
		{
			if (((ObjectRenderer)__instance).modelId == 70 || ((ObjectRenderer)__instance).modelId == 455)
			{
				return !AuxConfig.norender_lab_bool.Value && !AuxConfig.simulatorrender;
			}
			return true;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(SectorModel), "LateUpdate")]
		public static bool EnemyDFGroundRendererRenderPatch()
		{
			return !AuxConfig.norender_DarkFog.Value && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(DysonSphere), "DrawModel")]
		public static bool DysonDrawModelPatch()
		{
			return !AuxConfig.norender_dysonshell_bool.Value && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(DysonSphere), "DrawPost")]
		public static bool DysonDrawPostPatch()
		{
			return !AuxConfig.norender_dysonswarm_bool.Value && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(UIPowerGizmo), "DrawArea")]
		public static bool UIPowerGizmoDrawAreaPatch()
		{
			return !AuxConfig.norender_powerdisk_bool.Value && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(UIDarkFogMonitor), "Determine")]
		public static bool UIDarkFogMonitorDetermine()
		{
			return !Auxilaryfunction.HideDarkFogMonitor && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(UIDarkFogAssaultTip), "Determine")]
		public static bool UIDarkFogAssaultTipDetermine()
		{
			return !Auxilaryfunction.HideDarkFogAssaultTip && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(CargoContainer), "Draw")]
		public static bool PathRenderingBatchDrawPatch()
		{
			return !AuxConfig.norender_beltitem.Value && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(UIPowerGizmo), "DrawCover")]
		public static bool UIPowerGizmoDrawCoverPatch()
		{
			return !AuxConfig.norender_powerdisk_bool.Value && !AuxConfig.simulatorrender;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(UniverseSimulator), "GameTick")]
		public static void UniverseSimulatorGameTickPatch(UniverseSimulator __instance)
		{
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Invalid comparison between Unknown and I4
			if (!AuxConfig.simulatorchanging)
			{
				return;
			}
			int num = 0;
			((Component)__instance.backgroundStars).gameObject.SetActive(!AuxConfig.simulatorrender);
			while (__instance.planetSimulators != null && num < __instance.planetSimulators.Length)
			{
				if ((Object)(object)__instance.planetSimulators[num] != (Object)null)
				{
					((Component)__instance.planetSimulators[num]).gameObject.SetActive(!AuxConfig.simulatorrender);
				}
				num++;
			}
			num = 0;
			while (__instance.starSimulators != null && num < __instance.starSimulators.Length)
			{
				if ((Object)(object)__instance.starSimulators[num] != (Object)null)
				{
					if ((int)__instance.starSimulators[num].starData.type == 3 && (Object)(object)Configs.builtin.neutronStarPrefab.streamRenderer != (Object)null)
					{
						num++;
						continue;
					}
					((Component)__instance.starSimulators[num]).gameObject.SetActive(!AuxConfig.simulatorrender);
				}
				num++;
			}
			AuxConfig.simulatorchanging = false;
		}
	}
	public static class AuxilaryTranslate
	{
		public static HashSet<string> notranslateStr = new HashSet<string>();

		private static readonly Dictionary<string, string> TranslateDict = new Dictionary<string, string>();

		public static string getTranslate(this string s)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			if ((int)Localization.CurrentLanguage.glyph > 0)
			{
				return s;
			}
			if (TranslateDict.ContainsKey(s))
			{
				return TranslateDict[s];
			}
			notranslateStr.Add(s);
			return s;
		}

		public static void regallTranslate()
		{
			TranslateDict.Clear();
			TranslateDict.Add("辅助面板错误提示", "Auxilaryfunction Error");
			TranslateDict.Add("默认面板", "Default Panel");
			TranslateDict.Add("戴森球面板", "Dyson Sphere Panel");
			TranslateDict.Add("选择一个蓝图后,点击右侧的层级可以自动导入", "Select BluePrintFile,you can click enabled layers to paste");
			TranslateDict.Add("单层壳", "Single Layer");
			TranslateDict.Add("多层壳", "Layers");
			TranslateDict.Add("戴森云", "Dyson Swarm");
			TranslateDict.Add("戴森球(包括壳、云)", "Dyson Sphere(include layers and swarm)");
			TranslateDict.Add("打开戴森球蓝图文件夹", "Open DysonBlueprint Folder");
			TranslateDict.Add("刷新文件", "Refresh files list");
			TranslateDict.Add("复制选中文件代码", "Copy selected file cotent");
			TranslateDict.Add("清除剪贴板", "clear clipboard");
			TranslateDict.Add("应用蓝图", "Apply Selected BluePrint File");
			TranslateDict.Add("自动生成最大半径戴森壳", "Auto Add bigest layers");
			TranslateDict.Add("删除全部空壳", "Delete all empty layers");
			TranslateDict.Add("可用戴森壳层级:", "Enabled layers:");
			TranslateDict.Add("不可用戴森壳层级:", "Disabled layers:");
			TranslateDict.Add("勾选即可点击删除", "Tick to click delete layer");
			TranslateDict.Add("路径为空,请重新选择", "The path is empty, please select again");
			TranslateDict.Add("文件读取失败", "file read failed");
			TranslateDict.Add("文件不存在", "file does not exist");
			TranslateDict.Add("自动清除空戴森球", "Auto Clear Empty Dyson");
			TranslateDict.Add("每次打开戴森球面板(Y)都会自动进行清理", "Auto Clear Empty Dyson when you open DysonPanel(Y)");
			TranslateDict.Add("记录上次蓝图路径", "Record the last blueprint path");
			TranslateDict.Add("单层壳蓝图请选择层级", " Single layer blueprint please select the layer");
			TranslateDict.Add("自动配置新运输站", "AutoStation");
			TranslateDict.Add("配置参数", "Configurations");
			TranslateDict.Add("填充飞机数量", "Fill the number of drones");
			TranslateDict.Add("填充飞船数量", "Fill the number of vessel");
			TranslateDict.Add("最大充电功率", "Max. Charging Power");
			TranslateDict.Add("运输机最远路程", "Transport range of Drones");
			TranslateDict.Add("运输船最远路程", "Transport range of Vessels");
			TranslateDict.Add("曲速启用路程", "Distance to enable Warp");
			TranslateDict.Add("运输机起送量", "Min. Load of Drones");
			TranslateDict.Add("运输船起送量", "Min. Load of Vessels");
			TranslateDict.Add("翘曲填充数量", "Fill the number of warper");
			TranslateDict.Add("大型采矿机采矿速率", "Advanced mining machine gathering Speed");
			TranslateDict.Add("批量配置当前星球大型采矿机采矿速率", "set all advanced mining machine gathering Speed");
			TranslateDict.Add("铺满轨道采集器", "Full orbital Collector this planet(gas)");
			TranslateDict.Add("填充当前星球配送机飞机飞船、翘曲器", "Fill all stations with courier,vessels,drones,warpers");
			TranslateDict.Add("批量配置当前星球物流站", "set all stations");
			TranslateDict.Add("不渲染戴森壳", "Don't render Dyson shell");
			TranslateDict.Add("不渲染戴森云", "Don't render Dyson swarm");
			TranslateDict.Add("不渲染研究站", "Don't render lab");
			TranslateDict.Add("不渲染传送带货物", "Don't render belt item");
			TranslateDict.Add("不渲染运输船和飞机", "Don't render vessels,drones");
			TranslateDict.Add("不渲染实体", "Don't render entity");
			TranslateDict.Add("不渲染全部", "Don't render at all");
			TranslateDict.Add("不渲染电网覆盖", "Don't render power grid");
			TranslateDict.Add("关闭玩家走路飞行声音", "Turn off the player's walking and flying sound");
			TranslateDict.Add("自动添加翘曲器", "Auto add Warp");
			TranslateDict.Add("自动添加机甲燃料", "Auto add fuel");
			TranslateDict.Add("停止工厂", "stop factory");
			TranslateDict.Add("ctrl+空格快速开关", "quick start and stop(ctrl+space)");
			TranslateDict.Add("个", "");
			TranslateDict.Add("剩余", "surplus");
			TranslateDict.Add("回收", "recycle");
			TranslateDict.Add("个未完成建筑,该星球无法初始化", "unfinished building,The planet cannot be initialized.");
			TranslateDict.Add("自动飞向未完成建筑", "Auto fly to unfinished buildings");
			TranslateDict.Add("自动飞向地面黑雾基地", "Autp fly to dark fog on ground");
			TranslateDict.Add("自动添加科技队列", "Auto add tech queue");
			TranslateDict.Add("未选择", "no selected");
			TranslateDict.Add("自动配置太阳帆弹射器", "Auto set Ejector");
			TranslateDict.Add("自动导航", "Auto navigation");
			TranslateDict.Add("自动导航使用曲速", "Auto use warper");
			TranslateDict.Add("自动使用翘曲器距离", "Auto use warper distance");
			TranslateDict.Add("自动添加科技等级上限", "Auto add technology level cap");
			TranslateDict.Add("光年", "light-years");
			TranslateDict.Add("精准拿取", "Accurately take");
			TranslateDict.Add("建筑计数", "Building count");
			TranslateDict.Add("一键闭嘴", "One key to shut up");
			TranslateDict.Add("科技面板选中不缩放", "Technologies panel no scale");
			TranslateDict.Add("蓝图全选", "Blueprint SelectAll");
			TranslateDict.Add("蓝图删除", "Blueprint Delete");
			TranslateDict.Add("蓝图撤销", "Blueprint Revocation");
			TranslateDict.Add("蓝图设置配方", "Blueprint setting recipe");
			TranslateDict.Add("蓝图复制直接粘贴", "Blueprint copy and paste directly");
			TranslateDict.Add("物流站信息显示", "Show station info");
			TranslateDict.Add("详细模式", "Detailed mode");
			TranslateDict.Add("简易模式", "Simple Mode");
			TranslateDict.Add("物流站物品设置复制粘贴", "Station grids copy(<) and paste(>)");
			TranslateDict.Add("30s间隔自动吸收垃圾", "Auto. recycle Litter in 30s");
			TranslateDict.Add("只回收建筑", "Recycle only buildings");
			TranslateDict.Add("30s间隔自动清除垃圾", "Auto. clear Litter in 30s");
			TranslateDict.Add("改变窗口快捷键", "Change Window shortcut");
			TranslateDict.Add("点击确认", "Click to confirm");
			TranslateDict.Add("生产加速", "Production Speedup");
			TranslateDict.Add("额外产出", "Extra Products");
			TranslateDict.Add("初始化预制建筑池", "Initialize all planet prebuild pool");
			TranslateDict.Add("自动画最密戴森球", "Auto. draw DysonSphere");
			TranslateDict.Add("缓慢最密画法", "slow draw method");
			TranslateDict.Add("根", "root");
			TranslateDict.Add("带壳", "With Shell");
			TranslateDict.Add("带", "yes");
			TranslateDict.Add("不带", "no");
			TranslateDict.Add("只画单层", "only single layer");
			TranslateDict.Add("启动", "start draw");
			TranslateDict.Add("正在画", "Drawing");
			TranslateDict.Add("停止", "Stop");
			TranslateDict.Add("启动时间流速修改", "Start time flow rate modification");
			TranslateDict.Add("流速倍率", "Flow rate multiplier");
			TranslateDict.Add("加速减速", "Speed up and slow down");
			TranslateDict.Add("自动填充人造恒星", "Auto add fuel to Artificial Star");
			TranslateDict.Add("人造恒星燃料数量", "Artificial Star fuel quantity");
			TranslateDict.Add("填充当前星球人造恒星", "Fill the current planet with artificial stars");
			TranslateDict.Add("保持传送带高度(shift)", "Keep belt height(shift)");
			TranslateDict.Add("修改自动保存时长", "Modify AutosaveTime");
			TranslateDict.Add("自动保存时间", "Autosavetime");
			TranslateDict.Add("文字科技树", "Text technology tree");
			TranslateDict.Add("限制材料", "Restricted material");
			TranslateDict.Add("自动乱点", "Auto random select");
			TranslateDict.Add("暂停导航", "stop navigation");
			TranslateDict.Add("继续导航", "continue navigation");
			TranslateDict.Add("取消方向指示", "cacel Indicatior");
			TranslateDict.Add("辅助面板", "Auxilaryfunction");
			TranslateDict.Add("无", "none");
			TranslateDict.Add("粘贴物流站配方", "paste station grids set");
			TranslateDict.Add("上限", "Upper limit");
			TranslateDict.Add("本地", "Local");
			TranslateDict.Add("星际", "Remote");
			TranslateDict.Add("第", "No.");
			TranslateDict.Add("格", "Grid");
			TranslateDict.Add("准备研究", "Research Queue");
			TranslateDict.Add("科技", "Technologies");
			TranslateDict.Add("关闭白色面板", "ClosePanel");
			TranslateDict.Add("升级", "Upgrades");
			TranslateDict.Add("光子生成", "Photon Generation");
			TranslateDict.Add("直接发电", "Power Generation");
			TranslateDict.Add("科技等级上限", "TechLevel Upper Limit");
			TranslateDict.Add("行为设置", "Behavior");
			TranslateDict.Add("忽略配队设置", "Ignore Pairing");
			TranslateDict.Add("优先配队设置", "Priority Pairing");
			TranslateDict.Add("只看配队设置", "Exclusive Pairing");
			TranslateDict.Add("物流站名称", "Station Name");
			TranslateDict.Add("设置名称", "Set Station Name");
			TranslateDict.Add("设置分组", "Set group");
			TranslateDict.Add("设置物流站物品", "Set Station Items");
			TranslateDict.Add("设置物流站参数", "Set Station Config");
			TranslateDict.Add("设置分组行为", "Set Behavior");
			TranslateDict.Add("垃圾桶", "trash can");
			TranslateDict.Add("暂无选中设备", "No equipment selected");
			TranslateDict.Add("开关显示垃圾桶,垃圾桶关闭后自动清理内部物品", "Switch to display the trash can and automatically clean the contents when the trash can is closed");
			TranslateDict.Add("火种列表", "Tinder list");
			TranslateDict.Add("无火种", "No tinder");
			TranslateDict.Add("通讯器列表", "List of communicators");
			TranslateDict.Add("与玩家距离", "Distance from the player");
			TranslateDict.Add("导航", "navigation");
			TranslateDict.Add("黑雾巢穴自动导航", "Auto move to DarkFog");
			TranslateDict.Add("跟随距离", "Follow Distance");
			TranslateDict.Add("模型屏蔽", "Model masking");
			TranslateDict.Add("UI屏蔽", "UI masking");
			TranslateDict.Add("声音屏蔽", "Sound blocking");
			TranslateDict.Add("机甲自动化", "Mecha automation");
			TranslateDict.Add("自动菜单", "Auto Menu");
			TranslateDict.Add("渲染屏蔽", "Render Mask");
			TranslateDict.Add("便捷小功能", "Convenience Features");
			TranslateDict.Add("战斗", "Battles");
			TranslateDict.Add("蓝图设置", "Blueprint settings");
			TranslateDict.Add("填充当前星球飞机飞船、翘曲器", "Fill current planet aircraft ships, warpers");
			TranslateDict.Add("自动填充配送运输机", "Auto-fill delivery transports");
			TranslateDict.Add("填充配送运输机数量", "Fill the number of delivery transports");
			TranslateDict.Add("填充当前星球配送机", "Fill current planet's dispensers");
			TranslateDict.Add("自动加速", "Auto Acceleration");
			TranslateDict.Add("自动曲速最低距离", "Auto Warp Minimum Distance");
			TranslateDict.Add("自动曲速最低能量", "Auto-warp minimum energy");
			TranslateDict.Add("不渲染黑雾", "Do not render black fog");
			TranslateDict.Add("关闭建筑栏提示", "Turn off building bar prompts");
			TranslateDict.Add("关闭教学提示", "Turn off teaching tips");
			TranslateDict.Add("关闭顾问", "Turn off advisors");
			TranslateDict.Add("关闭里程碑提示", "Turn off milestone alerts");
			TranslateDict.Add("隐藏黑雾威胁度检测", "Hide black fog threat level detection");
			TranslateDict.Add("隐藏黑雾入侵提示", "Hide Black Fog Intrusion Alerts");
			TranslateDict.Add("蓝图功能优化", "Blueprint optimization");
			TranslateDict.Add("物流站功能优化", "Logistics Station Optimization");
			TranslateDict.Add("背包垃圾桶", "Backpack trash can");
			TranslateDict.Add("夜灯", "Night Light");
			TranslateDict.Add("当前选中", "Currently selected");
			TranslateDict.Add("进入蓝图模式可使用", "Available in Blueprint Mode");
			TranslateDict.Add("全选当前星球建筑", "Select all buildings on current planet");
			TranslateDict.Add("删除选中建筑", "Delete selected buildings");
			TranslateDict.Add("可修改建筑", "Modify buildings");
			TranslateDict.Add("科研模式", "Research mode");
			TranslateDict.Add("辅助面板提示", "Auxiliary Panel Tips");
		}
	}
	public class Constant
	{
		public static double[,] posxz = new double[10, 2]
		{
			{ 0.0, 1.0 },
			{ 0.1563, -0.9877 },
			{ 0.3089, -0.9511 },
			{ 0.4539, -0.8911 },
			{ 0.5877, -0.8091 },
			{ 0.7071, -0.7071 },
			{ 0.8091, -0.5877 },
			{ 0.891, -0.454 },
			{ 0.9511, -0.3089 },
			{ 0.9877, -0.1564 }
		};

		public static GUIStyle[] StationStoreStyles = (GUIStyle[])(object)new GUIStyle[3];

		public static GUIStyle GetStationStorelogicStyle(ELogisticStorage i)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected I4, but got Unknown
			return (GUIStyle)((int)i switch
			{
				0 => StationStoreStyles[0], 
				1 => StationStoreStyles[1], 
				2 => StationStoreStyles[2], 
				_ => GUI.skin.button, 
			});
		}
	}
	internal class NumberTranslate
	{
		public static string DistanceTranslate(double distance)
		{
			if (distance < 1599.5)
			{
				return distance.ToString("0") + " m";
			}
			if (distance < 2400000.0)
			{
				return (distance / 40000.0).ToString("0.00") + " AU";
			}
			return (distance / 2400000.0).ToString("0.00") + " " + Localization.Translate("光年");
		}
	}
	public static class AuxConfig
	{
		public const string GUID = "cn.blacksnipe.dsp.Auxilaryfunction";

		public const string NAME = "Auxilaryfunction";

		public const string VERSION = "3.0.4";

		public static string ErrorTitle = "辅助面板错误提示";

		public static Harmony harmony;

		public static bool ChangingBluePrintQuickKey;

		public static bool ChangingQuickKey;

		public static bool ChangeBluePrintQuickKey;

		public static bool ChangeQuickKey;

		public static KeyboardShortcut tempBluePrintShowWindow;

		public static KeyboardShortcut tempShowWindow;

		public static bool simulatorrender;

		public static bool simulatorchanging;

		public static float originUnlockVolumn;

		public static ConfigEntry<int> auto_add_techid;

		public static ConfigEntry<int> auto_add_techmaxLevel;

		public static ConfigEntry<int> auto_supply_Courier;

		public static ConfigEntry<int> auto_supply_drone;

		public static ConfigEntry<int> auto_supply_ship;

		public static ConfigEntry<int> auto_supply_starfuel;

		public static ConfigEntry<int> auto_supply_starfuelID;

		public static ConfigEntry<bool> auto_supply_station;

		public static ConfigEntry<int> auto_supply_warp;

		public static ConfigEntry<bool> autoabsorttrash_bool;

		public static ConfigEntry<bool> autoAddPlayerVel;

		public static ConfigEntry<bool> autoaddtech_bool;

		public static ConfigEntry<bool> autoAddwarp;

		public static ConfigEntry<bool> autocleartrash_bool;

		public static ConfigEntry<bool> automovetodarkfog;

		public static ConfigEntry<float> automovetoPrebuildSecondElapse;

		public static ConfigEntry<bool> automovetounbuilt;

		public static ConfigEntry<bool> AutoNavigateToDarkFogHive;

		public static ConfigEntry<int> AutoNavigateToDarkFogHiveKeepDistance;

		public static ConfigEntry<bool> autonavigation_bool;

		public static ConfigEntry<int> autosavetime;

		public static ConfigEntry<bool> autosavetimechange;

		public static ConfigEntry<bool> autosetCourier_bool;

		public static ConfigEntry<bool> autosetSomevalue_bool;

		public static ConfigEntry<bool> autosetstationconfig;

		public static ConfigEntry<bool> autowarpcommand;

		public static ConfigEntry<float> autowarpdistance;

		public static ConfigEntry<float> autowarpdistanceEnergyPercent;

		public static ConfigEntry<bool> BluePrintDelete;

		public static ConfigEntry<bool> BluePrintSelectAll;

		public static ConfigEntry<KeyboardShortcut> BluePrintShowWindow;

		public static ConfigEntry<bool> CloseMilestone;

		public static ConfigEntry<bool> closeplayerflyaudio;

		public static ConfigEntry<bool> CloseUIAdvisor;

		public static ConfigEntry<bool> CloseUIRandomTip;

		public static ConfigEntry<bool> CloseUITutorialTip;

		public static ConfigEntry<bool> CloseUIGeneralTip;

		public static ConfigEntry<float> DroneStartCarry;

		public static ConfigEntry<bool> DysonPanelDysonSphere;

		public static ConfigEntry<bool> DysonPanelLayers;

		public static ConfigEntry<bool> DysonPanelSingleLayer;

		public static ConfigEntry<bool> DysonPanelSwarm;

		public static ConfigEntry<bool> KeepBeltHeight;

		public static ConfigEntry<string> LastOpenBluePrintBrowserPathConfig;

		public static ConfigEntry<bool> norender_beltitem;

		public static ConfigEntry<bool> norender_DarkFog;

		public static ConfigEntry<bool> norender_dysonshell_bool;

		public static ConfigEntry<bool> norender_dysonswarm_bool;

		public static ConfigEntry<bool> norender_entity_bool;

		public static ConfigEntry<bool> norender_lab_bool;

		public static ConfigEntry<bool> norender_powerdisk_bool;

		public static ConfigEntry<bool> norender_shipdrone_bool;

		public static ConfigEntry<bool> noscaleuitech_bool;

		public static ConfigEntry<bool> onlygetbuildings;

		public static ConfigEntry<KeyboardShortcut> QuickKey;

		public static ConfigEntry<bool> Quickstop_bool;

		public static ConfigEntry<bool> SaveLastOpenBluePrintBrowserPathConfig;

		public static ConfigEntry<float> ShipStartCarry;

		public static ConfigEntry<bool> ShowStationInfo;

		public static ConfigEntry<bool> ShowStationInfoMode;

		public static ConfigEntry<bool> stationcopyItem_bool;

		public static ConfigEntry<int> stationdronedist;

		public static ConfigEntry<float> stationmaxpowerpertick;

		public static ConfigEntry<int> stationshipdist;

		public static ConfigEntry<double> stationwarpdist;

		public static ConfigEntry<bool> SunLightOpen;

		public static ConfigEntry<bool> TrashStorageWindow_bool;

		public static ConfigEntry<bool> upsquickset;

		public static ConfigEntry<int> veincollectorspeed;

		public static ConfigEntry<float> window_height;

		public static ConfigEntry<float> window_width;

		public static ConfigEntry<int> scale;

		public static PlanetData LocalPlanet => GameMain.localPlanet;

		public static void BindAll(ConfigFile config)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			QuickKey = config.Bind<KeyboardShortcut>("打开窗口快捷键", "Key", new KeyboardShortcut((KeyCode)308, (KeyCode[])(object)new KeyCode[1] { (KeyCode)50 }), (ConfigDescription)null);
			BluePrintShowWindow = config.Bind<KeyboardShortcut>("打开蓝图窗口快捷键", "BluePrintQuickKey", new KeyboardShortcut((KeyCode)306, (KeyCode[])(object)new KeyCode[1] { (KeyCode)102 }), (ConfigDescription)null);
			tempShowWindow = QuickKey.Value;
			tempBluePrintShowWindow = BluePrintShowWindow.Value;
			auto_supply_station = config.Bind<bool>("自动配置新运输站", "auto_supply_station", false, (ConfigDescription)null);
			autosetstationconfig = config.Bind<bool>("自动配置新运输站参数显示", "autosetstationconfig", true, (ConfigDescription)null);
			auto_supply_Courier = config.Bind<int>("自动填充配送机", "auto_supply_Courier", 10, (ConfigDescription)null);
			auto_supply_drone = config.Bind<int>("自动填充飞机数量", "auto_supply_drone", 10, (ConfigDescription)null);
			auto_supply_ship = config.Bind<int>("自动填充飞船数量", "auto_supply_ship", 5, (ConfigDescription)null);
			stationmaxpowerpertick = config.Bind<float>("自动设置最大充电功率", "autowarpdistance", 30f, (ConfigDescription)null);
			stationwarpdist = config.Bind<double>("自动设置物流站使用翘曲器距离", "stationwarpdist", 12.0, (ConfigDescription)null);
			DroneStartCarry = config.Bind<float>("自动设置物流站小飞机起送量", "DroneStartCarry", 0.1f, (ConfigDescription)null);
			ShipStartCarry = config.Bind<float>("自动设置物流站运输船起送量", "ShipStartCarry", 1f, (ConfigDescription)null);
			veincollectorspeed = config.Bind<int>("大型采矿机采矿速度", "veincollectorspeed", 10, (ConfigDescription)null);
			auto_supply_warp = config.Bind<int>("自动设置物流站翘曲器数量", "auto_supply_warp", 0, (ConfigDescription)null);
			stationdronedist = config.Bind<int>("自动设置物流站运输机最远距离", "stationdronedist", 180, (ConfigDescription)null);
			stationshipdist = config.Bind<int>("自动设置物流站运输船最远距离", "stationshipdist", 61, (ConfigDescription)null);
			scale = config.Bind<int>("大小适配", "scale", 16, (ConfigDescription)null);
			SunLightOpen = config.Bind<bool>("夜灯", "SunLight", false, (ConfigDescription)null);
			closeplayerflyaudio = config.Bind<bool>("关闭玩家飞行声音", "closeplayerflyaudio", false, (ConfigDescription)null);
			BluePrintDelete = config.Bind<bool>("蓝图删除", "BluePrintDelete", false, (ConfigDescription)null);
			BluePrintSelectAll = config.Bind<bool>("蓝图全选", "BluePrintSelectAll", false, (ConfigDescription)null);
			stationcopyItem_bool = config.Bind<bool>("物流站复制物品配方", "stationcopyItem_bool", false, (ConfigDescription)null);
			autocleartrash_bool = config.Bind<bool>("30s间隔自动清除垃圾", "autocleartrash_bool", false, (ConfigDescription)null);
			autoabsorttrash_bool = config.Bind<bool>("30s间隔自动吸收垃圾", "autoabsorttrash_bool", false, (ConfigDescription)null);
			onlygetbuildings = config.Bind<bool>("只回收建筑", "onlygetbuildings", false, (ConfigDescription)null);
			autowarpcommand = config.Bind<bool>("自动导航使用翘曲", "autowarpcommand", false, (ConfigDescription)null);
			CloseUIRandomTip = config.Bind<bool>("关闭建筑栏提示", "CloseUIRandomTip", false, (ConfigDescription)null);
			CloseUITutorialTip = config.Bind<bool>("关闭教学提示", "CloseUITutorialTip", false, (ConfigDescription)null);
			CloseUIAdvisor = config.Bind<bool>("关闭顾问", "CloseUIAdvisor", false, (ConfigDescription)null);
			CloseMilestone = config.Bind<bool>("关闭里程碑", "CloseMilestone", false, (ConfigDescription)null);
			CloseUIGeneralTip = config.Bind<bool>("关闭科技解锁提示", "CloseUIGeneralTip", false, (ConfigDescription)null);
			autoAddwarp = config.Bind<bool>("自动添加翘曲器", "autoAddwarp", false, (ConfigDescription)null);
			autonavigation_bool = config.Bind<bool>("自动导航", "autonavigation_bool", false, (ConfigDescription)null);
			autoAddPlayerVel = config.Bind<bool>("自动加速", "autoAddPlayerVel", false, (ConfigDescription)null);
			autowarpdistance = config.Bind<float>("自动使用翘曲器距离", "autowarpdistance", 0f, (ConfigDescription)null);
			autowarpdistanceEnergyPercent = config.Bind<float>("自动曲速能量阈值", "autowarpdistanceEnergyPercent", 0f, (ConfigDescription)null);
			autoaddtech_bool = config.Bind<bool>("自动添加科技队列", "autoaddtech_bool", false, (ConfigDescription)null);
			auto_add_techid = config.Bind<int>("自动添加科技队列科技ID", "auto_add_techid", 0, (ConfigDescription)null);
			auto_add_techmaxLevel = config.Bind<int>("自动添加科技队列科技等级上限", "auto_add_techmaxLevel", 500, (ConfigDescription)null);
			ShowStationInfo = config.Bind<bool>("展示物流站信息", "ShowStationInfo", false, (ConfigDescription)null);
			ShowStationInfoMode = config.Bind<bool>("展示物流站信息模式", "ShowStationInfoMode", false, (ConfigDescription)null);
			SaveLastOpenBluePrintBrowserPathConfig = config.Bind<bool>("记录上次蓝图路径", "SaveLastOpenBluePrintBrowserPathConfig", false, (ConfigDescription)null);
			noscaleuitech_bool = config.Bind<bool>("科技页面不缩放", "noscaleuitech_bool", false, (ConfigDescription)null);
			norender_shipdrone_bool = config.Bind<bool>("不渲染飞机飞船", "norender_shipdrone_bool", false, (ConfigDescription)null);
			norender_lab_bool = config.Bind<bool>("不渲染研究室", "norender_lab_bool", false, (ConfigDescription)null);
			norender_beltitem = config.Bind<bool>("不渲染传送带货物", "norender_beltitem", false, (ConfigDescription)null);
			norender_dysonshell_bool = config.Bind<bool>("不渲染戴森壳", "norender_dysonshell_bool", false, (ConfigDescription)null);
			norender_dysonswarm_bool = config.Bind<bool>("不渲染戴森云", "norender_dysonswarm_bool", false, (ConfigDescription)null);
			norender_DarkFog = config.Bind<bool>("不渲染黑雾", "norender_DarkFog", false, (ConfigDescription)null);
			norender_entity_bool = config.Bind<bool>("不渲染实体", "norender_entity_bool", false, (ConfigDescription)null);
			norender_powerdisk_bool = config.Bind<bool>("不渲染电网覆盖", "norender_powerdisk_bool", false, (ConfigDescription)null);
			Quickstop_bool = config.Bind<bool>("ctrl+空格开启暂停工厂和戴森球", "Quickstop_bool", false, (ConfigDescription)null);
			automovetounbuilt = config.Bind<bool>("自动走向未完成建筑", "automovetounbuilt", false, (ConfigDescription)null);
			automovetoPrebuildSecondElapse = config.Bind<float>("自动走向未完成建筑时间间隔", "automovetoPrebuildSecondElapse", 1f, (ConfigDescription)null);
			automovetodarkfog = config.Bind<bool>("自动飞向地面黑雾基地", "automovetodarkfog", false, (ConfigDescription)null);
			upsquickset = config.Bind<bool>("快速设置逻辑帧倍数", "upsquickset", false, (ConfigDescription)null);
			autosetSomevalue_bool = config.Bind<bool>("自动配置建筑", "autosetSomevalue_bool", false, (ConfigDescription)null);
			autosetCourier_bool = config.Bind<bool>("自动填充配送运输机", "autosetCourier_bool", false, (ConfigDescription)null);
			auto_supply_starfuel = config.Bind<int>("人造恒星自动填充燃料数量", "auto_supply_starfuel", 4, (ConfigDescription)null);
			auto_supply_starfuelID = config.Bind<int>("人造恒星自动填充燃料ID", "auto_supply_starfuelID", 1803, (ConfigDescription)null);
			autosavetimechange = config.Bind<bool>("自动保存", "autosavetimechange", false, (ConfigDescription)null);
			KeepBeltHeight = config.Bind<bool>("保持传送带高度", "KeepBeltHeight", false, (ConfigDescription)null);
			autosavetime = config.Bind<int>("自动保存时间", "autosavetime", 25, (ConfigDescription)null);
			DysonPanelSingleLayer = config.Bind<bool>("单层壳列表", "DysonPanelSingleLayer", true, (ConfigDescription)null);
			DysonPanelLayers = config.Bind<bool>("多层壳列表", "DysonPanelLayers", true, (ConfigDescription)null);
			DysonPanelSwarm = config.Bind<bool>("戴森云列表", "DysonPanelSwarm", true, (ConfigDescription)null);
			DysonPanelDysonSphere = config.Bind<bool>("戴森壳列表", "DysonPanelDysonSphere", true, (ConfigDescription)null);
			TrashStorageWindow_bool = config.Bind<bool>("背包垃圾桶", "TrashStorageWindow_bool", false, (ConfigDescription)null);
			window_height = config.Bind<float>("窗口高度", "window_height", 660f, (ConfigDescription)null);
			window_width = config.Bind<float>("窗口宽度", "window_width", 830f, (ConfigDescription)null);
			LastOpenBluePrintBrowserPathConfig = config.Bind<string>("上次打开蓝图路径", "LastOpenBluePrintBrowserPathConfig", "", (ConfigDescription)null);
			AutoNavigateToDarkFogHive = config.Bind<bool>("自动导航至黑雾巢穴", "AutoNavigateToDarkFogHive", false, (ConfigDescription)null);
			AutoNavigateToDarkFogHiveKeepDistance = config.Bind<int>("自动导航至黑雾巢穴跟随距离", "AutoNavigateToDarkFogHiveKeepDistance", 400, (ConfigDescription)null);
		}
	}
}
namespace Auxilaryfunction.Services
{
	public class DysonBluePrintDataService
	{
		public static TempDysonBlueprintData selectDysonBlueprintData = new TempDysonBlueprintData();

		public static List<TempDysonBlueprintData> tempDysonBlueprintData = new List<TempDysonBlueprintData>();

		public static void LoadDysonBluePrintData()
		{
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Invalid comparison between Unknown and I4
			DysonBluePrintDataService.tempDysonBlueprintData = new List<TempDysonBlueprintData>();
			string text = new StringBuilder(GameConfig.overrideDocumentFolder).Append(GameConfig.gameName).Append("/DysonBluePrint/").ToString();
			if (!Directory.Exists(text))
			{
				Directory.CreateDirectory(text);
				Stream manifestResourceStream = Assembly.GetExecutingAssembly().GetManifestResourceStream("Auxilaryfunction.Resources.450节点+框架+32壳面.txt");
				byte[] array = new byte[manifestResourceStream.Length];
				manifestResourceStream.Read(array, 0, (int)manifestResourceStream.Length);
				manifestResourceStream.Close();
				UTF8Encoding uTF8Encoding = new UTF8Encoding();
				string @string = uTF8Encoding.GetString(array);
				try
				{
					File.WriteAllText(Path.Combine(text, "450节点+框架+32壳面.txt"), @string);
				}
				catch
				{
				}
			}
			string[] files = Directory.GetFiles(text, "*.txt", SearchOption.AllDirectories);
			for (int i = 0; i < files.Length; i++)
			{
				string content = File.ReadAllText(files[i]);
				TempDysonBlueprintData tempDysonBlueprintData = new TempDysonBlueprintData
				{
					name = files[i].Substring(text.Length),
					path = files[i]
				};
				tempDysonBlueprintData.ReadDysonSphereBluePrint(content);
				if ((int)tempDysonBlueprintData.type > 0)
				{
					DysonBluePrintDataService.tempDysonBlueprintData.Add(tempDysonBlueprintData);
				}
			}
		}

		public static string ReaddataFromFile(string path)
		{
			if (selectDysonBlueprintData.path == "")
			{
				UIMessageBox.Show(AuxConfig.ErrorTitle.getTranslate(), "路径为空,请重新选择".getTranslate(), Localization.Translate("确定"), 3, (Response)null);
				return "";
			}
			if (File.Exists(path))
			{
				try
				{
					return File.ReadAllText(path);
				}
				catch
				{
					UIMessageBox.Show(AuxConfig.ErrorTitle.getTranslate(), "文件读取失败".getTranslate(), Localization.Translate("确定"), 3, (Response)null);
				}
			}
			UIMessageBox.Show(AuxConfig.ErrorTitle.getTranslate(), "文件不存在".getTranslate(), Localization.Translate("确定"), 3, (Response)null);
			return "";
		}

		public static void RemoveLayerById(int Id)
		{
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Expected O, but got Unknown
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			DysonSphere dysonSphere = UIRoot.instance.uiGame.dysonEditor.selection.viewDysonSphere;
			if (dysonSphere == null)
			{
				return;
			}
			DysonSphereLayer layer = dysonSphere.layersIdBased[Id];
			if (layer == null)
			{
				return;
			}
			if (layer.nodeCount > 0 || layer.frameCount > 0 || layer.shellCount > 0)
			{
				UIMessageBox.Show(Localization.Translate("删除层级非空标题"), Localization.Translate("删除层级非空描述"), Localization.Translate("取消"), Localization.Translate("确定"), 1, (Response)null, (Response)delegate
				{
					if (dysonSphere.layersSorted.Contains(layer))
					{
						DysonSphereLayer obj = layer;
						if (obj != null)
						{
							obj.RemoveAllStructure();
						}
						dysonSphere.RemoveLayer(layer);
					}
				});
				VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
			else
			{
				dysonSphere.RemoveLayer(layer);
			}
		}

		private static void ApplySingleLayerBlueprint(string data, DysonSphere dysonSphere, int id)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Invalid comparison between Unknown and I4
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Invalid comparison between Unknown and I4
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Invalid comparison between Unknown and I4
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Expected I4, but got Unknown
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			DysonBlueprintDataIOError val = new DysonBlueprintData().FromBase64String(data, (EDysonBlueprintType)1, dysonSphere, dysonSphere.layersIdBased[id]);
			if ((int)val == 0)
			{
				VFAudio.Create("ui-click-1", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
			else if ((int)val == 6)
			{
				UIMessageBox.Show(Localization.Translate("戴森球蓝图纬度过高标题"), Localization.Translate("戴森球蓝图纬度过高描述"), Localization.Translate("确定"), 3, (Response)null);
				VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
			else if ((int)val >= 7)
			{
				string arg = "";
				DysonBlueprintDataIOError val2 = val;
				DysonBlueprintDataIOError val3 = val2;
				switch (val3 - 7)
				{
				case 0:
					arg = Localization.Translate("戴森球");
					break;
				case 1:
					arg = Localization.Translate("戴森云");
					break;
				case 2:
					arg = Localization.Translate("戴森壳");
					break;
				}
				string text = string.Format(Localization.Translate("戴森球蓝图类型不匹配描述"), arg, Localization.Translate("戴森层级"));
				UIMessageBox.Show(Localization.Translate("戴森球蓝图类型不匹配标题"), text, Localization.Translate("确定"), 3, (Response)null);
				VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
			else
			{
				UIMessageBox.Show(Localization.Translate("戴森球蓝图错误标题"), Localization.Translate("戴森球蓝图错误描述"), Localization.Translate("确定"), 3, (Response)null);
				VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
		}

		private static void ApplyDysonLayersBlueprint(string data, DysonSphere dysonSphere)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Invalid comparison between Unknown and I4
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Invalid comparison between Unknown and I4
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Invalid comparison between Unknown and I4
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Invalid comparison between Unknown and I4
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			DysonBlueprintDataIOError val = new DysonBlueprintData().FromBase64String(data, (EDysonBlueprintType)2, dysonSphere, (DysonSphereLayer)null);
			if ((int)val == 0)
			{
				VFAudio.Create("ui-click-1", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
			else if ((int)val == 6)
			{
				UIMessageBox.Show(Localization.Translate("戴森球蓝图纬度过高标题"), Localization.Translate("戴森球蓝图纬度过高描述"), Localization.Translate("确定"), 3, (Response)null);
				VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
			else if ((int)val >= 7)
			{
				string arg = "";
				if ((int)val != 8)
				{
					if ((int)val == 10)
					{
						arg = Localization.Translate("戴森层级");
					}
				}
				else
				{
					arg = Localization.Translate("戴森云");
				}
				string text = string.Format(Localization.Translate("戴森球蓝图类型不匹配描述"), arg, Localization.Translate("戴森壳"));
				UIMessageBox.Show(Localization.Translate("戴森球蓝图类型不匹配标题"), text, Localization.Translate("确定"), 3, (Response)null);
				VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
			else
			{
				UIMessageBox.Show(Localization.Translate("戴森球蓝图错误标题"), Localization.Translate("戴森球蓝图错误描述"), Localization.Translate("确定"), 3, (Response)null);
				VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
		}

		private static void ApplyDysonBlueprint(string data, DysonSphere dysonSphere)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Invalid comparison between Unknown and I4
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Invalid comparison between Unknown and I4
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Invalid comparison between Unknown and I4
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Expected I4, but got Unknown
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			DysonBlueprintDataIOError val = new DysonBlueprintData().FromBase64String(data, (EDysonBlueprintType)4, dysonSphere, (DysonSphereLayer)null);
			if ((int)val == 0)
			{
				VFAudio.Create("ui-click-1", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
			else if ((int)val == 6)
			{
				UIMessageBox.Show(Localization.Translate("戴森球蓝图纬度过高标题"), Localization.Translate("戴森球蓝图纬度过高描述"), Localization.Translate("确定"), 3, (Response)null);
				VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
			else if ((int)val >= 7)
			{
				string arg = "";
				DysonBlueprintDataIOError val2 = val;
				DysonBlueprintDataIOError val3 = val2;
				switch (val3 - 8)
				{
				case 0:
					arg = Localization.Translate("戴森云");
					break;
				case 1:
					arg = Localization.Translate("戴森壳");
					break;
				case 2:
					arg = Localization.Translate("戴森层级");
					break;
				}
				string text = string.Format(Localization.Translate("戴森球蓝图类型不匹配描述"), arg, Localization.Translate("戴森球无空格"));
				UIMessageBox.Show(Localization.Translate("戴森球蓝图类型不匹配标题"), text, Localization.Translate("确定"), 3, (Response)null);
				VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
			else
			{
				UIMessageBox.Show(Localization.Translate("戴森球蓝图错误标题"), Localization.Translate("戴森球蓝图错误描述"), Localization.Translate("确定"), 3, (Response)null);
				VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
		}

		private static void ApplySwarmBlueprint(string data, DysonSphere dysonSphere)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Invalid comparison between Unknown and I4
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Invalid comparison between Unknown and I4
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Invalid comparison between Unknown and I4
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Invalid comparison between Unknown and I4
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			DysonBlueprintDataIOError val = new DysonBlueprintData().FromBase64String(data, (EDysonBlueprintType)3, dysonSphere, (DysonSphereLayer)null);
			if ((int)val == 0)
			{
				VFAudio.Create("ui-click-1", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
			else if ((int)val >= 7)
			{
				string arg = "";
				if ((int)val != 9)
				{
					if ((int)val == 10)
					{
						arg = Localization.Translate("戴森层级");
					}
				}
				else
				{
					arg = Localization.Translate("戴森壳");
				}
				string text = string.Format(Localization.Translate("戴森球蓝图类型不匹配描述"), arg, Localization.Translate("戴森云"));
				UIMessageBox.Show(Localization.Translate("戴森球蓝图类型不匹配标题"), text, Localization.Translate("确定"), 3, (Response)null);
				VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
			else
			{
				UIMessageBox.Show(Localization.Translate("戴森球蓝图错误标题"), Localization.Translate("戴森球蓝图错误描述"), Localization.Translate("确定"), 3, (Response)null);
				VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
			}
		}

		public static void ApplyDysonBlueprintManage(string data, DysonSphere dysonSphere, EDysonBlueprintType type, int id = -1)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected I4, but got Unknown
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Expected O, but got Unknown
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			if (data == "" || dysonSphere == null)
			{
				return;
			}
			switch (type - 1)
			{
			case 0:
				if (id == -1)
				{
					UIMessageBox.Show(AuxConfig.ErrorTitle.getTranslate(), Localization.Translate("单层壳蓝图请选择层级"), Localization.Translate("确定"), 3, (Response)null);
					VFAudio.Create("ui-error", (Transform)null, Vector3.zero, true, 1, -1, -1L);
				}
				else
				{
					ApplySingleLayerBlueprint(data, dysonSphere, id);
				}
				break;
			case 1:
				UIMessageBox.Show(Localization.Translate("戴森球多层壳蓝图应用"), Localization.Translate("确定应用多层壳蓝图吗?使用时鼠标最好不要放在戴森球上"), Localization.Translate("取消"), Localization.Translate("确定"), 1, (Response)null, (Response)delegate
				{
					ApplyDysonLayersBlueprint(data, dysonSphere);
				});
				break;
			case 2:
				ApplySwarmBlueprint(data, dysonSphere);
				break;
			case 3:
				ApplyDysonBlueprint(data, dysonSphere);
				break;
			}
		}
	}
	public class TempDysonBlueprintData
	{
		public string path = "";

		public string name = "";

		public EDysonBlueprintType type;

		public string TypeName = "";

		private bool VerifyDysonBluePrintData(string Content)
		{
			if (Content.Length < 23 || Content.Substring(0, 5) != "DYBP:")
			{
				return false;
			}
			int num = Content.IndexOf('"');
			int num2 = Content.LastIndexOf('"');
			if (num == -1 || num2 == -1 || num2 < num + 32)
			{
				return false;
			}
			string[] array = Content.Substring(5, num - 5).Split(new char[1] { ',' });
			if (array.Length < 3 || (Math.Max(Content.Length - 36, 0) > num2 && !MD5F.Compute(Content.Substring(0, num2)).Equals(Content.Substring(num2 + 1, 32), StringComparison.Ordinal)))
			{
				return false;
			}
			return true;
		}

		public void ReadDysonSphereBluePrint(string Content)
		{
			//IL_003d: 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_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected I4, but got Unknown
			if (VerifyDysonBluePrintData(Content))
			{
				int num = Content.IndexOf('"');
				string[] array = Content.Substring(5, num - 5).Split(new char[1] { ',' });
				type = (EDysonBlueprintType)int.Parse(array[3]);
				EDysonBlueprintType val = type;
				EDysonBlueprintType val2 = val;
				switch (val2 - 1)
				{
				case 0:
					TypeName = "单层壳";
					break;
				case 1:
					TypeName = "多层壳";
					break;
				case 2:
					TypeName = "戴森云";
					break;
				case 3:
					TypeName = "戴森球(包括壳、云)";
					break;
				}
			}
		}
	}
	public class GUIDraw
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Action<int> <>9__71_1;

			public static Func<StationStore, int> <>9__73_0;

			public static Func<int, bool> <>9__73_1;

			public static Response <>9__75_0;

			public static Predicate<TempDysonBlueprintData> <>9__79_0;

			public static Func<TempDysonBlueprintData, bool> <>9__79_1;

			public static Predicate<TempDysonBlueprintData> <>9__79_2;

			public static Func<TempDysonBlueprintData, bool> <>9__79_3;

			public static Predicate<TempDysonBlueprintData> <>9__79_4;

			public static Func<TempDysonBlueprintData, bool> <>9__79_5;

			public static Predicate<TempDysonBlueprintData> <>9__79_6;

			public static Func<TempDysonBlueprintData, bool> <>9__79_7;

			public static WaitCallback <>9__79_8;

			public static Action<int> <>9__87_0;

			public static Func<StationStore, bool> <>9__90_1;

			public static Func<StationStore, int> <>9__90_2;

			public static Func<StationStoreConfig, bool> <>9__93_1;

			public static Func<StationStoreConfig, int> <>9__93_2;

			internal void <GameWindowCopyInit>b__71_1(int _)
			{
				Auxilaryfunction.TrashStorage.Sort(true);
			}

			internal int <StationInfoWindowUpdate>b__73_0(StationStore x)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				return x.itemId;
			}

			internal bool <StationInfoWindowUpdate>b__73_1(int x)
			{
				return x != 0;
			}

			internal void <BluePrintConfigSetPanel>b__75_0()
			{
				PlayerAction_Build actionBuild = Auxilaryfunction.player.controller.actionBuild;
				BuildPreview[] bpPool = BluePrintBatchModifyBuild.blue_copy.bpPool;
				foreach (BuildPreview val in bpPool)
				{
					if (val == null || val.item == null || val.objId == 0)
					{
						continue;
					}
					if (val.objId > 0)
					{
						int stationId = AuxConfig.LocalPlanet.factory.entityPool[val.objId].stationId;
						if (stationId > 0)
						{
							StationComponent val2 = AuxConfig.LocalPlanet.factory.transport.stationPool[stationId];
							for (int j = 0; j < val2.storage.Length; j++)
							{
								int num = Auxilaryfunction.player.TryAddItemToPackage(val2.storage[j].itemId, val2.storage[j].count, 0, true, val.objId, false);
								UIItemup.Up(val2.storage[j].itemId, num);
							}
							val2.storage = (StationStore[])(object)new StationStore[val2.storage.Length];
							val2.needs = new int[val2.needs.Length];
						}
					}
					actionBuild.DoDismantleObject(val.objId);
				}
				BluePrintBatchModifyBuild.blue_copy.ClearSelection();
				BluePrintBatchModifyBuild.blue_copy.ClearPreSelection();
				BluePrintBatchModifyBuild.blue_copy.ResetBlueprint();
				BluePrintBatchModifyBuild.blue_copy.ResetBuildPreviews();
				BluePrintBatchModifyBuild.blue_copy.RefreshBlueprintData();
			}

			internal bool <DysonPanel>b__79_0(TempDysonBlueprintData o)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Invalid comparison between Unknown and I4
				return (int)o.type == 1;
			}

			internal bool <DysonPanel>b__79_1(TempDysonBlueprintData x)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Invalid comparison between Unknown and I4
				return (int)x.type == 1;
			}

			internal bool <DysonPanel>b__79_2(TempDysonBlueprintData o)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Invalid comparison between Unknown and I4
				return (int)o.type == 2;
			}

			internal bool <DysonPanel>b__79_3(TempDysonBlueprintData x)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Invalid comparison between Unknown and I4
				return (int)x.type == 2;
			}

			internal bool <DysonPanel>b__79_4(TempDysonBlueprintData o)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Invalid comparison between Unknown and I4
				return (int)o.type == 3;
			}

			internal bool <DysonPanel>b__79_5(TempDysonBlueprintData x)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Invalid comparison between Unknown and I4
				return (int)x.type == 3;
			}

			internal bool <DysonPanel>b__79_6(TempDysonBlueprintData o)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Invalid comparison between Unknown and I4
				return (int)o.type == 4;
			}

			internal bool <DysonPanel>b__79_7(TempDysonBlueprintData x)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Invalid comparison between Unknown and I4
				return (int)x.type == 4;
			}

			internal void <DysonPanel>b__79_8(object o)
			{
				Thread.Sleep(10000);
				GUIUtility.systemCopyBuffer = "";
			}

			internal void <BeltModify>b__87_0(int signalid)
			{
				BluePrintBatchModifyBuild.BeltSignalIconId = signalid;
			}

			internal bool <NormalStationModify>b__90_1(StationStore x)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				return x.itemId != 0;
			}

			internal int <NormalStationModify>b__90_2(StationStore x)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				return x.itemId;
			}

			internal bool <StellarStationModify>b__93_1(StationStoreConfig x)
			{
				return x.ItemId != 0;
			}

			internal int <StellarStationModify>b__93_2(StationStoreConfig x)
			{
				return x.ItemId;
			}
		}

		private const float TitleBarHeight = 20f;

		private const float BorderMargin = 10f;

		private const float EdgeTolerance = 10f;

		public static Color BlueColor;

		public static bool blueprintopen;

		public static Vector2 dysonBluePrintscrollPosition;

		public static Sprite flatsprite;

		public static Sprite leftsprite;

		public static bool limitmaterial;

		public static Color OrangeColor;

		public static Sprite rightsprite;

		public static Vector2 scrollPosition;

		public static bool showwindow;

		public static Sprite trashcan;

		public static Sprite trashcanOpen;

		public bool AutoUnlockTechInSandBox;

		public float MainWindow_x = 300f;

		public float DragStartWindowX = 200f;

		public float MainWindow_y = 200f;

		public float DragStartWindowY = 200f;

		public Texture2D mytexture;

		public bool selectautoaddtechid;

		public Texture2D stationbluetexture;

		public float DragStartMouseX = 10f;

		public float DragStartMouseY = 200f;

		public int whichpannel;

		private float _windowheight;

		private float _windowwidth;

		private int baseSize;

		private GUILayoutOption[] bigiconbuttonoptions;

		private bool bottomscaling;

		private GUILayoutOption[] buttonoptions;

		private GUIStyle buttonstyleblue = null;

		private GUIStyle buttonstyleyellow = null;

		private bool DeleteDysonLayer;

		private bool firstDraw;

		private int heightdis;

		private GUILayoutOption[] HorizontalSlideroptions;

		private GUILayoutOption[] iconbuttonoptions;

		private GUIStyle imageButtonNormalStyle = null;

		private GUIStyle imageButtonSelectedStyle = null;

		private GUIStyle labelstyle = null;

		private bool leftscaling;

		private string[] menus;

		private bool isDragging;

		private GUIStyle nomargin