feat: add an "open url" button to the plugin installer, if the plugin sets the RepoUrl property in its definition

This commit is contained in:
goat 2020-05-12 19:11:09 +02:00
parent dd711ed10c
commit 5a80342243
2 changed files with 13 additions and 0 deletions

View file

@ -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; }
}
}

View file

@ -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}");
}