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