Profile editor - Finished most of the refactor except databindings

This commit is contained in:
SpoinkyNL committed 2020-09-14 01:24:07 +02:00
1 parent 7fff1a593f
commit fea454ad12
56 files changed
+866 -459

No files matched your search

@@ -22,5 +22,10 @@ namespace Artemis.Core.Services
/// Returns a list of all registered layer brush descriptors
/// </summary>
List<LayerBrushDescriptor> GetLayerBrushes();
/// <summary>
/// Returns the descriptor of the default layer brush
/// </summary>
LayerBrushDescriptor GetDefaultLayerBrush();
}
}
@@ -7,6 +7,13 @@ namespace Artemis.Core.Services
{
internal class LayerBrushService : ILayerBrushService
{
private readonly ISettingsService _settingsService;
public LayerBrushService(ISettingsService settingsService)
{
_settingsService = settingsService;
}
public LayerBrushRegistration RegisterLayerBrush(LayerBrushDescriptor descriptor)
{
if (descriptor == null)
@@ -26,5 +33,16 @@ namespace Artemis.Core.Services
{
return LayerBrushStore.GetAll().Select(r => r.LayerBrushDescriptor).ToList();
}
public LayerBrushDescriptor GetDefaultLayerBrush()
{
var defaultReference = _settingsService.GetSetting("ProfileEditor.DefaultLayerBrushDescriptor", new LayerBrushReference
{
BrushPluginGuid = Guid.Parse("92a9d6ba-6f7a-4937-94d5-c1d715b4141a"),
BrushType = "ColorBrush"
});
return LayerBrushStore.Get(defaultReference.Value.BrushPluginGuid, defaultReference.Value.BrushType)?.LayerBrushDescriptor;
}
}
}