Decompiled source of FactoryMutiplier v2.2.0

FactoryMultiplier.dll

Decompiled 10 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using UnityEngine;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("FactoryMutiplier")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FactoryMutiplier")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("fc2031c0-0866-4377-acca-7189e241c495")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace FactoryMultiplier;

public class MyUI
{
	public string Title;

	public WindowFunction DrawUi;

	public readonly int WindowId = 0;

	public Rect WinRect;

	public float _width;

	public float _height;

	private readonly RectTransform _rt;

	private readonly GameObject _canvasObj;

	private bool isShown = false;

	public MyUI(WindowFunction drawUi, float width, float height, string title = "", int windowId = 0)
	{
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Expected O, but got Unknown
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0090: Expected O, but got Unknown
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		DrawUi = drawUi;
		if (windowId == 0)
		{
			windowId = Random.Range(268435456, 536870912);
		}
		WindowId = windowId;
		Title = title;
		_width = width;
		_height = height;
		_canvasObj = new GameObject("NextBlockerCanvas");
		_canvasObj.AddComponent<Canvas>().renderMode = (RenderMode)0;
		_canvasObj.AddComponent<GraphicRaycaster>();
		GameObject val = new GameObject("RayBlocker");
		_rt = val.AddComponent<RectTransform>();
		((Transform)_rt).SetParent(_canvasObj.transform);
		_rt.pivot = new Vector2(0f, 1f);
		Image val2 = val.AddComponent<Image>();
		((Graphic)val2).color = Color.clear;
		((Graphic)val2).raycastTarget = true;
		CloseBlocker();
		Object.DontDestroyOnLoad((Object)(object)_canvasObj);
	}

	public void OpenBlocker()
	{
		_canvasObj.SetActive(true);
	}

	public void CloseBlocker()
	{
		_canvasObj.SetActive(false);
	}

	public void Render(bool show)
	{
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: 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_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006c: Unknown result type (might be due to invalid IL or missing references)
		if (!show)
		{
			isShown = false;
			CloseBlocker();
			return;
		}
		if (!isShown)
		{
			isShown = true;
			WinRect = new Rect(((float)Screen.width - _width) / 2f, ((float)Screen.height - _height) / 2f, _width, _height);
			OpenBlocker();
		}
		WinRect = GUI.Window(WindowId, WinRect, DrawUi, Title);
		_rt.sizeDelta = ((Rect)(ref WinRect)).size;
		((Transform)_rt).position = new Vector3(((Rect)(ref WinRect)).position.x, (float)Screen.height - ((Rect)(ref WinRect)).position.y);
		Cursor.visible = true;
	}
}
public static class Translate
{
	private static Dictionary<string, string> TranslateDict = new Dictionary<string, string>();

	public static string getTranslate(this string s)
	{
		if (Localization.isKMG && TranslateDict.ContainsKey(s))
		{
			return TranslateDict[s];
		}
		return s;
	}

	public static void regAllTranslate()
	{
		TranslateDict.Clear();
		TranslateDict.Add("设置冶炼倍数", "Smelter Multiple");
		TranslateDict.Add("冶炼倍数更改为", "Smelt Multipe Changed To ");
		TranslateDict.Add("设置化工厂倍数", "Chemical Multiple");
		TranslateDict.Add("化工厂倍数更改为", "Chemical Multipe Changed To ");
		TranslateDict.Add("设置精炼厂倍数", "Refinery Multiple");
		TranslateDict.Add("精炼厂倍数更改为", "Refinery Multipe Changed To ");
		TranslateDict.Add("设置制造台倍数", "Assembler Multiple");
		TranslateDict.Add("制造台倍数更改为", "Assembler Multipe Changed To ");
		TranslateDict.Add("设置对撞机倍数", "Collider Multiple");
		TranslateDict.Add("对撞机倍数更改为", "Collider Multipe Changed To ");
		TranslateDict.Add("设置研究站倍数", "Lab Multiple");
		TranslateDict.Add("研究站倍数更改为", "Lab Multipe Changed To ");
		TranslateDict.Add("设置分馏器倍数", "Fractionator Multiple");
		TranslateDict.Add("分馏器倍数更改为", "Fractionator Multipe Changed To ");
		TranslateDict.Add("设置弹射器倍数", "Ejector Multiple");
		TranslateDict.Add("弹射器倍数更改为", "Ejector Multipe Changed To ");
		TranslateDict.Add("设置发射井倍数", "Silo Multiple");
		TranslateDict.Add("发射井倍数更改为", "Silo Multipe Changed To ");
		TranslateDict.Add("设置射线站倍数", "Gamma Multiple");
		TranslateDict.Add("射线站倍数更改为", "Gamma Multipe Changed To ");
		TranslateDict.Add("设置行走倍数", "WalkSpeed Multiple");
		TranslateDict.Add("行走倍数更改为", "WalkSpeed Multipe Changed To ");
		TranslateDict.Add("设置采集速度倍数", "MiningSpeed Multiple");
		TranslateDict.Add("采集速度倍数更改为", "MiningSpeed Multipe Changed To ");
	}
}
[BepInPlugin("waRNing.dsp.plugins.FactoryMultiplier", "FactoryMultiplier", "2.2.0")]
public class FactoryMultiplier : BaseUnityPlugin
{
	private static class Patch
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(Player), "GameTick")]
		private static void WalkSpeed_Tech()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			GameHistoryData history = GameMain.history;
			for (int num = 8; num > 0; num--)
			{
				if (!history.techStates[2201].unlocked)
				{
					walkspeed_tech = 0;
					break;
				}
				if (history.techStates[2200 + num].unlocked)
				{
					walkspeed_tech = num;
					break;
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Mecha), "GameTick")]
		private static void WalkSpeed_patch(Mecha __instance)
		{
			if (!Speed_set.Value)
			{
				if (walkspeed_tech == 0)
				{
					__instance.walkSpeed = Configs.freeMode.mechaWalkSpeed * (float)walkspeedMultiply.Value;
				}
				else if (walkspeed_tech >= 7)
				{
					__instance.walkSpeed = (Configs.freeMode.mechaWalkSpeed + (float)((walkspeed_tech - 6) * 2) + 6f) * (float)walkspeedMultiply.Value;
				}
				else if (walkspeed_tech < 7)
				{
					__instance.walkSpeed = (Configs.freeMode.mechaWalkSpeed + (float)walkspeed_tech) * (float)walkspeedMultiply.Value;
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(FactorySystem), "GameTick", new Type[]
		{
			typeof(long),
			typeof(bool),
			typeof(int),
			typeof(int),
			typeof(int)
		})]
		private static void MiningSpeedScale_patch()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			GameHistoryData history = GameMain.history;
			for (int num = 4; num > 0; num--)
			{
				if (history.techStates[3605].unlocked)
				{
					history.miningSpeedScale = ((float)(history.techStates[3606].curLevel - 1) / 10f + Configs.freeMode.miningSpeedScale) * (float)miningMultiply.Value;
					break;
				}
				if (!history.techStates[3601].unlocked)
				{
					history.miningSpeedScale = Configs.freeMode.miningSpeedScale * (float)miningMultiply.Value;
					break;
				}
				if (history.techStates[3600 + num].unlocked)
				{
					history.miningSpeedScale = ((float)num / 10f + Configs.freeMode.miningSpeedScale) * (float)miningMultiply.Value;
					break;
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(FactorySystem), "GameTick", new Type[]
		{
			typeof(long),
			typeof(bool),
			typeof(int),
			typeof(int),
			typeof(int)
		})]
		private static void Assembler_patch(FactorySystem __instance)
		{
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Expected I4, but got Unknown
			int num = 0;
			for (int i = 1; i < __instance.assemblerCursor; i++)
			{
				int entityId = __instance.assemblerPool[i].entityId;
				if (entityId > 0)
				{
					ItemProto val = ((ProtoSet<ItemProto>)(object)LDB.items).Select((int)__instance.factory.entityPool[entityId].protoId);
					ERecipeType recipeType = __instance.assemblerPool[i].recipeType;
					ERecipeType val2 = recipeType;
					ERecipeType val3 = val2;
					switch (val3 - 1)
					{
					case 0:
						num = smeltMultiply.Value;
						break;
					case 1:
						num = chemicalMultiply.Value;
						break;
					case 2:
						num = refineMultiply.Value;
						break;
					case 3:
						num = assembleMultiply.Value;
						break;
					case 4:
						num = particleMultiply.Value;
						break;
					default:
						continue;
					}
					__instance.assemblerPool[i].speed = num * val.prefabDesc.assemblerSpeed;
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(LabComponent), "InternalUpdateAssemble")]
		private static void Lab_patch(ref LabComponent __instance)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Invalid comparison between Unknown and I4
			if (!__instance.researchMode && __instance.recipeId > 0)
			{
				RecipeProto val = ((ProtoSet<RecipeProto>)(object)LDB.recipes).Select(__instance.recipeId);
				if (val != null && (int)val.Type == 15)
				{
					__instance.timeSpend = val.TimeSpend * 10000 / labMultiply.Value;
					__instance.extraTimeSpend = val.TimeSpend * 100000 / labMultiply.Value;
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(MechaLab), "GameTick")]
		private static void Techspeed_patch(MechaLab __instance)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			GameHistoryData history = GameMain.history;
			for (int num = 2; num > 0; num--)
			{
				if (history.techStates[3903].unlocked)
				{
					history.techSpeed = history.techStates[3904].curLevel * labMultiply.Value;
					break;
				}
				if (!history.techStates[3901].unlocked)
				{
					history.techSpeed = Configs.freeMode.techSpeed * labMultiply.Value;
					break;
				}
				if (history.techStates[3900 + num].unlocked)
				{
					history.techSpeed = (num + Configs.freeMode.techSpeed) * labMultiply.Value;
					break;
				}
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(FractionatorComponent), "InternalUpdate")]
		private static void Fractionate_patch(ref FractionatorComponent __instance)
		{
			__instance.produceProb = (float)fractionatorMultiply.Value * 0.01f;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(EjectorComponent), "InternalUpdate")]
		private static void Ejector_patch(ref EjectorComponent __instance)
		{
			ItemProto val = ((ProtoSet<ItemProto>)(object)LDB.items).Select(2311);
			__instance.chargeSpend = val.prefabDesc.ejectorChargeFrame * 10000 / ejectorMultiply.Value;
			__instance.coldSpend = val.prefabDesc.ejectorColdFrame * 10000 / ejectorMultiply.Value;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(SiloComponent), "InternalUpdate")]
		private static void Silo_patch(ref SiloComponent __instance)
		{
			ItemProto val = ((ProtoSet<ItemProto>)(object)LDB.items).Select(2312);
			__instance.chargeSpend = val.prefabDesc.siloChargeFrame * 10000 / siloMultiply.Value;
			__instance.coldSpend = val.prefabDesc.siloColdFrame * 10000 / siloMultiply.Value;
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(PowerGeneratorComponent), "GameTick_Gamma")]
		private static void Gamma_patch(ref PowerGeneratorComponent __instance)
		{
			ItemProto val = ((ProtoSet<ItemProto>)(object)LDB.items).Select(2208);
			if (__instance.gamma)
			{
				__instance.genEnergyPerTick = gammaMultiply.Value * val.prefabDesc.genEnergyPerTick;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(PowerSystem), "GameTick")]
		private static void Power_patch(PowerSystem __instance)
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Expected I4, but got Unknown
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			float num = 0f;
			for (int i = 1; i < __instance.consumerCursor; i++)
			{
				int entityId = __instance.consumerPool[i].entityId;
				if (entityId <= 0)
				{
					continue;
				}
				ItemProto val = ((ProtoSet<ItemProto>)(object)LDB.items).Select((int)__instance.factory.entityPool[entityId].protoId);
				if (val.prefabDesc.isAssembler)
				{
					ERecipeType assemblerRecipeType = val.prefabDesc.assemblerRecipeType;
					ERecipeType val2 = assemblerRecipeType;
					ERecipeType val3 = val2;
					switch (val3 - 1)
					{
					case 0:
						num = smeltMultiply.Value;
						break;
					case 1:
						num = chemicalMultiply.Value;
						break;
					case 2:
						num = refineMultiply.Value;
						break;
					case 3:
						num = assembleMultiply.Value;
						break;
					case 4:
						num = particleMultiply.Value;
						break;
					default:
						continue;
					}
				}
				else if (val.prefabDesc.isLab)
				{
					num = labMultiply.Value;
				}
				else if (val.prefabDesc.isEjector)
				{
					num = ejectorMultiply.Value;
				}
				else if (val.prefabDesc.isSilo)
				{
					num = siloMultiply.Value;
				}
				else if (val.prefabDesc.isFractionator)
				{
					num = ((fractionatorMultiply.Value != 1) ? ((float)(Math.Pow(1.055, fractionatorMultiply.Value) * (double)fractionatorMultiply.Value)) : 1f);
				}
				else
				{
					if ((int)val.prefabDesc.minerType == 0 || val.prefabDesc.minerPeriod <= 0)
					{
						continue;
					}
					num = miningMultiply.Value;
				}
				__instance.consumerPool[i].workEnergyPerTick = (long)(num * (float)val.prefabDesc.workEnergyPerTick);
			}
		}
	}

	private static int walkspeed_tech;

	private static ConfigEntry<int> walkspeedMultiply;

	private static ConfigEntry<int> miningMultiply;

	private static ConfigEntry<int> smeltMultiply;

	private static ConfigEntry<int> chemicalMultiply;

	private static ConfigEntry<int> refineMultiply;

	private static ConfigEntry<int> assembleMultiply;

	private static ConfigEntry<int> particleMultiply;

	private static ConfigEntry<int> labMultiply;

	private static ConfigEntry<int> fractionatorMultiply;

	private static ConfigEntry<int> ejectorMultiply;

	private static ConfigEntry<int> siloMultiply;

	private static ConfigEntry<int> gammaMultiply;

	private static ConfigEntry<KeyboardShortcut> mainWindowHotkey;

	private static ConfigEntry<bool> Speed_set;

	private string walkspeedmulti_str = "";

	private string smeltmulti_str = "";

	private string chemicalmulti_str = "";

	private string refinemulti_str = "";

	private string assemblemulti_str = "";

	private string particlemulti_str = "";

	private string labmulti_str = "";

	private string fractionatormulti_str = "";

	private string ejectormulti_str = "";

	private string silomulti_str = "";

	private string gammamulti_str = "";

	private string miningmulti_str = "";

	private string tempText = "";

	private bool Showwindow = false;

	private MyUI myUI;

	private void Start()
	{
		//IL_002d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0309: Unknown result type (might be due to invalid IL or missing references)
		//IL_0323: Expected O, but got Unknown
		Harmony.CreateAndPatchAll(typeof(Patch), (string)null);
		Translate.regAllTranslate();
		mainWindowHotkey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Keyboard Shortcuts", "mainWindowHotkey", KeyboardShortcut.Deserialize("R + LeftControl"), "开关窗口的热键");
		walkspeedMultiply = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "walkspeedMultiply", 1, "行走速度倍率");
		miningMultiply = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "miningMultiply", 1, "采集速度倍率");
		smeltMultiply = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "smeltMultiply", 1, "熔炉速度倍率");
		chemicalMultiply = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "chemicalMultiply", 1, "化工厂速度倍率");
		refineMultiply = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "refineMultiply", 1, "精炼速度倍率");
		assembleMultiply = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "assembleMultiply", 1, "制造台速度倍率");
		particleMultiply = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "particleMultiply", 1, "对撞机速度倍率");
		labMultiply = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "labMultiply", 1, "研究站速度倍率");
		fractionatorMultiply = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "fractionatorMultiply", 1, "分馏塔生产概率倍率");
		ejectorMultiply = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "ejectorMultiply", 1, "弹射器速度倍率");
		siloMultiply = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "siloMultiply", 1, "发射井速度倍率");
		gammaMultiply = ((BaseUnityPlugin)this).Config.Bind<int>("Config", "gammaMultiply", 1, "射线接受倍率");
		Speed_set = ((BaseUnityPlugin)this).Config.Bind<bool>("Bool Config", "Speedsetting", false, "设置行走速度");
		walkspeedmulti_str = walkspeedMultiply.Value.ToString();
		smeltmulti_str = smeltMultiply.Value.ToString();
		chemicalmulti_str = chemicalMultiply.Value.ToString();
		refinemulti_str = refineMultiply.Value.ToString();
		assemblemulti_str = assembleMultiply.Value.ToString();
		particlemulti_str = particleMultiply.Value.ToString();
		labmulti_str = labMultiply.Value.ToString();
		fractionatormulti_str = fractionatorMultiply.Value.ToString();
		ejectormulti_str = ejectorMultiply.Value.ToString();
		silomulti_str = siloMultiply.Value.ToString();
		gammamulti_str = gammaMultiply.Value.ToString();
		miningmulti_str = miningMultiply.Value.ToString();
		myUI = new MyUI(new WindowFunction(MainUI), 750f, 550f, "FactoryMultiplier");
	}

	private void Update()
	{
		ToggleWindow();
	}

	private void ToggleWindow()
	{
		//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)
		if (GameMain.isRunning && !GameMain.isPaused && !GameMain.instance.isMenuDemo)
		{
			KeyboardShortcut value = mainWindowHotkey.Value;
			if (((KeyboardShortcut)(ref value)).IsDown())
			{
				Showwindow = !Showwindow;
				tempText = "";
			}
			if (Input.GetKeyDown("escape"))
			{
				Showwindow = false;
			}
		}
	}

	private void OnGUI()
	{
		myUI.Render(Showwindow);
	}

	private void MainUI(int id)
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Unknown result type (might be due to invalid IL or missing references)
		//IL_0162: Unknown result type (might be due to invalid IL or missing references)
		//IL_018d: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_020e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0238: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0343: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0429: Unknown result type (might be due to invalid IL or missing references)
		//IL_049e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0513: Unknown result type (might be due to invalid IL or missing references)
		//IL_0588: Unknown result type (might be due to invalid IL or missing references)
		//IL_05fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0672: Unknown result type (might be due to invalid IL or missing references)
		//IL_06e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_076d: Unknown result type (might be due to invalid IL or missing references)
		//IL_07fb: Unknown result type (might be due to invalid IL or missing references)
		GUILayout.BeginArea(new Rect(0f, 20f, 750f, 550f));
		smeltmulti_str = GUI.TextField(new Rect(60f, 20f, 150f, 30f), smeltmulti_str, 1);
		chemicalmulti_str = GUI.TextField(new Rect(60f, 105f, 150f, 30f), chemicalmulti_str, 1);
		refinemulti_str = GUI.TextField(new Rect(60f, 190f, 150f, 30f), refinemulti_str, 1);
		assemblemulti_str = GUI.TextField(new Rect(60f, 275f, 150f, 30f), assemblemulti_str, 1);
		particlemulti_str = GUI.TextField(new Rect(60f, 360f, 150f, 30f), particlemulti_str, 1);
		labmulti_str = GUI.TextField(new Rect(300f, 20f, 150f, 30f), labmulti_str, 1);
		fractionatormulti_str = GUI.TextField(new Rect(300f, 105f, 150f, 30f), fractionatormulti_str, 2);
		ejectormulti_str = GUI.TextField(new Rect(300f, 190f, 150f, 30f), ejectormulti_str, 1);
		silomulti_str = GUI.TextField(new Rect(300f, 275f, 150f, 30f), silomulti_str, 1);
		gammamulti_str = GUI.TextField(new Rect(300f, 360f, 150f, 30f), gammamulti_str, 1);
		walkspeedmulti_str = GUI.TextField(new Rect(540f, 20f, 75f, 30f), walkspeedmulti_str, 2);
		miningmulti_str = GUI.TextField(new Rect(540f, 105f, 150f, 30f), miningmulti_str, 1);
		GUI.Label(new Rect(300f, 460f, 150f, 50f), tempText);
		if (GUI.Button(new Rect(60f, 55f, 150f, 30f), "设置冶炼倍数".getTranslate()))
		{
			smeltMultiply.Value = int.Parse(Regex.Replace(smeltmulti_str, "[^0-9]", ""));
			tempText = "冶炼倍数更改为".getTranslate() + smeltmulti_str + "X";
		}
		if (GUI.Button(new Rect(60f, 140f, 150f, 30f), "设置化工厂倍数".getTranslate()))
		{
			chemicalMultiply.Value = int.Parse(Regex.Replace(chemicalmulti_str, "[^0-9]", ""));
			tempText = "化工厂倍数更改为".getTranslate() + chemicalmulti_str + "X";
		}
		if (GUI.Button(new Rect(60f, 225f, 150f, 30f), "设置精炼厂倍数".getTranslate()))
		{
			refineMultiply.Value = int.Parse(Regex.Replace(refinemulti_str, "[^0-9]", ""));
			tempText = "精炼厂倍数更改为".getTranslate() + refinemulti_str + "X";
		}
		if (GUI.Button(new Rect(60f, 310f, 150f, 30f), "设置制造台倍数".getTranslate()))
		{
			assembleMultiply.Value = int.Parse(Regex.Replace(assemblemulti_str, "[^0-9]", ""));
			tempText = "制造台倍数更改为".getTranslate() + assemblemulti_str + "X";
		}
		if (GUI.Button(new Rect(60f, 395f, 150f, 30f), "设置对撞机倍数".getTranslate()))
		{
			particleMultiply.Value = int.Parse(Regex.Replace(particlemulti_str, "[^0-9]", ""));
			tempText = "对撞机倍数更改为".getTranslate() + particlemulti_str + "X";
		}
		if (GUI.Button(new Rect(300f, 55f, 150f, 30f), "设置研究站倍数".getTranslate()))
		{
			labMultiply.Value = int.Parse(Regex.Replace(labmulti_str, "[^0-9]", ""));
			tempText = "研究站倍数更改为".getTranslate() + labmulti_str + "X";
		}
		if (GUI.Button(new Rect(300f, 140f, 150f, 30f), "设置分馏器倍数".getTranslate()))
		{
			fractionatorMultiply.Value = int.Parse(Regex.Replace(fractionatormulti_str, "[^0-9]", ""));
			tempText = "分馏器倍数更改为".getTranslate() + fractionatormulti_str + "X";
		}
		if (GUI.Button(new Rect(300f, 225f, 150f, 30f), "设置弹射器倍数".getTranslate()))
		{
			ejectorMultiply.Value = int.Parse(Regex.Replace(ejectormulti_str, "[^0-9]", ""));
			tempText = "弹射器倍数更改为".getTranslate() + ejectormulti_str + "X";
		}
		if (GUI.Button(new Rect(300f, 310f, 150f, 30f), "设置发射井倍数".getTranslate()))
		{
			siloMultiply.Value = int.Parse(Regex.Replace(silomulti_str, "[^0-9]", ""));
			tempText = "发射井倍数更改为".getTranslate() + silomulti_str + "X";
		}
		if (GUI.Button(new Rect(300f, 395f, 150f, 30f), "设置射线站倍数".getTranslate()))
		{
			gammaMultiply.Value = int.Parse(Regex.Replace(gammamulti_str, "[^0-9]", ""));
			tempText = "射线站倍数更改为".getTranslate() + gammamulti_str + "X";
		}
		if (GUI.Button(new Rect(540f, 55f, 150f, 30f), "设置行走倍数".getTranslate()))
		{
			Speed_set.Value = false;
			walkspeedMultiply.Value = int.Parse(Regex.Replace(walkspeedmulti_str, "[^0-9]", ""));
			tempText = "行走倍数更改为".getTranslate() + walkspeedmulti_str + "X";
		}
		if (Speed_set.Value = GUI.Toggle(new Rect(620f, 20f, 70f, 30f), Speed_set.Value, "m/s"))
		{
			GameMain.mainPlayer.mecha.walkSpeed = float.Parse(Regex.Replace(walkspeedmulti_str, "[^0-9]", ""));
			walkspeedMultiply.Value = int.Parse(Regex.Replace(walkspeedmulti_str, "[^0-9]", ""));
		}
		if (GUI.Button(new Rect(540f, 140f, 150f, 30f), "设置采集速度倍数".getTranslate()))
		{
			miningMultiply.Value = int.Parse(Regex.Replace(miningmulti_str, "[^0-9]", ""));
			tempText = "采集速度倍数更改为".getTranslate() + miningmulti_str + "X";
		}
		GUILayout.EndArea();
		GUI.DragWindow();
	}
}