mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2026-11-11 04:57:15 +00:00
Refactored LedIds
Everything is now based on the same ids for all devices
This commit is contained in:
1 parent
200e471e4d
commit
c5a1825f50
80 files changed
+2923
-3657
No files matched your search
@@ -47,14 +47,17 @@ namespace RGB.NET.Devices.Corsair
|
||||
positions.Add(ledPosition);
|
||||
}
|
||||
|
||||
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));
|
||||
Dictionary<CorsairLedId, LedId> mapping = HeadsetStandIdMapping.DEFAULT.SwapKeyValue();
|
||||
foreach (_CorsairLedPosition ledPosition in positions.OrderBy(p => p.LedId))
|
||||
InitializeLed(mapping.TryGetValue(ledPosition.LedId, out LedId ledId) ? ledId : LedId.Invalid, new Rectangle(ledPosition.left, ledPosition.top, ledPosition.width, ledPosition.height));
|
||||
|
||||
ApplyLayoutFromFile(PathHelper.GetAbsolutePath($@"Layouts\Corsair\HeadsetStands\{DeviceInfo.Model.Replace(" ", string.Empty).ToUpper()}.xml"),
|
||||
null, PathHelper.GetAbsolutePath(@"Images\Corsair\HeadsetStands"));
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override object CreateLedCustomData(LedId ledId) => HeadsetStandIdMapping.DEFAULT.TryGetValue(ledId, out CorsairLedId id) ? id : CorsairLedId.Invalid;
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System.Collections.Generic;
|
||||
using RGB.NET.Core;
|
||||
|
||||
namespace RGB.NET.Devices.Corsair
|
||||
{
|
||||
internal static class HeadsetStandIdMapping
|
||||
{
|
||||
internal static readonly Dictionary<LedId, CorsairLedId> DEFAULT = new Dictionary<LedId, CorsairLedId>
|
||||
{
|
||||
{ LedId.HeadsetStand1, CorsairLedId.HeadsetStandZone1 },
|
||||
{ LedId.HeadsetStand2, CorsairLedId.HeadsetStandZone2 },
|
||||
{ LedId.HeadsetStand3, CorsairLedId.HeadsetStandZone3 },
|
||||
{ LedId.HeadsetStand4, CorsairLedId.HeadsetStandZone4 },
|
||||
{ LedId.HeadsetStand5, CorsairLedId.HeadsetStandZone5 },
|
||||
{ LedId.HeadsetStand6, CorsairLedId.HeadsetStandZone6 },
|
||||
{ LedId.HeadsetStand7, CorsairLedId.HeadsetStandZone7 },
|
||||
{ LedId.HeadsetStand8, CorsairLedId.HeadsetStandZone8 },
|
||||
{ LedId.HeadsetStand9, CorsairLedId.HeadsetStandZone9 }
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user