Add donate links to title bar

This commit is contained in:
Asriel Camora
2024-11-28 14:05:29 -08:00
parent 127fa43757
commit 8451572a79
7 changed files with 30 additions and 2 deletions
+1 -1
View File
@@ -591,7 +591,7 @@ internal static class ImGuiUtils
{ {
ImGui.SetMouseCursor(ImGuiMouseCursor.Hand); ImGui.SetMouseCursor(ImGuiMouseCursor.Hand);
if (ImGui.IsItemClicked(ImGuiMouseButton.Left)) if (ImGui.IsItemClicked(ImGuiMouseButton.Left))
Process.Start(new ProcessStartInfo { FileName = url, UseShellExecute = true }); Dalamud.Utility.Util.OpenLink(url);
var urlWithoutScheme = url; var urlWithoutScheme = url;
if (Uri.TryCreate(url, UriKind.Absolute, out var uri)) if (Uri.TryCreate(url, UriKind.Absolute, out var uri))
urlWithoutScheme = uri.Host + (string.Equals(uri.PathAndQuery, "/", StringComparison.Ordinal) ? string.Empty : uri.PathAndQuery); urlWithoutScheme = uri.Host + (string.Equals(uri.PathAndQuery, "/", StringComparison.Ordinal) ? string.Empty : uri.PathAndQuery);
+1
View File
@@ -18,6 +18,7 @@ public sealed class Plugin : IDalamudPlugin
public string Author { get; } public string Author { get; }
public string BuildConfiguration { get; } public string BuildConfiguration { get; }
public ILoadedTextureIcon Icon { get; } public ILoadedTextureIcon Icon { get; }
public const string SupportLink = "https://ko-fi.com/camora";
public WindowSystem WindowSystem { get; } public WindowSystem WindowSystem { get; }
public Settings SettingsWindow { get; } public Settings SettingsWindow { get; }
+7
View File
@@ -23,6 +23,7 @@ using System.Threading.Tasks;
using Sim = Craftimizer.Simulator.Simulator; using Sim = Craftimizer.Simulator.Simulator;
using SimNoRandom = Craftimizer.Simulator.SimulatorNoRandom; using SimNoRandom = Craftimizer.Simulator.SimulatorNoRandom;
using Recipe = Lumina.Excel.Sheets.Recipe; using Recipe = Lumina.Excel.Sheets.Recipe;
using Dalamud.Utility;
namespace Craftimizer.Windows; namespace Craftimizer.Windows;
@@ -147,6 +148,12 @@ public sealed class MacroEditor : Window, IDisposable
IconOffset = new(2, 1), IconOffset = new(2, 1),
Click = _ => Service.Plugin.OpenSettingsTab("Macro Editor"), Click = _ => Service.Plugin.OpenSettingsTab("Macro Editor"),
ShowTooltip = () => ImGuiUtils.Tooltip("Open Settings") 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!")
} }
]; ];
+7
View File
@@ -12,6 +12,7 @@ using System.Linq;
using System.Numerics; using System.Numerics;
using Sim = Craftimizer.Simulator.SimulatorNoRandom; using Sim = Craftimizer.Simulator.SimulatorNoRandom;
using Dalamud.Interface.Utility; using Dalamud.Interface.Utility;
using Dalamud.Utility;
namespace Craftimizer.Windows; namespace Craftimizer.Windows;
@@ -45,6 +46,12 @@ public sealed class MacroList : Window, IDisposable
IconOffset = new(2, 1), IconOffset = new(2, 1),
Click = _ => Service.Plugin.OpenSettingsTab("General"), Click = _ => Service.Plugin.OpenSettingsTab("General"),
ShowTooltip = () => ImGuiUtils.Tooltip("Open Settings") 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!")
} }
]; ];
+6
View File
@@ -103,6 +103,12 @@ public sealed unsafe class RecipeNote : Window, IDisposable
IconOffset = new(2, 1), IconOffset = new(2, 1),
Click = _ => Service.Plugin.OpenSettingsTab("Crafting Log"), Click = _ => Service.Plugin.OpenSettingsTab("Crafting Log"),
ShowTooltip = () => ImGuiUtils.Tooltip("Open Settings") 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!")
} }
]; ];
+1 -1
View File
@@ -1130,7 +1130,7 @@ public sealed class Settings : Window, IDisposable
ImGuiUtils.AlignCentered(ImGui.CalcTextSize($"Support me on Ko-fi!").X); ImGuiUtils.AlignCentered(ImGui.CalcTextSize($"Support me on Ko-fi!").X);
ImGui.TextUnformatted($"Support me on "); ImGui.TextUnformatted($"Support me on ");
ImGui.SameLine(0, 0); ImGui.SameLine(0, 0);
ImGuiUtils.Hyperlink("Ko-fi", "https://ko-fi.com/camora"); ImGuiUtils.Hyperlink("Ko-fi", Plugin.SupportLink);
ImGui.SameLine(0, 0); ImGui.SameLine(0, 0);
ImGui.TextUnformatted("!"); ImGui.TextUnformatted("!");
} }
+7
View File
@@ -10,6 +10,7 @@ using Dalamud.Interface.ManagedFontAtlas;
using Dalamud.Interface.Utility; using Dalamud.Interface.Utility;
using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Utility.Raii;
using Dalamud.Interface.Windowing; using Dalamud.Interface.Windowing;
using Dalamud.Utility;
using FFXIVClientStructs.FFXIV.Client.Game; using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Client.Game.Character; using FFXIVClientStructs.FFXIV.Client.Game.Character;
using FFXIVClientStructs.FFXIV.Client.UI; using FFXIVClientStructs.FFXIV.Client.UI;
@@ -94,6 +95,12 @@ public sealed unsafe class SynthHelper : Window, IDisposable
IconOffset = new(2, 1), IconOffset = new(2, 1),
Click = _ => Service.Plugin.OpenSettingsTab("Synthesis Helper"), Click = _ => Service.Plugin.OpenSettingsTab("Synthesis Helper"),
ShowTooltip = () => ImGuiUtils.Tooltip("Open Settings") 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!")
} }
]; ];