mirror of
https://github.com/DarthAffe/RGB.NET.git
synced 2025-12-13 10:08:31 +00:00
Added a method to change the behavior of selecting leds to update in devices
This commit is contained in:
parent
5a0d5ff104
commit
fde6d17bda
@ -86,7 +86,7 @@ namespace RGB.NET.Core
|
|||||||
DeviceUpdate();
|
DeviceUpdate();
|
||||||
|
|
||||||
// Send LEDs to SDK
|
// Send LEDs to SDK
|
||||||
IEnumerable<Led> ledsToUpdate = ((RequiresFlush || flushLeds) ? LedMapping.Values : LedMapping.Values.Where(x => x.IsDirty)).ToList();
|
List<Led> ledsToUpdate = GetLedsToUpdate(flushLeds)?.ToList() ?? new List<Led>();
|
||||||
foreach (Led ledToUpdate in ledsToUpdate)
|
foreach (Led ledToUpdate in ledsToUpdate)
|
||||||
ledToUpdate.Update();
|
ledToUpdate.Update();
|
||||||
|
|
||||||
@ -94,6 +94,8 @@ namespace RGB.NET.Core
|
|||||||
UpdateLeds(ledsToUpdate);
|
UpdateLeds(ledsToUpdate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual IEnumerable<Led> GetLedsToUpdate(bool flushLeds) => ((RequiresFlush || flushLeds) ? LedMapping.Values : LedMapping.Values.Where(x => x.IsDirty));
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
public virtual void SyncBack()
|
public virtual void SyncBack()
|
||||||
{ }
|
{ }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user