Decompiled source of MoreStatInfo v1.4.4

MoreStatInfo.dll

Decompiled 4 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text.RegularExpressions;
using System.Threading;
using BepInEx;
using BepInEx.Configuration;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SuperStation")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SuperStation")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("061d45a7-58d9-4049-b964-4de2ac7ab0af")]
[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")]
namespace MoreStatInfo;

internal class GUIDraw
{
	private bool firstDraw;

	private bool RefreshBaseSize;

	private static GameObject ui_morestatinfopanel;

	public static Texture2D mytexture;

	public static GUIStyle normalPlanetButtonStyle;

	public static GUIStyle selectedPlanetButtonStyle;

	public static GUIStyle stylenormalblue;

	public static GUIStyle styleboldblue;

	public static GUIStyle styleyellow;

	public static GUIStyle styleitemname = null;

	public static GUIStyle buttonstyleyellow = null;

	public static GUIStyle buttonstyleblue = null;

	private int baseSize;

	public static int heightdis;

	public static int switchwitdh;

	public static int switchheight;

	private static float temp_MainWindow_x = 10f;

	private static float temp_MainWindow_y = 200f;

	private static float MainWindow_x_move = 200f;

	private static float MainWindow_y_move = 200f;

	private static float MainWindow_x = 200f;

	public static float MainWindow_y = 200f;

	public static int cursortrule;

	public static int cursortcolumnindex;

	public static string[] columnsbuttonstr = new string[11]
	{
		"物品", "实时产量", "实时消耗", "理论产量", "需求产量", "生产者", "消费者", "总计", "本地提供", "本地需求",
		"本地仓储"
	};

	public static float MainWindowWidth = 1150f;

	public static float MainWindowHeight = 700f;

	private static bool moving;

	private static bool leftscaling;

	private static bool rightscaling;

	private static bool bottomscaling;

	private bool _ShowGUIWindow;

	public GUIStyle emptyStyle;

	public GUIStyle whiteStyle;

	public bool ShowGUIWindow
	{
		get
		{
			return _ShowGUIWindow;
		}
		set
		{
			_ShowGUIWindow = value;
			ui_morestatinfopanel.SetActive(value);
			if (value)
			{
				firstDraw = true;
			}
		}
	}

	public int BaseSize
	{
		get
		{
			return baseSize;
		}
		set
		{
			baseSize = value;
			MoreStatInfo.scale.Value = value;
			RefreshBaseSize = true;
			heightdis = value * 2;
		}
	}

	public GUIDraw()
	{
		Init();
	}

	private void Init()
	{
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Expected O, but got Unknown
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: 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_00c8: Expected O, but got Unknown
		//IL_00e6: 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_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fb: 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_0111: Expected O, but got Unknown
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_013f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0144: Unknown result type (might be due to invalid IL or missing references)
		//IL_014c: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Expected O, but got Unknown
		//IL_0175: Unknown result type (might be due to invalid IL or missing references)
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("MoreStatInfo.morestatinfopanel")).LoadAsset<GameObject>("MoreStatInfoPanel");
		ui_morestatinfopanel = Object.Instantiate<GameObject>(val, ((Component)UIRoot.instance.overlayCanvas).transform);
		mytexture = new Texture2D(10, 10);
		for (int i = 0; i < ((Texture)mytexture).width; i++)
		{
			for (int j = 0; j < ((Texture)mytexture).height; j++)
			{
				mytexture.SetPixel(i, j, new Color(0f, 0f, 0f, 1f));
			}
		}
		mytexture.Apply();
		styleboldblue = new GUIStyle
		{
			fontStyle = (FontStyle)1,
			fontSize = 20
		};
		styleboldblue.normal.textColor = Color32.op_Implicit(new Color32((byte)167, byte.MaxValue, byte.MaxValue, byte.MaxValue));
		stylenormalblue = new GUIStyle
		{
			fontStyle = (FontStyle)0,
			fontSize = 20
		};
		stylenormalblue.normal.textColor = Color32.op_Implicit(new Color32((byte)167, byte.MaxValue, byte.MaxValue, byte.MaxValue));
		styleyellow = new GUIStyle
		{
			fontStyle = (FontStyle)1,
			fontSize = 20
		};
		styleyellow.normal.textColor = Color32.op_Implicit(new Color32((byte)240, (byte)191, (byte)103, byte.MaxValue));
	}

	public void Draw()
	{
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Expected O, but got Unknown
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Expected O, but got Unknown
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_0113: Expected O, but got Unknown
		//IL_011d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Expected O, but got Unknown
		//IL_0150: 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_016f: Expected O, but got Unknown
		//IL_0183: Unknown result type (might be due to invalid IL or missing references)
		//IL_0198: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a2: Expected O, but got Unknown
		//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b6: Expected O, but got Unknown
		//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
		if (firstDraw)
		{
			firstDraw = false;
			BaseSize = GUI.skin.label.fontSize;
		}
		if (Input.GetKey((KeyCode)306))
		{
			int num = (int)(Input.GetAxis("Mouse Wheel") * 10f);
			int num2 = BaseSize + num;
			if (Input.GetKeyDown((KeyCode)273))
			{
				num2++;
			}
			if (Input.GetKeyDown((KeyCode)274))
			{
				num2--;
			}
			num2 = Math.Max(5, Math.Min(num2, 35));
			BaseSize = num2;
		}
		switchwitdh = (MoreStatInfo.IsEnglish ? (7 * heightdis) : (4 * heightdis));
		switchheight = heightdis * 10;
		if (styleitemname == null)
		{
			emptyStyle = new GUIStyle();
			whiteStyle = new GUIStyle();
			whiteStyle.normal.background = Texture2D.whiteTexture;
			styleitemname = new GUIStyle(GUI.skin.label);
			styleitemname.normal.textColor = Color.white;
			buttonstyleblue = new GUIStyle(GUI.skin.button);
			buttonstyleblue.normal.textColor = styleboldblue.normal.textColor;
			buttonstyleyellow = new GUIStyle(GUI.skin.button);
			buttonstyleyellow.normal.textColor = styleyellow.normal.textColor;
			normalPlanetButtonStyle = new GUIStyle(GUI.skin.button);
			selectedPlanetButtonStyle = new GUIStyle(GUI.skin.button);
			selectedPlanetButtonStyle.normal.textColor = Color32.op_Implicit(new Color32((byte)215, (byte)186, (byte)245, byte.MaxValue));
		}
		if (RefreshBaseSize)
		{
			RefreshBaseSize = false;
			GUI.skin.label.fontSize = BaseSize;
			GUI.skin.button.fontSize = BaseSize;
			GUI.skin.toggle.fontSize = BaseSize;
			GUI.skin.textField.fontSize = BaseSize;
			GUI.skin.textArea.fontSize = BaseSize;
			buttonstyleblue.fontSize = BaseSize;
			buttonstyleyellow.fontSize = BaseSize;
		}
		UIPanelSet();
	}

	public static void UIPanelSet()
	{
		//IL_001d: 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_005d: 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)
		//IL_0084: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		RectTransform component = ui_morestatinfopanel.GetComponent<RectTransform>();
		RectTransform component2 = ((Component)UIRoot.instance.overlayCanvas).GetComponent<RectTransform>();
		float num = component2.sizeDelta.x * 1f / (float)Screen.width;
		float num2 = component2.sizeDelta.y * 1f / (float)Screen.height;
		component.sizeDelta = new Vector2(num * MainWindowWidth, num2 * MainWindowHeight);
		((Transform)component).localPosition = Vector2.op_Implicit(new Vector2((0f - component2.sizeDelta.x) / 2f + MainWindow_x * num, component2.sizeDelta.y / 2f - MainWindow_y * num2 - component.sizeDelta.y));
	}

	public static Rect AddRect(int x, ref int y, Vector2 Size)
	{
		//IL_0008: 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_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		Rect result = default(Rect);
		((Rect)(ref result))..ctor(new Vector2((float)x, (float)y), Size);
		y += (int)Size.y;
		return result;
	}

	public static Rect AddRect(ref int x, int y, Vector2 Size)
	{
		//IL_0008: 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_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		Rect result = default(Rect);
		((Rect)(ref result))..ctor(new Vector2((float)x, (float)y), Size);
		x += (int)Size.x;
		return result;
	}

	public static Rect AddRect(ref int x, int y, float width, float height)
	{
		//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_001a: Unknown result type (might be due to invalid IL or missing references)
		Rect result = default(Rect);
		((Rect)(ref result))..ctor((float)x, (float)y, width, height);
		x += (int)width;
		return result;
	}

	public static Rect AddRect(ref int x, int y, int width, int height)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: 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)
		Rect result = default(Rect);
		((Rect)(ref result))..ctor((float)x, (float)y, (float)width, (float)height);
		x += width;
		return result;
	}

	public static Rect AddRect(int x, ref int y, int width, int height)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: 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)
		Rect result = default(Rect);
		((Rect)(ref result))..ctor((float)x, (float)y, (float)width, (float)height);
		y += height;
		return result;
	}

	public static Rect AddRect(ref float x, float y, float width, float height)
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: 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)
		Rect result = default(Rect);
		((Rect)(ref result))..ctor(x, y, width, height);
		x += width;
		return result;
	}

	public static Rect AddRect(float x, ref float y, float width, float height)
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: 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)
		Rect result = default(Rect);
		((Rect)(ref result))..ctor(x, y, width, height);
		y += height;
		return result;
	}

	public static Rect GetMainWindowRect()
	{
		//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)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		return new Rect(MainWindow_x, MainWindow_y, MainWindowWidth, MainWindowHeight);
	}

	public static Rect GetSwitchWindowRect()
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: 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)
		return new Rect(MainWindow_x - (float)switchwitdh, MainWindow_y, (float)switchwitdh, (float)switchheight);
	}

	public static Rect GetPlanetWindowRect()
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: 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)
		return new Rect(MainWindow_x + MainWindowWidth, MainWindow_y, (float)(heightdis * 8 + 10), (float)(heightdis * 21 + 30));
	}

	public static void ChangeSort(int columnnum)
	{
		if (cursortrule != 0)
		{
			columnsbuttonstr[cursortcolumnindex] = columnsbuttonstr[cursortcolumnindex].Substring(0, columnsbuttonstr[cursortcolumnindex].Length - 1);
		}
		if (columnnum != cursortcolumnindex)
		{
			cursortrule = 1;
		}
		else
		{
			cursortrule++;
			if (cursortrule > 1)
			{
				cursortrule = -1;
			}
		}
		cursortcolumnindex = columnnum;
		switch (cursortrule)
		{
		case 1:
			columnsbuttonstr[columnnum] += "↑";
			break;
		case -1:
			columnsbuttonstr[columnnum] += "↓";
			break;
		case 0:
			cursortcolumnindex = 0;
			break;
		}
	}

	public static void MoveWindow()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: 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_00fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		if (leftscaling || rightscaling || bottomscaling)
		{
			return;
		}
		Vector2 val = Vector2.op_Implicit(Input.mousePosition);
		if (val.x > MainWindow_x && val.x < MainWindow_x + MainWindowWidth && (float)Screen.height - val.y > MainWindow_y && (float)Screen.height - val.y < MainWindow_y + 20f)
		{
			if (Input.GetMouseButton(0))
			{
				if (!moving)
				{
					MainWindow_x_move = MainWindow_x;
					MainWindow_y_move = MainWindow_y;
					temp_MainWindow_x = val.x;
					temp_MainWindow_y = (float)Screen.height - val.y;
				}
				moving = true;
				MainWindow_x = MainWindow_x_move + val.x - temp_MainWindow_x;
				MainWindow_y = MainWindow_y_move + ((float)Screen.height - val.y) - temp_MainWindow_y;
			}
			else
			{
				moving = false;
				temp_MainWindow_x = MainWindow_x;
				temp_MainWindow_y = MainWindow_y;
			}
		}
		else if (moving)
		{
			moving = false;
			MainWindow_x = MainWindow_x_move + val.x - temp_MainWindow_x;
			MainWindow_y = MainWindow_y_move + ((float)Screen.height - val.y) - temp_MainWindow_y;
		}
		MainWindow_y = Math.Max(10f, Math.Min(Screen.height - 10, MainWindow_y));
		MainWindow_x = Math.Max(10f, Math.Min(Screen.width - 10, MainWindow_x));
	}

	public static void Scaling_Window()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: 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)
		//IL_0026: 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_0052: 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_0086: 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_0066: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0110: 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_014f: 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_0197: Unknown result type (might be due to invalid IL or missing references)
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_022f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0244: Unknown result type (might be due to invalid IL or missing references)
		//IL_0209: Unknown result type (might be due to invalid IL or missing references)
		Vector2 val = Vector2.op_Implicit(Input.mousePosition);
		float num = MainWindowWidth;
		float num2 = MainWindowHeight;
		if (Input.GetMouseButton(0))
		{
			if ((val.x + 10f > MainWindow_x && val.x - 10f < MainWindow_x && (float)Screen.height - val.y >= MainWindow_y && (float)Screen.height - val.y <= MainWindow_y + num2) || leftscaling)
			{
				num -= val.x - MainWindow_x;
				MainWindow_x = val.x;
				leftscaling = true;
				rightscaling = false;
			}
			if ((val.x + 10f > MainWindow_x + num && val.x - 10f < MainWindow_x + num && (float)Screen.height - val.y >= MainWindow_y && (float)Screen.height - val.y <= MainWindow_y + num2) || rightscaling)
			{
				num += val.x - MainWindow_x - num;
				rightscaling = true;
				leftscaling = false;
			}
			if (((float)Screen.height - val.y + 10f > num2 + MainWindow_y && (float)Screen.height - val.y - 10f < num2 + MainWindow_y && val.x >= MainWindow_x && val.x <= MainWindow_x + num) || bottomscaling)
			{
				num2 += (float)Screen.height - val.y - (MainWindow_y + num2);
				bottomscaling = true;
			}
			if ((rightscaling || leftscaling) && (float)Screen.height - val.y + 10f > MainWindow_y && (float)Screen.height - val.y - 10f < MainWindow_y && val.x >= MainWindow_x && val.x <= MainWindow_x + num)
			{
				num2 -= (float)Screen.height - val.y - MainWindow_y;
				MainWindow_y = (float)Screen.height - val.y;
			}
		}
		if (Input.GetMouseButtonUp(0))
		{
			rightscaling = false;
			leftscaling = false;
			bottomscaling = false;
		}
		MainWindowWidth = num;
		MainWindowHeight = num2;
	}
}
public static class MoreStatInfoTranslate
{
	private static Dictionary<string, string> TranslateDict = new Dictionary<string, string>();

	public static string getTranslate(this string s)
	{
		return (MoreStatInfo.IsEnglish && TranslateDict.ContainsKey(s) && TranslateDict[s].Length > 0) ? TranslateDict[s] : s;
	}

	public static void regallTranslate()
	{
		TranslateDict.Clear();
		TranslateDict.Add("放电功率", "Discharging power");
		TranslateDict.Add("充电功率", "Charging power");
		TranslateDict.Add("统计面板", "Stat Pannel");
		TranslateDict.Add("可燃冰", "Fire ice");
		TranslateDict.Add("氢", "Hydrogen");
		TranslateDict.Add("重氢", "Deuterium");
		TranslateDict.Add("水", "Water");
		TranslateDict.Add("硫酸", "Sulfuric acid");
		TranslateDict.Add("潮汐锁定", "Tidal locking perpetual day and night");
		TranslateDict.Add("轨道共振1:2", "Orbital resonance 1:2");
		TranslateDict.Add("轨道共振1:4", "Orbital resonance 1:4");
		TranslateDict.Add("距离玩家", "Distance from player");
		TranslateDict.Add("横躺自传", "Horizontal rotation");
		TranslateDict.Add("反向自传", "Reverse rotation");
		TranslateDict.Add("多卫星", "Satellite");
		TranslateDict.Add("工厂状态", "Factory Status");
		TranslateDict.Add("有", "Existed");
		TranslateDict.Add("电力不足", "Insufficient power");
		TranslateDict.Add("产物筛选", "Item filter");
		TranslateDict.Add("一级原料", "rawmaterial");
		TranslateDict.Add("二级原料", "secondrawmaterial");
		TranslateDict.Add("建筑", "Building");
		TranslateDict.Add("合成材料", "Compound");
		TranslateDict.Add("只看目标产物", "only show point item");
		TranslateDict.Add("依目标产物排序", "Sort by point item's prod.");
		TranslateDict.Add("实时产量<理论产量", "prod.<Theoretical prod.");
		TranslateDict.Add("实时产量<需求产量", "prod.<Theoretical cons.");
		TranslateDict.Add("理论产量<需求产量", "Theoretical prod.<Theoretical cons.");
		TranslateDict.Add("发电性能", "Generation capacity");
		TranslateDict.Add("耗电需求", "Consumption demand");
		TranslateDict.Add("总耗能", "Total energy consumption");
		TranslateDict.Add("物品", "ItemName");
		TranslateDict.Add("无", "None");
		TranslateDict.Add("生产者", "Producer");
		TranslateDict.Add("消费者", "Consumer");
		TranslateDict.Add("总计", "Total");
		TranslateDict.Add("本地提供", "LocalProvide");
		TranslateDict.Add("本地需求", "LocalDemand");
		TranslateDict.Add("本地仓储", "LocalStore");
		TranslateDict.Add("远程提供", "RemoteProvide");
		TranslateDict.Add("远程需求", "RemoteDemand");
		TranslateDict.Add("远程仓储", "RemoteStore");
		TranslateDict.Add("实时产量", "Prodcution");
		TranslateDict.Add("实时消耗", "Consumption");
		TranslateDict.Add("需求产量", "Theoretical cons.");
		TranslateDict.Add("理论产量", "Theoretical prod.");
		TranslateDict.Add("围绕行星", "Orbit Around Planet");
		TranslateDict.Add("恒星亮度", "Star lumination");
		TranslateDict.Add("恒星信息", "Star information");
		TranslateDict.Add("星球类型", "Planet type");
		TranslateDict.Add("海洋类型", "Ocean type");
		TranslateDict.Add("行星信息", "Planet information");
		TranslateDict.Add("方向指引", "Indicator");
		TranslateDict.Add("目标星球矿物", "VeinType");
		TranslateDict.Add("附属气态星产物", "GasType");
		TranslateDict.Add("星球特殊性", "PlanetSingularity");
		TranslateDict.Add("本地/远程", "Local/Remote");
		TranslateDict.Add("全部/星球", "Total/Planets");
		TranslateDict.Add("停止刷新", "StopRefresh");
		TranslateDict.Add("单位转化", "Unit conversion");
		TranslateDict.Add("筛选条件", "FilterCondition");
		TranslateDict.Add("工厂信息", "FactoryInfo");
		TranslateDict.Add("星球信息", "PlanetInfo");
		TranslateDict.Add("多选星球", "Multiple select planets");
		TranslateDict.Add("防止穿透", "Close White Panel");
		TranslateDict.Add("加载全部星球", "Load All Planets");
		TranslateDict.Add("已加载星球", "Loaded Planets");
		TranslateDict.Add("未加载星球", "Unloaded Planets");
		TranslateDict.Add("个星球加载中", "Unloaded Planets");
		TranslateDict.Add("未选择", "UnSelected");
	}
}
[BepInPlugin("cn.blacksnipe.dsp.MoreStatInfo", "MoreStatInfo", "1.4.4")]
public class MoreStatInfo : BaseUnityPlugin
{
	public const string GUID = "cn.blacksnipe.dsp.MoreStatInfo";

	public const string NAME = "MoreStatInfo";

	public const string VERSION = "1.4.4";

	public static bool IsEnglish;

	private static GUIDraw guiDraw;

	private int unloadPlanetNum;

	private bool[] searchcondition_bool = new bool[40];

	private string searchcondition_TypeName = "";

	private int pointPlanetId;

	private int producelowerlimit;

	private string producelowerlimitstr = "0";

	private int comsumelowerlimit;

	private string comsumelowerlimitstr = "0";

	private int theoryproducelowerlimit;

	private string theoryproducelowerlimitstr = "0";

	private int theorycomsumelowerlimit;

	private string theorycomsumelowerlimitstr = "0";

	private int windowmaxwidth = 700;

	private int windowmaxheight = 630;

	private int selectitemId;

	private static Dictionary<int, bool> Productsearchcondition = new Dictionary<int, bool>();

	private bool firstStart = true;

	private bool StopRefresh;

	private bool producelimittoggle;

	private bool comsumeimittoggle;

	private bool theoryproducelimittoggle;

	private bool theorycomsumelimittoggle;

	private bool rawmaterial = true;

	private bool secondrawmaterial = true;

	private bool building = true;

	private bool compound = true;

	private bool onlyseechose;

	private bool noreachtheoryproduce;

	private bool noreachneedproduce;

	private bool theorynoreachneedproduce;

	private Vector2 scrollPosition;

	private Vector2 pdselectscrollPosition;

	private List<int> iteminfoshow = new List<int>();

	private List<int> planetinfoshow = new List<int>();

	private List<int> planetsproductinfoshow = new List<int>();

	private List<string> PlanetType = new List<string>();

	private static List<ItemProto> ItemList = new List<ItemProto>();

	private static Dictionary<int, long[]> SumProduce = new Dictionary<int, long[]>();

	private Dictionary<int, int> factoryinfoshow = new Dictionary<int, int>();

	private long[] sumpowerinfoshow = new long[5];

	private Dictionary<int, long[]> powerenergyinfoshow = new Dictionary<int, long[]>();

	private Dictionary<int, long[]> multPlanetProduce = new Dictionary<int, long[]>();

	private static Dictionary<int, Dictionary<int, long[]>> PlanetProduce = new Dictionary<int, Dictionary<int, long[]>>();

	private static Dictionary<int, Dictionary<int, int>> productIndices = new Dictionary<int, Dictionary<int, int>>();

	private int ItemInfoShowIndex = 1;

	private int pdselectinfoindex = 1;

	public static ConfigEntry<int> scale;

	private static ConfigEntry<KeyboardShortcut> ShowCounter1;

	private bool dropdownbutton;

	private bool _filtercondition;

	private bool _refreshfactoryinfo;

	private bool _refreshPlanetinfo;

	private bool _multplanetproduct;

	private bool _PlanetorSum;

	private bool _TGMKinttostringMode;

	private bool _RemoteorLocal;

	private bool _sortbypointproduct;

	private bool _sortbyPlanetDataDis;

	public static bool OneSecondElapsed;

	public bool RemoteorLocal
	{
		get
		{
			return _RemoteorLocal;
		}
		set
		{
			if (value == _RemoteorLocal)
			{
				return;
			}
			_RemoteorLocal = value;
			GUIDraw.columnsbuttonstr[8] = ((!RemoteorLocal) ? "本地提供".getTranslate() : "远程提供".getTranslate());
			GUIDraw.columnsbuttonstr[9] = ((!RemoteorLocal) ? "本地需求".getTranslate() : "远程需求".getTranslate());
			GUIDraw.columnsbuttonstr[10] = ((!RemoteorLocal) ? "本地仓储".getTranslate() : "远程仓储".getTranslate());
			if (GUIDraw.cursortcolumnindex >= 8 && GUIDraw.cursortcolumnindex <= 10)
			{
				switch (GUIDraw.cursortrule)
				{
				case 1:
					GUIDraw.columnsbuttonstr[GUIDraw.cursortcolumnindex] += "↑";
					break;
				case -1:
					GUIDraw.columnsbuttonstr[GUIDraw.cursortcolumnindex] += "↓";
					break;
				case 0:
					GUIDraw.columnsbuttonstr[GUIDraw.cursortcolumnindex] += "-";
					break;
				}
			}
		}
	}

	public bool Filtercondition
	{
		get
		{
			return _filtercondition;
		}
		set
		{
			if (value != _filtercondition)
			{
				_filtercondition = value;
				if (value)
				{
					RefreshPlanetinfo = false;
					Refreshfactoryinfo = false;
				}
			}
		}
	}

	public bool Refreshfactoryinfo
	{
		get
		{
			return _refreshfactoryinfo;
		}
		set
		{
			if (value != _refreshfactoryinfo)
			{
				_refreshfactoryinfo = value;
				if (value)
				{
					Filtercondition = false;
					RefreshPlanetinfo = false;
					Multplanetproduct = false;
					RefreshFactory(pointPlanetId);
				}
			}
		}
	}

	public bool RefreshPlanetinfo
	{
		get
		{
			return _refreshPlanetinfo;
		}
		set
		{
			if (value != _refreshPlanetinfo)
			{
				_refreshPlanetinfo = value;
				if (value)
				{
					Refreshfactoryinfo = false;
					Filtercondition = false;
					Multplanetproduct = false;
				}
			}
		}
	}

	public bool Multplanetproduct
	{
		get
		{
			return _multplanetproduct;
		}
		set
		{
			if (value != _multplanetproduct)
			{
				_multplanetproduct = value;
				if (value)
				{
					Refreshfactoryinfo = false;
					RefreshPlanetinfo = false;
					PlanetorSum = true;
				}
			}
		}
	}

	public bool TGMKinttostringMode
	{
		get
		{
			return _TGMKinttostringMode;
		}
		set
		{
			if (value != _TGMKinttostringMode)
			{
				_TGMKinttostringMode = value;
				if (TGMKinttostringMode)
				{
					GUIDraw.styleboldblue.fontSize = 20;
					GUIDraw.styleyellow.fontSize = 20;
				}
				else
				{
					GUIDraw.styleboldblue.fontSize = 15;
					GUIDraw.styleyellow.fontSize = 15;
				}
			}
		}
	}

	public bool PlanetorSum
	{
		get
		{
			return _PlanetorSum;
		}
		set
		{
			if (value != _PlanetorSum)
			{
				_PlanetorSum = value;
				if (!value)
				{
					pointPlanetId = 0;
				}
				RefreshProductStat();
			}
		}
	}

	public bool SortbyPointProduct
	{
		get
		{
			return _sortbypointproduct;
		}
		set
		{
			if (value == _sortbypointproduct)
			{
				return;
			}
			_sortbypointproduct = value;
			if (value)
			{
				for (int i = 0; i < ItemList.Count; i++)
				{
					Productsearchcondition[((Proto)ItemList[i]).ID] = false;
				}
				if (selectitemId > 0)
				{
					Productsearchcondition[selectitemId] = true;
				}
			}
		}
	}

	private void Start()
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		_TGMKinttostringMode = true;
		scale = ((BaseUnityPlugin)this).Config.Bind<int>("大小适配", "scale", 16, (ConfigDescription)null);
		ShowCounter1 = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("打开窗口快捷键", "Key", new KeyboardShortcut((KeyCode)51, (KeyCode[])(object)new KeyCode[1] { (KeyCode)308 }), (ConfigDescription)null);
		guiDraw = new GUIDraw();
		((Vector2)(ref scrollPosition))[0] = 0f;
		((Vector2)(ref pdselectscrollPosition))[0] = 0f;
		MoreStatInfoTranslate.regallTranslate();
		Debug.Log((object)"MoreStatInfo Start");
		ThreadPool.QueueUserWorkItem(delegate
		{
			while (true)
			{
				OneSecondElapsed = true;
				Thread.Sleep(1000);
			}
		});
	}

	private void Update()
	{
		//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)
		if ((Object)(object)GameMain.instance == (Object)null)
		{
			return;
		}
		if (!GameMain.instance.running)
		{
			firstStart = false;
			ItemList = new List<ItemProto>(((ProtoSet<ItemProto>)(object)LDB.items).dataArray);
			while (PlanetModelingManager.calPlanetReqList.Count > 0)
			{
				PlanetModelingManager.calPlanetReqList.Dequeue();
			}
		}
		else if (!firstStart)
		{
			firstStart = true;
			Productsearchcondition = new Dictionary<int, bool>();
			for (int i = 0; i < ItemList.Count; i++)
			{
				if (!Productsearchcondition.ContainsKey(((Proto)ItemList[i]).ID))
				{
					Productsearchcondition.Add(((Proto)ItemList[i]).ID, value: false);
				}
			}
			StarData[] stars = GameMain.galaxy.stars;
			foreach (StarData val in stars)
			{
				PlanetData[] planets = val.planets;
				foreach (PlanetData val2 in planets)
				{
					if (!PlanetType.Contains(val2.typeString))
					{
						PlanetType.Add(val2.typeString);
					}
				}
			}
		}
		else
		{
			KeyboardShortcut value = ShowCounter1.Value;
			if (((KeyboardShortcut)(ref value)).IsDown())
			{
				guiDraw.ShowGUIWindow = !guiDraw.ShowGUIWindow;
			}
		}
	}

	private void OnGUI()
	{
		if (guiDraw.ShowGUIWindow)
		{
			guiDraw.Draw();
			RefreshAll();
			MainWindowShowFun();
			SwitchWindowShowFun();
			RefreshPlanet();
			PlanetWindowShowFun();
			if (OneSecondElapsed)
			{
				OneSecondElapsed = false;
			}
		}
	}

	private void MainWindowShowFun()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Invalid comparison between Unknown and I4
		//IL_0024: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_004e: Expected O, but got Unknown
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		IsEnglish = (int)Localization.CurrentLanguage.glyph == 0;
		GUIDraw.MoveWindow();
		GUIDraw.Scaling_Window();
		GUI.DrawTexture(GUI.Window(20210821, GUIDraw.GetMainWindowRect(), new WindowFunction(MainWindow), "统计面板".getTranslate() + "(1.4.4)ps:ctrl+↑↓"), (Texture)(object)GUIDraw.mytexture);
	}

	private void SwitchWindowShowFun()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Expected O, but got Unknown
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		GUI.DrawTexture(GUI.Window(202108212, GUIDraw.GetSwitchWindowRect(), new WindowFunction(SwitchWindow), ""), (Texture)(object)GUIDraw.mytexture);
	}

	private void PlanetWindowShowFun()
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Expected O, but got Unknown
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		if (PlanetorSum || RefreshPlanetinfo)
		{
			GUI.DrawTexture(GUI.Window(202108213, GUIDraw.GetPlanetWindowRect(), new WindowFunction(PlanetWindow), ""), (Texture)(object)GUIDraw.mytexture);
		}
	}

	public void MainWindow(int id)
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_004b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0068: 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)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1193: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_1249: Unknown result type (might be due to invalid IL or missing references)
		//IL_127c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1406: Unknown result type (might be due to invalid IL or missing references)
		//IL_138d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1392: Unknown result type (might be due to invalid IL or missing references)
		//IL_13ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_13b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_13be: Expected O, but got Unknown
		//IL_13cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_12f5: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.BeginArea(new Rect(10f, 20f, GUIDraw.MainWindowWidth, GUIDraw.MainWindowHeight));
		int x = 0;
		int y = 0;
		scrollPosition = GUI.BeginScrollView(new Rect(0f, 0f, GUIDraw.MainWindowWidth - 20f, GUIDraw.MainWindowHeight - 30f), scrollPosition, new Rect(0f, 0f, (float)windowmaxwidth, (float)windowmaxheight));
		if (Refreshfactoryinfo && factoryinfoshow != null && factoryinfoshow.Count > 0)
		{
			foreach (KeyValuePair<int, int> item in factoryinfoshow)
			{
				ItemProto val = ((ProtoSet<ItemProto>)(object)LDB.items).Select(item.Key);
				GUI.Button(new Rect((float)x, (float)y, (float)(GUIDraw.heightdis * 2), (float)(GUIDraw.heightdis * 2)), (Texture)(object)val.iconSprite.texture, guiDraw.emptyStyle);
				GUI.Label(GUIDraw.AddRect(ref x, y + GUIDraw.heightdis * 2, GUIDraw.heightdis * 2, GUIDraw.heightdis), item.Value.ToString() ?? "", GUIDraw.styleboldblue);
				if ((float)x > GUIDraw.MainWindowWidth - 10f - (float)(GUIDraw.heightdis * 2))
				{
					x = 0;
					y += GUIDraw.heightdis * 4;
				}
			}
			y += GUIDraw.heightdis * 4;
			string[] array = new string[5]
			{
				"发电性能".getTranslate() + ":",
				"耗电需求".getTranslate() + ":",
				"总耗能".getTranslate() + ":",
				"放电功率".getTranslate() + ":",
				"充电功率".getTranslate() + ":"
			};
			for (int i = 0; i < 5; i++)
			{
				string text = ((i == 2) ? "J" : "W");
				double num = (((RefreshPlanetinfo || PlanetorSum) && pointPlanetId > 0 && powerenergyinfoshow.ContainsKey(pointPlanetId)) ? powerenergyinfoshow[pointPlanetId][i] : sumpowerinfoshow[i]);
				array[i] += (TGMKinttostringMode ? TGMKinttostring(num, text) : (Threeinttostring(num) + text));
				GUI.Label(GUIDraw.AddRect(10, ref y, 200, GUIDraw.heightdis), array[i], GUIDraw.styleboldblue);
			}
			windowmaxwidth = (int)GUIDraw.MainWindowWidth - 10;
		}
		else if (RefreshPlanetinfo)
		{
			GUILayoutOption[] array2 = (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width((float)GUIDraw.heightdis),
				GUILayout.Height((float)GUIDraw.heightdis)
			};
			GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Label("附属气态星产物".getTranslate(), Array.Empty<GUILayoutOption>());
			for (int j = 15; j <= 17; j++)
			{
				searchcondition_bool[j] = GUILayout.Toggle(searchcondition_bool[j], searchchineseTranslate(j), Array.Empty<GUILayoutOption>());
			}
			GUILayout.Label("星球特殊性".getTranslate(), Array.Empty<GUILayoutOption>());
			for (int k = 18; k <= 25; k++)
			{
				searchcondition_bool[k] = GUILayout.Toggle(searchcondition_bool[k], searchchineseTranslate(k), Array.Empty<GUILayoutOption>());
			}
			if (searchcondition_bool[26] != GUILayout.Toggle(searchcondition_bool[26], "具有工厂".getTranslate(), Array.Empty<GUILayoutOption>()))
			{
				searchcondition_bool[26] = !searchcondition_bool[26];
				if (searchcondition_bool[26])
				{
					searchcondition_bool[27] = false;
				}
			}
			if (searchcondition_bool[27] != GUILayout.Toggle(searchcondition_bool[27], "不具有工厂".getTranslate(), Array.Empty<GUILayoutOption>()))
			{
				searchcondition_bool[27] = !searchcondition_bool[27];
				if (searchcondition_bool[27])
				{
					searchcondition_bool[26] = false;
				}
			}
			if (searchcondition_bool[28] != GUILayout.Toggle(searchcondition_bool[28], "电力不足".getTranslate(), Array.Empty<GUILayoutOption>()))
			{
				searchcondition_bool[28] = !searchcondition_bool[28];
				if (searchcondition_bool[28])
				{
					searchcondition_bool[26] = true;
				}
			}
			if (searchcondition_bool[29] != GUILayout.Toggle(searchcondition_bool[29], "已加载星球".getTranslate(), Array.Empty<GUILayoutOption>()))
			{
				searchcondition_bool[29] = !searchcondition_bool[29];
				if (searchcondition_bool[29])
				{
					searchcondition_bool[30] = false;
				}
			}
			if (searchcondition_bool[30] != GUILayout.Toggle(searchcondition_bool[30], "未加载星球".getTranslate(), Array.Empty<GUILayoutOption>()))
			{
				searchcondition_bool[30] = !searchcondition_bool[30];
				if (searchcondition_bool[30])
				{
					searchcondition_bool[29] = false;
				}
			}
			GUILayout.EndVertical();
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Label("目标星球矿物".getTranslate(), Array.Empty<GUILayoutOption>());
			for (int l = 1; l <= 14; l++)
			{
				searchcondition_bool[l] = GUILayout.Toggle(searchcondition_bool[l], searchchineseTranslate(l), Array.Empty<GUILayoutOption>());
			}
			_sortbyPlanetDataDis = GUILayout.Toggle(_sortbyPlanetDataDis, "依照离玩家距离排序".getTranslate(), Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("取消所有条件".getTranslate(), Array.Empty<GUILayoutOption>()))
			{
				for (int num2 = searchcondition_bool.Length - 1; num2 >= 0; num2--)
				{
					searchcondition_bool[num2] = false;
				}
			}
			GUILayout.Label("未加载星球".getTranslate() + $"{unloadPlanetNum}", Array.Empty<GUILayoutOption>());
			if (GUILayout.Button("加载全部星球".getTranslate(), Array.Empty<GUILayoutOption>()))
			{
				LoadAllPlanet();
			}
			if (PlanetModelingManager.calPlanetReqList.Count > 0)
			{
				GUILayout.Label($"{PlanetModelingManager.calPlanetReqList.Count}" + "个星球加载中".getTranslate(), Array.Empty<GUILayoutOption>());
				GUILayout.Label("请勿切换存档".getTranslate(), Array.Empty<GUILayoutOption>());
			}
			GUILayout.EndVertical();
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.Label("星球类型".getTranslate(), Array.Empty<GUILayoutOption>());
			if (GUILayout.Button((searchcondition_TypeName == "") ? "未选择".getTranslate() : searchcondition_TypeName, Array.Empty<GUILayoutOption>()))
			{
				dropdownbutton = !dropdownbutton;
			}
			if (dropdownbutton)
			{
				if (GUILayout.Button("取消选择", Array.Empty<GUILayoutOption>()))
				{
					dropdownbutton = !dropdownbutton;
					searchcondition_TypeName = "";
				}
				for (int m = 0; m < PlanetType.Count; m++)
				{
					if (GUILayout.Button(PlanetType[m], Array.Empty<GUILayoutOption>()))
					{
						dropdownbutton = !dropdownbutton;
						searchcondition_TypeName = PlanetType[m];
					}
				}
			}
			GUILayout.EndVertical();
			GUILayout.Space((float)GUIDraw.heightdis);
			PlanetData val2;
			if (pointPlanetId > 0 && (val2 = GameMain.galaxy.PlanetById(pointPlanetId)) != null)
			{
				GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
				GUILayout.Label("行星信息".getTranslate() + ":", GUIDraw.styleboldblue, Array.Empty<GUILayoutOption>());
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Space(20f);
				GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
				string text2 = GUILayout.TextArea(val2.displayName, Array.Empty<GUILayoutOption>());
				if (!text2.Equals(val2.displayName))
				{
					val2.overrideName = text2;
					val2.NotifyOnDisplayNameChange();
				}
				if (val2.gasItems == null)
				{
					string waterTypeText = GetWaterTypeText(val2.waterItemId);
					GUILayout.Space(5f);
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					GUILayout.Label("海洋类型".getTranslate() + ":", GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
					GUILayout.Space(20f);
					GUILayout.Label(waterTypeText, GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
					GUILayout.EndHorizontal();
					GUILayout.Space(5f);
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					GUILayout.Label("星球类型".getTranslate() + ":", GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
					GUILayout.Space(20f);
					GUILayout.Label(val2.typeString, GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
					GUILayout.EndHorizontal();
					if (val2.singularityString.Length > 0)
					{
						GUILayout.Space(5f);
						GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
						GUILayout.Label("星球特殊性".getTranslate() + ": ", GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
						GUILayout.Space(20f);
						GUILayout.Label(val2.singularityString, GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
						GUILayout.EndHorizontal();
					}
				}
				GUILayout.Space(5f);
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label("工厂状态".getTranslate() + ":", GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
				GUILayout.Space(20f);
				GUILayout.Label(PlanetProduce.ContainsKey(val2.id) ? "有".getTranslate() : "无".getTranslate(), GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
				GUILayout.EndHorizontal();
				GUILayout.Space(5f);
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label("距离玩家".getTranslate() + ":", GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
				GUILayout.Space(20f);
				GUILayout.Label(PlayerToPlanetDisTranslate(val2), GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
				GUILayout.EndHorizontal();
				if (GUILayout.Button("方向指引".getTranslate(), Array.Empty<GUILayoutOption>()))
				{
					GameMain.mainPlayer.navigation._indicatorAstroId = val2.id;
				}
				GUILayout.Space(20f);
				if (val2.gasItems != null)
				{
					for (int n = 0; n < val2.gasItems.Length; n++)
					{
						ItemProto val3 = ((ProtoSet<ItemProto>)(object)LDB.items).Select(val2.gasItems[n]);
						GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
						GUILayout.Button((Texture)(object)val3.iconSprite.texture, guiDraw.emptyStyle, array2);
						GUILayout.Label(((Proto)val3).name + ":" + $"{val2.gasSpeeds[n]:N2}", GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
						GUILayout.EndHorizontal();
					}
				}
				else
				{
					long[] array3 = new long[64];
					val2.CalcVeinAmounts(ref array3, new HashSet<int>(), UIRoot.instance.uiGame.veinAmountDisplayFilter);
					int[] array4 = veinSpotsSketch(val2);
					int num3 = 1;
					while (array4 != null && num3 <= 14)
					{
						if (array4[num3] != 0)
						{
							long num4 = array3[num3];
							ItemProto val4 = ((ProtoSet<ItemProto>)(object)LDB.items).Select(((ProtoSet<VeinProto>)(object)LDB.veins).Select(num3).MiningItem);
							GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
							GUILayout.Button((Texture)(object)val4.iconSprite.texture, guiDraw.emptyStyle, array2);
							GUILayout.Label(((Proto)val4).name + TGMKinttostring(num4) + "(" + array4[num3] + ")", GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
							GUILayout.EndHorizontal();
						}
						num3++;
					}
				}
				GUILayout.EndVertical();
				GUILayout.EndHorizontal();
				GUILayout.EndVertical();
				GUILayout.Space(20f);
				GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
				GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
				if (val2.orbitAroundPlanet != null)
				{
					GUILayout.Label("围绕行星".getTranslate() + ":", GUIDraw.styleboldblue, Array.Empty<GUILayoutOption>());
					GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
					GUILayout.Space(20f);
					GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
					text2 = GUILayout.TextArea(val2.orbitAroundPlanet.displayName, Array.Empty<GUILayoutOption>());
					if (!text2.Equals(val2.orbitAroundPlanet.displayName))
					{
						val2.orbitAroundPlanet.overrideName = text2;
						val2.orbitAroundPlanet.NotifyOnDisplayNameChange();
					}
					for (int num5 = 0; num5 < val2.orbitAroundPlanet.gasItems.Length; num5++)
					{
						ItemProto val5 = ((ProtoSet<ItemProto>)(object)LDB.items).Select(val2.orbitAroundPlanet.gasItems[num5]);
						GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
						GUILayout.Button((Texture)(object)val5.iconSprite.texture, guiDraw.emptyStyle, array2);
						GUILayout.Label(((Proto)val5).name + ":" + $"{val2.orbitAroundPlanet.gasSpeeds[num5]:N2}", GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
						GUILayout.EndHorizontal();
					}
					GUILayout.EndVertical();
					GUILayout.EndHorizontal();
					GUILayout.Space((float)GUIDraw.heightdis);
				}
				GUILayout.Label("恒星信息".getTranslate() + ":", GUIDraw.styleboldblue, Array.Empty<GUILayoutOption>());
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Space(20f);
				GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
				StarData star = val2.star;
				string text3 = GUILayout.TextArea(star.displayName, Array.Empty<GUILayoutOption>());
				if (!text3.Equals(star.displayName))
				{
					star.overrideName = text3;
					star.NotifyOnDisplayNameChange();
				}
				GUILayout.Space(5f);
				GUILayout.Label(star.typeString, GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
				GUILayout.Space(5f);
				GUILayout.Label("恒星亮度".getTranslate() + ":" + star.dysonLumino, GUIDraw.stylenormalblue, Array.Empty<GUILayoutOption>());
				GUILayout.Space(5f);
				GUILayout.EndVertical();
				GUILayout.EndHorizontal();
				GUILayout.EndVertical();
				GUILayout.EndVertical();
			}
			GUILayout.FlexibleSpace();
			GUILayout.EndHorizontal();
			windowmaxwidth = (int)GUIDraw.MainWindowWidth - 30;
		}
		else
		{
			Dictionary<int, long[]> dictionary = (Multplanetproduct ? multPlanetProduce : ((PlanetorSum && PlanetProduce != null && PlanetProduce.ContainsKey(pointPlanetId)) ? PlanetProduce[pointPlanetId] : SumProduce));
			int[] array5 = new int[11]
			{
				IsEnglish ? (GUIDraw.heightdis * 8) : (GUIDraw.heightdis * 4),
				GUIDraw.heightdis * 4,
				GUIDraw.heightdis * 4,
				GUIDraw.heightdis * 4,
				GUIDraw.heightdis * 4,
				TGMKinttostringMode ? (GUIDraw.heightdis * 4) : (GUIDraw.heightdis * 2),
				TGMKinttostringMode ? (GUIDraw.heightdis * 4) : (GUIDraw.heightdis * 2),
				GUIDraw.heightdis * 4,
				GUIDraw.heightdis * 4,
				GUIDraw.heightdis * 4,
				GUIDraw.heightdis * 4
			};
			windowmaxwidth = array5.Sum();
			for (int num6 = 0; num6 <= 10; num6++)
			{
				GUIStyle val6 = ((num6 % 2 == 0) ? GUIDraw.buttonstyleyellow : GUIDraw.buttonstyleblue);
				if (GUI.Button(GUIDraw.AddRect(ref x, y, array5[num6], GUIDraw.heightdis), GUIDraw.columnsbuttonstr[num6].getTranslate(), val6))
				{
					GUIDraw.ChangeSort(num6);
				}
			}
			x = 0;
			y += GUIDraw.heightdis;
			foreach (int item2 in iteminfoshow.Skip((ItemInfoShowIndex - 1) * 20).Take(20))
			{
				if (dictionary.ContainsKey(item2))
				{
					ItemProto val7 = ((ProtoSet<ItemProto>)(object)LDB.items).Select(item2);
					int iD = ((Proto)val7).ID;
					GUI.Button(GUIDraw.AddRect(ref x, y, GUIDraw.heightdis, GUIDraw.heightdis), (Texture)(object)val7.iconSprite.texture, guiDraw.emptyStyle);
					GUI.Label(GUIDraw.AddRect(ref x, y, array5[0] - GUIDraw.heightdis, GUIDraw.heightdis), ((Proto)val7).name, GUIDraw.styleitemname);
					for (int num7 = 0; num7 < 10; num7++)
					{
						GUIStyle val8 = ((num7 % 2 == 0) ? GUIDraw.styleboldblue : GUIDraw.styleyellow);
						string text4 = (TGMKinttostringMode ? TGMKinttostring(dictionary[iD][num7]) : dictionary[iD][num7].ToString());
						GUI.Label(GUIDraw.AddRect(ref x, y, array5[num7 + 1], GUIDraw.heightdis), text4, val8);
					}
					x = 0;
					y += GUIDraw.heightdis;
				}
			}
			int num8 = (int)((float)iteminfoshow.Count / 20.5f) + 1;
			ItemInfoShowIndex = Math.Min(ItemInfoShowIndex, num8);
			x = 0;
			for (int num9 = 1; num9 <= num8; num9++)
			{
				if (num8 <= 1)
				{
					break;
				}
				if (num9 == ItemInfoShowIndex)
				{
					GUIStyle val9 = new GUIStyle(GUI.skin.button);
					val9.normal.textColor = Color32.op_Implicit(new Color32((byte)215, (byte)186, (byte)245, byte.MaxValue));
					GUIStyle val10 = val9;
					if (GUI.Button(GUIDraw.AddRect(ref x, y, GUIDraw.heightdis, GUIDraw.heightdis), num9.ToString() ?? "", val10))
					{
						ItemInfoShowIndex = num9;
					}
				}
				else if (GUI.Button(GUIDraw.AddRect(ref x, y, GUIDraw.heightdis, GUIDraw.heightdis), num9.ToString() ?? ""))
				{
					ItemInfoShowIndex = num9;
				}
			}
			y += GUIDraw.heightdis;
		}
		if (Filtercondition)
		{
			FilterUI(ref y);
		}
		windowmaxheight = y + GUIDraw.heightdis;
		GUI.EndScrollView();
		GUILayout.EndArea();
	}

	private void SwitchWindow(int id)
	{
		//IL_0017: 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)
		//IL_0062: 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_00bd: 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_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_0147: Unknown result type (might be due to invalid IL or missing references)
		//IL_0175: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.BeginArea(new Rect(10f, 20f, (float)GUIDraw.switchwitdh, (float)GUIDraw.switchheight));
		int x = 0;
		int y = 0;
		RemoteorLocal = GUI.Toggle(GUIDraw.AddRect(x, ref y, GUIDraw.switchwitdh, GUIDraw.heightdis), RemoteorLocal, "本地/远程".getTranslate());
		PlanetorSum = GUI.Toggle(GUIDraw.AddRect(x, ref y, GUIDraw.switchwitdh, GUIDraw.heightdis), PlanetorSum, "全部/星球".getTranslate());
		StopRefresh = GUI.Toggle(GUIDraw.AddRect(x, ref y, GUIDraw.switchwitdh, GUIDraw.heightdis), StopRefresh, "停止刷新".getTranslate());
		TGMKinttostringMode = GUI.Toggle(GUIDraw.AddRect(x, ref y, GUIDraw.switchwitdh, GUIDraw.heightdis), TGMKinttostringMode, "单位转化".getTranslate());
		Filtercondition = GUI.Toggle(GUIDraw.AddRect(x, ref y, GUIDraw.switchwitdh, GUIDraw.heightdis), Filtercondition, "筛选条件".getTranslate());
		Refreshfactoryinfo = GUI.Toggle(GUIDraw.AddRect(x, ref y, GUIDraw.switchwitdh, GUIDraw.heightdis), Refreshfactoryinfo, "工厂信息".getTranslate());
		RefreshPlanetinfo = GUI.Toggle(GUIDraw.AddRect(x, ref y, GUIDraw.switchwitdh, GUIDraw.heightdis), RefreshPlanetinfo, "星球信息".getTranslate());
		Multplanetproduct = GUI.Toggle(GUIDraw.AddRect(x, ref y, GUIDraw.switchwitdh, GUIDraw.heightdis), Multplanetproduct, "多选星球".getTranslate());
		GUILayout.EndArea();
	}

	private void PlanetWindow(int id)
	{
		//IL_001f: 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_009c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0233: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.BeginArea(new Rect(0f, 20f, (float)(GUIDraw.heightdis * 8 + 10), (float)(GUIDraw.heightdis * 21)));
		for (int i = (pdselectinfoindex - 1) * 20; i < pdselectinfoindex * 20 && i < planetinfoshow.Count; i++)
		{
			GUIStyle val = GUIDraw.normalPlanetButtonStyle;
			if (!Multplanetproduct)
			{
				if (pointPlanetId == planetinfoshow[i])
				{
					val = GUIDraw.selectedPlanetButtonStyle;
				}
				if (GUI.Button(new Rect(5f, (float)((i - (pdselectinfoindex - 1) * 20) * GUIDraw.heightdis), (float)(GUIDraw.heightdis * 8), (float)GUIDraw.heightdis), GameMain.galaxy.PlanetById(planetinfoshow[i]).displayName, val))
				{
					pointPlanetId = planetinfoshow[i];
					RefreshFactory(pointPlanetId);
				}
				continue;
			}
			if (planetsproductinfoshow.Contains(planetinfoshow[i]))
			{
				val = GUIDraw.selectedPlanetButtonStyle;
			}
			if (GUI.Button(new Rect(5f, (float)((i - (pdselectinfoindex - 1) * GUIDraw.heightdis) * GUIDraw.heightdis), (float)(GUIDraw.heightdis * 8), (float)GUIDraw.heightdis), GameMain.galaxy.PlanetById(planetinfoshow[i]).displayName, val))
			{
				if (planetsproductinfoshow.Contains(planetinfoshow[i]))
				{
					planetsproductinfoshow.Remove(planetinfoshow[i]);
				}
				else
				{
					planetsproductinfoshow.Add(planetinfoshow[i]);
				}
			}
		}
		int num = planetinfoshow.Count / 20 + 1;
		int num2 = 0;
		for (int j = ((pdselectinfoindex <= 3) ? 1 : (pdselectinfoindex - 2)); j <= num; j++)
		{
			if (GUI.Button(new Rect((float)(GUIDraw.heightdis * num2++), (float)(20 * GUIDraw.heightdis), (float)GUIDraw.heightdis, (float)GUIDraw.heightdis), j.ToString() ?? "", (j == pdselectinfoindex) ? GUIDraw.selectedPlanetButtonStyle : GUIDraw.normalPlanetButtonStyle))
			{
				pdselectinfoindex = j;
			}
		}
		GUILayout.EndArea();
	}

	private void FilterUI(ref int y)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Expected O, but got Unknown
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0116: Expected O, but got Unknown
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_029c: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a6: Expected O, but got Unknown
		//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_0166: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f9: Unknown result type (might be due to invalid IL or missing references)
		float x = 0f;
		GUIStyle toggle = GUI.skin.toggle;
		GUI.Label(GUIDraw.AddRect(ref x, y, toggle.CalcSize(new GUIContent("产物筛选".getTranslate())).x, GUIDraw.heightdis), "产物筛选".getTranslate());
		string[] array = new string[9] { "一级原料", "二级原料", "建筑", "合成材料", "只看目标产物", "依目标产物排序", "实时产量<理论产量", "实时产量<需求产量", "理论产量<需求产量" };
		bool[] array2 = new bool[9] { rawmaterial, secondrawmaterial, building, compound, onlyseechose, SortbyPointProduct, noreachtheoryproduce, noreachneedproduce, theorynoreachneedproduce };
		for (int i = 0; i < array.Length; i++)
		{
			string translate = array[i].getTranslate();
			float x2 = toggle.CalcSize(new GUIContent(translate)).x;
			if (x + x2 + 5f > (float)windowmaxwidth || i == 6)
			{
				x = 0f;
				y += GUIDraw.heightdis;
			}
			array2[i] = GUI.Toggle(GUIDraw.AddRect(ref x, y, x2 + 5f, GUIDraw.heightdis), array2[i], translate);
		}
		rawmaterial = array2[0];
		secondrawmaterial = array2[1];
		building = array2[2];
		compound = array2[3];
		onlyseechose = array2[4];
		SortbyPointProduct = array2[5];
		noreachtheoryproduce = array2[6];
		noreachneedproduce = array2[7];
		theorynoreachneedproduce = array2[8];
		x = 0f;
		y += GUIDraw.heightdis;
		array = new string[4] { "实时产量", "实时消耗", "需求产量", "理论产量" };
		array2 = new bool[4] { producelimittoggle, comsumeimittoggle, theorycomsumelimittoggle, theoryproducelimittoggle };
		string[] array3 = new string[4] { producelowerlimitstr, comsumelowerlimitstr, theorycomsumelowerlimitstr, theoryproducelowerlimitstr };
		for (int j = 0; j < array.Length; j++)
		{
			string text = array[j].getTranslate() + ":";
			bool flag = array2[j];
			string text2 = array3[j];
			Vector2 val = toggle.CalcSize(new GUIContent(text));
			array2[j] = GUI.Toggle(GUIDraw.AddRect(ref x, y, val.x + 5f, GUIDraw.heightdis), flag, text, toggle);
			array3[j] = GUI.TextArea(GUIDraw.AddRect(ref x, y, GUIDraw.heightdis * 4, GUIDraw.heightdis), text2 + "/min");
		}
		producelowerlimitstr = Regex.Replace(array3[0], "[^0-9]", "");
		comsumelowerlimitstr = Regex.Replace(array3[1], "[^0-9]", "");
		theorycomsumelowerlimitstr = Regex.Replace(array3[2], "[^0-9]", "");
		theoryproducelowerlimitstr = Regex.Replace(array3[3], "[^0-9]", "");
		producelowerlimitstr = ClampString(producelowerlimitstr, 0, 9);
		comsumelowerlimitstr = ClampString(comsumelowerlimitstr, 0, 9);
		theorycomsumelowerlimitstr = ClampString(theorycomsumelowerlimitstr, 0, 9);
		theoryproducelowerlimitstr = ClampString(theoryproducelowerlimitstr, 0, 9);
		int.TryParse(comsumelowerlimitstr, out comsumelowerlimit);
		int.TryParse(theorycomsumelowerlimitstr, out theorycomsumelowerlimit);
		int.TryParse(theoryproducelowerlimitstr, out theoryproducelowerlimit);
		int.TryParse(producelowerlimitstr, out producelowerlimit);
		if (!SequenceEqual(array2, new bool[4] { producelimittoggle, comsumeimittoggle, theorycomsumelimittoggle, theoryproducelimittoggle }))
		{
			producelimittoggle = array2[0];
			comsumeimittoggle = array2[1];
			theorycomsumelimittoggle = array2[2];
			theoryproducelimittoggle = array2[3];
		}
		x = 0f;
		y += GUIDraw.heightdis;
		foreach (ItemProto item in ItemList)
		{
			int iD = ((Proto)item).ID;
			if (!Productsearchcondition.ContainsKey(iD))
			{
				Productsearchcondition.Add(iD, value: false);
			}
			if (iD == 1030 || iD == 1031 || (((iD >= 1000 && iD < 1030) || iD == 1208) && !rawmaterial) || (iD > 1100 && iD < 1200 && !secondrawmaterial) || (item.CanBuild && !building))
			{
				continue;
			}
			if (item.recipes.Count > 0)
			{
				switch (iD)
				{
				default:
					if (item.BuildIndex == 0 && !compound)
					{
						continue;
					}
					break;
				case 1003:
				case 1101:
				case 1102:
				case 1103:
				case 1104:
				case 1105:
				case 1106:
				case 1107:
				case 1108:
				case 1109:
				case 1110:
				case 1111:
				case 1112:
				case 1113:
				case 1114:
				case 1115:
				case 1116:
				case 1117:
				case 1118:
				case 1119:
				case 1120:
				case 1121:
				case 1122:
				case 1123:
				case 1124:
				case 1125:
				case 1126:
				case 1127:
				case 1128:
				case 1129:
				case 1130:
				case 1131:
				case 1132:
				case 1133:
				case 1134:
				case 1135:
				case 1136:
				case 1137:
				case 1138:
				case 1139:
				case 1140:
				case 1141:
				case 1142:
				case 1143:
				case 1144:
				case 1145:
				case 1146:
				case 1147:
				case 1148:
				case 1149:
				case 1150:
				case 1151:
				case 1152:
				case 1153:
				case 1154:
				case 1155:
				case 1156:
				case 1157:
				case 1158:
				case 1159:
				case 1160:
				case 1161:
				case 1162:
				case 1163:
				case 1164:
				case 1165:
				case 1166:
				case 1167:
				case 1168:
				case 1169:
				case 1170:
				case 1171:
				case 1172:
				case 1173:
				case 1174:
				case 1175:
				case 1176:
				case 1177:
				case 1178:
				case 1179:
				case 1180:
				case 1181:
				case 1182:
				case 1183:
				case 1184:
				case 1185:
				case 1186:
				case 1187:
				case 1188:
				case 1189:
				case 1190:
				case 1191:
				case 1192:
				case 1193:
				case 1194:
				case 1195:
				case 1196:
				case 1197:
				case 1198:
				case 1199:
					break;
				}
			}
			GUIStyle val2 = guiDraw.emptyStyle;
			if (Productsearchcondition[iD])
			{
				val2 = guiDraw.whiteStyle;
			}
			if (GUI.Button(GUIDraw.AddRect(ref x, y, GUIDraw.heightdis, GUIDraw.heightdis), (Texture)(object)item.iconSprite.texture, val2))
			{
				Productsearchcondition[iD] = !Productsearchcondition[iD];
				if (SortbyPointProduct && Productsearchcondition[iD])
				{
					selectitemId = iD;
					List<int> list = Productsearchcondition.Keys.ToList();
					foreach (int item2 in list)
					{
						Productsearchcondition[item2] = false;
					}
					Productsearchcondition[iD] = true;
				}
			}
			if (x > GUIDraw.MainWindowWidth - (float)(GUIDraw.heightdis * 2))
			{
				y += GUIDraw.heightdis;
				x = 0f;
			}
		}
	}

	public Dictionary<int, long[]> sortItem(Dictionary<int, long[]> itemsmap, int columnnum, int sortrules)
	{
		if (sortrules == 0)
		{
			return itemsmap;
		}
		Dictionary<int, long[]> dictionary = new Dictionary<int, long[]>();
		if (columnnum == 0)
		{
			List<int> list = new List<int>(itemsmap.Keys);
			list.Sort();
			if (sortrules == -1)
			{
				list.Reverse();
			}
			for (int i = 0; i < list.Count; i++)
			{
				dictionary.Add(list[i], itemsmap[list[i]]);
			}
			return dictionary;
		}
		columnnum--;
		Dictionary<int, long[]> dictionary2 = new Dictionary<int, long[]>(itemsmap);
		List<int> list2 = new List<int>();
		int count = itemsmap.Count;
		for (int j = 0; j < count; j++)
		{
			long num = -1L;
			int num2 = 0;
			foreach (KeyValuePair<int, long[]> item in dictionary2)
			{
				if (num < item.Value[columnnum])
				{
					num2 = item.Key;
					num = item.Value[columnnum];
				}
			}
			list2.Add(num2);
			dictionary2.Remove(num2);
		}
		if (sortrules == 1)
		{
			list2.Reverse();
		}
		for (int k = 0; k < count; k++)
		{
			dictionary.Add(list2[k], itemsmap[list2[k]]);
		}
		return dictionary;
	}

	private string searchchineseTranslate(int i)
	{
		if (0 < i && i < 15)
		{
			return ((Proto)((ProtoSet<ItemProto>)(object)LDB.items).Select(((ProtoSet<VeinProto>)(object)LDB.veins).Select(i).MiningItem)).name;
		}
		return i switch
		{
			15 => "可燃冰".getTranslate(), 
			16 => "氢".getTranslate(), 
			17 => "重氢".getTranslate(), 
			18 => "水".getTranslate(), 
			19 => "硫酸".getTranslate(), 
			20 => "潮汐锁定".getTranslate(), 
			21 => "轨道共振1:2".getTranslate(), 
			22 => "轨道共振1:4".getTranslate(), 
			23 => "横躺自传".getTranslate(), 
			24 => "反向自传".getTranslate(), 
			25 => "多卫星".getTranslate(), 
			_ => "", 
		};
	}

	private void LoadAllPlanet()
	{
		StarData[] stars = GameMain.galaxy.stars;
		foreach (StarData val in stars)
		{
			PlanetData[] planets = val.planets;
			foreach (PlanetData val2 in planets)
			{
				if (!val2.calculated && !val2.calculating && val2.data == null && !val2.loaded && !val2.loading && val2.factory == null)
				{
					val2.calculating = true;
					PlanetModelingManager.calPlanetReqList.Enqueue(val2);
				}
			}
		}
	}

	private void RefreshAll()
	{
		if (StopRefresh || !OneSecondElapsed)
		{
			return;
		}
		RefreshProductStat();
		Dictionary<int, long[]> itemsmap = SumProduce;
		if (PlanetorSum && PlanetProduce != null && PlanetProduce.Count > 0)
		{
			if (Multplanetproduct)
			{
				multPlanetProduce = new Dictionary<int, long[]>();
				for (int i = 0; i < planetsproductinfoshow.Count; i++)
				{
					if (!PlanetProduce.ContainsKey(planetsproductinfoshow[i]))
					{
						continue;
					}
					Dictionary<int, long[]> dictionary = PlanetProduce[planetsproductinfoshow[i]];
					foreach (KeyValuePair<int, long[]> item in dictionary)
					{
						if (multPlanetProduce.ContainsKey(item.Key))
						{
							for (int j = 0; j < 10; j++)
							{
								multPlanetProduce[item.Key][j] += item.Value[j];
							}
						}
						else
						{
							multPlanetProduce.Add(item.Key, item.Value);
						}
					}
				}
				multPlanetProduce = sortItem(multPlanetProduce, GUIDraw.cursortcolumnindex, GUIDraw.cursortrule);
				itemsmap = multPlanetProduce;
			}
			else if (PlanetProduce.ContainsKey(pointPlanetId))
			{
				PlanetProduce[pointPlanetId] = sortItem(PlanetProduce[pointPlanetId], GUIDraw.cursortcolumnindex, GUIDraw.cursortrule);
				itemsmap = PlanetProduce[pointPlanetId];
			}
		}
		itemsmap = sortItem(itemsmap, GUIDraw.cursortcolumnindex, GUIDraw.cursortrule);
		List<int> list = new List<int>(itemsmap.Keys);
		iteminfoshow = new List<int>();
		for (int k = 0; k < list.Count; k++)
		{
			int num = list[k];
			ItemProto val = ((ProtoSet<ItemProto>)(object)LDB.items).Select(num);
			if (((ProtoSet<ItemProto>)(object)LDB.items).Select(num) == null || num == 1030 || num == 1031 || (((num >= 1000 && num < 1030) || num == 1208) && !rawmaterial) || (num > 1100 && num < 1200 && !secondrawmaterial) || (val.CanBuild && !building))
			{
				continue;
			}
			if (val.recipes.Count > 0)
			{
				switch (num)
				{
				default:
					if (val.BuildIndex == 0 && !compound)
					{
						continue;
					}
					break;
				case 1003:
				case 1101:
				case 1102:
				case 1103:
				case 1104:
				case 1105:
				case 1106:
				case 1107:
				case 1108:
				case 1109:
				case 1110:
				case 1111:
				case 1112:
				case 1113:
				case 1114:
				case 1115:
				case 1116:
				case 1117:
				case 1118:
				case 1119:
				case 1120:
				case 1121:
				case 1122:
				case 1123:
				case 1124:
				case 1125:
				case 1126:
				case 1127:
				case 1128:
				case 1129:
				case 1130:
				case 1131:
				case 1132:
				case 1133:
				case 1134:
				case 1135:
				case 1136:
				case 1137:
				case 1138:
				case 1139:
				case 1140:
				case 1141:
				case 1142:
				case 1143:
				case 1144:
				case 1145:
				case 1146:
				case 1147:
				case 1148:
				case 1149:
				case 1150:
				case 1151:
				case 1152:
				case 1153:
				case 1154:
				case 1155:
				case 1156:
				case 1157:
				case 1158:
				case 1159:
				case 1160:
				case 1161:
				case 1162:
				case 1163:
				case 1164:
				case 1165:
				case 1166:
				case 1167:
				case 1168:
				case 1169:
				case 1170:
				case 1171:
				case 1172:
				case 1173:
				case 1174:
				case 1175:
				case 1176:
				case 1177:
				case 1178:
				case 1179:
				case 1180:
				case 1181:
				case 1182:
				case 1183:
				case 1184:
				case 1185:
				case 1186:
				case 1187:
				case 1188:
				case 1189:
				case 1190:
				case 1191:
				case 1192:
				case 1193:
				case 1194:
				case 1195:
				case 1196:
				case 1197:
				case 1198:
				case 1199:
					break;
				}
			}
			if ((!onlyseechose || Productsearchcondition[num]) && (!noreachtheoryproduce || (itemsmap.ContainsKey(num) && itemsmap[num][0] < itemsmap[num][2])) && (!noreachneedproduce || (itemsmap.ContainsKey(num) && itemsmap[num][0] < itemsmap[num][3])) && (!theorynoreachneedproduce || (itemsmap.ContainsKey(num) && itemsmap[num][2] < itemsmap[num][3])) && (!producelimittoggle || (itemsmap.ContainsKey(num) && itemsmap[num][0] > producelowerlimit)) && (!comsumeimittoggle || (itemsmap.ContainsKey(num) && itemsmap[num][1] > comsumelowerlimit)) && (!theoryproducelimittoggle || (itemsmap.ContainsKey(num) && itemsmap[num][2] > theoryproducelowerlimit)) && (!theorycomsumelimittoggle || (itemsmap.ContainsKey(num) && itemsmap[num][3] > theorycomsumelowerlimit)))
			{
				iteminfoshow.Add(num);
			}
		}
	}

	private void RefreshProductStat()
	{
		//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_03be: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_086c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0871: Unknown result type (might be due to invalid IL or missing references)
		//IL_0874: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ec: Invalid comparison between Unknown and I4
		//IL_087e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ab4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ab9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0abc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ac6: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_04fd: Invalid comparison between Unknown and I4
		//IL_0bd9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bde: Unknown result type (might be due to invalid IL or missing references)
		//IL_0be1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0beb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cfe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d03: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d06: Unknown result type (might be due to invalid IL or missing references)
		//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_06be: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c4: Invalid comparison between Unknown and I4
		//IL_09dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_09f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d10: Unknown result type (might be due to invalid IL or missing references)
		//IL_06c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0595: Unknown result type (might be due to invalid IL or missing references)
		//IL_10c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_10cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_10d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_051f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d31: Unknown result type (might be due to invalid IL or missing references)
		//IL_10da: Unknown result type (might be due to invalid IL or missing references)
		//IL_052b: Unknown result type (might be due to invalid IL or missing references)
		//IL_1448: Unknown result type (might be due to invalid IL or missing references)
		//IL_144d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1450: Unknown result type (might be due to invalid IL or missing references)
		//IL_082f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0648: Unknown result type (might be due to invalid IL or missing references)
		//IL_10fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_055f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0569: Unknown result type (might be due to invalid IL or missing references)
		//IL_056e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0570: Unknown result type (might be due to invalid IL or missing references)
		//IL_1119: Unknown result type (might be due to invalid IL or missing references)
		//IL_06f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0582: Unknown result type (might be due to invalid IL or missing references)
		//IL_0689: Unknown result type (might be due to invalid IL or missing references)
		//IL_069d: Unknown result type (might be due to invalid IL or missing references)
		//IL_1122: Unknown result type (might be due to invalid IL or missing references)
		//IL_159d: Unknown result type (might be due to invalid IL or missing references)
		//IL_15a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_15a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e13: Unknown result type (might be due to invalid IL or missing references)
		//IL_1131: Unknown result type (might be due to invalid IL or missing references)
		//IL_113e: Unknown result type (might be due to invalid IL or missing references)
		//IL_114c: Unknown result type (might be due to invalid IL or missing references)
		//IL_115d: Unknown result type (might be due to invalid IL or missing references)
		//IL_15af: Unknown result type (might be due to invalid IL or missing references)
		//IL_0729: Unknown result type (might be due to invalid IL or missing references)
		//IL_0733: Unknown result type (might be due to invalid IL or missing references)
		//IL_0738: Unknown result type (might be due to invalid IL or missing references)
		//IL_0eb6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e5c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fb6: Unknown result type (might be due to invalid IL or missing references)
		//IL_15cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_07fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_1059: Unknown result type (might be due to invalid IL or missing references)
		//IL_1060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fff: Unknown result type (might be due to invalid IL or missing references)
		//IL_1277: Unknown result type (might be due to invalid IL or missing references)
		//IL_1285: Unknown result type (might be due to invalid IL or missing references)
		//IL_1ae2: Unknown result type (might be due to invalid IL or missing references)
		//IL_1ae7: Unknown result type (might be due to invalid IL or missing references)
		//IL_1aea: Unknown result type (might be due to invalid IL or missing references)
		//IL_1af4: Unknown result type (might be due to invalid IL or missing references)
		//IL_1afe: Unknown result type (might be due to invalid IL or missing references)
		//IL_1b1a: Unknown result type (might be due to invalid IL or missing references)
		//IL_1be7: Unknown result type (might be due to invalid IL or missing references)
		//IL_1b9c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1f8e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1f94: Invalid comparison between Unknown and I4
		//IL_1d2e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1d34: Invalid comparison between Unknown and I4
		//IL_1fd6: Unknown result type (might be due to invalid IL or missing references)
		//IL_1fdc: Invalid comparison between Unknown and I4
		//IL_1d85: Unknown result type (might be due to invalid IL or missing references)
		//IL_1d8b: Invalid comparison between Unknown and I4
		//IL_2077: Unknown result type (might be due to invalid IL or missing references)
		//IL_207d: Invalid comparison between Unknown and I4
		//IL_1e3e: Unknown result type (might be due to invalid IL or missing references)
		//IL_1e44: Invalid comparison between Unknown and I4
		//IL_20bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_20c5: Invalid comparison between Unknown and I4
		//IL_1e95: Unknown result type (might be due to invalid IL or missing references)
		//IL_1e9b: Invalid comparison between Unknown and I4
		Dictionary<int, Dictionary<int, float>> dictionary = new Dictionary<int, Dictionary<int, float>>();
		Dictionary<int, Dictionary<int, float>> dictionary2 = new Dictionary<int, Dictionary<int, float>>();
		Dictionary<int, Dictionary<int, long>> dictionary3 = new Dictionary<int, Dictionary<int, long>>();
		Dictionary<int, Dictionary<int, long>> dictionary4 = new Dictionary<int, Dictionary<int, long>>();
		PlanetProduce = new Dictionary<int, Dictionary<int, long[]>>();
		productIndices = new Dictionary<int, Dictionary<int, int>>();
		SumProduce = new Dictionary<int, long[]>();
		powerenergyinfoshow = new Dictionary<int, long[]>();
		sumpowerinfoshow = new long[6];
		StarData[] stars = GameMain.galaxy.stars;
		foreach (StarData val in stars)
		{
			PlanetData[] planets = val.planets;
			foreach (PlanetData val2 in planets)
			{
				if (val2.factory == null)
				{
					continue;
				}
				FactoryProductionStat val3 = GameMain.data.statistics.production.factoryStatPool[val2.factory.index];
				if (val3 == null)
				{
					continue;
				}
				productIndices[val2.id] = new Dictionary<int, int>();
				dictionary[val2.id] = new Dictionary<int, float>();
				dictionary2[val2.id] = new Dictionary<int, float>();
				dictionary3[val2.id] = new Dictionary<int, long>();
				dictionary4[val2.id] = new Dictionary<int, long>();
				PlanetProduce[val2.id] = new Dictionary<int, long[]>();
				powerenergyinfoshow[val2.id] = new long[6];
				for (int k = 1; k < val3.productCursor; k++)
				{
					if (!productIndices[val2.id].ContainsKey(k))
					{
						foreach (ItemProto item in ItemList)
						{
							if (k == val3.productIndices[((Proto)item).ID])
							{
								productIndices[val2.id].Add(k, ((Proto)item).ID);
								break;
							}
						}
					}
					if (!productIndices[val2.id].ContainsKey(k))
					{
						continue;
					}
					int key = productIndices[val2.id][k];
					if (PlanetorSum || RefreshPlanetinfo)
					{
						if (!PlanetProduce[val2.id].ContainsKey(key))
						{
							PlanetProduce[val2.id].Add(key, new long[10]);
						}
						PlanetProduce[val2.id][key][0] += val3.productPool[k].total[1];
						PlanetProduce[val2.id][key][1] += val3.productPool[k].total[8];
					}
					else
					{
						if (!SumProduce.ContainsKey(key))
						{
							SumProduce[key] = new long[10];
						}
						SumProduce[key][0] += val3.productPool[k].total[1];
						SumProduce[key][1] += val3.productPool[k].total[8];
					}
				}
				FactorySystem factorySystem = val2.factory.factorySystem;
				MinerComponent[] minerPool = factorySystem.minerPool;
				foreach (MinerComponent val4 in minerPool)
				{
					if (val4.id <= 0 || val4.entityId <= 0)
					{
						continue;
					}
					if ((int)val4.type == 1 && val2.waterItemId > 0)
					{
						if (!dictionary[val2.id].ContainsKey(val2.waterItemId))
						{
							dictionary[val2.id][val2.waterItemId] = 0f;
						}
						if (!dictionary4[val2.id].ContainsKey(val2.waterItemId))
						{
							dictionary4[val2.id][val2.waterItemId] = 0L;
						}
						dictionary[val2.id][val2.waterItemId] += (long)(50f * GameMain.history.miningSpeedScale);
						dictionary4[val2.id][val2.waterItemId]++;
					}
					else if ((int)val4.type == 2 && val4.veinCount > 0)
					{
						int key2 = 0;
						for (int m = 0; m < val4.veins.Length; m++)
						{
							if (val4.veins[m] != 0 && val4.veins[m] < factorySystem.factory.veinPool.Length)
							{
								VeinData val5 = factorySystem.factory.veinPool[val4.veins[m]];
								if (val5.productId != 0)
								{
									key2 = val5.productId;
									break;
								}
							}
						}
						if (!dictionary[val2.id].ContainsKey(key2))
						{
							dictionary[val2.id][key2] = 0f;
						}
						if (!dictionary4[val2.id].ContainsKey(key2))
						{
							dictionary4[val2.id][key2] = 0L;
						}
						dictionary4[val2.id][key2]++;
						bool flag = val2.factory.entityPool[val4.entityId].stationId > 0;
						dictionary[val2.id][key2] += (long)((float)(30 * ((!flag) ? 1 : 2) * val4.veinCount) * GameMain.history.miningSpeedScale * (float)val4.speed) / 10000;
					}
					else
					{
						if ((int)val4.type != 3 || val4.veinCount <= 0)
						{
							continue;
						}
						for (int n = 0; n < val4.veins.Length; n++)
						{
							if (val4.veins[n] != 0 && val4.veins[n] < factorySystem.factory.veinPool.Length)
							{
								VeinData val6 = factorySystem.factory.veinPool[val4.veins[n]];
								if (!dictionary[val2.id].ContainsKey(1007))
								{
									dictionary[val2.id][1007] = 0f;
								}
								if (!dictionary4[val2.id].ContainsKey(1007))
								{
									dictionary4[val2.id][1007] = 0L;
								}
								dictionary4[val2.id][1007]++;
								dictionary[val2.id][1007] += (long)((float)val6.amount * GameMain.history.miningSpeedScale * VeinData.oilSpeedMultiplier * 60f);
								break;
							}
						}
					}
				}
				FractionatorComponent[] fractionatorPool = factorySystem.fractionatorPool;
				for (int num = 0; num < fractionatorPool.Length; num++)
				{
					FractionatorComponent val7 = fractionatorPool[num];
					if (val7.id > 0 && val7.entityId > 0)
					{
						if (!dictionary[val2.id].ContainsKey(1121))
						{
							dictionary[val2.id][1121] = 0f;
						}
						if (!dictionary2[val2.id].ContainsKey(1120))
						{
							dictionary2[val2.id][1120] = 0f;
						}
						if (!dictionary4[val2.id].ContainsKey(1121))
						{
							dictionary4[val2.id][1121] = 0L;
						}
						if (!dictionary3[val2.id].ContainsKey(1120))
						{
							dictionary3[val2.id][1120] = 0L;
						}
						dictionary4[val2.id][1121]++;
						dictionary3[val2.id][1120]++;
						float num2 = Mathf.Clamp(Mathf.Min(val7.fluidInputCargoCount, 30f) * (float)(int)((double)val7.fluidInputCount / (double)val7.fluidInputCargoCount + 0.5) * 60f, 0f, 7200f) * (1f + ((FractionatorComponent)(ref val7)).extraIncProduceProb) / 100f;
						dictionary[val2.id][1121] += num2;
						dictionary2[val2.id][1120] += num2;
					}
				}
				SiloComponent[] siloPool = factorySystem.siloPool;
				foreach (SiloComponent val8 in siloPool)
				{
					if (val8.id > 0 && val8.entityId > 0)
					{
						if (!dictionary2[val2.id].ContainsKey(1503))
						{
							dictionary2[val2.id][1503] = 0f;
						}
						if (!dictionary3[val2.id].ContainsKey(1503))
						{
							dictionary3[val2.id][1503] = 0L;
						}
						dictionary3[val2.id][1503]++;
						dictionary2[val2.id][1503] += 5f;
					}
				}
				EjectorComponent[] ejectorPool = factorySystem.ejectorPool;
				foreach (EjectorComponent val9 in ejectorPool)
				{
					if (val9.id > 0 && val9.entityId > 0)
					{
						if (!dictionary2[val2.id].ContainsKey(1501))
						{
							dictionary2[val2.id][1501] = 0f;
						}
						if (!dictionary3[val2.id].ContainsKey(1501))
						{
							dictionary3[val2.id][1501] = 0L;
						}
						dictionary3[val2.id][1501]++;
						dictionary2[val2.id][1501] += 20f;
					}
				}
				AssemblerComponent[] assemblerPool = factorySystem.assemblerPool;
				foreach (AssemblerComponent val10 in assemblerPool)
				{
					RecipeProto val11;
					if (val10.id <= 0 || val10.entityId <= 0 || (val11 = ((ProtoSet<RecipeProto>)(object)LDB.recipes).Select(val10.recipeId)) == null)
					{
						continue;
					}
					for (int num6 = 0; num6 < val11.Items.Length; num6++)
					{
						if (!dictionary2[val2.id].ContainsKey(val11.Items[num6]))
						{
							dictionary2[val2.id].Add(val11.Items[num6], 0f);
						}
						if (!dictionary3[val2.id].ContainsKey(val11.Items[num6]))
						{
							dictionary3[val2.id][val11.Items[num6]] = 0L;
						}
						dictionary3[val2.id][val11.Items[num6]]++;
						if (val10.extraSpeed == 0)
						{
							dictionary2[val2.id][val11.Items[num6]] += (float)val11.ItemCounts[num6] * 9f * (float)val10.speedOverride / ((float)val11.TimeSpend * 25f);
						}
						else
						{
							dictionary2[val2.id][val11.Items[num6]] += (float)val11.ItemCounts[num6] * 9f * (float)val10.speed / ((float)val11.TimeSpend * 25f);
						}
					}
					for (int num7 = 0; num7 < val11.Results.Length; num7++)
					{
						if (!dictionary[val2.id].ContainsKey(val11.Results[num7]))
						{
							dictionary[val2.id].Add(val11.Results[num7], 0f);
						}
						if (!dictionary4[val2.id].ContainsKey(val11.Results[num7]))
						{
							dictionary4[val2.id][val11.Results[num7]] = 0L;
						}
						dictionary4[val2.id][val11.Results[num7]]++;
						if (val10.extraSpeed == 0)
						{
							dictionary[val2.id][val11.Results[num7]] += (float)val11.ResultCounts[num7] * 9f * (float)val10.speedOverride / ((float)val11.TimeSpend * 25f);
						}
						else
						{
							dictionary[val2.id][val11.Results[num7]] += (float)val11.ResultCounts[num7] * 9f * (float)(val10.speed + val10.extraSpeed / 10) / ((float)val11.TimeSpend * 25f);
						}
					}
				}
				LabComponent[] labPool = factorySystem.labPool;
				foreach (LabComponent val12 in labPool)
				{
					RecipeProto val13;
					if (val12.id <= 0 || val12.entityId <= 0 || (val13 = ((ProtoSet<RecipeProto>)(object)LDB.recipes).Select(val12.recipeId)) == null)
					{
						continue;
					}
					bool flag2 = val12.productive && !val12.forceAccMode;
					int num9 = (int)((float)val12.speedOverride * (1f + (float)val12.extraSpeed * 0.1f / (float)val12.speedOverride) * 3600f / (float)val12.timeSpend);
					for (int num10 = 0; num10 < val13.Items.Length; num10++)
					{
						if (!dictionary2[val2.id].ContainsKey(val13.Items[num10]))
						{
							dictionary2[val2.id].Add(val13.Items[num10], 0f);
						}
						if (!dictionary3[val2.id].ContainsKey(val13.Items[num10]))
						{
							dictionary3[val2.id][val13.Items[num10]] = 0L;
						}
						dictionary3[val2.id][val13.Items[num10]]++;
						if (flag2)
						{
							dictionary2[val2.id][val13.Items[num10]] += (float)(val13.ItemCounts[num10] * num9) * 1f / (1f + (float)val12.extraSpeed * 1f / ((float)val12.speed * 10f));
						}
						else
						{
							dictionary2[val2.id][val13.Items[num10]] += val13.ItemCounts[num10] * num9;
						}
					}
					for (int num11 = 0; num11 < val13.Results.Length; num11++)
					{
						if (!dictionary[val2.id].ContainsKey(val13.Results[num11]))
						{
							dictionary[val2.id].Add(val13.Results[num11], 0f);
						}
						if (!dictionary4[val2.id].ContainsKey(val13.Results[num11]))
						{
							dictionary4[val2.id][val13.Results[num11]] = 0L;
						}
						dictionary4[val2.id][val13.Results[num11]]++;
						dictionary[val2.id][val13.Results[num11]] += num9;
					}
				}
				float num12 = 0f;
				PowerGeneratorComponent[] genPool = factorySystem.factory.powerSystem.genPool;
				for (int num13 = 0; num13 < genPool.Length; num13++)
				{
					PowerGeneratorComponent val14 = genPool[num13];
					if (val14.gamma)
					{
						float num14 = 1f - GameMain.history.solarEnergyLossRate;
						num12 += ((PowerGeneratorComponent)(ref val14)).EtaCurrent_Gamma(num14) * (float)((PowerGeneratorComponent)(ref val14)).RequiresCurrent_Gamma(num14);
						if (!dictionary4[val2.id].ContainsKey(1208))
						{
							dictionary4[val2.id][1208] = 0L;
						}
						dictionary4[val2.id][1208]++;
					}
				}
				if (num12 > 0f)
				{
					if (!dictionary[val2.id].ContainsKey(1208))
					{
						dictionary[val2.id][1208] = 0f;
					}
					dictionary[val2.id][1208] = (long)(num12 * 3f / 1000000f);
				}
				PowerExchangerComponent[] excPool = factorySystem.factory.powerSystem.excPool;
				foreach (PowerExchangerComponent val15 in excPool)
				{
					if (val15.id > 0 && val15.targetState != 0f)
					{
						int num16 = ((val15.targetState == 1f) ? 2207 : 2206);
						int key3 = 4413 - num16;
						if (!dictionary[val2.id].ContainsKey(num16))
						{
							dictionary[val2.id][num16] = 0f;
						}
						if (!dictionary4[val2.id].ContainsKey(num16))
						{
							dictionary4[val2.id][num16] = 0L;
						}
						if (!dictionary2[val2.id].ContainsKey(key3))
						{
							dictionary2[val2.id][key3] = 0f;
						}
						if (!dictionary3[val2.id].ContainsKey(key3))
						{
							dictionary3[val2.id][key3] = 0L;
						}
						dictionary4[val2.id][num16]++;
						dictionary3[val2.id][key3]++;
						dictionary[val2.id][num16] += 10f;
						dictionary2[val2.id][key3] += 10f;
					}
				}
				if (val3.powerPool != null && val3.powerPool.Length != 0)
				{
					powerenergyinfoshow[val2.id][0] = val3.powerPool[0].total[0] / 10;
					powerenergyinfoshow[val2.id][1] = val3.powerPool[1].total[0] / 10;
					powerenergyinfoshow[val2.id][2] = val3.energyConsumption;
					powerenergyinfoshow[val2.id][3] = val3.powerPool[3].total[0] / 10;
					powerenergyinfoshow[val2.id][4] = val3.powerPool[2].total[0] / 10;
					sumpowerinfoshow[0] += val3.powerPool[0].total[0] / 10;
					sumpowerinfoshow[1] += val3.powerPool[1].total[0] / 10;
					sumpowerinfoshow[2] += val3.energyConsumption;
					sumpowerinfoshow[3] = val3.powerPool[3].total[0] / 10;
					sumpowerinfoshow[4] = val3.powerPool[2].total[0] / 10;
				}
				if (factorySystem.storage != null)
				{
					if (factorySystem.storage.storagePool != null)
					{
						StorageComponent[] storagePool = factorySystem.storage.storagePool;
						foreach (StorageComponent val16 in storagePool)
						{
							if (val16 == null || val16.entityId <= 0 || val16.isEmpty)
							{
								continue;
							}
							for (int num18 = 0; num18 < val16.grids.Length; num18++)
							{
								int itemId;
								if ((itemId = val16.grids[num18].itemId) <= 0)
								{
									continue;
								}
								if (PlanetorSum || RefreshPlanetinfo)
								{
									if (!PlanetProduce[val2.id].ContainsKey(itemId))
									{
										PlanetProduce[val2.id].Add(itemId, new long[10]);
									}
									PlanetProduce[val2.id][itemId][6] += val16.grids[num18].count;
								}
								else
								{
									if (!SumProduce.ContainsKey(itemId))
									{
										SumProduce[itemId] = new long[10];
									}
									SumProduce[itemId][6] += val16.grids[num18].count;
								}
							}
						}
					}
					if (factorySystem.storage.tankPool != null)
					{
						TankComponent[] tankPool = factorySystem.storage.tankPool;
						foreach (TankComponent val17 in tankPool)
						{
							if (val17.id <= 0 || val17.fluidId <= 0 || val17.fluidCount <= 0)
							{
								continue;
							}
							int fluidId = val17.fluidId;
							if (PlanetorSum || RefreshPlanetinfo)
							{
								if (!PlanetProduce[val2.id].ContainsKey(fluidId))
								{
									PlanetProduce[val2.id].Add(fluidId, new long[10]);
								}
								PlanetProduce[val2.id][fluidId][6] += val17.fluidCount;
							}
							else
							{
								if (!SumProduce.ContainsKey(fluidId))
								{
									SumProduce[fluidId] = new long[10];
								}
								SumProduce[fluidId][6] += val17.fluidCount;
							}
						}
					}
				}
				int num20 = 0;
				StationComponent[] stationPool = factorySystem.factory.transport.stationPool;
				foreach (StationComponent val18 in stationPool)
				{
					if (val18 == null || val18.entityId <= 0)
					{
						continue;
					}
					num20++;
					for (int num22 = 0; num22 < val18.storage.Length; num22++)
					{
						int itemId2 = val18.storage[num22].itemId;
						if (itemId2 <= 0)
						{
							continue;
						}
						if (PlanetorSum || RefreshPlanetinfo)
						{
							if (!PlanetProduce[val2.id].ContainsKey(itemId2))
							{
								PlanetProduce[val2.id].Add(itemId2, new long[10]);
							}
							PlanetProduce[val2.id][itemId2][6] += val18.storage[num22].count;
							if (!RemoteorLocal)
							{
								if ((int)val18.storage[num22].localLogic == 1)
								{
									PlanetProduce[val2.id][itemId2][7] += val18.storage[num22].count;
								}
								else if ((int)val18.storage[num22].localLogic == 2)
								{
									PlanetProduce[val2.id][itemId2][8] += val18.storage[num22].count;
								}
								else
								{
									PlanetProduce[val2.id][itemId2][9] += val18.storage[num22].count;
								}
							}
							else if (RemoteorLocal && (val18.isCollector || val18.isStellar))
							{
								if ((int)val18.storage[num22].remoteLogic == 1)
								{
									PlanetProduce[val2.id][itemId2][7] += val18.storage[num22].count;
								}
								else if ((int)val18.storage[num22].remoteLogic == 2)
								{
									PlanetProduce[val2.id][itemId2][8] += val18.storage[num22].count;
								}
								else
								{
									PlanetProduce[val2.id][itemId2][9] += val18.storage[num22].count;
								}
							}
							continue;
						}
						if (!SumProduce.ContainsKey(itemId2))
						{
							SumProduce[itemId2] = new long[10];
						}
						SumProduce[itemId2][6] += val18.storage[num22].count;
						if (!RemoteorLocal)
						{
							if ((int)val18.storage[num22].localLogic == 1)
							{
								SumProduce[itemId2][7] += val18.storage[num22].count;
							}
							else if ((int)val18.storage[num22].localLogic == 2)
							{
								SumProduce[itemId2][8] += val18.storage[num22].count;
							}
							else
							{
								SumProduce[itemId2][9] += val18.storage[num22].count;
							}
						}
						else if (RemoteorLocal && (val18.isCollector || val18.isStellar))
						{
							if ((int)val18.storage[num22].remoteLogic == 1)
							{
								SumProduce[itemId2][7] += val18.storage[num22].count;
							}
							else if ((int)val18.storage[num22].remoteLogic == 2)
							{
								SumProduce[itemId2][8] += val18.storage[num22].count;
							}
							else
							{
								SumProduce[itemId2][9] += val18.storage[num22].count;
							}
						}
					}
					float miningSpeedScale = GameMain.history.miningSpeedScale;
					int id = val2.id;
					string text = factorySystem.factory.ReadExtraInfoOnEntity(val18.entityId);
					if (string.IsNullOrEmpty(text) && val18.isStellar && (text.Equals("Station_miner") || text.Equals("星球矿机")))
					{
						for (int num23 = 0; num23 < 5; num23++)
						{
							int itemId3 = val18.storage[num23].itemId;
							if (itemId3 > 0)
							{
								if (!dictionary.ContainsKey(id))
								{
									dictionary[id] = new Dictionary<int, float>();
								}
								if (!dictionary[id].ContainsKey(itemId3))
								{
									dictionary[id][itemId3] = 0f;
								}
								if (!dictionary4.ContainsKey(id))
								{
									dictionary4[id] = new Dictionary<int, long>();
								}
								if (!dictionary4[id].ContainsKey(itemId3))
								{
									dictionary4[id][itemId3] = 0L;
								}
								dictionary4[id][itemId3]++;
								if (val2.waterItemId == itemId3)
								{
									dictionary[id][itemId3] += (long)(1800f * miningSpeedScale);
								}
								else
								{
									dictionary[id][itemId3] += ((itemId3 != 1007) ? ((int)((float)getVeinnumber(itemId3, id) * miningSpeedScale) / 2 * 60) : ((int)((float)getVeinnumber(itemId3, id) * miningSpeedScale) * 60));
								}
							}
						}
					}
					if (val18.collectionPerTick == null || !val18.isCollector)
					{
						continue;
					}
					PrefabDesc prefabDesc = ((ProtoSet<ItemProto>)(object)LDB.items).Select(ItemProto.stationCollectorId).prefabDesc;
					double num24 = (double)prefabDesc.workEnergyPerTick * 60.0;
					num24 /= (double)prefabDesc.stationCollectSpeed;
					double gasTotalHeat = val2.gasTotalHeat;
					float num25 = ((gasTotalHeat - num24 <= 0.0) ? 1f : ((float)(((double)miningSpeedScale * gasTotalHeat - num24) / (gasTotalHeat - num24))));
					for (int num26 = 0; num26 < val18.collectionIds.Length; num26++)
					{
						if (!dictionary[id].ContainsKey(val18.storage[num26].itemId))
						{
							dictionary[id][val18.storage[num26].itemId] = 0f;
						}
						if (!dictionary4.ContainsKey(id))
						{
							dictionary4[id] = new Dictionary<int, long>();
						}
						if (!dictionary4[id].ContainsKey(val18.storage[num26].itemId))
						{
							dictionary4[id][val18.storage[num26].itemId] = 0L;
						}
						dictionary[id][val18.storage[num26].itemId] += (long)(val18.collectionPerTick[num26] * num25 * 3600f);
						dictionary4[id][val18.storage[num26].itemId]++;
					}
				}
			}
		}
		foreach (KeyValuePair<int, Dictionary<int, float>> item2 in dictionary)
		{
			if ((PlanetorSum || RefreshPlanetinfo) && !PlanetProduce.ContainsKey(item2.Key))
			{
				PlanetProduce.Add(item2.Key, new Dictionary<int, long[]>());
			}
			foreach (KeyValuePair<int, float> item3 in item2.Value)
			{
				if (PlanetorSum || RefreshPlanetinfo)
				{
					if (!PlanetProduce[item2.Key].ContainsKey(item3.Key))
					{
						PlanetProduce[item2.Key].Add(item3.Key, new long[10]);
					}
					PlanetProduce[item2.Key][item3.Key][2] += (int)item3.Value;
				}
				else
				{
					if (!SumProduce.ContainsKey(item3.Key))
					{
						SumProduce[item3.Key] = new long[10];
					}
					SumProduce[item3.Key][2] += (long)item3.Value;
				}
			}
		}
		foreach (KeyValuePair<int, Dictionary<int, float>> item4 in dictionary2)
		{
			if ((PlanetorSum || RefreshPlanetinfo) && !PlanetProduce.ContainsKey(item4.Key))
			{
				PlanetProduce.Add(item4.Key, new Dictionary<int, long[]>());
			}
			foreach (KeyValuePair<int, float> item5 in item4.Value)
			{
				if (PlanetorSum || RefreshPlanetinfo)
				{
					if (!PlanetProduce[item4.Key].ContainsKey(item5.Key))
					{
						PlanetProduce[item4.Key].Add(item5.Key, new long[10]);
					}
					PlanetProduce[item4.Key][item5.Key][3] += (long)item5.Value;
				}
				else
				{
					if (!SumProduce.ContainsKey(item5.Key))
					{
						SumProduce[item5.Key] = new long[10];