Implemented basic keyframes

This commit is contained in:
Robert committed 2020-01-09 16:56:46 +01:00
1 parent b734fa2f8f
commit 8a1759a575
41 files changed
+951 -123

No files matched your search

@@ -24,8 +24,10 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
Update();
Layer.RenderPropertiesUpdated += LayerOnRenderPropertiesUpdated;
_profileEditorService.SelectedProfileElementChanged += OnSelectedProfileElementChanged;
_profileEditorService.SelectedProfileElementUpdated += OnSelectedProfileElementUpdated;
_profileEditorService.CurrentTimeChanged += ProfileEditorServiceOnCurrentTimeChanged;
}
public Layer Layer { get; }
public Geometry LayerGeometry { get; set; }
@@ -119,8 +121,7 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
shapeGeometry.Freeze();
ShapeGeometry = shapeGeometry;
}
private void CreateViewportRectangle()
{
if (!Layer.Leds.Any() || Layer.LayerShape == null)
@@ -190,6 +191,20 @@ namespace Artemis.UI.Screens.Module.ProfileEditor.Visualization
IsSelected = _profileEditorService.SelectedProfileElement == Layer;
}
private void OnSelectedProfileElementUpdated(object sender, EventArgs e)
{
if (IsSelected)
Update();
}
private void ProfileEditorServiceOnCurrentTimeChanged(object sender, EventArgs e)
{
if (!IsSelected)
return;
CreateShapeGeometry();
CreateViewportRectangle();
}
public void Dispose()
{
Layer.RenderPropertiesUpdated -= LayerOnRenderPropertiesUpdated;