From dd12a284e59abe2489cc139bafb3dff9c68b95bc Mon Sep 17 00:00:00 2001
From: goat <16760685+goaaats@users.noreply.github.com>
Date: Wed, 8 Dec 2021 09:30:05 +0100
Subject: [PATCH] feat: add Util.OpenLink()
---
Dalamud/Utility/Util.cs | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/Dalamud/Utility/Util.cs b/Dalamud/Utility/Util.cs
index 1013e0aad..447a51f7a 100644
--- a/Dalamud/Utility/Util.cs
+++ b/Dalamud/Utility/Util.cs
@@ -247,6 +247,12 @@ namespace Dalamud.Utility
ImGui.PopStyleVar();
}
+ ///
+ /// Show a structure in an ImGui context.
+ ///
+ /// The type of the structure.
+ /// The pointer to the structure.
+ /// Whether or not this structure should start out expanded.
public static unsafe void ShowStruct(T* obj, bool autoExpand = false) where T : unmanaged
{
ShowStruct(*obj, (ulong)&obj, autoExpand);
@@ -433,6 +439,19 @@ namespace Dalamud.Utility
return Check1() || Check2() || Check3();
}
+ ///
+ /// Open a link in the default browser.
+ ///
+ /// The link to open.
+ public static void OpenLink(string url)
+ {
+ var process = new ProcessStartInfo(url)
+ {
+ UseShellExecute = true
+ };
+ Process.Start(process);
+ }
+
private static unsafe void ShowValue(ulong addr, IEnumerable path, Type type, object value)
{
if (type.IsPointer)