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.Security; using System.Security.Permissions; using System.Text; using System.Threading; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("PlanetFinder")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("PlanetFinder")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("43cacced-1c08-475c-80c9-8a77158a4bd9")] [assembly: AssemblyFileVersion("1.2.6.0")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.2.6.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace PlanetFinder { public static class PluginInfo { public const string PLUGIN_GUID = "PlanetFinder"; public const string PLUGIN_NAME = "PlanetFinder"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace PlanetFinderMod { public class CruiseAssistIntg { public MethodInfo _selectPlanetOrStar; public MethodInfo _selectPlanetOrStar_CAAP_N; public readonly bool canSelectPlanet; public CruiseAssistIntg() { canSelectPlanet = false; _selectPlanetOrStar = null; _selectPlanetOrStar_CAAP_N = null; try { Dictionary pluginInfos = Chainloader.PluginInfos; if (pluginInfos.TryGetValue("tanu.CruiseAssist", out var value) && (Object)(object)value.Instance != (Object)null) { Type type = ((object)value.Instance).GetType().Assembly.GetType("tanu.CruiseAssist.CruiseAssistStarListUI"); _selectPlanetOrStar = type.GetMethod("SelectStar", new Type[2] { typeof(StarData), typeof(PlanetData) }); canSelectPlanet = _selectPlanetOrStar != null; } else if (pluginInfos.TryGetValue("nord.CruiseAssist", out value) && (Object)(object)value.Instance != (Object)null) { Type type2 = ((object)value.Instance).GetType().Assembly.GetType("tanu.CruiseAssist.CruiseAssistStarListUI"); _selectPlanetOrStar_CAAP_N = type2.GetMethod("SelectStar", new Type[3] { typeof(StarData), typeof(PlanetData), typeof(bool) }); canSelectPlanet = _selectPlanetOrStar_CAAP_N != null; } } catch (Exception) { } } public void SelectPlanetOrStar(PlanetData planet, StarData star = null) { if (!(_selectPlanetOrStar == null) || !(_selectPlanetOrStar_CAAP_N == null)) { if (planet != null && star == null) { star = planet.star; } if (_selectPlanetOrStar != null && (planet != null || star != null)) { object[] parameters = new object[2] { star, planet }; _selectPlanetOrStar.Invoke(null, parameters); } else if (_selectPlanetOrStar_CAAP_N != null && (planet != null || star != null)) { object[] parameters2 = new object[3] { star, planet, true }; _selectPlanetOrStar_CAAP_N.Invoke(null, parameters2); } } } } public class DSPStarMapMemoIntg { public readonly bool canGetSignalIconId; public readonly bool canGetDesc; private FieldInfo _memoPool; private FieldInfo _signalIconIdField; private FieldInfo _descField; public DSPStarMapMemoIntg() { canGetSignalIconId = false; canGetDesc = false; try { if (Chainloader.PluginInfos.TryGetValue("Appun.DSP.plugin.StarMapMemo", out var value) && (Object)(object)value.Instance != (Object)null) { Type type = ((object)value.Instance).GetType().Assembly.GetType("DSPStarMapMemo.MemoPool"); Type type2 = ((object)value.Instance).GetType().Assembly.GetType("DSPStarMapMemo.MemoPool+Memo"); if (type != null && type2 != null) { _signalIconIdField = type2.GetField("signalIconId"); _descField = type2.GetField("desc"); _memoPool = type.GetField("memoPool", BindingFlags.Static | BindingFlags.Public); } canGetSignalIconId = _memoPool != null && _signalIconIdField != null; canGetDesc = _memoPool != null && _descField != null; } } catch (Exception) { } } public int GetSignalIconId(int planetId) { if (_memoPool != null && _signalIconIdField != null) { object value = _memoPool.GetValue(null); if (value == null) { return 0; } object[] array = new object[2] { planetId, null }; if ((bool)value.GetType().InvokeMember("TryGetValue", BindingFlags.InvokeMethod, null, value, array) && array.Length == 2 && array[1] != null) { object value2 = _signalIconIdField.GetValue(array[1]); if (value2 != null) { int[] array2 = value2 as int[]; for (int i = 0; i < array2.Length; i++) { if (array2[i] != 0) { return array2[i]; } } } } } return 0; } public string GetDesc(int planetId) { if (_memoPool != null && _descField != null) { object value = _memoPool.GetValue(null); if (value == null) { return null; } object[] array = new object[2] { planetId, null }; if ((bool)value.GetType().InvokeMember("TryGetValue", BindingFlags.InvokeMethod, null, value, array) && array.Length == 2 && array[1] != null) { object value2 = _descField.GetValue(array[1]); if (value2 != null) { return value2 as string; } } } return null; } } public class LSTMIntg { public MethodInfo _openPlanetId; public readonly bool canOpenPlanetId; public LSTMIntg() { canOpenPlanetId = false; _openPlanetId = null; try { if (Chainloader.PluginInfos.TryGetValue("com.hetima.dsp.LSTM", out var value) && (Object)(object)value.Instance != (Object)null) { _openPlanetId = ((object)value.Instance).GetType().GetMethod("IntegrationOpenPlanetId", new Type[1] { typeof(int) }); canOpenPlanetId = _openPlanetId != null; } } catch (Exception) { } } public void OpenPlanetId(int planetId) { if (_openPlanetId != null) { object[] parameters = new object[1] { planetId }; _openPlanetId.Invoke(null, parameters); } } } public class MyCheckBox : MonoBehaviour { public UIButton uiButton; public Image checkImage; public RectTransform rectTrans; public Text labelText; public ConfigEntry config; public static RectTransform CreateCheckBox(ConfigEntry config, string label = "", int fontSize = 17) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(((Component)UIRoot.instance.uiGame.buildMenu.uxFacilityCheck).gameObject); ((Object)val).name = "my-checkbox"; MyCheckBox cb = val.AddComponent(); cb.config = config; Transform transform = val.transform; RectTransform val2 = (RectTransform)(object)((transform is RectTransform) ? transform : null); cb.rectTrans = val2; ResetAnchor(val2); val2.anchoredPosition3D = new Vector3(0f, 0f, 0f); cb.uiButton = val.GetComponent(); MyCheckBox myCheckBox = cb; Transform obj = val.transform.Find("checked"); myCheckBox.checkImage = ((obj != null) ? ((Component)obj).GetComponent() : null); Transform val3 = val.transform.Find("text"); if ((Object)(object)val3 != (Object)null) { Object.DestroyImmediate((Object)(object)((Component)val3).GetComponent()); cb.labelText = ((Component)val3).GetComponent(); cb.labelText.fontSize = fontSize; cb.SetLabelText(label); } cb.uiButton.onClick += cb.OnClick; cb.SettingChanged(); config.SettingChanged += delegate { cb.SettingChanged(); }; return cb.rectTrans; static void ResetAnchor(RectTransform rect_) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) rect_.anchorMax = Vector2.zero; rect_.anchorMin = Vector2.zero; } } public void SetLabelText(string val) { if ((Object)(object)labelText != (Object)null) { labelText.text = val; } } public void SettingChanged() { if (config.Value != ((Behaviour)checkImage).enabled) { ((Behaviour)checkImage).enabled = config.Value; } } public void OnClick(int obj) { config.Value = !config.Value; } } public class MyKeyBinder : MonoBehaviour { public ConfigEntry config; [SerializeField] public Text functionText; [SerializeField] public Text keyText; [SerializeField] public InputField setTheKeyInput; [SerializeField] public Toggle setTheKeyToggle; [SerializeField] public RectTransform rectTrans; [SerializeField] public UIButton inputUIButton; [SerializeField] public Text conflictText; [SerializeField] public Text waitingText; [SerializeField] public UIButton setDefaultUIButton; [SerializeField] public UIButton setNoneKeyUIButton; private bool nextNotOn; private KeyCode _lastKey; private static KeyCode[] modKeys; public static RectTransform CreateKeyBinder(ConfigEntry config, string label = "") { //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) UIKeyEntry val = Object.Instantiate(UIRoot.instance.optionWindow.entryPrefab); ((Component)val).gameObject.SetActive(true); GameObject gameObject = ((Component)val).gameObject; ((Object)gameObject).name = "my-keybinder"; MyKeyBinder kb = gameObject.AddComponent(); kb.config = config; kb.functionText = val.functionText; kb.keyText = val.keyText; kb.setTheKeyInput = val.setTheKeyInput; kb.setTheKeyToggle = val.setTheKeyToggle; kb.rectTrans = val.rectTrans; kb.inputUIButton = val.inputUIButton; kb.conflictText = val.conflictText; kb.waitingText = val.waitingText; kb.setDefaultUIButton = val.setDefaultUIButton; kb.setNoneKeyUIButton = val.setNoneKeyUIButton; kb.functionText.text = label; kb.functionText.fontSize = 17; Transform transform = ((Component)kb.keyText).transform; ((RectTransform)((transform is RectTransform) ? transform : null)).anchoredPosition = new Vector2(20f, -22f); kb.keyText.fontSize = 17; Transform transform2 = ((Component)((Component)kb.inputUIButton).transform.parent).transform; ((RectTransform)((transform2 is RectTransform) ? transform2 : null)).anchoredPosition = new Vector2(20f, -52f); Transform transform3 = ((Component)kb.setDefaultUIButton).transform; ((RectTransform)((transform3 is RectTransform) ? transform3 : null)).anchoredPosition = new Vector2(160f, -52f); Transform transform4 = ((Component)kb.setNoneKeyUIButton).transform; ((RectTransform)((transform4 is RectTransform) ? transform4 : null)).anchoredPosition = new Vector2(260f, -52f); Transform transform5 = gameObject.transform; Transform obj = ((transform5 is RectTransform) ? transform5 : null); ResetAnchor((RectTransform)(object)obj); Object.Destroy((Object)(object)val); ((Component)kb.setNoneKeyUIButton).gameObject.SetActive(false); kb.SettingChanged(); config.SettingChanged += delegate { kb.SettingChanged(); }; kb.inputUIButton.onClick += kb.OnInputUIButtonClick; kb.setDefaultUIButton.onClick += kb.OnSetDefaultKeyClick; return (RectTransform)(object)obj; static void ResetAnchor(RectTransform rect_) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) rect_.anchorMax = Vector2.zero; rect_.anchorMin = Vector2.zero; } } private void Update() { if (!setTheKeyToggle.isOn && inputUIButton.highlighted) { setTheKeyToggle.isOn = true; } if (!setTheKeyToggle.isOn) { return; } if (!inputUIButton._isPointerEnter && Input.GetKeyDown((KeyCode)323)) { inputUIButton.highlighted = false; setTheKeyToggle.isOn = false; Reset(); return; } if (!inputUIButton.highlighted) { setTheKeyToggle.isOn = false; Reset(); return; } ((Component)waitingText).gameObject.SetActive(true); if (TrySetValue()) { setTheKeyToggle.isOn = false; inputUIButton.highlighted = false; Reset(); } } public bool TrySetValue() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKey((KeyCode)27)) { VFInput.UseEscape(); return true; } if (Input.GetKey((KeyCode)323) || Input.GetKey((KeyCode)324)) { return true; } if (!GetIunptKeys() && (int)_lastKey != 0) { string pressedKey = GetPressedKey(); if (string.IsNullOrEmpty(pressedKey)) { return false; } _lastKey = (KeyCode)0; config.Value = KeyboardShortcut.Deserialize(pressedKey); return true; } return false; } public string GetPressedKey() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) string text = ((object)(KeyCode)(ref _lastKey)).ToString(); if (string.IsNullOrEmpty(text)) { return null; } string text2 = ""; KeyCode[] array = modKeys; for (int i = 0; i < array.Length; i++) { KeyCode val = array[i]; if (Input.GetKey(val)) { text2 = text2 + "+" + ((object)(KeyCode)(ref val)).ToString(); } } if (!string.IsNullOrEmpty(text2)) { text += text2; } return text; } public bool GetIunptKeys() { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) bool result = false; new List(); foreach (KeyCode value in Enum.GetValues(typeof(KeyCode))) { if ((int)value != 0 && !modKeys.Contains(value) && Input.GetKey(value)) { _lastKey = value; result = true; } } return result; } public void Reset() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) ((Component)conflictText).gameObject.SetActive(false); ((Component)waitingText).gameObject.SetActive(false); ((Selectable)setDefaultUIButton.button).Select(); _lastKey = (KeyCode)0; } public void OnInputUIButtonClick(int data) { inputUIButton.highlighted = true; if (nextNotOn) { nextNotOn = false; inputUIButton.highlighted = false; setTheKeyToggle.isOn = false; ((Component)waitingText).gameObject.SetActive(false); } } public void OnSetDefaultKeyClick(int data) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) config.Value = (KeyboardShortcut)((ConfigEntryBase)config).DefaultValue; Text obj = keyText; KeyboardShortcut value = config.Value; obj.text = ((KeyboardShortcut)(ref value)).Serialize(); } public void OnSetNoneKeyClick(int data) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) config.Value = (KeyboardShortcut)((ConfigEntryBase)config).DefaultValue; Text obj = keyText; KeyboardShortcut value = config.Value; obj.text = ((KeyboardShortcut)(ref value)).Serialize(); } public void SettingChanged() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) Text obj = keyText; KeyboardShortcut value = config.Value; obj.text = ((KeyboardShortcut)(ref value)).Serialize(); } static MyKeyBinder() { KeyCode[] array = new KeyCode[12]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); modKeys = (KeyCode[])(object)array; } } public class MyListView : MonoBehaviour { public RecyclingListView recyclingListView; public ScrollRect m_ScrollRect; public static MyListView CreateListView(MonoBehaviour preFab, RecyclingListView.ItemDelegate dlgt, string goName = "", Transform parent = null, float vsWidth = 16f) { //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(((Component)UIRoot.instance.uiGame.tutorialWindow.entryList).gameObject); if ((Object)(object)parent != (Object)null) { val.transform.SetParent(parent, false); } if (!string.IsNullOrEmpty(goName)) { ((Object)val).name = goName; } UIListView component = val.GetComponent(); GameObject gameObject = ((Component)component.m_ContentPanel).gameObject; MyListView myListView = val.AddComponent(); myListView.recyclingListView = gameObject.AddComponent(); Object.Destroy((Object)(object)gameObject.transform.GetChild(0)); gameObject.transform.DetachChildren(); myListView.recyclingListView.ChildPrefab = preFab; myListView.recyclingListView.ItemCallback = dlgt; myListView.m_ScrollRect = component.m_ScrollRect; myListView.recyclingListView.scrollRect = myListView.m_ScrollRect; ((Component)myListView.recyclingListView.scrollRect.horizontalScrollbar).gameObject.SetActive(false); ((Component)myListView.recyclingListView.scrollRect.verticalScrollbar).gameObject.SetActive(true); myListView.recyclingListView.scrollRect.vertical = true; myListView.recyclingListView.scrollRect.horizontal = false; myListView.recyclingListView.RowPadding = 4f; Image component2 = ((Component)myListView.recyclingListView.scrollRect.verticalScrollbar).GetComponent(); if ((Object)(object)component2 != (Object)null) { ((Graphic)component2).color = new Color(0f, 0f, 0f, 0.62f); } Transform transform = ((Component)myListView.recyclingListView.scrollRect.verticalScrollbar).transform; Transform obj = ((transform is RectTransform) ? transform : null); ((RectTransform)obj).anchorMin = new Vector2(1f, 0f); ((RectTransform)obj).anchorMax = new Vector2(1f, 1f); ((RectTransform)obj).sizeDelta = new Vector2(16f, 0f); Object.Destroy((Object)(object)component.m_ContentPanel); Object.Destroy((Object)(object)component); myListView.m_ScrollRect.content.sizeDelta = new Vector2(640f, 0f); return myListView; } public void Clear() { recyclingListView.Clear(); } public void SetItemCount(int num) { recyclingListView.RowCount = num; } } public class MySlider : MonoBehaviour { public Slider slider; public RectTransform rectTrans; public Text labelText; public string labelFormat; public ConfigEntry config; private bool _sliderEventLock; public static RectTransform CreateSlider(ConfigEntry config, float minValue, float maxValue, string format = "0", float width = 0f) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(((Component)UIRoot.instance.optionWindow.audioVolumeComp).gameObject); ((Object)val).name = "my-slider"; val.SetActive(true); MySlider sl = val.AddComponent(); sl.config = config; Transform transform = val.transform; RectTransform val2 = (RectTransform)(object)((transform is RectTransform) ? transform : null); sl.rectTrans = val2; ResetAnchor(val2); if (width > 0f) { val2.sizeDelta = new Vector2(width, val2.sizeDelta.y); } sl.slider = val.GetComponent(); sl.slider.minValue = minValue; sl.slider.maxValue = maxValue; ((UnityEventBase)sl.slider.onValueChanged).RemoveAllListeners(); ((UnityEvent)(object)sl.slider.onValueChanged).AddListener((UnityAction)sl.SliderChanged); MySlider mySlider = sl; Slider obj = sl.slider; object obj2; if (obj == null) { obj2 = null; } else { RectTransform handleRect = obj.handleRect; if (handleRect == null) { obj2 = null; } else { Transform obj3 = ((Transform)handleRect).Find("Text"); obj2 = ((obj3 != null) ? ((Component)obj3).GetComponent() : null); } } mySlider.labelText = (Text)obj2; if ((Object)(object)sl.labelText != (Object)null) { sl.labelText.fontSize = 14; Transform transform2 = ((Component)sl.labelText).transform; ((RectTransform)((transform2 is RectTransform) ? transform2 : null)).sizeDelta = new Vector2(22f, 22f); } sl.labelFormat = format; Transform obj4 = ((Component)sl.slider).transform.Find("Background"); Image val3 = ((obj4 != null) ? ((Component)obj4).GetComponent() : null); if ((Object)(object)val3 != (Object)null) { ((Graphic)val3).color = new Color(0.5f, 0.5f, 0.5f, 0.5f); } Image component = ((Component)sl.slider.fillRect).GetComponent(); if ((Object)(object)component != (Object)null) { ((Graphic)component).color = new Color(1f, 1f, 1f, 0.28f); } sl.SettingChanged(); sl.UpdateLabel(); config.SettingChanged += delegate { sl.SettingChanged(); }; return sl.rectTrans; static void ResetAnchor(RectTransform rect_) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) rect_.anchorMax = Vector2.zero; rect_.anchorMin = Vector2.zero; rect_.anchoredPosition3D = new Vector3(0f, 0f, 0f); } } public void SettingChanged() { if (_sliderEventLock) { return; } _sliderEventLock = true; if (config.Value != slider.value) { float num = config.Value; if (num > slider.maxValue) { num = slider.maxValue; } else if (num < slider.minValue) { num = slider.minValue; } slider.value = num; UpdateLabel(); } _sliderEventLock = false; } public void UpdateLabel() { if ((Object)(object)labelText != (Object)null) { labelText.text = config.Value.ToString(labelFormat); } } public void SliderChanged(float val) { if (!_sliderEventLock) { _sliderEventLock = true; float value = Mathf.Round(slider.value); config.Value = value; UpdateLabel(); _sliderEventLock = false; } } } public interface MyWindow { void TryClose(); bool isFunctionWindow(); } public static class MyWindowCtl { public static class Patch { [HarmonyPostfix] [HarmonyPatch(typeof(UIGame), "_OnCreate")] public static void UIGame__OnCreate_Postfix() { _created = true; } [HarmonyPostfix] [HarmonyPatch(typeof(UIGame), "_OnDestroy")] public static void UIGame__OnDestroy_Postfix() { foreach (ManualBehaviour window in _windows) { window._Destroy(); } _windows.Clear(); } [HarmonyPostfix] [HarmonyPatch(typeof(UIGame), "_OnInit")] public static void UIGame__OnInit_Postfix(UIGame __instance) { foreach (ManualBehaviour window in _windows) { window._Init(window.data); } _inited = true; } [HarmonyPostfix] [HarmonyPatch(typeof(UIGame), "_OnFree")] public static void UIGame__OnFree_Postfix() { foreach (ManualBehaviour window in _windows) { window._Free(); } } [HarmonyPostfix] [HarmonyPatch(typeof(UIGame), "_OnUpdate")] public static void UIGame__OnUpdate_Postfix() { if (GameMain.isPaused || !GameMain.isRunning) { return; } foreach (ManualBehaviour window in _windows) { window._Update(); } } [HarmonyPostfix] [HarmonyPatch(typeof(UIGame), "ShutAllFunctionWindow")] public static void UIGame_ShutAllFunctionWindow_Postfix() { foreach (ManualBehaviour window in _windows) { if (useMyWindowInterface) { if ((window as MyWindow).isFunctionWindow()) { (window as MyWindow).TryClose(); } } else { window._Close(); } } } } public static bool useMyWindowInterface = true; public static List _windows = new List(4); internal static bool _created = false; internal static bool _inited = false; public static T CreateWindow(string name, string title = "") where T : Component { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown UIInserterWindow inserterWindow = UIRoot.instance.uiGame.inserterWindow; GameObject val = Object.Instantiate(((Component)inserterWindow).gameObject, ((Component)inserterWindow).transform.parent); ((Object)val).name = name; val.SetActive(false); Object.Destroy((Object)(object)val.GetComponent()); object obj = val.AddComponent(); ManualBehaviour val2 = (ManualBehaviour)((obj is ManualBehaviour) ? obj : null); for (int i = 0; i < val.transform.childCount; i++) { GameObject gameObject = ((Component)val.transform.GetChild(i)).gameObject; if (((Object)gameObject).name == "panel-bg") { Button componentInChildren = gameObject.GetComponentInChildren