Added layer properties to core and hooked it up with the UI

Implemented timeline caret scrolling logic
Added special treeview style for the layer properties tree
This commit is contained in:
Robert committed 2020-01-06 16:01:35 +01:00
1 parent 14065bffef
commit 59f0062c97
48 files changed
+618 -381

No files matched your search

@@ -1,16 +1,23 @@
using System;
using System.Collections.Generic;
using Artemis.Core.Exceptions;
namespace Artemis.Core.Models.Profile
{
public class LayerProperty
{
internal LayerProperty(Layer layer, LayerProperty parent)
private object _baseValue;
internal LayerProperty(Layer layer, LayerProperty parent, string name, string description, Type type)
{
Layer = layer;
Parent = parent;
Name = name;
Description = description;
Type = type;
Children = new List<LayerProperty>();
Keyframes = new List<Keyframe>();
}
public Layer Layer { get; }
@@ -20,7 +27,23 @@ namespace Artemis.Core.Models.Profile
public string Name { get; set; }
public string Description { get; set; }
public Type Type { get; set; }
public object BaseValue { get; set; }
public object BaseValue
{
get => _baseValue;
set
{
if (value != null && value.GetType() != Type)
throw new ArtemisCoreException($"Cannot set value of type {value.GetType()} on property {Name}, expected type is {Type}.");
_baseValue = value;
}
}
public List<Keyframe> Keyframes { get; set; }
public void ApplyToEntity()
{
// Big o' TODO
}
}
}