chore: some more manifest refactoring

This commit is contained in:
goat 2023-07-02 18:00:24 +02:00
parent 7ada7eb4e7
commit 9a429ef9f4
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
16 changed files with 30 additions and 16 deletions

View file

@ -11,6 +11,7 @@ using Dalamud.Game;
using Dalamud.Networking.Http;
using Dalamud.Plugin.Internal;
using Dalamud.Plugin.Internal.Types;
using Dalamud.Plugin.Internal.Types.Manifest;
using Dalamud.Utility;
using ImGuiScene;
using Serilog;

View file

@ -24,6 +24,7 @@ using Dalamud.Plugin.Internal;
using Dalamud.Plugin.Internal.Exceptions;
using Dalamud.Plugin.Internal.Profiles;
using Dalamud.Plugin.Internal.Types;
using Dalamud.Plugin.Internal.Types.Manifest;
using Dalamud.Support;
using Dalamud.Utility;
using ImGuiNET;
@ -2036,13 +2037,12 @@ internal class PluginInstallerWindow : Window, IDisposable
label += Locs.PluginTitleMod_TestingVersion;
}
// TODO: check with the repos instead
/*
if (plugin.Manifest.IsAvailableForTesting && configuration.DoPluginTest && testingOptIn == null)
var hasTestingAvailable = this.pluginListAvailable.Any(x => x.InternalName == plugin.InternalName &&
x.IsAvailableForTesting);
if (hasTestingAvailable && configuration.DoPluginTest && testingOptIn == null)
{
label += Locs.PluginTitleMod_TestingAvailable;
}
*/
// Freshly installed
if (showInstalled)
@ -2157,12 +2157,15 @@ internal class PluginInstallerWindow : Window, IDisposable
ImGui.SameLine();
ImGui.TextColored(ImGuiColors.DalamudGrey3, downloadText);
var acceptsFeedback =
this.pluginListAvailable.Any(x => x.InternalName == plugin.InternalName && x.AcceptsFeedback);
var isThirdParty = plugin.IsThirdParty;
var canFeedback = !isThirdParty &&
!plugin.IsDev &&
!plugin.IsOrphaned &&
plugin.Manifest.DalamudApiLevel == PluginManager.DalamudApiLevel &&
// plugin.Manifest.AcceptsFeedback && // TODO: check with the repos
acceptsFeedback &&
availablePluginUpdate == default;
// Installed from

View file

@ -21,6 +21,7 @@ using Dalamud.Interface.Internal;
using Dalamud.Interface.Internal.Windows.PluginInstaller;
using Dalamud.Plugin.Internal;
using Dalamud.Plugin.Internal.Types;
using Dalamud.Plugin.Internal.Types.Manifest;
using Dalamud.Plugin.Ipc;
using Dalamud.Plugin.Ipc.Exceptions;
using Dalamud.Plugin.Ipc.Internal;

View file

@ -25,6 +25,7 @@ using Dalamud.Networking.Http;
using Dalamud.Plugin.Internal.Exceptions;
using Dalamud.Plugin.Internal.Profiles;
using Dalamud.Plugin.Internal.Types;
using Dalamud.Plugin.Internal.Types.Manifest;
using Dalamud.Plugin.Ipc.Internal;
using Dalamud.Utility;
using Dalamud.Utility.Timing;

View file

@ -1,3 +1,5 @@
using Dalamud.Plugin.Internal.Types.Manifest;
namespace Dalamud.Plugin.Internal.Types;
/// <summary>

View file

@ -6,6 +6,7 @@ using System.Threading.Tasks;
using Dalamud.Configuration.Internal;
using Dalamud.Interface.Internal.Notifications;
using Dalamud.Logging.Internal;
using Dalamud.Plugin.Internal.Types.Manifest;
namespace Dalamud.Plugin.Internal.Types;

View file

@ -15,6 +15,7 @@ using Dalamud.Logging.Internal;
using Dalamud.Plugin.Internal.Exceptions;
using Dalamud.Plugin.Internal.Loader;
using Dalamud.Plugin.Internal.Profiles;
using Dalamud.Plugin.Internal.Types.Manifest;
using Dalamud.Utility;
namespace Dalamud.Plugin.Internal.Types;

View file

@ -1,4 +1,4 @@
namespace Dalamud.Plugin.Internal.Types;
namespace Dalamud.Plugin.Internal.Types.Manifest;
/// <summary>
/// Public interface for the local plugin manifest.

View file

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
namespace Dalamud.Plugin.Internal.Types;
namespace Dalamud.Plugin.Internal.Types.Manifest;
/// <summary>
/// Public interface for the base plugin manifest.

View file

@ -5,7 +5,7 @@ using Dalamud.Utility;
using Newtonsoft.Json;
using Serilog;
namespace Dalamud.Plugin.Internal.Types;
namespace Dalamud.Plugin.Internal.Types.Manifest;
/// <summary>
/// Information about a plugin, packaged in a json file with the DLL. This variant includes additional information such as
@ -55,11 +55,6 @@ internal record LocalPluginManifest : PluginManifest, ILocalPluginManifest
/// </summary>
public Version EffectiveVersion => this.Testing && this.TestingAssemblyVersion != null ? this.TestingAssemblyVersion : this.AssemblyVersion;
/// <summary>
/// Gets a value indicating whether this plugin is eligible for testing.
/// </summary>
public bool IsAvailableForTesting => this.TestingAssemblyVersion != null && this.TestingAssemblyVersion > this.AssemblyVersion;
/// <summary>
/// Save a plugin manifest to file.
/// </summary>

View file

@ -1,7 +1,7 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
namespace Dalamud.Plugin.Internal.Types;
namespace Dalamud.Plugin.Internal.Types.Manifest;
/// <summary>
/// Information about a plugin, packaged in a json file with the DLL. This variant includes additional information such as
@ -16,4 +16,9 @@ internal record RemotePluginManifest : PluginManifest
/// </summary>
[JsonIgnore]
public PluginRepository SourceRepo { get; set; } = null!;
/// <summary>
/// Gets a value indicating whether this plugin is eligible for testing.
/// </summary>
public bool IsAvailableForTesting => this.TestingAssemblyVersion != null && this.TestingAssemblyVersion > this.AssemblyVersion;
}

View file

@ -1,5 +1,7 @@
using System.IO;
using Dalamud.Plugin.Internal.Types.Manifest;
namespace Dalamud.Plugin.Internal.Types;
/// <summary>

View file

@ -2,6 +2,7 @@ using System;
using System.Collections.Generic;
using Dalamud.Game;
using Dalamud.Plugin.Internal.Types.Manifest;
using Newtonsoft.Json;
namespace Dalamud.Plugin.Internal.Types;

View file

@ -10,6 +10,7 @@ using System.Threading.Tasks;
using Dalamud.Logging.Internal;
using Dalamud.Networking.Http;
using Dalamud.Plugin.Internal.Types.Manifest;
using Dalamud.Utility;
using Newtonsoft.Json;

View file

@ -3,7 +3,7 @@ using System.Text;
using System.Threading.Tasks;
using Dalamud.Networking.Http;
using Dalamud.Plugin.Internal.Types;
using Dalamud.Plugin.Internal.Types.Manifest;
using Dalamud.Utility;
using Newtonsoft.Json;

View file

@ -7,7 +7,7 @@ using Dalamud.Configuration;
using Dalamud.Configuration.Internal;
using Dalamud.Interface.Internal;
using Dalamud.Plugin.Internal;
using Dalamud.Plugin.Internal.Types;
using Dalamud.Plugin.Internal.Types.Manifest;
using Dalamud.Utility;
using Newtonsoft.Json;
using Serilog;