1
0
vibe-plugin/FFXIV_Vibe_Plugin/App/UI/Components/ButtonLink.cs
2023-01-24 22:50:56 +01:00

27 lines
717 B
C#

using System;
using Dalamud.Interface.Components;
using System.Diagnostics;
using ImGuiNET;
using FFXIV_Vibe_Plugin.Commons;
namespace FFXIV_Vibe_Plugin.UI.Components {
internal class ButtonLink {
public static void Draw(string text, string link, Dalamud.Interface.FontAwesomeIcon Icon, Logger Logger) {
if(ImGuiComponents.IconButton(Icon)) {
try {
_ = Process.Start(new ProcessStartInfo() {
FileName = link,
UseShellExecute = true,
});
} catch(Exception e) {
Logger.Error($"Could not open repoUrl: {link}", e);
}
}
if(ImGui.IsItemHovered()) { ImGui.SetTooltip(text); }
}
}
}