Core - Added ColorGradient type to use for.. gradients!

Core - Initialisation process no longer takes place in core constructor and is no longer async
UI - Fixed exceptions during init not being shown
Gradient editor - Started work on this
This commit is contained in:
Robert committed 2020-02-28 23:19:38 +01:00
1 parent 9b62ba5f3d
commit c3b2c981da
29 files changed
+1517 -113

No files matched your search

-3
View File
@@ -36,9 +36,6 @@
<ProjectReference Include="..\Artemis.Storage\Artemis.Storage.csproj">
<Private>false</Private>
</ProjectReference>
<ProjectReference Include="..\Artemis.UI.Shared\Artemis.UI.Shared.csproj">
<Private>false</Private>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Ben.Demystifier" Version="0.1.6" />
@@ -0,0 +1,28 @@
using System.Collections.Generic;
using SkiaSharp;
namespace Artemis.Core.Models.Profile
{
public class ColorGradient
{
public ColorGradient()
{
Colors = new List<ColorGradientColor>();
}
public List<ColorGradientColor> Colors { get; }
public float Rotation { get; set; }
}
public struct ColorGradientColor
{
public ColorGradientColor(SKColor color, float position)
{
Color = color;
Position = position;
}
public SKColor Color { get; set; }
public float Position { get; set; }
}
}
-11
View File
@@ -4,7 +4,6 @@ using Artemis.Core.Models.Profile.KeyframeEngines;
using Artemis.Core.Plugins.Models;
using Artemis.Core.Services.Interfaces;
using Artemis.Storage.Repositories.Interfaces;
using Artemis.UI.Shared.Services.Interfaces;
using LiteDB;
using Ninject.Activation;
using Ninject.Extensions.Conventions;
@@ -30,16 +29,6 @@ namespace Artemis.Core.Ninject
.Configure(c => c.InSingletonScope());
});
// Bind all shared UI services as singletons
Kernel.Bind(x =>
{
x.FromAssemblyContaining<IArtemisSharedUIService>()
.SelectAllClasses()
.InheritedFrom<IArtemisSharedUIService>()
.BindAllInterfaces()
.Configure(c => c.InSingletonScope());
});
// Bind all protected services as singletons
Kernel.Bind(x =>
{
+5 -6
View File
@@ -49,7 +49,6 @@ namespace Artemis.Core.Services
_pluginService.PluginDisabled += (sender, args) => _modules = _pluginService.GetPluginsOfType<Module>();
ConfigureJsonConvert();
Task.Run(Initialize);
}
public bool ModuleUpdatingDisabled { get; set; }
@@ -81,7 +80,7 @@ namespace Artemis.Core.Services
};
}
private async Task Initialize()
public void Initialize()
{
if (IsInitialized)
throw new ArtemisCoreException("Cannot initialize the core as it is already initialized.");
@@ -90,8 +89,8 @@ namespace Artemis.Core.Services
ApplyLoggingLevel();
// Initialize the services
await Task.Run(() => _pluginService.CopyBuiltInPlugins());
await Task.Run(() => _pluginService.LoadPlugins());
_pluginService.CopyBuiltInPlugins();
_pluginService.LoadPlugins();
var surfaceConfig = _surfaceService.ActiveSurface;
if (surfaceConfig != null)
@@ -99,8 +98,8 @@ namespace Artemis.Core.Services
else
_logger.Information("Initialized without an active surface entity");
await Task.Run(() => _profileService.ActivateDefaultProfiles());
_profileService.ActivateDefaultProfiles();
OnInitialized();
}
@@ -20,6 +20,11 @@ namespace Artemis.Core.Services.Interfaces
/// </summary>
bool ModuleRenderingDisabled { get; set; }
/// <summary>
/// Initializes the core, only call once
/// </summary>
void Initialize();
/// <summary>
/// Occurs the core has finished initializing
/// </summary>