mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
UI - Many misc fixes I can't remember
Profile editor - Removed layer outline, increasing performance by a lot Device visualizer - Streamlined custom Device providers - Added debug device provider ASUS - Added Maximus X Hero thanks @copystring Plugin core - Added PerLedLayerBrush Noise layer - Converted to PerLedLayerBrush, increasing performance and quality
This commit is contained in:
1 parent
f36049a0e1
commit
29489fe7b3
29 files changed
+767
-277
No files matched your search
@@ -0,0 +1,67 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Artemis.Core.Plugins.Abstract;
|
||||
using Artemis.Core.Plugins.Abstract.ViewModels;
|
||||
using Artemis.Core.Plugins.Models;
|
||||
using Artemis.Core.Services.Interfaces;
|
||||
using Artemis.Plugins.Devices.Debug.Settings;
|
||||
using Artemis.Plugins.Devices.Debug.ViewModels;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Devices.Debug;
|
||||
|
||||
namespace Artemis.Plugins.Devices.Debug
|
||||
{
|
||||
// ReSharper disable once UnusedMember.Global
|
||||
public class DebugDeviceProvider : DeviceProvider
|
||||
{
|
||||
private readonly IRgbService _rgbService;
|
||||
private readonly PluginSettings _settings;
|
||||
|
||||
public DebugDeviceProvider(IRgbService rgbService, PluginSettings settings) : base(RGB.NET.Devices.Debug.DebugDeviceProvider.Instance)
|
||||
{
|
||||
_settings = settings;
|
||||
_rgbService = rgbService;
|
||||
}
|
||||
|
||||
|
||||
public override void EnablePlugin()
|
||||
{
|
||||
HasConfigurationViewModel = true;
|
||||
PathHelper.ResolvingAbsolutePath += PathHelperOnResolvingAbsolutePath;
|
||||
|
||||
var definitions = _settings.GetSetting<List<DeviceDefinition>>("DeviceDefinitions");
|
||||
if (definitions.Value == null)
|
||||
definitions.Value = new List<DeviceDefinition>();
|
||||
|
||||
foreach (var deviceDefinition in definitions.Value)
|
||||
RGB.NET.Devices.Debug.DebugDeviceProvider.Instance.AddFakeDeviceDefinition(deviceDefinition.Layout, deviceDefinition.ImageLayout);
|
||||
|
||||
_rgbService.AddDeviceProvider(RgbDeviceProvider);
|
||||
}
|
||||
|
||||
private void PathHelperOnResolvingAbsolutePath(object sender, ResolvePathEventArgs e)
|
||||
{
|
||||
if (sender is DebugRGBDevice debugRgbDevice)
|
||||
{
|
||||
if (debugRgbDevice.LayoutPath.Contains("\\Layouts\\"))
|
||||
{
|
||||
var rootDirectory = debugRgbDevice.LayoutPath.Split("\\Layouts")[0];
|
||||
e.FinalPath = Path.Combine(rootDirectory, e.RelativePath);
|
||||
}
|
||||
|
||||
var test =debugRgbDevice.LayoutPath;
|
||||
}
|
||||
}
|
||||
|
||||
public override void DisablePlugin()
|
||||
{
|
||||
// TODO: Remove the device provider from the surface
|
||||
}
|
||||
|
||||
public override PluginConfigurationViewModel GetConfigurationViewModel()
|
||||
{
|
||||
return new DebugConfigurationViewModel(this, _settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user