more lightwel control listener

This commit is contained in:
Pilzinsel64
2024-12-03 08:47:36 +01:00
parent b9ba58324b
commit a2b89e4fef
3 changed files with 31 additions and 14 deletions

View File

@@ -19,7 +19,12 @@ public static class PluginFeatureControllerExtensions
public static IControlListener ApplyControlManager(this PluginFeatureController @this, string featureType, Control control, bool recursive, bool autoTrack, PluginFunctionParameter? parameter)
{
var manager = new ControlListener(@this.Features.Get(featureType).OfType<ControlListenerFeature>(), control, recursive);
var features = @this.Features.Get(featureType).OfType<ControlListenerFeature>();
if (!features.Any())
return new ControlListenerDummy([], control, recursive);
var manager = new ControlListener(features, control, recursive);
if (autoTrack)
manager.Track();