public static void _OnOpen_Postfix(UIFatalErrorTip __instance) { try { if (button == null) { button = GameObject.Find("UI Root/Overlay Canvas/In Game/Windows/Dyson Sphere Editor/Dyson Editor Control Panel/hierarchy/layers/blueprint-group/blueprint-2/copy-button"); GameObject errorPanel = GameObject.Find("UI Root/Overlay Canvas/Fatal Error/errored-panel/"); errorPanel.transform.Find("tip-text-1").GetComponent <Text>().text = Title(); GameObject.Destroy(errorPanel.transform.Find("tip-text-1").GetComponent <Localizer>()); button = GameObject.Instantiate(button, errorPanel.transform); button.name = "Copy & Close button"; button.transform.localPosition = errorPanel.transform.Find("icon").localPosition + new Vector3(30, -35, 0); //-885 -30 //-855 -60 button.GetComponent <Image>().color = new Color(0.3113f, 0f, 0.0097f, 0.6f); button.GetComponent <UIButton>().BindOnClickSafe(OnClick); button.GetComponent <UIButton>().tips = new UIButton.TipSettings(); } DedicatedServerReportError(); } catch (Exception e) { Log.Warn($"UIFatalErrorTip button did not patch! {e}"); } }
static void errorFalse2(UIFatalErrorTip __instance) { //if (errorCount > 0) //{ // errorCount--; // ManualBehaviour m = UIFatalErrorTip.instance; // if (m != null) // { // m._Close(); // } //} }
private static void OnClick(int id) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("```ini"); stringBuilder.AppendLine(Title()); string[] subs = UIFatalErrorTip.instance.errorLogText.text.Split('\n', '\r'); foreach (string str in subs) { // Nebula only: skip the message after PacketProcessor if (str.StartsWith("NebulaModel.Packets.PacketProcessor")) { break; } stringBuilder.AppendLine(str); } stringBuilder.Replace(" (at", ";(at"); stringBuilder.AppendLine("```"); // Copy string to clipboard GUIUtility.systemCopyBuffer = stringBuilder.ToString(); UIFatalErrorTip.ClearError(); GameObject.Destroy(button); button = null; }
static void errorFalse(UIFatalErrorTip __instance) { isError = true; }