mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-14 20:54:16 +01:00
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:
parent
dd711ed10c
commit
5a80342243
2 changed files with 13 additions and 0 deletions
|
|
@ -14,6 +14,7 @@ namespace Dalamud.Plugin
|
||||||
public string AssemblyVersion { get; set; }
|
public string AssemblyVersion { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public string ApplicableVersion { get; set; }
|
public string ApplicableVersion { get; set; }
|
||||||
|
public string RepoUrl { get; set; }
|
||||||
public bool IsHide { get; set; }
|
public bool IsHide { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ using System.Numerics;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CheapLoc;
|
using CheapLoc;
|
||||||
|
using Dalamud.Interface;
|
||||||
using ImGuiNET;
|
using ImGuiNET;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Serilog;
|
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 (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.SameLine();
|
||||||
ImGui.TextColored(new Vector4(0.5f, 0.5f, 0.5f, 1.0f), $" v{pluginDefinition.AssemblyVersion}");
|
ImGui.TextColored(new Vector4(0.5f, 0.5f, 0.5f, 1.0f), $" v{pluginDefinition.AssemblyVersion}");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue