diff --git a/src/Artemis.Core/Artemis.Core.csproj.DotSettings b/src/Artemis.Core/Artemis.Core.csproj.DotSettings index d0a878038..0a4b33a3e 100644 --- a/src/Artemis.Core/Artemis.Core.csproj.DotSettings +++ b/src/Artemis.Core/Artemis.Core.csproj.DotSettings @@ -1,4 +1,12 @@  + True + True + True + True + True + True + True + True True True True diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/EqualsConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/EqualsConditionOperator.cs similarity index 93% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/EqualsConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/EqualsConditionOperator.cs index 87b60d484..9981c4910 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/EqualsConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/EqualsConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class EqualsConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/GreaterThanConditionOperator.cs similarity index 94% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/GreaterThanConditionOperator.cs index 6fa3287a5..6735fd128 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/GreaterThanConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class GreaterThanConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanOrEqualConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/GreaterThanOrEqualConditionOperator.cs similarity index 94% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanOrEqualConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/GreaterThanOrEqualConditionOperator.cs index 5bd914abb..2e950af71 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/GreaterThanOrEqualConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/GreaterThanOrEqualConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class GreaterThanOrEqualConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/LessThanConditionOperator.cs similarity index 93% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/LessThanConditionOperator.cs index 72567b9a9..89b47acdd 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/LessThanConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class LessThanConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanOrEqualConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/LessThanOrEqualConditionOperator.cs similarity index 94% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanOrEqualConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/LessThanOrEqualConditionOperator.cs index fd344dbf3..93b4ecd99 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/LessThanOrEqualConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/LessThanOrEqualConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class LessThanOrEqualConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/NotEqualConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/NotEqualConditionOperator.cs similarity index 94% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/NotEqualConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/NotEqualConditionOperator.cs index 4af94147c..b799a2afb 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/NotEqualConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/NotEqualConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class NotEqualConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringContainsConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringContainsConditionOperator.cs similarity index 96% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/StringContainsConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/StringContainsConditionOperator.cs index 3ef231cfd..a2755c3d1 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringContainsConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringContainsConditionOperator.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class StringContainsConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringEndsWithConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringEndsWithConditionOperator.cs similarity index 96% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/StringEndsWithConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/StringEndsWithConditionOperator.cs index 1903984e9..b90a2acf7 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringEndsWithConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringEndsWithConditionOperator.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class StringEndsWithConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringEqualsConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringEqualsConditionOperator.cs similarity index 95% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/StringEqualsConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/StringEqualsConditionOperator.cs index cc0cf432c..b6e0b95f4 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringEqualsConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringEqualsConditionOperator.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class StringEqualsConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotContainsConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringNotContainsConditionOperator.cs similarity index 96% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotContainsConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/StringNotContainsConditionOperator.cs index 97fbac2eb..100b47d50 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotContainsConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringNotContainsConditionOperator.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class StringNotContainsConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotEqualConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringNotEqualConditionOperator.cs similarity index 95% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotEqualConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/StringNotEqualConditionOperator.cs index 33e14b4e1..4a1421967 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNotEqualConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringNotEqualConditionOperator.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class StringNotEqualConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNullConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringNullConditionOperator.cs similarity index 95% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/StringNullConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/StringNullConditionOperator.cs index 6c51024ed..5ab353440 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringNullConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringNullConditionOperator.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Linq.Expressions; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class StringNullConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringStartsWithConditionOperator.cs b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringStartsWithConditionOperator.cs similarity index 96% rename from src/Artemis.Core/Models/Profile/Conditions/Operators/StringStartsWithConditionOperator.cs rename to src/Artemis.Core/DefaultTypes/Conditions/Operators/StringStartsWithConditionOperator.cs index 4b3d9f39b..7dd302975 100644 --- a/src/Artemis.Core/Models/Profile/Conditions/Operators/StringStartsWithConditionOperator.cs +++ b/src/Artemis.Core/DefaultTypes/Conditions/Operators/StringStartsWithConditionOperator.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Linq.Expressions; using System.Reflection; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class StringStartsWithConditionOperator : ConditionOperator { diff --git a/src/Artemis.Core/Models/Profile/DataBindings/Converters/FloatDataBindingConverter.cs b/src/Artemis.Core/DefaultTypes/DataBindings/Converters/FloatDataBindingConverter.cs similarity index 97% rename from src/Artemis.Core/Models/Profile/DataBindings/Converters/FloatDataBindingConverter.cs rename to src/Artemis.Core/DefaultTypes/DataBindings/Converters/FloatDataBindingConverter.cs index ed77db48f..6e458e161 100644 --- a/src/Artemis.Core/Models/Profile/DataBindings/Converters/FloatDataBindingConverter.cs +++ b/src/Artemis.Core/DefaultTypes/DataBindings/Converters/FloatDataBindingConverter.cs @@ -1,7 +1,6 @@ using System; -using SkiaSharp; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { /// public class FloatDataBindingConverter : FloatDataBindingConverter diff --git a/src/Artemis.Core/Models/Profile/DataBindings/Converters/GeneralDataBindingConverter.cs b/src/Artemis.Core/DefaultTypes/DataBindings/Converters/GeneralDataBindingConverter.cs similarity index 94% rename from src/Artemis.Core/Models/Profile/DataBindings/Converters/GeneralDataBindingConverter.cs rename to src/Artemis.Core/DefaultTypes/DataBindings/Converters/GeneralDataBindingConverter.cs index 478b17eea..16ef4bb8e 100644 --- a/src/Artemis.Core/Models/Profile/DataBindings/Converters/GeneralDataBindingConverter.cs +++ b/src/Artemis.Core/DefaultTypes/DataBindings/Converters/GeneralDataBindingConverter.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { /// public class GeneralDataBindingConverter : DataBindingConverter where T : ILayerProperty diff --git a/src/Artemis.Core/Models/Profile/DataBindings/Converters/IntDataBindingConverter.cs b/src/Artemis.Core/DefaultTypes/DataBindings/Converters/IntDataBindingConverter.cs similarity index 97% rename from src/Artemis.Core/Models/Profile/DataBindings/Converters/IntDataBindingConverter.cs rename to src/Artemis.Core/DefaultTypes/DataBindings/Converters/IntDataBindingConverter.cs index 86265461f..b4931f6ed 100644 --- a/src/Artemis.Core/Models/Profile/DataBindings/Converters/IntDataBindingConverter.cs +++ b/src/Artemis.Core/DefaultTypes/DataBindings/Converters/IntDataBindingConverter.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { /// public class IntDataBindingConverter : IntDataBindingConverter diff --git a/src/Artemis.Core/Models/Profile/DataBindings/Converters/SKColorDataBindingConverter.cs b/src/Artemis.Core/DefaultTypes/DataBindings/Converters/SKColorDataBindingConverter.cs similarity index 64% rename from src/Artemis.Core/Models/Profile/DataBindings/Converters/SKColorDataBindingConverter.cs rename to src/Artemis.Core/DefaultTypes/DataBindings/Converters/SKColorDataBindingConverter.cs index d9c0a60dd..917bc1ca8 100644 --- a/src/Artemis.Core/Models/Profile/DataBindings/Converters/SKColorDataBindingConverter.cs +++ b/src/Artemis.Core/DefaultTypes/DataBindings/Converters/SKColorDataBindingConverter.cs @@ -1,10 +1,16 @@ using SkiaSharp; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { /// public class SKColorDataBindingConverter : DataBindingConverter { + public SKColorDataBindingConverter() + { + SupportsInterpolate = true; + SupportsSum = true; + } + /// public override SKColor Sum(SKColor a, SKColor b) { @@ -14,7 +20,7 @@ namespace Artemis.Core /// public override SKColor Interpolate(SKColor a, SKColor b, double progress) { - return a.Interpolate(b, (float)progress); + return a.Interpolate(b, (float) progress); } } -} +} \ No newline at end of file diff --git a/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/DivideModifierType.cs b/src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/DivideModifierType.cs similarity index 95% rename from src/Artemis.Core/Models/Profile/DataBindings/Modifiers/DivideModifierType.cs rename to src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/DivideModifierType.cs index 0497fde96..b3c6a7482 100644 --- a/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/DivideModifierType.cs +++ b/src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/DivideModifierType.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class DivideModifierType : DataBindingModifierType { diff --git a/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/FloorModifierType.cs b/src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/FloorModifierType.cs similarity index 94% rename from src/Artemis.Core/Models/Profile/DataBindings/Modifiers/FloorModifierType.cs rename to src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/FloorModifierType.cs index d04f4cf6a..9f33f79b4 100644 --- a/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/FloorModifierType.cs +++ b/src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/FloorModifierType.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class FloorModifierType : DataBindingModifierType { diff --git a/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/MultiplicationModifier.cs b/src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/MultiplicationModifier.cs similarity index 94% rename from src/Artemis.Core/Models/Profile/DataBindings/Modifiers/MultiplicationModifier.cs rename to src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/MultiplicationModifier.cs index fe71f7ccc..e1c8bb4f7 100644 --- a/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/MultiplicationModifier.cs +++ b/src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/MultiplicationModifier.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class MultiplicationModifierType : DataBindingModifierType { diff --git a/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/PercentageOfModifierType.cs b/src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/PercentageOfModifierType.cs similarity index 95% rename from src/Artemis.Core/Models/Profile/DataBindings/Modifiers/PercentageOfModifierType.cs rename to src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/PercentageOfModifierType.cs index ffc1b4662..24509a689 100644 --- a/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/PercentageOfModifierType.cs +++ b/src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/PercentageOfModifierType.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { internal class PercentageOfModifierType : DataBindingModifierType { diff --git a/src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/SKColorSumModifierType.cs b/src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/SKColorSumModifierType.cs new file mode 100644 index 000000000..df2acbfb2 --- /dev/null +++ b/src/Artemis.Core/DefaultTypes/DataBindings/Modifiers/SKColorSumModifierType.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using SkiaSharp; + +namespace Artemis.Core.DefaultTypes +{ + internal class SKColorSumModifierType : DataBindingModifierType + { + public override IReadOnlyCollection CompatibleTypes => new List {typeof(SKColor)}; + public override string Description => "Combine with"; + public override string Icon => "FormatColorFill"; + + public override object Apply(object currentValue, object parameterValue) + { + return ((SKColor) currentValue).Sum((SKColor) parameterValue); + } + } +} \ No newline at end of file diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/ColorGradientLayerProperty.cs b/src/Artemis.Core/DefaultTypes/Properties/ColorGradientLayerProperty.cs similarity index 96% rename from src/Artemis.Core/Models/Profile/LayerProperties/Types/ColorGradientLayerProperty.cs rename to src/Artemis.Core/DefaultTypes/Properties/ColorGradientLayerProperty.cs index fc1f58542..cc996aa4a 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/ColorGradientLayerProperty.cs +++ b/src/Artemis.Core/DefaultTypes/Properties/ColorGradientLayerProperty.cs @@ -1,4 +1,4 @@ -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { /// public class ColorGradientLayerProperty : LayerProperty diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/EnumLayerProperty.cs b/src/Artemis.Core/DefaultTypes/Properties/EnumLayerProperty.cs similarity index 96% rename from src/Artemis.Core/Models/Profile/LayerProperties/Types/EnumLayerProperty.cs rename to src/Artemis.Core/DefaultTypes/Properties/EnumLayerProperty.cs index eb99a3b3e..9068441f3 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/EnumLayerProperty.cs +++ b/src/Artemis.Core/DefaultTypes/Properties/EnumLayerProperty.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { /// public class EnumLayerProperty : LayerProperty where T : Enum diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/FloatLayerProperty.cs b/src/Artemis.Core/DefaultTypes/Properties/FloatLayerProperty.cs similarity index 96% rename from src/Artemis.Core/Models/Profile/LayerProperties/Types/FloatLayerProperty.cs rename to src/Artemis.Core/DefaultTypes/Properties/FloatLayerProperty.cs index e425154cd..633d27763 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/FloatLayerProperty.cs +++ b/src/Artemis.Core/DefaultTypes/Properties/FloatLayerProperty.cs @@ -1,4 +1,4 @@ -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { /// public class FloatLayerProperty : LayerProperty diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/IntLayerProperty.cs b/src/Artemis.Core/DefaultTypes/Properties/IntLayerProperty.cs similarity index 97% rename from src/Artemis.Core/Models/Profile/LayerProperties/Types/IntLayerProperty.cs rename to src/Artemis.Core/DefaultTypes/Properties/IntLayerProperty.cs index db567e619..edb785e29 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/IntLayerProperty.cs +++ b/src/Artemis.Core/DefaultTypes/Properties/IntLayerProperty.cs @@ -1,6 +1,6 @@ using System; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { /// public class IntLayerProperty : LayerProperty diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/LayerBrushReferenceLayerProperty.cs b/src/Artemis.Core/DefaultTypes/Properties/LayerBrushReferenceLayerProperty.cs similarity index 96% rename from src/Artemis.Core/Models/Profile/LayerProperties/Types/LayerBrushReferenceLayerProperty.cs rename to src/Artemis.Core/DefaultTypes/Properties/LayerBrushReferenceLayerProperty.cs index 04eb19730..2403b2f35 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/LayerBrushReferenceLayerProperty.cs +++ b/src/Artemis.Core/DefaultTypes/Properties/LayerBrushReferenceLayerProperty.cs @@ -1,4 +1,4 @@ -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { /// /// A special layer property used to configure the selected layer brush diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKColorLayerProperty.cs b/src/Artemis.Core/DefaultTypes/Properties/SKColorLayerProperty.cs similarity index 96% rename from src/Artemis.Core/Models/Profile/LayerProperties/Types/SKColorLayerProperty.cs rename to src/Artemis.Core/DefaultTypes/Properties/SKColorLayerProperty.cs index a7663a789..201086356 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKColorLayerProperty.cs +++ b/src/Artemis.Core/DefaultTypes/Properties/SKColorLayerProperty.cs @@ -1,6 +1,6 @@ using SkiaSharp; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { /// public class SKColorLayerProperty : LayerProperty diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKPointLayerProperty.cs b/src/Artemis.Core/DefaultTypes/Properties/SKPointLayerProperty.cs similarity index 96% rename from src/Artemis.Core/Models/Profile/LayerProperties/Types/SKPointLayerProperty.cs rename to src/Artemis.Core/DefaultTypes/Properties/SKPointLayerProperty.cs index 53484042f..f9836d457 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKPointLayerProperty.cs +++ b/src/Artemis.Core/DefaultTypes/Properties/SKPointLayerProperty.cs @@ -1,6 +1,6 @@ using SkiaSharp; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { /// public class SKPointLayerProperty : LayerProperty diff --git a/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKSizeLayerProperty.cs b/src/Artemis.Core/DefaultTypes/Properties/SKSizeLayerProperty.cs similarity index 96% rename from src/Artemis.Core/Models/Profile/LayerProperties/Types/SKSizeLayerProperty.cs rename to src/Artemis.Core/DefaultTypes/Properties/SKSizeLayerProperty.cs index f23a5ac19..bdfc66688 100644 --- a/src/Artemis.Core/Models/Profile/LayerProperties/Types/SKSizeLayerProperty.cs +++ b/src/Artemis.Core/DefaultTypes/Properties/SKSizeLayerProperty.cs @@ -1,6 +1,6 @@ using SkiaSharp; -namespace Artemis.Core +namespace Artemis.Core.DefaultTypes { /// public class SKSizeLayerProperty : LayerProperty diff --git a/src/Artemis.Core/Models/Profile/DataBindings/Converters/Internal/SKColorArgbDataBindingConverter.cs b/src/Artemis.Core/Models/Profile/DataBindings/Converters/Internal/SKColorArgbDataBindingConverter.cs deleted file mode 100644 index e713bd23a..000000000 --- a/src/Artemis.Core/Models/Profile/DataBindings/Converters/Internal/SKColorArgbDataBindingConverter.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using SkiaSharp; - -namespace Artemis.Core -{ - // This is internal because it's mainly a proof-of-concept - internal class SKColorArgbDataBindingConverter : DataBindingConverter - { - private readonly Channel _channel; - - public SKColorArgbDataBindingConverter(Channel channel) - { - _channel = channel; - - SupportsSum = true; - SupportsInterpolate = true; - } - - public override byte Sum(byte a, byte b) - { - return ClampToByte(a + b); - } - - public override byte Interpolate(byte a, byte b, double progress) - { - var diff = b - a; - return ClampToByte(a + diff * progress); - } - - public override void ApplyValue(byte value) - { - switch (_channel) - { - case Channel.Alpha: - DataBinding.LayerProperty.CurrentValue = DataBinding.LayerProperty.CurrentValue.WithAlpha(value); - break; - case Channel.Red: - DataBinding.LayerProperty.CurrentValue = DataBinding.LayerProperty.CurrentValue.WithRed(value); - break; - case Channel.Green: - DataBinding.LayerProperty.CurrentValue = DataBinding.LayerProperty.CurrentValue.WithGreen(value); - break; - case Channel.Blue: - DataBinding.LayerProperty.CurrentValue = DataBinding.LayerProperty.CurrentValue.WithBlue(value); - break; - default: - throw new ArgumentOutOfRangeException(); - } - } - - public override byte ConvertFromObject(object source) - { - var saveValue = Convert.ToDouble(source); - return ClampToByte(saveValue); - } - - private static byte ClampToByte(double value) - { - return (byte) Math.Clamp(value, 0, 255); - } - - public enum Channel - { - Alpha, - Red, - Green, - Blue - } - } -} \ No newline at end of file diff --git a/src/Artemis.Core/Models/Profile/DataBindings/Modifiers/Abstract/DataBindingModifierType.cs b/src/Artemis.Core/Models/Profile/DataBindings/DataBindingModifierType.cs similarity index 100% rename from src/Artemis.Core/Models/Profile/DataBindings/Modifiers/Abstract/DataBindingModifierType.cs rename to src/Artemis.Core/Models/Profile/DataBindings/DataBindingModifierType.cs diff --git a/src/Artemis.Core/Models/Profile/LayerGeneralProperties.cs b/src/Artemis.Core/Models/Profile/LayerGeneralProperties.cs index 40b4cb7eb..c5e6d0c2c 100644 --- a/src/Artemis.Core/Models/Profile/LayerGeneralProperties.cs +++ b/src/Artemis.Core/Models/Profile/LayerGeneralProperties.cs @@ -1,4 +1,5 @@ -using SkiaSharp; +using Artemis.Core.DefaultTypes; +using SkiaSharp; namespace Artemis.Core { diff --git a/src/Artemis.Core/Models/Profile/LayerTransformProperties.cs b/src/Artemis.Core/Models/Profile/LayerTransformProperties.cs index 7c9d8c2ff..a0d858156 100644 --- a/src/Artemis.Core/Models/Profile/LayerTransformProperties.cs +++ b/src/Artemis.Core/Models/Profile/LayerTransformProperties.cs @@ -1,4 +1,5 @@ -using SkiaSharp; +using Artemis.Core.DefaultTypes; +using SkiaSharp; namespace Artemis.Core { diff --git a/src/Artemis.Core/Plugins/Modules/Module.cs b/src/Artemis.Core/Plugins/Modules/Module.cs index e67eb1174..0892e6ab2 100644 --- a/src/Artemis.Core/Plugins/Modules/Module.cs +++ b/src/Artemis.Core/Plugins/Modules/Module.cs @@ -165,16 +165,6 @@ namespace Artemis.Core.Modules /// public abstract void ModuleDeactivated(bool isOverride); - internal virtual void InternalUpdate(double deltaTime) - { - Update(deltaTime); - } - - internal virtual void InternalRender(double deltaTime, ArtemisSurface surface, SKCanvas canvas, SKImageInfo canvasInfo) - { - Render(deltaTime, surface, canvas, canvasInfo); - } - /// /// Evaluates the activation requirements following the and returns the result /// @@ -190,6 +180,16 @@ namespace Artemis.Core.Modules return false; } + + internal virtual void InternalUpdate(double deltaTime) + { + Update(deltaTime); + } + + internal virtual void InternalRender(double deltaTime, ArtemisSurface surface, SKCanvas canvas, SKImageInfo canvasInfo) + { + Render(deltaTime, surface, canvas, canvasInfo); + } internal virtual void Activate(bool isOverride) { diff --git a/src/Artemis.Core/Plugins/Plugin.cs b/src/Artemis.Core/Plugins/Plugin.cs index dd6c0542f..0d9388737 100644 --- a/src/Artemis.Core/Plugins/Plugin.cs +++ b/src/Artemis.Core/Plugins/Plugin.cs @@ -39,6 +39,20 @@ namespace Artemis.Core /// public abstract void DisablePlugin(); + /// + /// Registers a timed update that whenever the plugin is enabled calls the provided at the provided + /// + /// + /// The interval at which the update should occur + /// The action to call every time the interval has passed. The delta time parameter represents the time passed since the last update in seconds + /// The resulting plugin update registration + public PluginUpdateRegistration AddTimedUpdate(TimeSpan interval, Action action) + { + if (action == null) + throw new ArgumentNullException(nameof(action)); + return new PluginUpdateRegistration(PluginInfo, interval, action); + } + internal void SetEnabled(bool enable, bool isAutoEnable = false) { if (enable && !Enabled) diff --git a/src/Artemis.Core/Plugins/PluginUpdateRegistration.cs b/src/Artemis.Core/Plugins/PluginUpdateRegistration.cs new file mode 100644 index 000000000..010e32511 --- /dev/null +++ b/src/Artemis.Core/Plugins/PluginUpdateRegistration.cs @@ -0,0 +1,102 @@ +using System; +using System.Timers; + +namespace Artemis.Core +{ + /// + /// Represents a registration for a timed plugin update + /// + public class PluginUpdateRegistration + { + private DateTime _lastEvent; + private Timer _timer; + + internal PluginUpdateRegistration(PluginInfo pluginInfo, TimeSpan interval, Action action) + { + PluginInfo = pluginInfo; + Interval = interval; + Action = action; + + PluginInfo.Instance.PluginEnabled += InstanceOnPluginEnabled; + PluginInfo.Instance.PluginDisabled += InstanceOnPluginDisabled; + + if (PluginInfo.Instance.Enabled) + Start(); + } + + /// + /// Gets the plugin info of the plugin this registration is associated with + /// + public PluginInfo PluginInfo { get; } + + /// + /// Gets the interval at which the update should occur + /// + public TimeSpan Interval { get; } + + /// + /// Gets the action that gets called each time the update event fires + /// + public Action Action { get; } + + /// + /// Starts calling the at the configured + /// Note: Called automatically when the plugin enables + /// + public void Start() + { + lock (this) + { + if (!PluginInfo.Instance.Enabled) + throw new ArtemisPluginException("Cannot start a timed update for a disabled plugin"); + + if (_timer != null) + return; + + _lastEvent = DateTime.Now; + _timer = new Timer(Interval.TotalMilliseconds); + _timer.Elapsed += TimerOnElapsed; + _timer.Start(); + } + } + + /// + /// Stops calling the at the configured + /// Note: Called automatically when the plugin disables + /// + public void Stop() + { + lock (this) + { + if (_timer == null) + return; + + _timer.Elapsed -= TimerOnElapsed; + _timer.Stop(); + _timer.Dispose(); + _timer = null; + } + } + + private void TimerOnElapsed(object sender, ElapsedEventArgs e) + { + if (!PluginInfo.Instance.Enabled) + return; + + var interval = DateTime.Now - _lastEvent; + _lastEvent = DateTime.Now; + + Action(interval.TotalSeconds); + } + + private void InstanceOnPluginEnabled(object? sender, EventArgs e) + { + Start(); + } + + private void InstanceOnPluginDisabled(object? sender, EventArgs e) + { + Stop(); + } + } +} \ No newline at end of file diff --git a/src/Artemis.Core/Services/Registration/ConditionOperatorService.cs b/src/Artemis.Core/Services/Registration/ConditionOperatorService.cs index 9ea6fab80..bfae42d34 100644 --- a/src/Artemis.Core/Services/Registration/ConditionOperatorService.cs +++ b/src/Artemis.Core/Services/Registration/ConditionOperatorService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Artemis.Core.DefaultTypes; namespace Artemis.Core.Services { diff --git a/src/Artemis.Core/Services/Registration/DataBindingService.cs b/src/Artemis.Core/Services/Registration/DataBindingService.cs index 4acec1b62..3a82340c1 100644 --- a/src/Artemis.Core/Services/Registration/DataBindingService.cs +++ b/src/Artemis.Core/Services/Registration/DataBindingService.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using Artemis.Core.DefaultTypes; namespace Artemis.Core.Services { @@ -45,6 +46,7 @@ namespace Artemis.Core.Services RegisterModifierType(Constants.CorePluginInfo, new PercentageOfModifierType()); RegisterModifierType(Constants.CorePluginInfo, new DivideModifierType()); RegisterModifierType(Constants.CorePluginInfo, new FloorModifierType()); + RegisterModifierType(Constants.CorePluginInfo, new SKColorSumModifierType()); } } } \ No newline at end of file diff --git a/src/Artemis.Core/Stores/DataBindingModifierTypeStore.cs b/src/Artemis.Core/Stores/DataBindingModifierTypeStore.cs index b398ed925..ca19b2208 100644 --- a/src/Artemis.Core/Stores/DataBindingModifierTypeStore.cs +++ b/src/Artemis.Core/Stores/DataBindingModifierTypeStore.cs @@ -53,7 +53,7 @@ namespace Artemis.Core if (type == null) return new List(Registrations); - var candidates = Registrations.Where(r => r.DataBindingModifierType.CompatibleTypes.Any(t => t.IsCastableFrom(type))).ToList(); + var candidates = Registrations.Where(r => r.DataBindingModifierType.CompatibleTypes.Any(t => t == type)).ToList(); // If there are multiple operators with the same description, use the closest match foreach (var displayDataBindingModifiers in candidates.GroupBy(r => r.DataBindingModifierType.Description).Where(g => g.Count() > 1).ToList()) diff --git a/src/Artemis.Plugins.DataModelExpansions.TestData/Artemis.Plugins.DataModelExpansions.TestData.csproj b/src/Artemis.Plugins.DataModelExpansions.TestData/Artemis.Plugins.DataModelExpansions.TestData.csproj new file mode 100644 index 000000000..91d9e96d8 --- /dev/null +++ b/src/Artemis.Plugins.DataModelExpansions.TestData/Artemis.Plugins.DataModelExpansions.TestData.csproj @@ -0,0 +1,39 @@ + + + netcoreapp3.1 + false + + Artemis.Plugins.DataModelExpansions.TestData + Artemis.Plugins.DataModelExpansions.TestData + x64 + False + + + + x64 + + + + + + all + + + all + + + + + + + + + + PreserveNewest + + + + + + + \ No newline at end of file diff --git a/src/Artemis.Plugins.DataModelExpansions.TestData/DataModels/PluginDataModel.cs b/src/Artemis.Plugins.DataModelExpansions.TestData/DataModels/PluginDataModel.cs new file mode 100644 index 000000000..ebb2c24cf --- /dev/null +++ b/src/Artemis.Plugins.DataModelExpansions.TestData/DataModels/PluginDataModel.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using Artemis.Core.DataModelExpansions; +using SkiaSharp; + +namespace Artemis.Plugins.DataModelExpansions.TestData.DataModels +{ + public class PluginDataModel : DataModel + { + public PluginDataModel() + { + PluginSubDataModel = new PluginSubDataModel(); + } + + // Your datamodel can have regular properties and you can annotate them if you'd like + [DataModelProperty(Name = "A test string", Description = "It doesn't do much, but it's there.")] + public string TemplateDataModelString { get; set; } + + public SKColor TestColorA { get; set; } + public SKColor TestColorB { get; set; } + + // You can even have classes in your datamodel, just don't forget to instantiate them ;) + [DataModelProperty(Name = "A class within the datamodel")] + public PluginSubDataModel PluginSubDataModel { get; set; } + } + + public class PluginSubDataModel + { + public PluginSubDataModel() + { + ListOfInts = new List { 1, 2, 3, 4, 5 }; + } + + // You don't need to annotate properties, they will still show up + public float FloatyFloat { get; set; } + + // You can even have a list! + public List ListOfInts { get; set; } + + // If you don't want a property to show up in the datamodel, annotate it with DataModelIgnore + [DataModelIgnore] + public string MyDarkestSecret { get; set; } + } +} \ No newline at end of file diff --git a/src/Artemis.Plugins.DataModelExpansions.TestData/PluginDataModelExpansion.cs b/src/Artemis.Plugins.DataModelExpansions.TestData/PluginDataModelExpansion.cs new file mode 100644 index 000000000..38ece82fd --- /dev/null +++ b/src/Artemis.Plugins.DataModelExpansions.TestData/PluginDataModelExpansion.cs @@ -0,0 +1,34 @@ +using System; +using Artemis.Core.DataModelExpansions; +using Artemis.Plugins.DataModelExpansions.TestData.DataModels; +using SkiaSharp; + +namespace Artemis.Plugins.DataModelExpansions.TestData +{ + public class PluginDataModelExpansion : DataModelExpansion + { + private Random _rand; + + public override void EnablePlugin() + { + _rand = new Random(); + AddTimedUpdate(TimeSpan.FromSeconds(1), TimedUpdate); + } + + private void TimedUpdate(double deltaTime) + { + DataModel.TestColorA = SKColor.FromHsv(_rand.Next(0, 360), 100, 100); + DataModel.TestColorB = SKColor.FromHsv(_rand.Next(0, 360), 100, 100); + } + + public override void DisablePlugin() + { + } + + public override void Update(double deltaTime) + { + // You can access your data model here and update it however you like + DataModel.TemplateDataModelString = $"The last delta time was {deltaTime} seconds"; + } + } +} \ No newline at end of file diff --git a/src/Artemis.Plugins.DataModelExpansions.TestData/Properties/launchSettings.json b/src/Artemis.Plugins.DataModelExpansions.TestData/Properties/launchSettings.json new file mode 100644 index 000000000..e7eb59a06 --- /dev/null +++ b/src/Artemis.Plugins.DataModelExpansions.TestData/Properties/launchSettings.json @@ -0,0 +1,9 @@ +{ + "profiles": { + "ModuleProject": { + "commandName": "Executable", + "executablePath": "C:\\Repos\\Artemis\\src\\Artemis.UI\\bin\\x64\\Debug\\netcoreapp3.1\\Artemis.UI.exe", + "workingDirectory": "C:\\Repos\\Artemis\\src\\Artemis.UI\\bin\\x64\\Debug\\netcoreapp3.1" + } + } +} \ No newline at end of file diff --git a/src/Artemis.Plugins.DataModelExpansions.TestData/plugin.json b/src/Artemis.Plugins.DataModelExpansions.TestData/plugin.json new file mode 100644 index 000000000..0fc53bc41 --- /dev/null +++ b/src/Artemis.Plugins.DataModelExpansions.TestData/plugin.json @@ -0,0 +1,7 @@ +{ + "Guid": "ab41d601-35e0-4a73-bf0b-94509b006ab0", + "Name": "Test data model expansion", + "Description": "A data model expansion providing test data", + "Version": "1.0.0.0", + "Main": "Artemis.Plugins.DataModelExpansions.TestData.dll" +} \ No newline at end of file diff --git a/src/Artemis.sln b/src/Artemis.sln index 8b6d01397..8ccde0555 100644 --- a/src/Artemis.sln +++ b/src/Artemis.sln @@ -17,6 +17,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artemis.UI", "Artemis.UI\Ar {0F288A66-6EB0-4589-8595-E33A3A3EAEA2} = {0F288A66-6EB0-4589-8595-E33A3A3EAEA2} {A46F278A-FC2C-4342-8455-994D957DDA03} = {A46F278A-FC2C-4342-8455-994D957DDA03} {26902C94-3EBC-4132-B7F0-FFCAB8E150DA} = {26902C94-3EBC-4132-B7F0-FFCAB8E150DA} + {5353C9A2-2D9A-4051-8599-AFE56D54B882} = {5353C9A2-2D9A-4051-8599-AFE56D54B882} {7F4C7AB0-4C9B-452D-AFED-34544C903DEF} = {7F4C7AB0-4C9B-452D-AFED-34544C903DEF} {235A45C7-24AD-4F47-B9D4-CD67E610A04D} = {235A45C7-24AD-4F47-B9D4-CD67E610A04D} {D004FEC9-0CF8-4828-B620-95DBA73201A3} = {D004FEC9-0CF8-4828-B620-95DBA73201A3} @@ -79,6 +80,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artemis.Plugins.Devices.Deb EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artemis.Plugins.Modules.Overlay", "Plugins\Artemis.Plugins.Modules.Overlay\Artemis.Plugins.Modules.Overlay.csproj", "{00318027-7FDB-4C86-AB86-9005A481E330}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DataModelExpansions", "DataModelExpansions", "{5A5B55D7-F631-467A-A16F-B880DE4E8909}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artemis.Plugins.DataModelExpansions.TestData", "Artemis.Plugins.DataModelExpansions.TestData\Artemis.Plugins.DataModelExpansions.TestData.csproj", "{5353C9A2-2D9A-4051-8599-AFE56D54B882}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -177,6 +182,10 @@ Global {00318027-7FDB-4C86-AB86-9005A481E330}.Debug|x64.Build.0 = Debug|x64 {00318027-7FDB-4C86-AB86-9005A481E330}.Release|x64.ActiveCfg = Release|x64 {00318027-7FDB-4C86-AB86-9005A481E330}.Release|x64.Build.0 = Release|x64 + {5353C9A2-2D9A-4051-8599-AFE56D54B882}.Debug|x64.ActiveCfg = Debug|x64 + {5353C9A2-2D9A-4051-8599-AFE56D54B882}.Debug|x64.Build.0 = Debug|x64 + {5353C9A2-2D9A-4051-8599-AFE56D54B882}.Release|x64.ActiveCfg = Release|x64 + {5353C9A2-2D9A-4051-8599-AFE56D54B882}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -205,6 +214,8 @@ Global {62214042-667E-4B29-B64E-1A68CE6FE209} = {2C1477DC-7A5C-4B65-85DB-1F16A18FB2EC} {3D83760B-0A36-4C8F-978D-7949C3FC862B} = {88792A7E-F037-4280-81D3-B131508EF1D8} {00318027-7FDB-4C86-AB86-9005A481E330} = {B258A061-FA19-4835-8DC4-E9C3AE3664A0} + {5A5B55D7-F631-467A-A16F-B880DE4E8909} = {E830A02B-A7E5-4A6B-943F-76B0A542630C} + {5353C9A2-2D9A-4051-8599-AFE56D54B882} = {5A5B55D7-F631-467A-A16F-B880DE4E8909} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {C203080A-4473-4CC2-844B-F552EA43D66A} diff --git a/src/Plugins/Artemis.Plugins.LayerBrushes.Color/PropertyGroups/ColorBrushProperties.cs b/src/Plugins/Artemis.Plugins.LayerBrushes.Color/PropertyGroups/ColorBrushProperties.cs index beeaec69a..9fb39f515 100644 --- a/src/Plugins/Artemis.Plugins.LayerBrushes.Color/PropertyGroups/ColorBrushProperties.cs +++ b/src/Plugins/Artemis.Plugins.LayerBrushes.Color/PropertyGroups/ColorBrushProperties.cs @@ -1,5 +1,6 @@ using System.ComponentModel; using Artemis.Core; +using Artemis.Core.DefaultTypes; using SkiaSharp; namespace Artemis.Plugins.LayerBrushes.Color.PropertyGroups diff --git a/src/Plugins/Artemis.Plugins.LayerBrushes.Color/PropertyGroups/RadialGradientProperties.cs b/src/Plugins/Artemis.Plugins.LayerBrushes.Color/PropertyGroups/RadialGradientProperties.cs index 21afb4bf5..a09836988 100644 --- a/src/Plugins/Artemis.Plugins.LayerBrushes.Color/PropertyGroups/RadialGradientProperties.cs +++ b/src/Plugins/Artemis.Plugins.LayerBrushes.Color/PropertyGroups/RadialGradientProperties.cs @@ -1,5 +1,6 @@ using System.ComponentModel; using Artemis.Core; +using Artemis.Core.DefaultTypes; namespace Artemis.Plugins.LayerBrushes.Color.PropertyGroups { diff --git a/src/Plugins/Artemis.Plugins.LayerBrushes.ColorRgbNet/RgbNetColorBrushProperties.cs b/src/Plugins/Artemis.Plugins.LayerBrushes.ColorRgbNet/RgbNetColorBrushProperties.cs index 5431e153c..5ed2ed592 100644 --- a/src/Plugins/Artemis.Plugins.LayerBrushes.ColorRgbNet/RgbNetColorBrushProperties.cs +++ b/src/Plugins/Artemis.Plugins.LayerBrushes.ColorRgbNet/RgbNetColorBrushProperties.cs @@ -1,4 +1,5 @@ using Artemis.Core; +using Artemis.Core.DefaultTypes; using SkiaSharp; namespace Artemis.Plugins.LayerBrushes.ColorRgbNet diff --git a/src/Plugins/Artemis.Plugins.LayerBrushes.Noise/NoiseBrushProperties.cs b/src/Plugins/Artemis.Plugins.LayerBrushes.Noise/NoiseBrushProperties.cs index 95e079ee0..86607f93c 100644 --- a/src/Plugins/Artemis.Plugins.LayerBrushes.Noise/NoiseBrushProperties.cs +++ b/src/Plugins/Artemis.Plugins.LayerBrushes.Noise/NoiseBrushProperties.cs @@ -1,4 +1,5 @@ using Artemis.Core; +using Artemis.Core.DefaultTypes; using SkiaSharp; namespace Artemis.Plugins.LayerBrushes.Noise diff --git a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/BlurEffectProperties.cs b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/BlurEffectProperties.cs index 4e8ddfb53..cf2c49104 100644 --- a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/BlurEffectProperties.cs +++ b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/BlurEffectProperties.cs @@ -1,4 +1,5 @@ using Artemis.Core; +using Artemis.Core.DefaultTypes; namespace Artemis.Plugins.LayerEffects.Filter { diff --git a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/DilateEffectProperties.cs b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/DilateEffectProperties.cs index 9ebf23ac7..9808b6f4d 100644 --- a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/DilateEffectProperties.cs +++ b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/DilateEffectProperties.cs @@ -1,4 +1,5 @@ using Artemis.Core; +using Artemis.Core.DefaultTypes; namespace Artemis.Plugins.LayerEffects.Filter { diff --git a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/ErodeEffectProperties.cs b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/ErodeEffectProperties.cs index 39c8feb99..3760ffecc 100644 --- a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/ErodeEffectProperties.cs +++ b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/ErodeEffectProperties.cs @@ -1,4 +1,5 @@ using Artemis.Core; +using Artemis.Core.DefaultTypes; namespace Artemis.Plugins.LayerEffects.Filter { diff --git a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/GlowEffectProperties.cs b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/GlowEffectProperties.cs index 9d73c25cd..97b575fe2 100644 --- a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/GlowEffectProperties.cs +++ b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/GlowEffectProperties.cs @@ -1,4 +1,5 @@ using Artemis.Core; +using Artemis.Core.DefaultTypes; using SkiaSharp; namespace Artemis.Plugins.LayerEffects.Filter diff --git a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/GrayScaleEffectProperties.cs b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/GrayScaleEffectProperties.cs index d931f6c22..11ff5d5d1 100644 --- a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/GrayScaleEffectProperties.cs +++ b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/GrayScaleEffectProperties.cs @@ -1,4 +1,5 @@ using Artemis.Core; +using Artemis.Core.DefaultTypes; namespace Artemis.Plugins.LayerEffects.Filter { diff --git a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/OpacityEffect.cs b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/OpacityEffect.cs index be618b7ab..40498684a 100644 --- a/src/Plugins/Artemis.Plugins.LayerEffects.Filter/OpacityEffect.cs +++ b/src/Plugins/Artemis.Plugins.LayerEffects.Filter/OpacityEffect.cs @@ -1,4 +1,5 @@ using Artemis.Core; +using Artemis.Core.DefaultTypes; using Artemis.Core.LayerEffects; using SkiaSharp; diff --git a/src/Plugins/Artemis.Plugins.Modules.General/DataModels/GeneralDataModel.cs b/src/Plugins/Artemis.Plugins.Modules.General/DataModels/GeneralDataModel.cs index da72828a4..e986d74ee 100644 --- a/src/Plugins/Artemis.Plugins.Modules.General/DataModels/GeneralDataModel.cs +++ b/src/Plugins/Artemis.Plugins.Modules.General/DataModels/GeneralDataModel.cs @@ -1,6 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; using Artemis.Core.DataModelExpansions; using Artemis.Plugins.Modules.General.DataModels.Windows; @@ -11,19 +9,10 @@ namespace Artemis.Plugins.Modules.General.DataModels public GeneralDataModel() { TimeDataModel = new TimeDataModel(); - TestTimeList = new List(); - - var testExpression = new Func((leftItem, rightDataModel) => - ((TimeDataModel) leftItem).CurrentTime.Month == ((GeneralDataModel) rightDataModel).TimeDataModel.CurrentTime.Day); - - - var test = TestTimeList.Any(model => testExpression(model, this)); } public WindowDataModel ActiveWindow { get; set; } public TimeDataModel TimeDataModel { get; set; } - - public List TestTimeList { get; set; } } public class TimeDataModel : DataModel diff --git a/src/Plugins/Artemis.Plugins.Modules.General/GeneralModule.cs b/src/Plugins/Artemis.Plugins.Modules.General/GeneralModule.cs index e6bfecda7..773256d97 100644 --- a/src/Plugins/Artemis.Plugins.Modules.General/GeneralModule.cs +++ b/src/Plugins/Artemis.Plugins.Modules.General/GeneralModule.cs @@ -19,11 +19,6 @@ namespace Artemis.Plugins.Modules.General DisplayIcon = "AllInclusive"; ExpandsDataModel = true; ModuleTabs = new List {new ModuleTab("General")}; - - DataModel.TestTimeList.Add(new TimeDataModel {CurrentTime = DateTimeOffset.Now.AddDays(1)}); - DataModel.TestTimeList.Add(new TimeDataModel {CurrentTime = DateTimeOffset.Now.AddDays(2)}); - DataModel.TestTimeList.Add(new TimeDataModel {CurrentTime = DateTimeOffset.Now.AddDays(3)}); - DataModel.TestTimeList.Add(new TimeDataModel {CurrentTime = DateTimeOffset.Now.AddDays(4)}); } public override void DisablePlugin()