Files
minecraft-modpack-updater/ModpackUpdater.Apps.Manager/Features/Tools/UpdatesCollectorFeature.cs
2025-11-06 12:20:03 +01:00

27 lines
938 B
C#

using ModpackUpdater.Apps.Manager.Api.Plugins.Params;
using ModpackUpdater.Apps.Manager.LangRes;
using Pilz.Features;
using Pilz.UI.Symbols;
namespace ModpackUpdater.Apps.Manager.Features.Tools;
internal class UpdatesCollectorFeature : PluginFunction, IPluginFeatureProvider<UpdatesCollectorFeature>
{
public static UpdatesCollectorFeature Instance { get; } = new();
public UpdatesCollectorFeature() : base(FeatureTypes.Tools, "origin.updatescollector", FeatureNamesLangRes.UpdatesCollectorFeature)
{
Icon = AppGlobals.Symbols.GetSvgImage(AppSymbols.search, SymbolSize.Small);
}
protected override object? ExecuteFunction(PluginFunctionParameter? @params)
{
if (@params is not MainApiParameters p || p.Api.CurWorkspace?.InstallInfos is null)
return null;
SharedFunctions.CollectUpdates(p.Api, [.. p.Api.CurWorkspace.InstallInfos.Actions]);
return null;
}
}