From 5ee4f6040f08e2fa4b40e9f187b01355b6afe726 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Thu, 9 Apr 2020 12:52:04 -0500 Subject: [PATCH] Exposed more manifest fields to the world --- IPA.Loader/Loader/PluginMetadata.cs | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/IPA.Loader/Loader/PluginMetadata.cs b/IPA.Loader/Loader/PluginMetadata.cs index 6d43543b..b4d74afc 100644 --- a/IPA.Loader/Loader/PluginMetadata.cs +++ b/IPA.Loader/Loader/PluginMetadata.cs @@ -1,6 +1,7 @@ using IPA.Loader.Features; using IPA.Utilities; using Mono.Cecil; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -46,7 +47,7 @@ namespace IPA.Loader /// The name of the author that wrote this plugin. /// /// the name of the plugin's author - public string Author { get; internal set; } + public string Author { get; private set; } /// /// The version of the plugin. @@ -75,6 +76,29 @@ namespace IPA.Loader /// a list of associated files public IReadOnlyList AssociatedFiles { get; private set; } = new List(); + /// + /// The name of the resource in the plugin assembly containing the plugin's icon. + /// + /// the name of the plugin's icon + public string IconName { get; private set; } + + /// + /// A link to this plugin's home page, if any. + /// + /// the of the plugin's home page + public Uri PluginHomeLink { get; private set; } + + /// + /// A link to this plugin's source code, if avaliable. + /// + /// the of the plugin's source code + public Uri PluginSourceLink { get; private set; } + /// + /// A link to a donate page for the author of this plugin, if avaliable. + /// + /// the of the author's donate page + public Uri DonateLink { get; private set; } + internal bool IsSelf; /// @@ -97,6 +121,10 @@ namespace IPA.Loader Version = value.Version; Id = value.Id; Author = value.Author; + IconName = value.IconPath; + PluginHomeLink = value.Links.ProjectHome; + PluginSourceLink = value.Links.ProjectSource; + DonateLink = value.Links.Donate; AssociatedFiles = value.Files .Select(f => Path.Combine(UnityGame.InstallPath, f)) .Select(p => new FileInfo(p)).ToList();