예제 #1
0
 /// <inheritdoc />
 protected BaseLayerEffect()
 {
     // These are set right after construction to keep the constructor of inherited classes clean
     _profileElement = null !;
     _descriptor     = null !;
     _name           = null !;
 }
예제 #2
0
        /// <summary>
        ///     Adds a layer effect descriptor for a given layer effect, so that it appears in the UI.
        ///     <para>Note: You do not need to manually remove these on disable</para>
        /// </summary>
        /// <typeparam name="T">The type of the layer effect you wish to register</typeparam>
        /// <param name="displayName">The name to display in the UI</param>
        /// <param name="description">The description to display in the UI</param>
        /// <param name="icon">
        ///     The Material icon to display in the UI, a full reference can be found
        ///     <see href="https://materialdesignicons.com">here</see>
        /// </param>
        protected void RegisterLayerEffectDescriptor <T>(string displayName, string description, string icon) where T : BaseLayerEffect
        {
            if (!Enabled)
            {
                throw new ArtemisPluginException(PluginInfo, "Can only add a layer effect descriptor when the plugin is enabled");
            }

            LayerEffectDescriptor descriptor = new LayerEffectDescriptor(displayName, description, icon, typeof(T), this);

            _layerEffectDescriptors.Add(descriptor);
            LayerEffectStore.Add(descriptor);
        }