mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 04:57:15 +00:00
Added layout-functionality to corsair devices
This commit is contained in:
1 parent
cedd220789
commit
f83b08af5e
12 files changed
+99
-31
No files matched your search
@@ -3,7 +3,9 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
using RGB.NET.Core;
|
||||
using RGB.NET.Devices.Corsair.Native;
|
||||
@@ -40,10 +42,8 @@ namespace RGB.NET.Devices.Corsair
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the <see cref="Led"/> of the mousemat.
|
||||
/// </summary>
|
||||
protected override void InitializeLeds()
|
||||
/// <inheritdoc />
|
||||
protected override void InitializeLayout()
|
||||
{
|
||||
_CorsairLedPositions nativeLedPositions =
|
||||
(_CorsairLedPositions)
|
||||
@@ -64,6 +64,9 @@ namespace RGB.NET.Devices.Corsair
|
||||
foreach (_CorsairLedPosition ledPosition in positions.OrderBy(p => p.ledId))
|
||||
InitializeLed(new CorsairLedId(this, ledPosition.ledId),
|
||||
new Rectangle(ledPosition.left, ledPosition.top, ledPosition.width, ledPosition.height));
|
||||
|
||||
ApplyLayoutFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
|
||||
$@"Layouts\Corsair\Mousemat\{MousematDeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using RGB.NET.Devices.Corsair.Native;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
@@ -18,7 +20,8 @@ namespace RGB.NET.Devices.Corsair
|
||||
internal CorsairMousematRGBDeviceInfo(int deviceIndex, _CorsairDeviceInfo nativeInfo)
|
||||
: base(deviceIndex, Core.RGBDeviceType.Mousemat, nativeInfo)
|
||||
{
|
||||
Image = new Uri($"pack://application:,,,/RGB.NET.Devices.Corsair;component/Images/Mousemat/{Model.Replace(" ", string.Empty).ToUpper()}.png", UriKind.Absolute);
|
||||
Image = new Uri(Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location),
|
||||
$@"Images\Corsair\Mousemat\{Model.Replace(" ", string.Empty).ToUpper()}.png"), UriKind.Relative);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in new issue
Block a user