diff --git a/Craftimizer/ImGuiUtils.cs b/Craftimizer/ImGuiUtils.cs index e2ba89b..3f9a43b 100644 --- a/Craftimizer/ImGuiUtils.cs +++ b/Craftimizer/ImGuiUtils.cs @@ -591,7 +591,7 @@ public static unsafe void Hyperlink(string text, string url, bool underline = tr { ImGui.SetMouseCursor(ImGuiMouseCursor.Hand); if (ImGui.IsItemClicked(ImGuiMouseButton.Left)) - Process.Start(new ProcessStartInfo { FileName = url, UseShellExecute = true }); + Dalamud.Utility.Util.OpenLink(url); var urlWithoutScheme = url; if (Uri.TryCreate(url, UriKind.Absolute, out var uri)) urlWithoutScheme = uri.Host + (string.Equals(uri.PathAndQuery, "/", StringComparison.Ordinal) ? string.Empty : uri.PathAndQuery); diff --git a/Craftimizer/Plugin.cs b/Craftimizer/Plugin.cs index 72acc0a..81b4f4a 100644 --- a/Craftimizer/Plugin.cs +++ b/Craftimizer/Plugin.cs @@ -18,6 +18,7 @@ public sealed class Plugin : IDalamudPlugin public string Author { get; } public string BuildConfiguration { get; } public ILoadedTextureIcon Icon { get; } + public const string SupportLink = "https://ko-fi.com/camora"; public WindowSystem WindowSystem { get; } public Settings SettingsWindow { get; } diff --git a/Craftimizer/Windows/MacroEditor.cs b/Craftimizer/Windows/MacroEditor.cs index 1348407..7ae2e21 100644 --- a/Craftimizer/Windows/MacroEditor.cs +++ b/Craftimizer/Windows/MacroEditor.cs @@ -23,6 +23,7 @@ using Sim = Craftimizer.Simulator.Simulator; using SimNoRandom = Craftimizer.Simulator.SimulatorNoRandom; using Recipe = Lumina.Excel.Sheets.Recipe; +using Dalamud.Utility; namespace Craftimizer.Windows; @@ -147,6 +148,12 @@ public MacroEditor(CharacterStats characterStats, RecipeData recipeData, Crafter IconOffset = new(2, 1), Click = _ => Service.Plugin.OpenSettingsTab("Macro Editor"), ShowTooltip = () => ImGuiUtils.Tooltip("Open Settings") + }, + new() { + Icon = FontAwesomeIcon.Heart, + IconOffset = new(2, 1), + Click = _ => Util.OpenLink(Plugin.Plugin.SupportLink), + ShowTooltip = () => ImGuiUtils.Tooltip("Support me on Ko-fi!") } ]; diff --git a/Craftimizer/Windows/MacroList.cs b/Craftimizer/Windows/MacroList.cs index 6ac34b6..f7fbfcc 100644 --- a/Craftimizer/Windows/MacroList.cs +++ b/Craftimizer/Windows/MacroList.cs @@ -12,6 +12,7 @@ using System.Numerics; using Sim = Craftimizer.Simulator.SimulatorNoRandom; using Dalamud.Interface.Utility; +using Dalamud.Utility; namespace Craftimizer.Windows; @@ -45,6 +46,12 @@ public MacroList() : base("Craftimizer Macro List", WindowFlags, false) IconOffset = new(2, 1), Click = _ => Service.Plugin.OpenSettingsTab("General"), ShowTooltip = () => ImGuiUtils.Tooltip("Open Settings") + }, + new() { + Icon = FontAwesomeIcon.Heart, + IconOffset = new(2, 1), + Click = _ => Util.OpenLink(Plugin.Plugin.SupportLink), + ShowTooltip = () => ImGuiUtils.Tooltip("Support me on Ko-fi!") } ]; diff --git a/Craftimizer/Windows/RecipeNote.cs b/Craftimizer/Windows/RecipeNote.cs index cf66203..3d98410 100644 --- a/Craftimizer/Windows/RecipeNote.cs +++ b/Craftimizer/Windows/RecipeNote.cs @@ -103,6 +103,12 @@ public RecipeNote() : base(WindowNamePinned) IconOffset = new(2, 1), Click = _ => Service.Plugin.OpenSettingsTab("Crafting Log"), ShowTooltip = () => ImGuiUtils.Tooltip("Open Settings") + }, + new() { + Icon = FontAwesomeIcon.Heart, + IconOffset = new(2, 1), + Click = _ => Util.OpenLink(Plugin.Plugin.SupportLink), + ShowTooltip = () => ImGuiUtils.Tooltip("Support me on Ko-fi!") } ]; diff --git a/Craftimizer/Windows/Settings.cs b/Craftimizer/Windows/Settings.cs index ab1cc64..3c9c16f 100644 --- a/Craftimizer/Windows/Settings.cs +++ b/Craftimizer/Windows/Settings.cs @@ -1130,7 +1130,7 @@ private void DrawTabAbout() ImGuiUtils.AlignCentered(ImGui.CalcTextSize($"Support me on Ko-fi!").X); ImGui.TextUnformatted($"Support me on "); ImGui.SameLine(0, 0); - ImGuiUtils.Hyperlink("Ko-fi", "https://ko-fi.com/camora"); + ImGuiUtils.Hyperlink("Ko-fi", Plugin.SupportLink); ImGui.SameLine(0, 0); ImGui.TextUnformatted("!"); } diff --git a/Craftimizer/Windows/SynthHelper.cs b/Craftimizer/Windows/SynthHelper.cs index 960738c..ecf75ac 100644 --- a/Craftimizer/Windows/SynthHelper.cs +++ b/Craftimizer/Windows/SynthHelper.cs @@ -10,6 +10,7 @@ using Dalamud.Interface.Utility; using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Windowing; +using Dalamud.Utility; using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.Game.Character; using FFXIVClientStructs.FFXIV.Client.UI; @@ -94,6 +95,12 @@ public SynthHelper() : base(WindowNamePinned) IconOffset = new(2, 1), Click = _ => Service.Plugin.OpenSettingsTab("Synthesis Helper"), ShowTooltip = () => ImGuiUtils.Tooltip("Open Settings") + }, + new() { + Icon = FontAwesomeIcon.Heart, + IconOffset = new(2, 1), + Click = _ => Util.OpenLink(Plugin.Plugin.SupportLink), + ShowTooltip = () => ImGuiUtils.Tooltip("Support me on Ko-fi!") } ];