mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Layers - Seperated activation and removal of layers/effects
Effects - Added effects UI, order is still a bit messed up and reordering is missed Effects - Added renaming of effects on the layer
This commit is contained in:
1 parent
692cf806b7
commit
18593853d8
39 files changed
+691
-334
No files matched your search
@@ -233,7 +233,14 @@ namespace Artemis.Core.Models.Profile
|
||||
|
||||
private void InitializeProperty(Layer layer, string path, BaseLayerProperty instance)
|
||||
{
|
||||
var pluginGuid = IsCorePropertyGroup || instance.IsCoreProperty ? Constants.CorePluginInfo.Guid : layer.LayerBrush.PluginInfo.Guid;
|
||||
Guid pluginGuid;
|
||||
if (IsCorePropertyGroup || instance.IsCoreProperty)
|
||||
pluginGuid = Constants.CorePluginInfo.Guid;
|
||||
else if (instance.Parent.LayerBrush != null)
|
||||
pluginGuid = instance.Parent.LayerBrush.PluginInfo.Guid;
|
||||
else
|
||||
pluginGuid = instance.Parent.LayerEffect.PluginInfo.Guid;
|
||||
|
||||
var entity = layer.LayerEntity.PropertyEntities.FirstOrDefault(p => p.PluginGuid == pluginGuid && p.Path == path);
|
||||
var fromStorage = true;
|
||||
if (entity == null)
|
||||
@@ -273,5 +280,20 @@ namespace Artemis.Core.Models.Profile
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public void UpdateOrder(int oldOrder)
|
||||
{
|
||||
// Expanded state is tied to the path so save it before changing the path
|
||||
var expanded = Layer.IsPropertyGroupExpanded(this);
|
||||
Layer.SetPropertyGroupExpanded(this, false);
|
||||
|
||||
Path = Path.Replace($"LayerEffect.{oldOrder}.", $"LayerEffect.{LayerEffect.Order}.");
|
||||
// Restore the expanded state with the new path
|
||||
Layer.SetPropertyGroupExpanded(this, expanded);
|
||||
|
||||
// Update children
|
||||
foreach (var layerPropertyGroup in LayerPropertyGroups)
|
||||
layerPropertyGroup.UpdateOrder(oldOrder);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user