mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Basic implementation of a few editor tools
This commit is contained in:
1 parent
580db3185e
commit
8539f05d90
26 files changed
+634
-174
No files matched your search
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using Artemis.Core.Models.Profile.LayerShapes;
|
||||
using Artemis.Core.Models.Surface;
|
||||
using Artemis.Storage.Entities.Profile;
|
||||
using SkiaSharp;
|
||||
@@ -72,6 +73,7 @@ namespace Artemis.Core.Models.Profile
|
||||
public Layer AddLayer(string name)
|
||||
{
|
||||
var layer = new Layer(Profile, this, name) {Order = Children.LastOrDefault()?.Order ?? 1};
|
||||
layer.LayerShape = new Fill(layer);
|
||||
AddChild(layer);
|
||||
return layer;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,8 @@ namespace Artemis.Core.Models.Profile
|
||||
set
|
||||
{
|
||||
_layerShape = value;
|
||||
_layerShape.CalculateRenderProperties();
|
||||
if (Path != null)
|
||||
_layerShape.CalculateRenderProperties();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,15 +147,18 @@ namespace Artemis.Core.Models.Profile
|
||||
LayerEntity.Condition.Clear();
|
||||
|
||||
// Brush
|
||||
LayerEntity.BrushEntity = new BrushEntity
|
||||
if (LayerBrush != null)
|
||||
{
|
||||
BrushPluginGuid = LayerBrush.Descriptor.LayerBrushProvider.PluginInfo.Guid,
|
||||
BrushType = LayerBrush.GetType().Name,
|
||||
Configuration = JsonConvert.SerializeObject(LayerBrush.Settings)
|
||||
};
|
||||
LayerEntity.BrushEntity = new BrushEntity
|
||||
{
|
||||
BrushPluginGuid = LayerBrush.Descriptor.LayerBrushProvider.PluginInfo.Guid,
|
||||
BrushType = LayerBrush.GetType().Name,
|
||||
Configuration = JsonConvert.SerializeObject(LayerBrush.Settings)
|
||||
};
|
||||
}
|
||||
|
||||
// Shape
|
||||
LayerShape.ApplyToEntity();
|
||||
LayerShape?.ApplyToEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -67,6 +67,11 @@ namespace Artemis.Core.Models.Profile
|
||||
}
|
||||
}
|
||||
|
||||
public Folder GetRootFolder()
|
||||
{
|
||||
return (Folder) Children.Single();
|
||||
}
|
||||
|
||||
internal override void ApplyToEntity()
|
||||
{
|
||||
ProfileEntity.Id = EntityId;
|
||||
|
||||
Reference in new issue
Block a user