mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Layer brushes & effects - Fix custom icon paths
This commit is contained in:
parent
8d75d0dd8c
commit
70bf8824db
@ -41,6 +41,8 @@ namespace Artemis.Core.LayerBrushes
|
|||||||
if (!IsEnabled)
|
if (!IsEnabled)
|
||||||
throw new ArtemisPluginException(Plugin, "Can only add a layer brush descriptor when the plugin is enabled");
|
throw new ArtemisPluginException(Plugin, "Can only add a layer brush descriptor when the plugin is enabled");
|
||||||
|
|
||||||
|
if (icon.ToLower().EndsWith(".svg"))
|
||||||
|
icon = Plugin.ResolveRelativePath(icon);
|
||||||
LayerBrushDescriptor descriptor = new(displayName, description, icon, typeof(T), this);
|
LayerBrushDescriptor descriptor = new(displayName, description, icon, typeof(T), this);
|
||||||
_layerBrushDescriptors.Add(descriptor);
|
_layerBrushDescriptors.Add(descriptor);
|
||||||
LayerBrushStore.Add(descriptor);
|
LayerBrushStore.Add(descriptor);
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Artemis.Core.LayerEffects
|
namespace Artemis.Core.LayerEffects
|
||||||
{
|
{
|
||||||
@ -33,14 +34,16 @@ namespace Artemis.Core.LayerEffects
|
|||||||
/// <param name="displayName">The name to display in the UI</param>
|
/// <param name="displayName">The name to display in the UI</param>
|
||||||
/// <param name="description">The description to display in the UI</param>
|
/// <param name="description">The description to display in the UI</param>
|
||||||
/// <param name="icon">
|
/// <param name="icon">
|
||||||
/// The Material icon to display in the UI, a full reference can be found
|
/// The Material icon to display in the UI, a full reference can be found <see href="https://materialdesignicons.com">here</see>.
|
||||||
/// <see href="https://materialdesignicons.com">here</see>
|
/// <para>May also be a path to an SVG file relative to the directory of the plugin.</para>
|
||||||
/// </param>
|
/// </param>
|
||||||
protected void RegisterLayerEffectDescriptor<T>(string displayName, string description, string icon) where T : BaseLayerEffect
|
protected void RegisterLayerEffectDescriptor<T>(string displayName, string description, string icon) where T : BaseLayerEffect
|
||||||
{
|
{
|
||||||
if (!IsEnabled)
|
if (!IsEnabled)
|
||||||
throw new ArtemisPluginFeatureException(this, "Can only add a layer effect descriptor when the plugin is enabled");
|
throw new ArtemisPluginFeatureException(this, "Can only add a layer effect descriptor when the plugin is enabled");
|
||||||
|
|
||||||
|
if (icon.ToLower().EndsWith(".svg"))
|
||||||
|
icon = Plugin.ResolveRelativePath(icon);
|
||||||
LayerEffectDescriptor descriptor = new(displayName, description, icon, typeof(T), this);
|
LayerEffectDescriptor descriptor = new(displayName, description, icon, typeof(T), this);
|
||||||
_layerEffectDescriptors.Add(descriptor);
|
_layerEffectDescriptors.Add(descriptor);
|
||||||
LayerEffectStore.Add(descriptor);
|
LayerEffectStore.Add(descriptor);
|
||||||
|
|||||||
@ -108,6 +108,8 @@
|
|||||||
</Grid.Style>
|
</Grid.Style>
|
||||||
<shared:ArtemisIcon Grid.Column="0"
|
<shared:ArtemisIcon Grid.Column="0"
|
||||||
Icon="{Binding LayerPropertyGroup.LayerBrush.Descriptor.Icon}"
|
Icon="{Binding LayerPropertyGroup.LayerBrush.Descriptor.Icon}"
|
||||||
|
Width="16"
|
||||||
|
Height="16"
|
||||||
Margin="0 5 5 0" />
|
Margin="0 5 5 0" />
|
||||||
<TextBlock Grid.Column="1"
|
<TextBlock Grid.Column="1"
|
||||||
ToolTip="{Binding LayerPropertyGroup.LayerBrush.Descriptor.Description}"
|
ToolTip="{Binding LayerPropertyGroup.LayerBrush.Descriptor.Description}"
|
||||||
@ -156,6 +158,8 @@
|
|||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Cursor="SizeNS"
|
Cursor="SizeNS"
|
||||||
Icon="{Binding LayerPropertyGroup.LayerEffect.Descriptor.Icon}"
|
Icon="{Binding LayerPropertyGroup.LayerEffect.Descriptor.Icon}"
|
||||||
|
Width="16"
|
||||||
|
Height="16"
|
||||||
Margin="0 5 5 0"
|
Margin="0 5 5 0"
|
||||||
Background="Transparent" />
|
Background="Transparent" />
|
||||||
<TextBlock Grid.Column="1" ToolTip="{Binding LayerPropertyGroup.LayerEffect.Descriptor.Description}" Margin="0 5 0 0">
|
<TextBlock Grid.Column="1" ToolTip="{Binding LayerPropertyGroup.LayerEffect.Descriptor.Description}" Margin="0 5 0 0">
|
||||||
|
|||||||
@ -171,7 +171,7 @@ namespace Artemis.UI.Screens.Settings.Tabs.Plugins
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await Task.Run(() => _pluginManagementService.EnablePlugin(Plugin, true));
|
await Task.Run(() => _pluginManagementService.EnablePlugin(Plugin, true, true));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user