Added Logitech support (limited to G910 and G403 for now)

Added a splashscreen
This commit is contained in:
SpoinkyNL committed 2019-11-10 17:36:18 +01:00
1 parent fff770326c
commit 39f2920c90
138 files changed
+1417 -64

No files matched your search

+1
View File
@@ -30,6 +30,7 @@ namespace Artemis.Core.Services
_surfaceService = surfaceService;
_rgbService.Surface.Updating += SurfaceOnUpdating;
_rgbService.Surface.Updated += SurfaceOnUpdated;
Task.Run(Initialize);
}
@@ -69,8 +69,20 @@ namespace Artemis.Core.Services.Interfaces
/// <returns>Returns a list of plug instances of type <see cref="T" /></returns>
List<T> GetPluginsOfType<T>() where T : Plugin;
Plugin GetDevicePlugin(IRGBDevice device);
#region Events
/// <summary>
/// Occurs when built-in plugins are being loaded
/// </summary>
event EventHandler CopyingBuildInPlugins;
/// <summary>
/// Occurs when a plugin has started loading
/// </summary>
event EventHandler<PluginEventArgs> PluginLoading;
/// <summary>
/// Occurs when a plugin has loaded
/// </summary>
@@ -92,7 +104,5 @@ namespace Artemis.Core.Services.Interfaces
event EventHandler<PluginEventArgs> PluginDisabled;
#endregion
Plugin GetDevicePlugin(IRGBDevice device);
}
}
+16 -2
View File
@@ -43,11 +43,12 @@ namespace Artemis.Core.Services
/// <inheritdoc />
public void CopyBuiltInPlugins()
{
OnCopyingBuildInPlugins();
var pluginDirectory = new DirectoryInfo(Path.Combine(Constants.DataFolder, "plugins"));
// Iterate built-in plugins
var varBuiltInPluginDirectory = new DirectoryInfo(Path.Combine(Directory.GetCurrentDirectory(), "Plugins"));
foreach (var subDirectory in varBuiltInPluginDirectory.EnumerateDirectories())
var builtInPluginDirectory = new DirectoryInfo(Path.Combine(Directory.GetCurrentDirectory(), "Plugins"));
foreach (var subDirectory in builtInPluginDirectory.EnumerateDirectories())
{
// Load the metadata
var builtInMetadataFile = Path.Combine(subDirectory.FullName, "plugin.json");
@@ -118,6 +119,7 @@ namespace Artemis.Core.Services
// Locate the main entry
var pluginInfo = JsonConvert.DeserializeObject<PluginInfo>(File.ReadAllText(metadataFile));
pluginInfo.Directory = subDirectory;
OnPluginLoading(new PluginEventArgs(pluginInfo));
LoadPlugin(pluginInfo);
}
catch (Exception e)
@@ -307,11 +309,23 @@ namespace Artemis.Core.Services
#region Events
public event EventHandler CopyingBuildInPlugins;
public event EventHandler<PluginEventArgs> PluginLoading;
public event EventHandler<PluginEventArgs> PluginLoaded;
public event EventHandler<PluginEventArgs> PluginUnloaded;
public event EventHandler<PluginEventArgs> PluginEnabled;
public event EventHandler<PluginEventArgs> PluginDisabled;
protected virtual void OnCopyingBuildInPlugins()
{
CopyingBuildInPlugins?.Invoke(this, EventArgs.Empty);
}
protected virtual void OnPluginLoading(PluginEventArgs e)
{
PluginLoading?.Invoke(this, e);
}
protected virtual void OnPluginLoaded(PluginEventArgs e)
{
PluginLoaded?.Invoke(this, e);