Decompiled source of VeinManager v20231215.17.1

VeinManager.dll

Decompiled 5 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using ModClass;
using ModCommon;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("VeinManage")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VeinManage")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5a5c8836-c706-4982-ac09-2c0002784394")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[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 VeinManager
{
	[BepInPlugin("ZHYB.DSP.MOD.VeinManager", "ZHYB.DSP.MOD.VeinManager", "2023.1215.1")]
	[BepInProcess("DSPGAME.exe")]
	public class VeinManager : BaseUnityPlugin
	{
		public const string Plugin_GUID = "ZHYB.DSP.MOD.VeinManager";

		public const string Plugin_NAME = "ZHYB.DSP.MOD.VeinManager";

		public const string Plugin_Process = "DSPGAME.exe";

		public const string Plugin_VERSION = "2023.1215.1";

		public static Harmony harmony;

		public ConfigEntry<bool> CheatMode;

		public ConfigEntry<KeyboardShortcut> shortKey;

		public void Start()
		{
			//IL_0051: 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)
			//IL_007a: Expected O, but got Unknown
			global::ModCommon.ModCommon.logger = ((BaseUnityPlugin)this).Logger;
			CheatMode = ((BaseUnityPlugin)this).Config.Bind<bool>("VeinManager", "CheatMode", true, "是否启用《全矿物添加》模式,启用《全矿物添加》模式后,添加全部矿物,每样矿物1000*10*10000份");
			ConfigFile config = ((BaseUnityPlugin)this).Config;
			KeyCode[] array = new KeyCode[3];
			RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
			shortKey = config.Bind<KeyboardShortcut>("VeinManager", "shortKey", new KeyboardShortcut((KeyCode)118, (KeyCode[])(object)array), "因为一个星球只可能用一次,快捷键设置:LeftControl LeftAlt LeftShift V");
			ModTranslate.Init();
			harmony = new Harmony("ZHYB.DSP.MOD.VeinManager");
			harmony.PatchAll();
		}

		public void Update()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			if (GameMain.localPlanet != null)
			{
				KeyboardShortcut value = shortKey.Value;
				if (((KeyboardShortcut)(ref value)).IsDown())
				{
					global::ModCommon.ModCommon.logger.LogInfo((object)" VeinManager  VeinControl");
					VeinControl.CheatMode = CheatMode.Value;
					VeinControl.ControlVein();
				}
			}
		}

		public void OnDestroy()
		{
			harmony.UnpatchSelf();
		}
	}
}
namespace ModClass
{
	public class VeinControl
	{
		private static readonly Dictionary<EVeinType, int> veinAmount = new Dictionary<EVeinType, int>();

		private static PlanetFactory factory = null;

		private const int VEINPERCOUNT = 100000;

		public static bool CheatMode = false;

		private static void ClearAllVein()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected I4, but got Unknown
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			veinAmount.Clear();
			foreach (EVeinType value2 in Enum.GetValues(typeof(EVeinType)))
			{
				if (((ProtoSet<VeinProto>)(object)LDB.veins).Select((int)value2) != null)
				{
					veinAmount.Add(value2, 0);
				}
			}
			VeinData[] veinPool = factory.veinPool;
			foreach (VeinData val2 in veinPool)
			{
				if (val2.id != 0)
				{
					if (veinAmount.TryGetValue(val2.type, out var value))
					{
						value += val2.amount;
						veinAmount[val2.type] = value;
					}
					else
					{
						veinAmount.Add(val2.type, val2.amount);
					}
					if (factory.veinGroups[val2.groupIndex].count == 0)
					{
						factory.veinGroups[val2.groupIndex].type = (EVeinType)0;
						factory.veinGroups[val2.groupIndex].amount = 0L;
						factory.veinGroups[val2.groupIndex].pos = Vector3.zero;
					}
					factory.RemoveVeinWithComponents(val2.id);
				}
			}
			factory.RecalculateAllVeinGroups();
			factory.ArrangeVeinGroups();
		}

		private static void RefreshNewVein()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Expected I4, but got Unknown
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Invalid comparison between Unknown and I4
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Invalid comparison between I4 and Unknown
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Invalid comparison between I4 and Unknown
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Invalid comparison between Unknown and I4
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Invalid comparison between Unknown and I4
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			float lat = 58f;
			foreach (KeyValuePair<EVeinType, int> item in veinAmount)
			{
				if (!CheatMode && item.Value == 0)
				{
					continue;
				}
				int num2 = (int)item.Key;
				if (((ProtoSet<VeinProto>)(object)LDB.veins).Select(num2) == null)
				{
					continue;
				}
				float log = num++ * 25;
				Vector3 val = PostionCompute(lat, log, 0, (int)item.Key == 7);
				int groupIndex = factory.AddVeinGroup(item.Key, val);
				int num3 = ((!CheatMode) ? ((7 == (int)item.Key) ? (item.Value / 60) : item.Value) : ((7 == (int)item.Key) ? 25000000 : 100000000));
				if (num3 != 0)
				{
					int num4 = (((int)item.Key == 7) ? (num3 / 4 + 1) : 100000);
					int num5 = 0;
					while (num3 > 0)
					{
						Vector3 pos = PostionCompute(lat, log, num5++, (int)item.Key == 7);
						VeinData val2 = ((num3 <= num4) ? CreateNewVein(item.Key, groupIndex, num3, pos) : CreateNewVein(item.Key, groupIndex, num4, pos));
						num3 -= val2.amount;
					}
				}
			}
			factory.RecalculateAllVeinGroups();
			factory.ArrangeVeinGroups();
		}

		private static VeinData CreateNewVein(EVeinType type, int groupIndex, int count, Vector3 Pos)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Expected I4, but got Unknown
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: 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_00f2: 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_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_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			int num = (int)type;
			VeinData val = default(VeinData);
			val.type = type;
			val.groupIndex = (short)groupIndex;
			val.amount = count;
			val.pos = Pos;
			val.modelIndex = (short)((ProtoSet<VeinProto>)(object)LDB.veins).Select(num).ModelIndex;
			val.productId = ((ProtoSet<VeinProto>)(object)LDB.veins).Select(num).MiningItem;
			val.minerCount = 0;
			VeinData val2 = val;
			val2.id = factory.AddVeinData(val2);
			val2.colliderId = factory.planet.physics.AddColliderData(((ColliderData)(ref ((ProtoSet<VeinProto>)(object)LDB.veins).Select(num).prefabDesc.colliders[0])).BindToObject(val2.id, 0, (EObjectType)2, val2.pos, Quaternion.FromToRotation(Vector3.up, ((Vector3)(ref val2.pos)).normalized)));
			val2.modelId = factory.planet.factoryModel.gpuiManager.AddModel((int)val2.modelIndex, val2.id, val2.pos, Maths.SphericalRotation(val2.pos, Random.value * 360f), true);
			factory.planet.factoryModel.gpuiManager.AlterModel((int)factory.veinPool[val2.id].modelIndex, factory.veinPool[val2.id].modelId, val2.id, factory.veinPool[val2.id].pos, Maths.SphericalRotation(factory.veinPool[val2.id].pos, 90f), true);
			factory.AssignGroupIndexForNewVein(ref val2);
			factory.veinPool[val2.id] = val2;
			factory.RefreshVeinMiningDisplay(val2.id, 0, 0);
			factory.RecalculateVeinGroup((int)factory.veinPool[val2.id].groupIndex);
			factory.ArrangeVeinGroups();
			return val2;
		}

		public static Vector3 PostionCompute(float lat, float log, int index, bool oil = false)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			float num = (oil ? 5f : 0.2f);
			int num2 = (oil ? 1 : 10);
			return Maths.GetPosByLatitudeAndLongitude(lat + (float)(index % num2) * num, log + (float)(index / num2) * num, GameMain.localPlanet.realRadius);
		}

		public static void ControlVein()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Invalid comparison between Unknown and I4
			if ((int)GameMain.localPlanet.type != 5)
			{
				factory = GameMain.localPlanet.factory;
				ClearAllVein();
				RefreshNewVein();
			}
		}
	}
}
namespace ModCommon
{
	public static class ModCommon
	{
		public static ManualLogSource logger;

		public static PlanetFactory factory;

		public static void Log(string str)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Expected O, but got Unknown
			if (logger == null)
			{
				logger = new ManualLogSource("ZHYB.DSP.MOD.ModCommon");
			}
			logger.LogMessage((object)str);
		}
	}
	public static class ItemIds
	{
		public const int IronOre = 1001;

		public const int CopperOre = 1002;

		public const int SiliconOre = 1003;

		public const int TitaniumOre = 1004;

		public const int Stone = 1005;

		public const int Coal = 1006;

		public const int Log = 1030;

		public const int PlantFuel = 1031;

		public const int FireIce = 1011;

		public const int KimberliteOre = 1012;

		public const int FractalSilicon = 1013;

		public const int OpticalGratingCrystal = 1014;

		public const int SpiniformStalagmiteCrystal = 1015;

		public const int UnipolarMagnet = 1016;

		public const int IronIngot = 1101;

		public const int CopperIngot = 1104;

		public const int High_puritySilicon = 1105;

		public const int TitaniumIngot = 1106;

		public const int StoneBrick = 1108;

		public const int EnergeticGraphite = 1109;

		public const int Steel = 1103;

		public const int TitaniumAlloy = 1107;

		public const int Glass = 1110;

		public const int TitaniumGlass = 1119;

		public const int Prism = 1111;

		public const int Diamond = 1112;

		public const int CrystalSilicon = 1113;

		public const int Gear = 1201;

		public const int Magnet = 1102;

		public const int MagneticCoil = 1202;

		public const int ElectricMotor = 1203;

		public const int ElectromagneticTurbine = 1204;

		public const int Super_magneticRing = 1205;

		public const int ParticleContainer = 1206;

		public const int StrangeMatter = 1127;

		public const int CircuitBoard = 1301;

		public const int Processor = 1303;

		public const int QuantumChip = 1305;

		public const int MicrocrystallineComponent = 1302;

		public const int PlaneFilter = 1304;

		public const int ParticleBroadband = 1402;

		public const int PlasmaExciter = 1401;

		public const int PhotonCombiner = 1404;

		public const int SolarSail = 1501;

		public const int Water = 1000;

		public const int CrudeOil = 1007;

		public const int RefinedOil = 1114;

		public const int SulfuricAcid = 1116;

		public const int Hydrogen = 1120;

		public const int Deuterium = 1121;

		public const int Antimatter = 1122;

		public const int CriticalPhoton = 1208;

		public const int HydrogenFuelRod = 1801;

		public const int DeuteronFuelRod = 1802;

		public const int AntimatterFuelRod = 1803;

		public const int Plastic = 1115;

		public const int Graphene = 1123;

		public const int CarbonNanotube = 1124;

		public const int OrganicCrystal = 1117;

		public const int TitaniumCrystal = 1118;

		public const int CasimirCrystal = 1126;

		public const int GravitonLens = 1209;

		public const int SpaceWarper = 1210;

		public const int AnnihilationConstraintSphere = 1403;

		public const int Thruster = 1405;

		public const int ReinforcedThruster = 1406;

		public const int LogisticsBot = 5003;

		public const int LogisticsDrone = 5001;

		public const int LogisticsVessel = 5002;

		public const int FrameMaterial = 1125;

		public const int DysonSphereComponent = 1502;

		public const int SmallCarrierRocket = 1503;

		public const int Foundation = 1131;

		public const int ProliferatorMk_I = 1141;

		public const int ProliferatorMk_II = 1142;

		public const int ProliferatorMk_III = 1143;

		public const int ConveyorBeltMK_I = 2001;

		public const int ConveyorBeltMK_II = 2002;

		public const int ConveyorBeltMK_III = 2003;

		public const int SorterMK_I = 2011;

		public const int SorterMK_II = 2012;

		public const int SorterMK_III = 2013;

		public const int Splitter = 2020;

		public const int AutomaticPiler = 2040;

		public const int TrafficMonitor = 2030;

		public const int SprayCoater = 2313;

		public const int LogisticsDistributor = 2107;

		public const int StorageMK_I = 2101;

		public const int StorageMK_II = 2102;

		public const int StorageTank = 2106;

		public const int AssemblingMachineMk_I = 2303;

		public const int AssemblingMachineMk_II = 2304;

		public const int AssemblingMachineMk_III = 2305;

		public const int TeslaTower = 2201;

		public const int WirelessPowerTower = 2202;

		public const int SatelliteSubstation = 2212;

		public const int WindTurbine = 2203;

		public const int ThermalPowerPlant = 2204;

		public const int MiniFusionPowerPlant = 2211;

		public const int GeothermalPowerStation = 2213;

		public const int MiningMachine = 2301;

		public const int AdvancedMiningMachine = 2316;

		public const int WaterPump = 2306;

		public const int ArcSmelter = 2302;

		public const int PlaneSmelter = 2315;

		public const int OilExtractor = 2307;

		public const int OilRefinery = 2308;

		public const int ChemicalPlant = 2309;

		public const int QuantumChemicalPlant = 2317;

		public const int Fractionator = 2314;

		public const int SolarPanel = 2205;

		public const int Accumulator = 2206;

		public const int Accumulator_full = 2207;

		public const int EM_RailEjector = 2311;

		public const int RayReceiver = 2208;

		public const int VerticalLaunchingSilo = 2312;

		public const int EnergyExchanger = 2209;

		public const int MiniatureParticleCollider = 2310;

		public const int ArtificialStar = 2210;

		public const int PlanetaryLogisticsStation = 2103;

		public const int InterstellarLogisticsStation = 2104;

		public const int OrbitalCollector = 2105;

		public const int MatrixLab = 2901;

		public const int ElectromagneticMatrix = 6001;

		public const int EnergyMatrix = 6002;

		public const int StructureMatrix = 6003;

		public const int InformationMatrix = 6004;

		public const int GravityMatrix = 6005;

		public const int UniverseMatrix = 6006;
	}
	public static class RecipesIds
	{
		public const int IronIngot = 1;

		public const int Magnet = 2;

		public const int CopperIngot = 3;

		public const int StoneBrick = 4;

		public const int Gear = 5;

		public const int MagneticCoil = 6;

		public const int WindTurbine = 7;

		public const int TeslaTower = 8;

		public const int ElectromagneticMatrix = 9;

		public const int MatrixLab = 10;

		public const int Prism = 11;

		public const int PlasmaExciter = 12;

		public const int WirelessPowerTower = 13;

		public const int OilExtractor = 14;

		public const int OilRefinery = 15;

		public const int PlasmaRefining = 16;

		public const int EnergeticGraphite = 17;

		public const int EnergyMatrix = 18;

		public const int HydrogenFuelRod = 19;

		public const int _Thruster = 20;

		public const int ReinforcedThruster = 21;

		public const int ChemicalPlant = 22;

		public const int Plastic = 23;

		public const int SulfuricAcid = 24;

		public const int OrganicCrystal = 25;

		public const int TitaniumCrystal = 26;

		public const int StructureMatrix = 27;

		public const int CasimirCrystal = 28;

		public const int CasimirCrystal_advanced = 29;

		public const int TitaniumGlass = 30;

		public const int Graphene = 31;

		public const int Graphene_advanced = 32;

		public const int CarbonNanotube = 33;

		public const int SiliconOre = 34;

		public const int CarbonNanotube_advanced = 35;

		public const int ParticleBroadband = 36;

		public const int CrystalSilicon = 37;

		public const int PlaneFilter = 38;

		public const int MiniatureParticleCollider = 39;

		public const int Deuterium = 40;

		public const int DeuteronFuelRod = 41;

		public const int AnnihilationConstraintSphere = 42;

		public const int ArtificialStar = 43;

		public const int AntimatterFuelRod = 44;

		public const int AssemblingMachineMk_I = 45;

		public const int AssemblingMachineMk_II = 46;

		public const int AssemblingMachineMk_III = 47;

		public const int MiningMachine = 48;

		public const int WaterPump = 49;

		public const int CircuitBoard = 50;

		public const int Processor = 51;

		public const int QuantumChip = 52;

		public const int MicrocrystallineComponent = 53;

		public const int OrganicCrystal_original = 54;

		public const int InformationMatrix = 55;

		public const int ArcSmelter = 56;

		public const int Glass = 57;

		public const int X_rayCracking = 58;

		public const int High_puritySilicon = 59;

		public const int Diamond = 60;

		public const int Diamond_advanced = 61;

		public const int CrystalSilicon_advanced = 62;

		public const int Steel = 63;

		public const int ThermalPowerPlant = 64;

		public const int TitaniumIngot = 65;

		public const int TitaniumAlloy = 66;

		public const int SolarPanel = 67;

		public const int PhotonCombiner = 68;

		public const int PhotonCombiner_advanced = 69;

		public const int SolarSail = 70;

		public const int EM_RailEjector = 71;

		public const int RayReceiver = 72;

		public const int SatelliteSubstation = 73;

		public const int Mass_energyStorage = 74;

		public const int UniverseMatrix = 75;

		public const int Accumulator = 76;

		public const int EnergyExchanger = 77;

		public const int SpaceWarper = 78;

		public const int SpaceWarper_advanced = 79;

		public const int FrameMaterial = 80;

		public const int DysonSphereComponent = 81;

		public const int VerticalLaunchingSilo = 82;

		public const int SmallCarrierRocket = 83;

		public const int ConveyorBeltMK_I = 84;

		public const int SorterMK_I = 85;

		public const int StorageMK_I = 86;

		public const int Splitter = 87;

		public const int SorterMK_II = 88;

		public const int ConveyorBeltMK_II = 89;

		public const int SorterMK_III = 90;

		public const int StorageMK_II = 91;

		public const int ConveyorBeltMK_III = 92;

		public const int PlanetaryLogisticsStation = 93;

		public const int LogisticsDrone = 94;

		public const int InterstellarLogisticsStation = 95;

		public const int LogisticsVessel = 96;

		public const int ElectricMotor = 97;

		public const int ElectromagneticTurbine = 98;

		public const int ParticleContainer = 99;

		public const int ParticleContainer_advanced = 100;

		public const int GravitonLens = 101;

		public const int GravityMatrix = 102;

		public const int Super_magneticRing = 103;

		public const int StrangeMatter = 104;

		public const int ProliferatorMk_I = 106;

		public const int ProliferatorMk_II = 107;

		public const int ProliferatorMk_III = 108;

		public const int SprayCoater = 109;

		public const int Fractionator = 110;

		public const int OrbitalCollector = 111;

		public const int Foundation = 112;

		public const int MiniFusionPowerPlant = 113;

		public const int StorageTank = 114;

		public const int DeuteriumFractionation = 115;

		public const int PlaneSmelter = 116;

		public const int TrafficMonitor = 117;

		public const int GeothermalPowerStation = 118;

		public const int AdvancedMiningMachine = 119;

		public const int AutomaticPiler = 120;

		public const int ReformingRefine = 121;

		public const int LogisticsDistributor = 122;

		public const int LogisticsBot = 123;

		public const int QuantumChemicalPlant = 124;
	}
	public static class TechsIds
	{
		public const int Dysonsphereprogram0 = 1;

		public const int Electromagnetism0 = 1001;

		public const int Electromagneticmatrix0 = 1002;

		public const int High_efficiencyplasmacontrol0 = 1101;

		public const int Plasmaextractrefining0 = 1102;

		public const int X_raycracking0 = 1103;

		public const int Reformingrefine0 = 1104;

		public const int Energymatrix0 = 1111;

		public const int Hydrogenfuelrod0 = 1112;

		public const int Thruster0 = 1113;

		public const int Reinforcedthruster0 = 1114;

		public const int Fluidstorageencapsulation0 = 1120;

		public const int Basicchemicalengineering0 = 1121;

		public const int Polymerchemicalengineering0 = 1122;

		public const int High_strengthcrystal0 = 1123;

		public const int Structurematrix0 = 1124;

		public const int Casimircrystal0 = 1125;

		public const int High_strengthglass0 = 1126;

		public const int Appliedsuperconductor0 = 1131;

		public const int High_strengthmaterial0 = 1132;

		public const int Particlecontroltechnology0 = 1133;

		public const int Deuteriumfractionation0 = 1134;

		public const int Wavefunctioninterference0 = 1141;

		public const int Miniatureparticlecollider0 = 1142;

		public const int Strangematter0 = 1143;

		public const int Artificialstar0 = 1144;

		public const int Controlledannihilationreaction0 = 1145;

		public const int ProliferatorMk_I0 = 1151;

		public const int ProliferatorMk_II0 = 1152;

		public const int ProliferatorMk_III0 = 1153;

		public const int Basicassemblingprocesses0 = 1201;

		public const int High_speedassemblingprocesses0 = 1202;

		public const int Quantumprintingtechnology0 = 1203;

		public const int Processor0 = 1302;

		public const int Quantumchip0 = 1303;

		public const int Photonspotlightminingtechnology0 = 1304;

		public const int Mesoscopicquantumentanglement0 = 1305;

		public const int Semiconductormaterial0 = 1311;

		public const int Informationmatrix0 = 1312;

		public const int Automaticmetallurgy0 = 1401;

		public const int Smeltingpurification0 = 1402;

		public const int Crystalsmelting0 = 1403;

		public const int Steelsmelting0 = 1411;

		public const int Thermalpower0 = 1412;

		public const int Titaniumsmelting0 = 1413;

		public const int High_strengthtitaniumalloy0 = 1414;

		public const int Environmentmodification0 = 1415;

		public const int Minifusionpowergeneration0 = 1416;

		public const int Plane_FilterSmeltingTechnology0 = 1417;

		public const int Solarcollection0 = 1501;

		public const int Photonfrequencyconversion0 = 1502;

		public const int Solarsailorbitsystem0 = 1503;

		public const int Rayreceiver0 = 1504;

		public const int Planetaryionosphereutilization0 = 1505;

		public const int Diracinversionmechanism0 = 1506;

		public const int Universematrix0 = 1507;

		public const int Missioncompleted0 = 1508;

		public const int Energystorage0 = 1511;

		public const int Interstellarpowertransmission0 = 1512;

		public const int Geothermalextraction0 = 1513;

		public const int High_strengthlightweightstructure0 = 1521;

		public const int Verticallaunchingsilo0 = 1522;

		public const int Dysonspherestresssystem1 = 1523;

		public const int Basiclogisticssystem0 = 1601;

		public const int Improvedlogisticssystem0 = 1602;

		public const int High_efficiencylogisticssystem0 = 1603;

		public const int Planetarylogisticssystem0 = 1604;

		public const int Interstellarlogisticssystem0 = 1605;

		public const int Gasgiantsexploitation0 = 1606;

		public const int Integratedlogisticssystem0 = 1607;

		public const int Distributionlogisticssystem0 = 1608;

		public const int Electromagneticdrive0 = 1701;

		public const int Magneticlevitationtechnology0 = 1702;

		public const int Magneticparticletrap0 = 1703;

		public const int Gravitationalwaverefraction0 = 1704;

		public const int Gravitymatrix0 = 1705;

		public const int Supermagneticfieldgenerator0 = 1711;

		public const int Satellitepowerdistributionsystem0 = 1712;

		public const int Mechacore1 = 2101;

		public const int Mechacore2 = 2102;

		public const int Mechacore3 = 2103;

		public const int Mechacore4 = 2104;

		public const int Mechacore5 = 2105;

		public const int Mechacore6 = 2106;

		public const int Mechanicalframe1 = 2201;

		public const int Mechanicalframe2 = 2202;

		public const int Mechanicalframe3 = 2203;

		public const int Mechanicalframe4 = 2204;

		public const int Mechanicalframe5 = 2205;

		public const int Mechanicalframe6 = 2206;

		public const int Mechanicalframe7 = 2207;

		public const int Mechanicalframe8 = 2208;

		public const int Inventorycapacity1 = 2301;

		public const int Inventorycapacity2 = 2302;

		public const int Inventorycapacity3 = 2303;

		public const int Inventorycapacity4 = 2304;

		public const int Inventorycapacity5 = 2305;

		public const int Inventorycapacity6 = 2306;

		public const int Communicationcontrol1 = 2401;

		public const int Communicationcontrol2 = 2402;

		public const int Communicationcontrol3 = 2403;

		public const int Communicationcontrol4 = 2404;

		public const int Communicationcontrol5 = 2405;

		public const int Communicationcontrol6 = 2406;

		public const int Communicationcontrol7 = 2407;

		public const int Energycircuit1 = 2501;

		public const int Energycircuit2 = 2502;

		public const int Energycircuit3 = 2503;

		public const int Energycircuit4 = 2504;

		public const int Energycircuit5 = 2505;

		public const int Energycircuit6 = 2506;

		public const int Droneengine1 = 2601;

		public const int Droneengine2 = 2602;

		public const int Droneengine3 = 2603;

		public const int Droneengine4 = 2604;

		public const int Droneengine5 = 2605;

		public const int Droneengine6 = 2606;

		public const int Massconstruction1 = 2701;

		public const int Massconstruction2 = 2702;

		public const int Massconstruction3 = 2703;

		public const int Massconstruction4 = 2704;

		public const int Massconstruction5 = 2705;

		public const int Driveengine1 = 2901;

		public const int Driveengine2 = 2902;

		public const int Driveengine3 = 2903;

		public const int Driveengine4 = 2904;

		public const int Driveengine5 = 2905;

		public const int Driveengine6 = 2906;

		public const int Solarsaillife1 = 3101;

		public const int Solarsaillife2 = 3102;

		public const int Solarsaillife3 = 3103;

		public const int Solarsaillife4 = 3104;

		public const int Solarsaillife5 = 3105;

		public const int Solarsaillife6 = 3106;

		public const int Raytransmissionefficiency1 = 3201;

		public const int Raytransmissionefficiency2 = 3202;

		public const int Raytransmissionefficiency3 = 3203;

		public const int Raytransmissionefficiency4 = 3204;

		public const int Raytransmissionefficiency5 = 3205;

		public const int Raytransmissionefficiency6 = 3206;

		public const int Raytransmissionefficiency7 = 3207;

		public const int Raytransmissionefficiency8 = 3208;

		public const int Sortercargostacking1 = 3301;

		public const int Sortercargostacking2 = 3302;

		public const int Sortercargostacking3 = 3303;

		public const int Sortercargostacking4 = 3304;

		public const int Sortercargostacking5 = 3305;

		public const int Distributionrange1 = 4001;

		public const int Distributionrange2 = 4002;

		public const int Distributionrange3 = 4003;

		public const int Distributionrange4 = 4004;

		public const int Distributionrange5 = 4005;

		public const int Logisticscarrierengine1 = 3401;

		public const int Logisticscarrierengine2 = 3402;

		public const int Logisticscarrierengine3 = 3403;

		public const int Logisticscarrierengine4 = 3404;

		public const int Logisticscarrierengine5 = 3405;

		public const int Logisticscarrierengine6 = 3406;

		public const int Logisticscarrierengine7 = 3407;

		public const int Logisticscarriercapacity1 = 3501;

		public const int Logisticscarriercapacity2 = 3502;

		public const int Logisticscarriercapacity3 = 3503;

		public const int Logisticscarriercapacity4 = 3504;

		public const int Logisticscarriercapacity5 = 3505;

		public const int Logisticscarriercapacity6 = 3506;

		public const int Logisticscarriercapacity7 = 3507;

		public const int Logisticscarriercapacity8 = 3508;

		public const int Logisticscarriercapacity9 = 3509;

		public const int Logisticscarriercapacity12 = 3510;

		public const int LogisticsStationintegratedlogistics1 = 3801;

		public const int LogisticsStationintegratedlogistics2 = 3802;

		public const int LogisticsStationintegratedlogistics3 = 3803;

		public const int Veinsutilization1 = 3601;

		public const int Veinsutilization2 = 3602;

		public const int Veinsutilization3 = 3603;

		public const int Veinsutilization4 = 3604;

		public const int Veinsutilization5 = 3605;

		public const int Veinsutilization6 = 3606;

		public const int Verticalconstruction1 = 3701;

		public const int Verticalconstruction2 = 3702;

		public const int Verticalconstruction3 = 3703;

		public const int Verticalconstruction4 = 3704;

		public const int Verticalconstruction5 = 3705;

		public const int Verticalconstruction6 = 3706;

		public const int Researchspeed1 = 3901;

		public const int Researchspeed2 = 3902;

		public const int Researchspeed3 = 3903;

		public const int Researchspeed4 = 3904;

		public const int Universeexploration1 = 4101;

		public const int Universeexploration2 = 4102;

		public const int Universeexploration3 = 4103;

		public const int Universeexploration4 = 4104;
	}
	public static class ModTranslate
	{
		public static void Init()
		{
		}
	}
	public static class Util
	{
		internal static Sprite _astroIndicatorIcon;

		public static Sprite astroIndicatorIcon
		{
			get
			{
				if ((Object)(object)_astroIndicatorIcon == (Object)null)
				{
					UIStarmap starmap = UIRoot.instance.uiGame.starmap;
					Transform obj = ((Component)starmap.cursorFunctionButton3).transform.Find("icon");
					object obj2;
					if (obj == null)
					{
						obj2 = null;
					}
					else
					{
						Image component = ((Component)obj).GetComponent<Image>();
						obj2 = ((component != null) ? component.sprite : null);
					}
					_astroIndicatorIcon = (Sprite)obj2;
				}
				return _astroIndicatorIcon;
			}
		}

		public static Color DSPBlue => new Color(0.3821f, 0.8455f, 1f, 0.68f);

		public static Color DSPOrange => new Color(0.9906f, 0.5897f, 0.3691f, 0.68f);

		public static T CreateGameObject<T>(string name, float width = 0f, float height = 0f) where T : Component
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Expected O, but got Unknown
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(name);
			RectTransform val2 = val.AddComponent<RectTransform>();
			((Transform)val2).localScale = Vector3.one;
			if (width > 0f || height > 0f)
			{
				val2.sizeDelta = new Vector2(width, height);
			}
			return val.AddComponent<T>();
		}

		public static UIListView CreateListView(Action<UIData> dataFunc, string goName = "", Transform parent = null, float vsWidth = 10f)
		{
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: 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_0119: 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)
			UIListView entryList = UIRoot.instance.uiGame.tutorialWindow.entryList;
			GameObject val = Object.Instantiate<GameObject>(((Component)entryList).gameObject);
			if ((Object)(object)parent != (Object)null)
			{
				val.transform.SetParent(parent, false);
			}
			if (!string.IsNullOrEmpty(goName))
			{
				((Object)val).name = goName;
			}
			UIListView component = val.GetComponent<UIListView>();
			if (dataFunc != null)
			{
				Transform transform = ((Component)component.m_ItemRes).gameObject.transform;
				RectTransform val2 = (RectTransform)(object)((transform is RectTransform) ? transform : null);
				for (int num = ((Transform)val2).childCount - 1; num >= 0; num--)
				{
					Object.Destroy((Object)(object)((Component)((Transform)val2).GetChild(num)).gameObject);
				}
				((Transform)val2).DetachChildren();
				Object.Destroy((Object)(object)((Component)val2).GetComponent<UITutorialListEntry>());
				dataFunc(component.m_ItemRes);
				component.RowHeight = (int)val2.sizeDelta.y;
				component.m_ItemRes.sel_highlight = null;
				component.m_ContentPanel.constraint = (Constraint)1;
				component.m_ContentPanel.constraintCount = 1;
				component.ColumnWidth = (int)val2.sizeDelta.x;
				component.RowHeight = (int)val2.sizeDelta.y;
			}
			component.HorzScroll = false;
			component.VertScroll = true;
			component.CullOutsideItems = false;
			component.ColumnSpacing = 0;
			component.RowSpacing = 4;
			Image component2 = ((Component)component.m_ScrollRect.verticalScrollbar).GetComponent<Image>();
			if ((Object)(object)component2 != (Object)null)
			{
				((Graphic)component2).color = new Color(0f, 0f, 0f, 0.62f);
			}
			Transform transform2 = ((Component)component.m_ScrollRect.verticalScrollbar).transform;
			RectTransform val3 = (RectTransform)(object)((transform2 is RectTransform) ? transform2 : null);
			val3.sizeDelta = new Vector2(vsWidth, val3.sizeDelta.y);
			return component;
		}

		public static Text CreateText(string label, int fontSize = 14, string objectName = "text")
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			Text stateText = UIRoot.instance.uiGame.assemblerWindow.stateText;
			Text val = Object.Instantiate<Text>(stateText);
			((Object)((Component)val).gameObject).name = objectName;
			val.text = label;
			((Graphic)val).color = new Color(1f, 1f, 1f, 0.4f);
			val.alignment = (TextAnchor)3;
			val.fontSize = fontSize;
			return val;
		}

		public static string GetCommandValue(string str, string cmd, bool ignoreCase = false)
		{
			if (string.IsNullOrEmpty(str) || string.IsNullOrEmpty(cmd))
			{
				return "";
			}
			StringComparison comparisonType = StringComparison.Ordinal;
			if (ignoreCase)
			{
				comparisonType = StringComparison.OrdinalIgnoreCase;
			}
			string text = "[" + cmd + ":";
			int num = str.IndexOf(text, comparisonType);
			if (num >= 0)
			{
				num += text.Length;
				int num2 = str.IndexOf("]", num);
				if (num2 > 0)
				{
					return str.Substring(num, num2 - num).Trim();
				}
			}
			return "";
		}

		public static string KMGFormat(long num)
		{
			if (num >= 100000000000000L)
			{
				return (num / 1000000000000L).ToString("#,0T");
			}
			if (num >= 10000000000000L)
			{
				return (num / 1000000000000L).ToString("0.#") + "T";
			}
			if (num >= 100000000000L)
			{
				return (num / 1000000000).ToString("#,0G");
			}
			if (num >= 10000000000L)
			{
				return (num / 1000000000).ToString("0.#") + "G";
			}
			if (num >= 100000000)
			{
				return (num / 1000000).ToString("#,0M");
			}
			if (num >= 10000000)
			{
				return (num / 1000000).ToString("0.#") + "M";
			}
			if (num >= 100000)
			{
				return (num / 1000).ToString("#,0K");
			}
			if (num >= 10000)
			{
				return (num / 1000).ToString("0.#") + "K";
			}
			return num.ToString("#,0");
		}

		public static Sprite LoadSpriteResource(string path)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			Sprite val = Resources.Load<Sprite>(path);
			if ((Object)(object)val != (Object)null)
			{
				return val;
			}
			Texture2D val2 = Resources.Load<Texture2D>(path);
			if ((Object)(object)val2 != (Object)null)
			{
				return Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f));
			}
			return null;
		}

		public static T MakeGameObject<T>(Transform parent, GameObject src, float posX = 0f, float posY = 0f, float width = 0f, float height = 0f, bool right = false, bool bottom = false)
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Expected O, but got Unknown
			//IL_0079: 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_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)src == (Object)null)
			{
				return default(T);
			}
			GameObject val = Object.Instantiate<GameObject>(src);
			if ((Object)(object)val == (Object)null)
			{
				return default(T);
			}
			RectTransform val2 = (RectTransform)val.transform;
			if ((Object)(object)val2 != (Object)null)
			{
				float num = ((!bottom) ? 1 : 0);
				float num2 = (right ? 1 : 0);
				val2.anchorMax = new Vector2(num2, num);
				val2.anchorMin = new Vector2(num2, num);
				val2.pivot = new Vector2(0f, 0f);
				if (width == -1f)
				{
					width = val2.sizeDelta.x;
				}
				if (height == -1f)
				{
					height = val2.sizeDelta.y;
				}
				if (width > 0f && height > 0f)
				{
					val2.sizeDelta = new Vector2(width, height);
				}
				((Transform)val2).SetParent(parent, false);
				val2.anchoredPosition = new Vector2(posX, posY);
			}
			return val.GetComponent<T>();
		}

		public static UIButton MakeIconButton(Transform parent, Sprite sprite, float posX = 0f, float posY = 0f, bool right = false, bool bottom = false)
		{
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//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_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			GameObject gameObject = ((Component)UIRoot.instance.uiGame.researchQueue.pauseButton).gameObject;
			if ((Object)(object)gameObject == (Object)null)
			{
				return null;
			}
			UIButton val = MakeGameObject<UIButton>(parent, gameObject, posX, posY, 0f, 0f, right, bottom);
			if ((Object)(object)val == (Object)null)
			{
				return null;
			}
			Transform val2 = ((Component)val).gameObject.transform.Find("bg");
			if ((Object)(object)val2 != (Object)null)
			{
				((Component)val2).gameObject.SetActive(false);
			}
			Transform val3 = ((Component)val).gameObject.transform.Find("sd");
			if ((Object)(object)val3 != (Object)null)
			{
				((Component)val3).gameObject.SetActive(false);
			}
			Transform val4 = ((Component)val).gameObject.transform.Find("icon");
			if ((Object)(object)sprite != (Object)null && (Object)(object)val4 != (Object)null)
			{
				Image component = ((Component)val4).GetComponent<Image>();
				if ((Object)(object)component != (Object)null)
				{
					component.sprite = sprite;
					((Graphic)component).color = new Color(0.94f, 0.74f, 0.24f, 0.6f);
				}
				val4.localScale = new Vector3(1.6f, 1.6f, 1.6f);
			}
			((Component)val).gameObject.transform.localScale = new Vector3(0.28f, 0.28f, 0.28f);
			val.tips.offset = new Vector2(0f, -10f);
			val.tips.corner = 0;
			val.tips.delay = 0.5f;
			val.tips.tipText = "";
			val.tips.tipTitle = "";
			return val;
		}

		public static UIButton MakeIconButtonB(Sprite sprite, float size = 60f)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(((Component)UIRoot.instance.uiGame.researchQueue.pauseButton).gameObject);
			UIButton component = val.GetComponent<UIButton>();
			RectTransform val2 = (RectTransform)val.transform;
			float num = size / 60f;
			((Transform)val2).localScale = new Vector3(num, num, num);
			Transform obj = val.transform.Find("icon");
			Image val3 = ((obj != null) ? ((Component)obj).GetComponent<Image>() : null);
			if ((Object)(object)val3 != (Object)null)
			{
				val3.sprite = sprite;
			}
			component.tips.tipText = "";
			component.tips.tipTitle = "";
			return component;
		}

		public static UIButton MakeIconButtonC(Sprite sprite, float size = 30f)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			UIButton northButton = UIRoot.instance.uiGame.starmap.northButton;
			object obj;
			if (northButton == null)
			{
				obj = null;
			}
			else
			{
				Transform obj2 = ((Component)northButton).transform.parent.Find("tip");
				obj = ((obj2 != null) ? ((Component)obj2).gameObject : null);
			}
			GameObject val = (GameObject)obj;
			GameObject val2 = Object.Instantiate<GameObject>(val);
			RemovePersistentCalls(val2);
			UIButton component = val2.GetComponent<UIButton>();
			RectTransform val3 = (RectTransform)val2.transform;
			for (int num = ((Transform)val3).childCount - 1; num >= 0; num--)
			{
				Object.Destroy((Object)(object)((Component)((Transform)val3).GetChild(num)).gameObject);
			}
			((Transform)val3).DetachChildren();
			if (size > 0f)
			{
				val3.sizeDelta = new Vector2(size, size);
			}
			Image component2 = val2.GetComponent<Image>();
			if ((Object)(object)component2 != (Object)null)
			{
				component2.sprite = sprite;
			}
			component.tips.tipText = "";
			component.tips.tipTitle = "";
			component.tips.delay = 0.6f;
			if (component.transitions != null && component.transitions.Length != 0)
			{
				component.transitions = (Transition[])(object)new Transition[1] { component.transitions[0] };
			}
			return component;
		}

		public static UIButton MakeSmallTextButton(string label = "", float width = 0f, float height = 0f)
		{
			//IL_00f0: 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_009e: Expected O, but got Unknown
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			UIAssemblerWindow assemblerWindow = UIRoot.instance.uiGame.assemblerWindow;
			GameObject val = Object.Instantiate<GameObject>(((Component)assemblerWindow.copyButton).gameObject);
			UIButton component = val.GetComponent<UIButton>();
			Transform val2 = val.transform.Find("Text");
			Object.DestroyImmediate((Object)(object)((Component)val2).GetComponent<Localizer>());
			Text component2 = ((Component)val2).GetComponent<Text>();
			component2.text = label;
			component.tips.tipText = "";
			component.tips.tipTitle = "";
			if (width > 0f || height > 0f)
			{
				RectTransform val3 = (RectTransform)val.transform;
				if (width == 0f)
				{
					width = val3.sizeDelta.x;
				}
				if (height == 0f)
				{
					height = val3.sizeDelta.y;
				}
				val3.sizeDelta = new Vector2(width, height);
			}
			val.transform.localScale = Vector3.one;
			return component;
		}

		public static RectTransform NormalizeRect(GameObject go, float width = 0f, float height = 0f)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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)
			RectTransform val = (RectTransform)go.transform;
			val.anchorMax = Vector2.zero;
			val.anchorMin = Vector2.zero;
			val.pivot = Vector2.zero;
			if (width > 0f && height > 0f)
			{
				val.sizeDelta = new Vector2(width, height);
			}
			return val;
		}

		public static RectTransform NormalizeRectB(GameObject go)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = (RectTransform)go.transform;
			val.anchorMax = Vector2.one;
			val.anchorMin = Vector2.zero;
			val.pivot = new Vector2(0.5f, 0.5f);
			return val;
		}

		public static RectTransform NormalizeRectC(GameObject go, float width = 0f, float height = 0f)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = (RectTransform)go.transform;
			val.anchorMax = new Vector2(0.5f, 0.5f);
			val.anchorMin = new Vector2(0.5f, 0.5f);
			val.pivot = new Vector2(0.5f, 0.5f);
			if (width > 0f && height > 0f)
			{
				val.sizeDelta = new Vector2(width, height);
			}
			return val;
		}

		public static RectTransform NormalizeRectD(GameObject go, float width = 0f, float height = 0f)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Expected O, but got Unknown
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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)
			RectTransform val = (RectTransform)go.transform;
			val.anchorMax = Vector2.up;
			val.anchorMin = Vector2.up;
			val.pivot = Vector2.up;
			if (width > 0f && height > 0f)
			{
				val.sizeDelta = new Vector2(width, height);
			}
			return val;
		}

		public static RectTransform NormalizeRectWithBottomLeft(Component cmp, float left, float bottom, Transform parent = null)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = cmp.transform;
			RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null);
			if ((Object)(object)parent != (Object)null)
			{
				((Transform)val).SetParent(parent, false);
			}
			val.anchorMax = new Vector2(0f, 0f);
			val.anchorMin = new Vector2(0f, 0f);
			val.pivot = new Vector2(0f, 0f);
			val.anchoredPosition3D = new Vector3(left, bottom, 0f);
			return val;
		}

		public static RectTransform NormalizeRectWithMargin(Component cmp, float top, float left, float bottom, float right, Transform parent = null)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = cmp.transform;
			RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null);
			if ((Object)(object)parent != (Object)null)
			{
				((Transform)val).SetParent(parent, false);
			}
			val.anchoredPosition3D = Vector3.zero;
			((Transform)val).localScale = Vector3.one;
			val.anchorMax = Vector2.one;
			val.anchorMin = Vector2.zero;
			val.pivot = new Vector2(0.5f, 0.5f);
			val.offsetMax = new Vector2(0f - right, 0f - top);
			val.offsetMin = new Vector2(left, bottom);
			return val;
		}

		public static RectTransform NormalizeRectWithTopLeft(Component cmp, float left, float top, Transform parent = null)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = cmp.transform;
			RectTransform val = (RectTransform)(object)((transform is RectTransform) ? transform : null);
			if ((Object)(object)parent != (Object)null)
			{
				((Transform)val).SetParent(parent, false);
			}
			val.anchorMax = new Vector2(0f, 1f);
			val.anchorMin = new Vector2(0f, 1f);
			val.pivot = new Vector2(0f, 1f);
			val.anchoredPosition3D = new Vector3(left, 0f - top, 0f);
			return val;
		}

		public static void RemovePersistentCalls(GameObject go)
		{
			Button component = go.GetComponent<Button>();
			UIButton component2 = go.GetComponent<UIButton>();
			if ((Object)(object)component2 != (Object)null && (Object)(object)component != (Object)null)
			{
				Object.DestroyImmediate((Object)(object)component);
				component2.button = go.AddComponent<Button>();
			}
		}
	}
}