mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Profile editor - Fixed new layers not saving in some situations
Profile tree - Improved buttons visibility Layer brushes - Support transformation by default, unless a RGB.NET brush
This commit is contained in:
parent
c60ae48e66
commit
f917728ac8
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using Artemis.Core.Models.Profile;
|
using Artemis.Core.Models.Profile;
|
||||||
|
using Artemis.Core.Plugins.Exceptions;
|
||||||
using Artemis.Core.Plugins.Models;
|
using Artemis.Core.Plugins.Models;
|
||||||
using Artemis.Core.Services.Interfaces;
|
using Artemis.Core.Services.Interfaces;
|
||||||
using SkiaSharp;
|
using SkiaSharp;
|
||||||
@ -11,6 +12,8 @@ namespace Artemis.Core.Plugins.LayerBrush.Abstract
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public abstract class BaseLayerBrush : IDisposable
|
public abstract class BaseLayerBrush : IDisposable
|
||||||
{
|
{
|
||||||
|
private bool _supportsTransformation = true;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the layer this brush is applied to
|
/// Gets the layer this brush is applied to
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -37,9 +40,19 @@ namespace Artemis.Core.Plugins.LayerBrush.Abstract
|
|||||||
public virtual LayerPropertyGroup BaseProperties => null;
|
public virtual LayerPropertyGroup BaseProperties => null;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets whether the brush supports transformations, RGB.NET brushes never support transformation
|
/// Gets or sets whether the brush supports transformations
|
||||||
|
/// <para>Note: RGB.NET brushes can never be transformed and setting this to true will throw an exception</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool SupportsTransformation { get; protected set; }
|
public bool SupportsTransformation
|
||||||
|
{
|
||||||
|
get => _supportsTransformation;
|
||||||
|
protected set
|
||||||
|
{
|
||||||
|
if (BrushType == LayerBrushType.RgbNet)
|
||||||
|
throw new ArtemisPluginException(PluginInfo, "An RGB.NET brush cannot support transformation");
|
||||||
|
_supportsTransformation = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -13,6 +13,7 @@ namespace Artemis.Core.Plugins.LayerBrush.Abstract
|
|||||||
protected RgbNetLayerBrush()
|
protected RgbNetLayerBrush()
|
||||||
{
|
{
|
||||||
BrushType = LayerBrushType.RgbNet;
|
BrushType = LayerBrushType.RgbNet;
|
||||||
|
SupportsTransformation = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -19,7 +19,7 @@ namespace Artemis.UI.Shared.Services.Interfaces
|
|||||||
IKernel Kernel { get; }
|
IKernel Kernel { get; }
|
||||||
|
|
||||||
void ChangeSelectedProfile(Profile profile);
|
void ChangeSelectedProfile(Profile profile);
|
||||||
void UpdateSelectedProfile();
|
void UpdateSelectedProfile(bool includeChildren);
|
||||||
void ChangeSelectedProfileElement(ProfileElement profileElement);
|
void ChangeSelectedProfileElement(ProfileElement profileElement);
|
||||||
void UpdateSelectedProfileElement();
|
void UpdateSelectedProfileElement();
|
||||||
void UpdateProfilePreview();
|
void UpdateProfilePreview();
|
||||||
|
|||||||
@ -71,9 +71,9 @@ namespace Artemis.UI.Shared.Services
|
|||||||
OnSelectedProfileChanged(profileElementEvent);
|
OnSelectedProfileChanged(profileElementEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateSelectedProfile()
|
public void UpdateSelectedProfile(bool includeChildren)
|
||||||
{
|
{
|
||||||
_profileService.UpdateProfile(SelectedProfile, false);
|
_profileService.UpdateProfile(SelectedProfile, includeChildren);
|
||||||
UpdateProfilePreview();
|
UpdateProfilePreview();
|
||||||
OnSelectedProfileElementUpdated(new ProfileElementEventArgs(SelectedProfile));
|
OnSelectedProfileElementUpdated(new ProfileElementEventArgs(SelectedProfile));
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,17 +9,22 @@ namespace Artemis.UI.Converters
|
|||||||
{
|
{
|
||||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
{
|
{
|
||||||
var direction = (Parameters) Enum.Parse(typeof(Parameters), (string) parameter ?? throw new InvalidOperationException());
|
Parameters direction;
|
||||||
|
if (parameter == null)
|
||||||
|
direction = Parameters.Normal;
|
||||||
|
else
|
||||||
|
direction = (Parameters) Enum.Parse(typeof(Parameters), (string) parameter);
|
||||||
|
|
||||||
if (direction == Parameters.Normal)
|
if (direction == Parameters.Normal)
|
||||||
{
|
{
|
||||||
if (value == null)
|
if (value == null)
|
||||||
return Visibility.Hidden;
|
return Visibility.Collapsed;
|
||||||
return Visibility.Visible;
|
return Visibility.Visible;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value == null)
|
if (value == null)
|
||||||
return Visibility.Visible;
|
return Visibility.Visible;
|
||||||
return Visibility.Hidden;
|
return Visibility.Collapsed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
<UserControl x:Class="Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.LayerPropertiesView"
|
<UserControl
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
@ -8,16 +8,14 @@
|
|||||||
xmlns:timeline="clr-namespace:Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline"
|
xmlns:timeline="clr-namespace:Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.Timeline"
|
||||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||||
xmlns:behaviors="clr-namespace:Artemis.UI.Behaviors"
|
xmlns:behaviors="clr-namespace:Artemis.UI.Behaviors"
|
||||||
|
xmlns:Converters="clr-namespace:Artemis.UI.Converters" x:Class="Artemis.UI.Screens.Module.ProfileEditor.LayerProperties.LayerPropertiesView"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450"
|
d:DesignHeight="450"
|
||||||
d:DesignWidth="800"
|
d:DesignWidth="800"
|
||||||
d:DataContext="{d:DesignInstance local:LayerPropertiesViewModel}"
|
d:DataContext="{d:DesignInstance {x:Type local:LayerPropertiesViewModel}}"
|
||||||
behaviors:InputBindingBehavior.PropagateInputBindingsToWindow="True">
|
behaviors:InputBindingBehavior.PropagateInputBindingsToWindow="True">
|
||||||
<UserControl.InputBindings>
|
|
||||||
<KeyBinding Command="{s:Action Play}" Key="Space" />
|
|
||||||
<KeyBinding Command="{s:Action PlayFromStart}" Modifiers="Shift" Key="Space" />
|
|
||||||
</UserControl.InputBindings>
|
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
|
<Converters:NullToVisibilityConverter x:Key="NullToVisibilityConverter"/>
|
||||||
<Style x:Key="SvStyle" TargetType="{x:Type ScrollViewer}">
|
<Style x:Key="SvStyle" TargetType="{x:Type ScrollViewer}">
|
||||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
@ -33,7 +31,7 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<ScrollContentPresenter Grid.ColumnSpan="2" Grid.RowSpan="2" />
|
<ScrollContentPresenter Grid.ColumnSpan="2" Grid.RowSpan="2" />
|
||||||
<ScrollBar Name="PART_VerticalScrollBar"
|
<ScrollBar x:Name="PART_VerticalScrollBar"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Opacity="0.5"
|
Opacity="0.5"
|
||||||
Grid.Row="0"
|
Grid.Row="0"
|
||||||
@ -42,7 +40,7 @@
|
|||||||
Maximum="{TemplateBinding ScrollableHeight}"
|
Maximum="{TemplateBinding ScrollableHeight}"
|
||||||
ViewportSize="{TemplateBinding ViewportHeight}"
|
ViewportSize="{TemplateBinding ViewportHeight}"
|
||||||
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" />
|
Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" />
|
||||||
<ScrollBar Name="PART_HorizontalScrollBar"
|
<ScrollBar x:Name="PART_HorizontalScrollBar"
|
||||||
VerticalAlignment="Bottom"
|
VerticalAlignment="Bottom"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
Opacity="0.5"
|
Opacity="0.5"
|
||||||
@ -58,6 +56,10 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
</UserControl.Resources>
|
</UserControl.Resources>
|
||||||
|
<UserControl.InputBindings>
|
||||||
|
<KeyBinding Command="{s:Action Play}" Key="Space" />
|
||||||
|
<KeyBinding Command="{s:Action PlayFromStart}" Modifiers="Shift" Key="Space" />
|
||||||
|
</UserControl.InputBindings>
|
||||||
<Grid x:Name="ContainerGrid">
|
<Grid x:Name="ContainerGrid">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*" />
|
<RowDefinition Height="*" />
|
||||||
@ -147,13 +149,13 @@
|
|||||||
VerticalScrollBarVisibility="Hidden" ScrollChanged="TimelineScrollChanged">
|
VerticalScrollBarVisibility="Hidden" ScrollChanged="TimelineScrollChanged">
|
||||||
<Grid Background="{DynamicResource MaterialDesignCardBackground}">
|
<Grid Background="{DynamicResource MaterialDesignCardBackground}">
|
||||||
<!-- Caret -->
|
<!-- Caret -->
|
||||||
<Canvas ZIndex="1"
|
<Canvas Panel.ZIndex="1"
|
||||||
Margin="{Binding TimeCaretPosition}"
|
Margin="{Binding TimeCaretPosition}"
|
||||||
Cursor="SizeWE"
|
Cursor="SizeWE"
|
||||||
MouseDown="{s:Action TimelineMouseDown}"
|
MouseDown="{s:Action TimelineMouseDown}"
|
||||||
MouseUp="{s:Action TimelineMouseUp}"
|
MouseUp="{s:Action TimelineMouseUp}"
|
||||||
MouseMove="{s:Action TimelineMouseMove}">
|
MouseMove="{s:Action TimelineMouseMove}">
|
||||||
<Polygon Points="-10,0 0,20, 10,00" Fill="{StaticResource SecondaryAccentBrush}" />
|
<Polygon Points="-10,0 0,20 10,0" Fill="{StaticResource SecondaryAccentBrush}" />
|
||||||
<Line X1="0" X2="0" Y1="0" Y2="{Binding ActualHeight, ElementName=ContainerGrid}"
|
<Line X1="0" X2="0" Y1="0" Y2="{Binding ActualHeight, ElementName=ContainerGrid}"
|
||||||
StrokeThickness="2" Stroke="{StaticResource SecondaryAccentBrush}" />
|
StrokeThickness="2" Stroke="{StaticResource SecondaryAccentBrush}" />
|
||||||
</Canvas>
|
</Canvas>
|
||||||
@ -175,7 +177,7 @@
|
|||||||
VerticalScrollBarVisibility="Auto"
|
VerticalScrollBarVisibility="Auto"
|
||||||
ScrollChanged="TimelineScrollChanged">
|
ScrollChanged="TimelineScrollChanged">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Canvas ZIndex="1"
|
<Canvas Panel.ZIndex="1"
|
||||||
Margin="{Binding TimeCaretPosition}"
|
Margin="{Binding TimeCaretPosition}"
|
||||||
Cursor="SizeWE"
|
Cursor="SizeWE"
|
||||||
MouseDown="{s:Action TimelineMouseDown}"
|
MouseDown="{s:Action TimelineMouseDown}"
|
||||||
@ -194,7 +196,7 @@
|
|||||||
Grid.ColumnSpan="2"
|
Grid.ColumnSpan="2"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
ZIndex="2"
|
Panel.ZIndex="2"
|
||||||
Background="{DynamicResource MaterialDesignCardBackground}">
|
Background="{DynamicResource MaterialDesignCardBackground}">
|
||||||
<!-- Selected layer controls -->
|
<!-- Selected layer controls -->
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@ -206,15 +208,26 @@
|
|||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<StackPanel Grid.Column="0" Orientation="Horizontal" Margin="6">
|
<StackPanel Grid.Column="0"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Margin="6"
|
||||||
|
Visibility="{Binding SelectedLayer, Converter={StaticResource NullToVisibilityConverter}}">
|
||||||
<materialDesign:PackIcon Kind="Layers" Width="16" />
|
<materialDesign:PackIcon Kind="Layers" Width="16" />
|
||||||
<materialDesign:PackIcon Kind="{Binding SelectedLayer.LayerBrush.Descriptor.Icon}"
|
<materialDesign:PackIcon Kind="{Binding SelectedLayer.LayerBrush.Descriptor.Icon}"
|
||||||
Width="16"
|
Width="16"
|
||||||
Margin="5 0 0 0"
|
Margin="5 0 0 0"
|
||||||
ToolTip="{Binding SelectedLayer.LayerBrush.Descriptor.DisplayName, Mode=OneWay}"
|
ToolTip="{Binding SelectedLayer.LayerBrush.Descriptor.DisplayName, Mode=OneWay}"
|
||||||
Background="Transparent" />
|
Background="Transparent"
|
||||||
|
Visibility="{Binding SelectedLayer.LayerBrush, Converter={StaticResource NullToVisibilityConverter}}"/>
|
||||||
<TextBlock Text="{Binding SelectedLayer.Name}" Margin="5 0 0 0" />
|
<TextBlock Text="{Binding SelectedLayer.Name}" Margin="5 0 0 0" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
<StackPanel Grid.Column="0"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Margin="6"
|
||||||
|
Visibility="{Binding SelectedFolder, Converter={StaticResource NullToVisibilityConverter}}">
|
||||||
|
<materialDesign:PackIcon Kind="Folder" Width="16" />
|
||||||
|
<TextBlock Text="{Binding SelectedFolder.Name}" Margin="5 0 0 0" />
|
||||||
|
</StackPanel>
|
||||||
<Button Grid.Column="1"
|
<Button Grid.Column="1"
|
||||||
Style="{StaticResource MaterialDesignFlatMidBgButton}"
|
Style="{StaticResource MaterialDesignFlatMidBgButton}"
|
||||||
Margin="0 -2"
|
Margin="0 -2"
|
||||||
@ -224,7 +237,7 @@
|
|||||||
ToolTip="Change the property's data binding"
|
ToolTip="Change the property's data binding"
|
||||||
|
|
||||||
VerticalAlignment="Center">
|
VerticalAlignment="Center">
|
||||||
<TextBlock FontSize="10">ADD EFFECT</TextBlock>
|
<TextBlock FontSize="10"><Run Text="ADD EFFECT"/></TextBlock>
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|||||||
@ -47,6 +47,8 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Layer SelectedLayer { get; set; }
|
public Layer SelectedLayer { get; set; }
|
||||||
|
public Folder SelectedFolder { get; set; }
|
||||||
|
|
||||||
public BindableCollection<LayerPropertyGroupViewModel> LayerPropertyGroups { get; set; }
|
public BindableCollection<LayerPropertyGroupViewModel> LayerPropertyGroups { get; set; }
|
||||||
public TreeViewModel TreeViewModel { get; set; }
|
public TreeViewModel TreeViewModel { get; set; }
|
||||||
public TimelineViewModel TimelineViewModel { get; set; }
|
public TimelineViewModel TimelineViewModel { get; set; }
|
||||||
@ -104,6 +106,10 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
|
|||||||
|
|
||||||
private void PopulateProperties(ProfileElement profileElement)
|
private void PopulateProperties(ProfileElement profileElement)
|
||||||
{
|
{
|
||||||
|
if (SelectedFolder != null)
|
||||||
|
{
|
||||||
|
SelectedFolder = null;
|
||||||
|
}
|
||||||
if (SelectedLayer != null)
|
if (SelectedLayer != null)
|
||||||
{
|
{
|
||||||
SelectedLayer.LayerBrushUpdated -= SelectedLayerOnLayerBrushUpdated;
|
SelectedLayer.LayerBrushUpdated -= SelectedLayerOnLayerBrushUpdated;
|
||||||
@ -115,7 +121,11 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
|
|||||||
LayerPropertyGroups.Clear();
|
LayerPropertyGroups.Clear();
|
||||||
_brushPropertyGroup = null;
|
_brushPropertyGroup = null;
|
||||||
|
|
||||||
if (profileElement is Layer layer)
|
if (profileElement is Folder folder)
|
||||||
|
{
|
||||||
|
SelectedFolder = folder;
|
||||||
|
}
|
||||||
|
else if (profileElement is Layer layer)
|
||||||
{
|
{
|
||||||
SelectedLayer = layer;
|
SelectedLayer = layer;
|
||||||
SelectedLayer.LayerBrushUpdated += SelectedLayerOnLayerBrushUpdated;
|
SelectedLayer.LayerBrushUpdated += SelectedLayerOnLayerBrushUpdated;
|
||||||
@ -151,7 +161,8 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.LayerProperties
|
|||||||
if (SelectedLayer == null)
|
if (SelectedLayer == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var hideRenderRelatedProperties = SelectedLayer?.LayerBrush?.BrushType == LayerBrushType.Regular && SelectedLayer.LayerBrush.SupportsTransformation;
|
var hideRenderRelatedProperties = SelectedLayer?.LayerBrush != null && !SelectedLayer.LayerBrush.SupportsTransformation;
|
||||||
|
|
||||||
SelectedLayer.General.ShapeType.IsHidden = hideRenderRelatedProperties;
|
SelectedLayer.General.ShapeType.IsHidden = hideRenderRelatedProperties;
|
||||||
SelectedLayer.General.FillType.IsHidden = hideRenderRelatedProperties;
|
SelectedLayer.General.FillType.IsHidden = hideRenderRelatedProperties;
|
||||||
SelectedLayer.General.BlendMode.IsHidden = hideRenderRelatedProperties;
|
SelectedLayer.General.BlendMode.IsHidden = hideRenderRelatedProperties;
|
||||||
|
|||||||
@ -47,21 +47,23 @@
|
|||||||
</TreeView>
|
</TreeView>
|
||||||
|
|
||||||
<StackPanel HorizontalAlignment="Right" Grid.Row="2" Orientation="Horizontal" Margin="8">
|
<StackPanel HorizontalAlignment="Right" Grid.Row="2" Orientation="Horizontal" Margin="8">
|
||||||
<Button Style="{StaticResource MaterialDesignToolButton}"
|
<Button Style="{StaticResource MaterialDesignIconForegroundButton}"
|
||||||
Width="30"
|
|
||||||
Padding="2 0 2 0"
|
Padding="2 0 2 0"
|
||||||
|
Width="30"
|
||||||
|
Height="30"
|
||||||
materialDesign:RippleAssist.IsCentered="True"
|
materialDesign:RippleAssist.IsCentered="True"
|
||||||
ToolTip="Add new folder to root"
|
ToolTip="Add new folder to root"
|
||||||
Command="{s:Action AddFolder}">
|
Command="{s:Action AddFolder}">
|
||||||
<materialDesign:PackIcon Kind="CreateNewFolder" />
|
<materialDesign:PackIcon Kind="CreateNewFolder" Width="15"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Style="{StaticResource MaterialDesignToolButton}"
|
<Button Style="{StaticResource MaterialDesignIconForegroundButton}"
|
||||||
Width="30"
|
Width="30"
|
||||||
|
Height="30"
|
||||||
Padding="2 0 2 0"
|
Padding="2 0 2 0"
|
||||||
materialDesign:RippleAssist.IsCentered="True"
|
materialDesign:RippleAssist.IsCentered="True"
|
||||||
ToolTip="Add new layer to root"
|
ToolTip="Add new layer to root"
|
||||||
Command="{s:Action AddLayer}">
|
Command="{s:Action AddLayer}">
|
||||||
<materialDesign:PackIcon Kind="LayersPlus" />
|
<materialDesign:PackIcon Kind="LayersPlus" Width="15"/>
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -78,7 +78,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.ProfileTree
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
_profileEditorService.UpdateSelectedProfile();
|
_profileEditorService.UpdateSelectedProfile(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once UnusedMember.Global - Called from view
|
// ReSharper disable once UnusedMember.Global - Called from view
|
||||||
|
|||||||
@ -114,7 +114,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.ProfileTree.TreeItem
|
|||||||
|
|
||||||
ProfileElement.AddChild(new Folder(ProfileElement.Profile, ProfileElement, "New folder"));
|
ProfileElement.AddChild(new Folder(ProfileElement.Profile, ProfileElement, "New folder"));
|
||||||
UpdateProfileElements();
|
UpdateProfileElements();
|
||||||
_profileEditorService.UpdateSelectedProfile();
|
_profileEditorService.UpdateSelectedProfile(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddLayer()
|
public void AddLayer()
|
||||||
@ -124,7 +124,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.ProfileTree.TreeItem
|
|||||||
|
|
||||||
_layerService.CreateLayer(ProfileElement.Profile, ProfileElement, "New layer");
|
_layerService.CreateLayer(ProfileElement.Profile, ProfileElement, "New layer");
|
||||||
UpdateProfileElements();
|
UpdateProfileElements();
|
||||||
_profileEditorService.UpdateSelectedProfile();
|
_profileEditorService.UpdateSelectedProfile(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ReSharper disable once UnusedMember.Global - Called from view
|
// ReSharper disable once UnusedMember.Global - Called from view
|
||||||
@ -136,7 +136,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.ProfileTree.TreeItem
|
|||||||
if (result is string newName)
|
if (result is string newName)
|
||||||
{
|
{
|
||||||
ProfileElement.Name = newName;
|
ProfileElement.Name = newName;
|
||||||
_profileEditorService.UpdateSelectedProfile();
|
_profileEditorService.UpdateSelectedProfile(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -153,11 +153,11 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.ProfileTree.TreeItem
|
|||||||
|
|
||||||
// Farewell, cruel world
|
// Farewell, cruel world
|
||||||
var parent = Parent;
|
var parent = Parent;
|
||||||
ProfileElement.Parent.RemoveChild(ProfileElement);
|
ProfileElement.Parent?.RemoveChild(ProfileElement);
|
||||||
parent.RemoveExistingElement(this);
|
parent.RemoveExistingElement(this);
|
||||||
parent.UpdateProfileElements();
|
parent.UpdateProfileElements();
|
||||||
|
|
||||||
_profileEditorService.UpdateSelectedProfile();
|
_profileEditorService.UpdateSelectedProfile(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateProfileElements()
|
public void UpdateProfileElements()
|
||||||
|
|||||||
@ -7,6 +7,7 @@ using System.Windows.Media.Imaging;
|
|||||||
using Artemis.Core.Models.Profile;
|
using Artemis.Core.Models.Profile;
|
||||||
using Artemis.Core.Models.Profile.LayerShapes;
|
using Artemis.Core.Models.Profile.LayerShapes;
|
||||||
using Artemis.Core.Models.Surface;
|
using Artemis.Core.Models.Surface;
|
||||||
|
using Artemis.Core.Plugins.LayerBrush.Abstract;
|
||||||
using Artemis.UI.Extensions;
|
using Artemis.UI.Extensions;
|
||||||
using Artemis.UI.Services.Interfaces;
|
using Artemis.UI.Services.Interfaces;
|
||||||
using Artemis.UI.Shared.Services.Interfaces;
|
using Artemis.UI.Shared.Services.Interfaces;
|
||||||
@ -147,7 +148,9 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
shapeGeometry.Transform = _layerEditorService.GetLayerTransformGroup(Layer);
|
if (Layer.LayerBrush == null || Layer.LayerBrush.SupportsTransformation)
|
||||||
|
shapeGeometry.Transform = _layerEditorService.GetLayerTransformGroup(Layer);
|
||||||
|
|
||||||
ShapeGeometry = shapeGeometry;
|
ShapeGeometry = shapeGeometry;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -207,7 +207,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
|
|||||||
if (_profileEditorService.SelectedProfileElement is Layer layer)
|
if (_profileEditorService.SelectedProfileElement is Layer layer)
|
||||||
{
|
{
|
||||||
CanApplyToLayer = true;
|
CanApplyToLayer = true;
|
||||||
CanSelectEditTool = (layer.LayerBrush == null || layer.LayerBrush.BrushType == LayerBrushType.Regular) && layer.Leds.Any();
|
CanSelectEditTool = (layer.LayerBrush == null || layer.LayerBrush.SupportsTransformation) && layer.Leds.Any();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -58,7 +58,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization.Tools
|
|||||||
newLayer.AddLeds(selectedLeds);
|
newLayer.AddLeds(selectedLeds);
|
||||||
ProfileEditorService.ChangeSelectedProfileElement(newLayer);
|
ProfileEditorService.ChangeSelectedProfileElement(newLayer);
|
||||||
ProfileEditorService.UpdateSelectedProfileElement();
|
ProfileEditorService.UpdateSelectedProfileElement();
|
||||||
ProfileEditorService.UpdateSelectedProfile();
|
ProfileEditorService.UpdateSelectedProfile(false);
|
||||||
}
|
}
|
||||||
// If no folder selected, apply it to a new layer in the root folder
|
// If no folder selected, apply it to a new layer in the root folder
|
||||||
else
|
else
|
||||||
@ -68,7 +68,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization.Tools
|
|||||||
newLayer.AddLeds(selectedLeds);
|
newLayer.AddLeds(selectedLeds);
|
||||||
ProfileEditorService.ChangeSelectedProfileElement(newLayer);
|
ProfileEditorService.ChangeSelectedProfileElement(newLayer);
|
||||||
ProfileEditorService.UpdateSelectedProfileElement();
|
ProfileEditorService.UpdateSelectedProfileElement();
|
||||||
ProfileEditorService.UpdateSelectedProfile();
|
ProfileEditorService.UpdateSelectedProfile(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user