feat: add Util.OpenLink()

This commit is contained in:
goat 2021-12-08 09:30:05 +01:00
parent c5237663b8
commit dd12a284e5
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5

View file

@ -247,6 +247,12 @@ namespace Dalamud.Utility
ImGui.PopStyleVar();
}
/// <summary>
/// Show a structure in an ImGui context.
/// </summary>
/// <typeparam name="T">The type of the structure.</typeparam>
/// <param name="obj">The pointer to the structure.</param>
/// <param name="autoExpand">Whether or not this structure should start out expanded.</param>
public static unsafe void ShowStruct<T>(T* obj, bool autoExpand = false) where T : unmanaged
{
ShowStruct(*obj, (ulong)&obj, autoExpand);
@ -433,6 +439,19 @@ namespace Dalamud.Utility
return Check1() || Check2() || Check3();
}
/// <summary>
/// Open a link in the default browser.
/// </summary>
/// <param name="url">The link to open.</param>
public static void OpenLink(string url)
{
var process = new ProcessStartInfo(url)
{
UseShellExecute = true
};
Process.Start(process);
}
private static unsafe void ShowValue(ulong addr, IEnumerable<string> path, Type type, object value)
{
if (type.IsPointer)