mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 11:26:27 +00:00
Workshop - Layout submission WIP
This commit is contained in:
1 parent
190d797f1a
commit
c77d51fb58
9 files changed
+364
-58
No files matched your search
@@ -15,6 +15,11 @@ public class ArtemisLedLayout
|
||||
DeviceLayout = deviceLayout;
|
||||
RgbLayout = led;
|
||||
LayoutCustomLedData = (LayoutCustomLedData?) led.CustomData ?? new LayoutCustomLedData();
|
||||
|
||||
// Default to the first logical layout for images
|
||||
LayoutCustomLedDataLogicalLayout? defaultLogicalLayout = LayoutCustomLedData.LogicalLayouts?.FirstOrDefault();
|
||||
if (defaultLogicalLayout != null)
|
||||
ApplyLogicalLayout(defaultLogicalLayout);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -54,6 +59,11 @@ public class ArtemisLedLayout
|
||||
.ThenBy(l => l.Name == null)
|
||||
.First();
|
||||
|
||||
ApplyLogicalLayout(logicalLayout);
|
||||
}
|
||||
|
||||
private void ApplyLogicalLayout(LayoutCustomLedDataLogicalLayout logicalLayout)
|
||||
{
|
||||
LogicalName = logicalLayout.Name;
|
||||
Image = new Uri(Path.Combine(Path.GetDirectoryName(DeviceLayout.FilePath)!, logicalLayout.Image!), UriKind.Absolute);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user