Add donate links to title bar
This commit is contained in:
@@ -591,7 +591,7 @@ internal static class ImGuiUtils
|
||||
{
|
||||
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);
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -23,6 +23,7 @@ using System.Threading.Tasks;
|
||||
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 sealed class MacroEditor : Window, IDisposable
|
||||
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!")
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ using System.Linq;
|
||||
using System.Numerics;
|
||||
using Sim = Craftimizer.Simulator.SimulatorNoRandom;
|
||||
using Dalamud.Interface.Utility;
|
||||
using Dalamud.Utility;
|
||||
|
||||
namespace Craftimizer.Windows;
|
||||
|
||||
@@ -45,6 +46,12 @@ public sealed class MacroList : Window, IDisposable
|
||||
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!")
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -103,6 +103,12 @@ public sealed unsafe class RecipeNote : Window, IDisposable
|
||||
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!")
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@@ -1130,7 +1130,7 @@ public sealed class Settings : Window, IDisposable
|
||||
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("!");
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ using Dalamud.Interface.ManagedFontAtlas;
|
||||
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 sealed unsafe class SynthHelper : Window, IDisposable
|
||||
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!")
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user