mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 04:57:15 +00:00
Added cm mouse support, removed update-overloads
This commit is contained in:
1 parent
66d03cdf4f
commit
c8a02b5f90
6 files changed
+79
-29
No files matched your search
@@ -20,18 +20,16 @@ namespace RGB.NET.Devices.CoolerMaster
|
||||
{ CoolerMasterDevicesIndexes.MasterMouse_L, new Dictionary<LedId, (int row, int column)>
|
||||
{
|
||||
{ LedId.Mouse1, (0,0) },
|
||||
{ LedId.Mouse2, (1,0) },
|
||||
{ LedId.Mouse3, (2,0) },
|
||||
{ LedId.Mouse4, (3,0) },
|
||||
{ LedId.Mouse2, (0,1) },
|
||||
{ LedId.Mouse3, (0,2) },
|
||||
{ LedId.Mouse4, (0,3) }
|
||||
}
|
||||
},
|
||||
|
||||
{ CoolerMasterDevicesIndexes.MasterMouse_S, new Dictionary<LedId, (int row, int column)>
|
||||
{
|
||||
{ LedId.Mouse1, (0,0) },
|
||||
{ LedId.Mouse2, (1,0) },
|
||||
{ LedId.Mouse3, (2,0) },
|
||||
{ LedId.Mouse4, (3,0) },
|
||||
{ LedId.Mouse2, (0,1) }
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.CoolerMaster
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a CoolerMaster mouse.
|
||||
/// </summary>
|
||||
public class CoolerMasterMouseRGBDevice : CoolerMasterRGBDevice<CoolerMasterMouseRGBDeviceInfo>
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterMouseRGBDevice" /> class.
|
||||
/// </summary>
|
||||
/// <param name="info">The specific information provided by CoolerMaster for the mouse</param>
|
||||
internal CoolerMasterMouseRGBDevice(CoolerMasterMouseRGBDeviceInfo info)
|
||||
: base(info)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void InitializeLayout()
|
||||
{
|
||||
Dictionary<LedId, (int row, int column)> mapping = CoolerMasterMouseLedMappings.Mapping[DeviceInfo.DeviceIndex];
|
||||
|
||||
foreach (KeyValuePair<LedId, (int row, int column)> led in mapping)
|
||||
InitializeLed(led.Key, new Rectangle(led.Value.column * 19, led.Value.row * 19, 19, 19));
|
||||
|
||||
string model = DeviceInfo.Model.Replace(" ", string.Empty).ToUpper();
|
||||
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\CoolerMaster\Mice\{model}.xml"), null);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override object CreateLedCustomData(LedId ledId) => CoolerMasterMouseLedMappings.Mapping[DeviceInfo.DeviceIndex][ledId];
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.CoolerMaster
|
||||
{
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Represents a generic information for a <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterMouseRGBDevice" />.
|
||||
/// </summary>
|
||||
public class CoolerMasterMouseRGBDeviceInfo : CoolerMasterRGBDeviceInfo
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>
|
||||
/// Internal constructor of managed <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterMouseRGBDeviceInfo" />.
|
||||
/// </summary>
|
||||
/// <param name="deviceIndex">The index of the <see cref="T:RGB.NET.Devices.CoolerMaster.CoolerMasterMouseRGBDevice" />.</param>
|
||||
internal CoolerMasterMouseRGBDeviceInfo(CoolerMasterDevicesIndexes deviceIndex)
|
||||
: base(RGBDeviceType.Mouse, deviceIndex)
|
||||
{ }
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user