mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 03:48:56 +00:00
Layers - Added support for rendering multiple timelines at once
Events - Added trigger modes
This commit is contained in:
1 parent
c6a06f0131
commit
86d6e540d7
21 files changed
+495
-333
No files matched your search
@@ -7,12 +7,14 @@
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
xmlns:converters="clr-namespace:Artemis.UI.Converters"
|
||||
xmlns:displayConditions="clr-namespace:Artemis.UI.Screens.ProfileEditor.DisplayConditions"
|
||||
xmlns:core="clr-namespace:Artemis.Core;assembly=Artemis.Core"
|
||||
x:Class="Artemis.UI.Screens.ProfileEditor.DisplayConditions.DisplayConditionsView"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800"
|
||||
d:DataContext="{d:DesignInstance {x:Type displayConditions:DisplayConditionsViewModel}}">
|
||||
<UserControl.Resources>
|
||||
<converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
|
||||
<converters:ComparisonConverter x:Key="ComparisonConverter" />
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Margin="10">
|
||||
@@ -198,7 +200,7 @@
|
||||
</Grid.ColumnDefinitions>
|
||||
<RadioButton Grid.Column="0"
|
||||
Style="{StaticResource MaterialDesignTabRadioButton}"
|
||||
IsChecked="True">
|
||||
IsChecked="{Binding Path=RenderProfileElement.EventOverlapMode, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static core:TimeLineEventOverlapMode.Restart}}">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="12">
|
||||
<materialDesign:PackIcon Kind="Repeat" VerticalAlignment="Center" Margin="-3 0 0 -3" />
|
||||
RESTART
|
||||
@@ -213,7 +215,7 @@
|
||||
</RadioButton>
|
||||
<RadioButton Grid.Column="1"
|
||||
Style="{StaticResource MaterialDesignTabRadioButton}"
|
||||
IsChecked="False">
|
||||
IsChecked="{Binding Path=RenderProfileElement.EventOverlapMode, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static core:TimeLineEventOverlapMode.Ignore}}">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="12">
|
||||
<materialDesign:PackIcon Kind="EarHearingOff" VerticalAlignment="Center" Margin="-3 0 0 -3" />
|
||||
IGNORE
|
||||
@@ -228,7 +230,7 @@
|
||||
</RadioButton>
|
||||
<RadioButton Grid.Column="2"
|
||||
Style="{StaticResource MaterialDesignTabRadioButton}"
|
||||
IsChecked="False">
|
||||
IsChecked="{Binding Path=RenderProfileElement.EventOverlapMode, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static core:TimeLineEventOverlapMode.Copy}}">
|
||||
<TextBlock VerticalAlignment="Center" FontSize="12">
|
||||
<materialDesign:PackIcon Kind="ContentCopy" VerticalAlignment="Center" Margin="-3 0 0 -3" />
|
||||
COPY
|
||||
|
||||
+8
-6
@@ -43,22 +43,24 @@ namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions
|
||||
|
||||
public bool DisplayContinuously
|
||||
{
|
||||
get => RenderProfileElement?.DisplayContinuously ?? false;
|
||||
get => RenderProfileElement?.PlayMode == TimelinePlayMode.Repeat;
|
||||
set
|
||||
{
|
||||
if (RenderProfileElement == null || RenderProfileElement.DisplayContinuously == value) return;
|
||||
RenderProfileElement.DisplayContinuously = value;
|
||||
TimelinePlayMode playMode = value ? TimelinePlayMode.Repeat : TimelinePlayMode.Once;
|
||||
if (RenderProfileElement == null || RenderProfileElement?.PlayMode == playMode) return;
|
||||
RenderProfileElement.PlayMode = playMode;
|
||||
_profileEditorService.UpdateSelectedProfileElement();
|
||||
}
|
||||
}
|
||||
|
||||
public bool AlwaysFinishTimeline
|
||||
{
|
||||
get => RenderProfileElement?.AlwaysFinishTimeline ?? false;
|
||||
get => RenderProfileElement?.StopMode == TimelineStopMode.Finish;
|
||||
set
|
||||
{
|
||||
if (RenderProfileElement == null || RenderProfileElement.AlwaysFinishTimeline == value) return;
|
||||
RenderProfileElement.AlwaysFinishTimeline = value;
|
||||
TimelineStopMode stopMode = value ? TimelineStopMode.Finish : TimelineStopMode.SkipToEnd;
|
||||
if (RenderProfileElement == null || RenderProfileElement?.StopMode == stopMode) return;
|
||||
RenderProfileElement.StopMode = stopMode;
|
||||
_profileEditorService.UpdateSelectedProfileElement();
|
||||
}
|
||||
}
|
||||
|
||||
+3
-5
@@ -104,15 +104,13 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
|
||||
{
|
||||
if (Segment != SegmentViewModelType.Main)
|
||||
return false;
|
||||
|
||||
return SelectedProfileElement?.DisplayContinuously ?? false;
|
||||
return SelectedProfileElement?.PlayMode == TimelinePlayMode.Repeat;
|
||||
}
|
||||
set
|
||||
{
|
||||
if (Segment != SegmentViewModelType.Main)
|
||||
return;
|
||||
|
||||
SelectedProfileElement.DisplayContinuously = value;
|
||||
SelectedProfileElement.PlayMode = value ? TimelinePlayMode.Repeat : TimelinePlayMode.Once;
|
||||
ProfileEditorService.UpdateSelectedProfileElement();
|
||||
NotifyOfPropertyChange(nameof(RepeatSegment));
|
||||
}
|
||||
@@ -348,7 +346,7 @@ namespace Artemis.UI.Screens.ProfileEditor.LayerProperties.Timeline
|
||||
e.PropertyName == nameof(RenderProfileElement.MainSegmentLength) ||
|
||||
e.PropertyName == nameof(RenderProfileElement.EndSegmentLength))
|
||||
Update();
|
||||
else if (e.PropertyName == nameof(RenderProfileElement.DisplayContinuously))
|
||||
else if (e.PropertyName == nameof(RenderProfileElement.PlayMode))
|
||||
NotifyOfPropertyChange(nameof(RepeatSegment));
|
||||
}
|
||||
|
||||
|
||||
@@ -246,6 +246,7 @@ namespace Artemis.UI.Screens.ProfileEditor
|
||||
{
|
||||
LoadWorkspaceSettings();
|
||||
Module.IsProfileUpdatingDisabled = true;
|
||||
Module.ActiveProfile?.Reset();
|
||||
Module.ActiveProfileChanged += ModuleOnActiveProfileChanged;
|
||||
LoadProfiles();
|
||||
|
||||
@@ -261,6 +262,7 @@ namespace Artemis.UI.Screens.ProfileEditor
|
||||
{
|
||||
SaveWorkspaceSettings();
|
||||
Module.IsProfileUpdatingDisabled = false;
|
||||
Module.ActiveProfile?.Reset();
|
||||
Module.ActiveProfileChanged -= ModuleOnActiveProfileChanged;
|
||||
|
||||
_profileEditorService.ChangeSelectedProfile(null);
|
||||
|
||||
@@ -125,25 +125,22 @@ namespace Artemis.UI.Screens.ProfileEditor.Visualization
|
||||
return;
|
||||
}
|
||||
|
||||
Execute.PostToUIThread(() =>
|
||||
Rect bounds = _layerEditorService.GetLayerBounds(Layer);
|
||||
Geometry shapeGeometry = Geometry.Empty;
|
||||
switch (Layer.LayerShape)
|
||||
{
|
||||
Rect bounds = _layerEditorService.GetLayerBounds(Layer);
|
||||
Geometry shapeGeometry = Geometry.Empty;
|
||||
switch (Layer.LayerShape)
|
||||
{
|
||||
case EllipseShape _:
|
||||
shapeGeometry = new EllipseGeometry(bounds);
|
||||
break;
|
||||
case RectangleShape _:
|
||||
shapeGeometry = new RectangleGeometry(bounds);
|
||||
break;
|
||||
}
|
||||
case EllipseShape _:
|
||||
shapeGeometry = new EllipseGeometry(bounds);
|
||||
break;
|
||||
case RectangleShape _:
|
||||
shapeGeometry = new RectangleGeometry(bounds);
|
||||
break;
|
||||
}
|
||||
|
||||
if (Layer.LayerBrush == null || Layer.LayerBrush.SupportsTransformation)
|
||||
shapeGeometry.Transform = _layerEditorService.GetLayerTransformGroup(Layer);
|
||||
if (Layer.LayerBrush == null || Layer.LayerBrush.SupportsTransformation)
|
||||
shapeGeometry.Transform = _layerEditorService.GetLayerTransformGroup(Layer);
|
||||
|
||||
ShapeGeometry = shapeGeometry;
|
||||
});
|
||||
ShapeGeometry = shapeGeometry;
|
||||
}
|
||||
|
||||
private void CreateViewportRectangle()
|
||||
|
||||
Reference in new issue
Block a user