From 5a80342243176e7570b1ec7bfe0f7392ef99bc9e Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Tue, 12 May 2020 19:11:09 +0200 Subject: [PATCH] feat: add an "open url" button to the plugin installer, if the plugin sets the RepoUrl property in its definition --- Dalamud/Plugin/PluginDefinition.cs | 1 + Dalamud/Plugin/PluginInstallerWindow.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/Dalamud/Plugin/PluginDefinition.cs b/Dalamud/Plugin/PluginDefinition.cs index 20768d6a6..e563d4209 100644 --- a/Dalamud/Plugin/PluginDefinition.cs +++ b/Dalamud/Plugin/PluginDefinition.cs @@ -14,6 +14,7 @@ namespace Dalamud.Plugin public string AssemblyVersion { get; set; } public string Description { get; set; } public string ApplicableVersion { get; set; } + public string RepoUrl { get; set; } public bool IsHide { get; set; } } } diff --git a/Dalamud/Plugin/PluginInstallerWindow.cs b/Dalamud/Plugin/PluginInstallerWindow.cs index d77bfc49c..8dc0a49f4 100644 --- a/Dalamud/Plugin/PluginInstallerWindow.cs +++ b/Dalamud/Plugin/PluginInstallerWindow.cs @@ -11,6 +11,7 @@ using System.Numerics; using System.Text; using System.Threading.Tasks; using CheapLoc; +using Dalamud.Interface; using ImGuiNET; using Newtonsoft.Json; using Serilog; @@ -127,6 +128,17 @@ namespace Dalamud.Plugin if (ImGui.Button(Loc.Localize("InstallerOpenConfig", "Open Configuration"))) installedPlugin.PluginInterface.UiBuilder.OnOpenConfigUi?.Invoke(null, null); } + if (!string.IsNullOrEmpty(installedPlugin.Definition.RepoUrl)) { + ImGui.PushFont(InterfaceManager.IconFont); + + ImGui.SameLine(); + if (ImGui.Button(FontAwesomeIcon.Globe.ToIconString()) && + installedPlugin.Definition.RepoUrl.StartsWith("https://")) + Process.Start(installedPlugin.Definition.RepoUrl); + + ImGui.PopFont(); + } + ImGui.SameLine(); ImGui.TextColored(new Vector4(0.5f, 0.5f, 0.5f, 1.0f), $" v{pluginDefinition.AssemblyVersion}"); }