feat(PluginInstaller): implement AcceptsFeedback, FeedbackMessage

This commit is contained in:
goat 2021-11-18 14:33:25 +01:00
parent f30ebe5166
commit 785df95071
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5
2 changed files with 22 additions and 2 deletions

View file

@ -387,6 +387,11 @@ internal class PluginInstallerWindow : Window, IDisposable
{
ImGui.Text(Locs.FeedbackModal_Text(this.feedbackPlugin.Name));
if (this.feedbackPlugin?.FeedbackMessage != null)
{
ImGui.TextWrapped(this.feedbackPlugin.FeedbackMessage);
}
if (this.pluginListUpdatable.Any(
up => up.InstalledPlugin.Manifest.InternalName == this.feedbackPlugin?.InternalName))
{
@ -1226,7 +1231,7 @@ internal class PluginInstallerWindow : Window, IDisposable
this.DrawVisitRepoUrlButton(manifest.RepoUrl);
if (!manifest.SourceRepo.IsThirdParty)
if (!manifest.SourceRepo.IsThirdParty && manifest.AcceptsFeedback)
{
this.DrawSendFeedbackButton(manifest);
}
@ -1401,7 +1406,7 @@ internal class PluginInstallerWindow : Window, IDisposable
ImGui.TextColored(ImGuiColors.DalamudGrey3, downloadText);
var isThirdParty = manifest.IsThirdParty;
var canFeedback = !isThirdParty && !plugin.IsDev && plugin.Manifest.DalamudApiLevel == PluginManager.DalamudApiLevel;
var canFeedback = !isThirdParty && !plugin.IsDev && plugin.Manifest.DalamudApiLevel == PluginManager.DalamudApiLevel && plugin.Manifest.AcceptsFeedback;
// Installed from
if (plugin.IsDev)

View file

@ -161,4 +161,19 @@ internal record PluginManifest
/// Gets an URL for the plugin's icon.
/// </summary>
public string? IconUrl { get; init; }
/// <summary>
/// Gets a value that indicates whether or not this plugin accepts feedback.
/// </summary>
public bool AcceptsFeedback { get; init; } = true;
/// <summary>
/// Gets a message that is shown to users when sending feedback.
/// </summary>
public string? FeedbackMessage { get; init; }
/// <summary>
/// Gets a value indicating the webhook URL feedback is sent to.
/// </summary>
public string? FeedbackWebhook { get; init; }
}