mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Profile editor - Many runtime fixes, UI is back to usable!
This commit is contained in:
1 parent
db9d9fb4e6
commit
7fff1a593f
38 files changed
+309
-352
No files matched your search
@@ -35,6 +35,7 @@ namespace Artemis.Core.LayerBrushes
|
||||
internal void InitializeProperties()
|
||||
{
|
||||
Properties = Activator.CreateInstance<T>();
|
||||
Properties.GroupDescription ??= new PropertyGroupDescriptionAttribute {Name = Descriptor.DisplayName, Description = Descriptor.Description};
|
||||
Properties.LayerBrush = this;
|
||||
Properties.Initialize(Layer, "LayerBrush.", PluginInfo);
|
||||
PropertiesInitialized = true;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Artemis.Core.Services;
|
||||
using Ninject;
|
||||
|
||||
namespace Artemis.Core.LayerBrushes
|
||||
@@ -43,11 +44,6 @@ namespace Artemis.Core.LayerBrushes
|
||||
/// </summary>
|
||||
public LayerBrushProvider LayerBrushProvider { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the kernel used to instantiate the described layer brush
|
||||
/// </summary>
|
||||
internal IKernel Kernel { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates an instance of the described brush and applies it to the layer
|
||||
/// </summary>
|
||||
@@ -56,7 +52,7 @@ namespace Artemis.Core.LayerBrushes
|
||||
if (layer.LayerBrush != null)
|
||||
throw new ArtemisCoreException("Layer already has an instantiated layer brush");
|
||||
|
||||
var brush = (BaseLayerBrush) Kernel.Get(LayerBrushType);
|
||||
var brush = (BaseLayerBrush) CoreService.Kernel.Get(LayerBrushType);
|
||||
brush.Layer = layer;
|
||||
brush.Descriptor = this;
|
||||
brush.Initialize();
|
||||
|
||||
@@ -41,11 +41,14 @@ namespace Artemis.Core.LayerBrushes
|
||||
if (!Enabled)
|
||||
throw new ArtemisPluginException(PluginInfo, "Can only add a layer brush descriptor when the plugin is enabled");
|
||||
|
||||
_layerBrushDescriptors.Add(new LayerBrushDescriptor(displayName, description, icon, typeof(T), this));
|
||||
var descriptor = new LayerBrushDescriptor(displayName, description, icon, typeof(T), this);
|
||||
_layerBrushDescriptors.Add(descriptor);
|
||||
LayerBrushStore.Add(descriptor);
|
||||
}
|
||||
|
||||
private void OnPluginDisabled(object sender, EventArgs e)
|
||||
{
|
||||
// The store will clean up the registrations by itself, the plugin just needs to clear its own list
|
||||
_layerBrushDescriptors.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Artemis.Core.Services;
|
||||
using Artemis.Storage.Entities.Profile;
|
||||
using Ninject;
|
||||
|
||||
@@ -44,12 +45,7 @@ namespace Artemis.Core.LayerEffects
|
||||
/// The plugin that provided this <see cref="LayerEffectDescriptor" />
|
||||
/// </summary>
|
||||
public LayerEffectProvider LayerEffectProvider { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the kernel used to instantiate the described layer effect
|
||||
/// </summary>
|
||||
internal IKernel Kernel { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets a boolean indicating if this descriptor is a placeholder for a missing plugin
|
||||
/// </summary>
|
||||
@@ -70,7 +66,7 @@ namespace Artemis.Core.LayerEffects
|
||||
return;
|
||||
}
|
||||
|
||||
var effect = (BaseLayerEffect) Kernel.Get(LayerEffectType);
|
||||
var effect = (BaseLayerEffect)CoreService.Kernel.Get(LayerEffectType);
|
||||
effect.ProfileElement = renderElement;
|
||||
effect.EntityId = entity.Id;
|
||||
effect.Order = entity.Order;
|
||||
|
||||
@@ -41,11 +41,14 @@ namespace Artemis.Core.LayerEffects
|
||||
if (!Enabled)
|
||||
throw new ArtemisPluginException(PluginInfo, "Can only add a layer effect descriptor when the plugin is enabled");
|
||||
|
||||
_layerEffectDescriptors.Add(new LayerEffectDescriptor(displayName, description, icon, typeof(T), this));
|
||||
var descriptor = new LayerEffectDescriptor(displayName, description, icon, typeof(T), this);
|
||||
_layerEffectDescriptors.Add(descriptor);
|
||||
LayerEffectStore.Add(descriptor);
|
||||
}
|
||||
|
||||
private void OnPluginDisabled(object sender, EventArgs e)
|
||||
{
|
||||
// The store will clean up the registrations by itself, the plugin just needs to clear its own list
|
||||
_layerEffectDescriptors.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user