mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
CoolerMaster - Throw more detailed error when missing LED mappings
This commit is contained in:
parent
408ce6d81b
commit
19d81d79c3
@ -27,8 +27,14 @@ namespace RGB.NET.Devices.CoolerMaster
|
|||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
protected override void InitializeLayout()
|
protected override void InitializeLayout()
|
||||||
{
|
{
|
||||||
Dictionary<LedId, (int row, int column)> mapping = CoolerMasterKeyboardLedMappings.Mapping[DeviceInfo.DeviceIndex][DeviceInfo.PhysicalLayout];
|
Dictionary<CoolerMasterPhysicalKeyboardLayout, Dictionary<LedId, (int row, int column)>> deviceMappings;
|
||||||
|
Dictionary<LedId, (int row, int column)> mapping;
|
||||||
|
|
||||||
|
if (!CoolerMasterKeyboardLedMappings.Mapping.TryGetValue(DeviceInfo.DeviceIndex, out deviceMappings))
|
||||||
|
throw new RGBDeviceException($"Failed to find a CoolerMasterKeyboardLedMapping for device index {DeviceInfo.DeviceIndex}");
|
||||||
|
if (!deviceMappings.TryGetValue(DeviceInfo.PhysicalLayout, out mapping))
|
||||||
|
throw new RGBDeviceException($"Failed to find a CoolerMasterKeyboardLedMapping for device index {DeviceInfo.DeviceIndex} with physical layout {DeviceInfo.PhysicalLayout}");
|
||||||
|
|
||||||
foreach (KeyValuePair<LedId, (int row, int column)> led in mapping)
|
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));
|
InitializeLed(led.Key, new Rectangle(led.Value.column * 19, led.Value.row * 19, 19, 19));
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user