mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Merge branch 'development'
This commit is contained in:
commit
e82e277758
@ -68,6 +68,7 @@
|
|||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cwebserver/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cwebserver/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cwebserver_005Ccontrollers/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cwebserver_005Ccontrollers/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cwebserver_005Cendpoints/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cwebserver_005Cendpoints/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cwebserver_005Cendpoints_005Ceventargs/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cwebserver_005Cinterfaces/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cwebserver_005Cinterfaces/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cwebserver_005Cjson/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=services_005Cwebserver_005Cjson/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=stores/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=stores/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
|||||||
@ -11,9 +11,8 @@ namespace Artemis.Core
|
|||||||
public class DataModelConditionEvent : DataModelConditionPart
|
public class DataModelConditionEvent : DataModelConditionPart
|
||||||
{
|
{
|
||||||
private bool _disposed;
|
private bool _disposed;
|
||||||
private IDataModelEvent? _event;
|
|
||||||
private bool _eventTriggered;
|
|
||||||
private bool _reinitializing;
|
private bool _reinitializing;
|
||||||
|
private DateTime _lastTrigger;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Creates a new instance of the <see cref="DataModelConditionEvent" /> class
|
/// Creates a new instance of the <see cref="DataModelConditionEvent" /> class
|
||||||
@ -53,22 +52,21 @@ namespace Artemis.Core
|
|||||||
if (_disposed)
|
if (_disposed)
|
||||||
throw new ObjectDisposedException("DataModelConditionEvent");
|
throw new ObjectDisposedException("DataModelConditionEvent");
|
||||||
|
|
||||||
// Ensure the event has not been replaced
|
if (EventPath?.GetValue() is not IDataModelEvent dataModelEvent)
|
||||||
if (EventPath?.GetValue() is IDataModelEvent dataModelEvent && _event != dataModelEvent)
|
return false;
|
||||||
SubscribeToDataModelEvent(dataModelEvent);
|
// Only evaluate to true once every time the event has been triggered since the last evaluation
|
||||||
|
if (dataModelEvent.LastTrigger <= _lastTrigger)
|
||||||
// Only evaluate to true once every time the event has been triggered
|
|
||||||
if (!_eventTriggered)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
_eventTriggered = false;
|
_lastTrigger = DateTime.Now;
|
||||||
|
|
||||||
// If there is a child (root group), it must evaluate to true whenever the event triggered
|
// If there is a child (root group), it must evaluate to true whenever the event triggered
|
||||||
if (Children.Any())
|
if (Children.Any())
|
||||||
return Children[0].EvaluateObject(_event?.LastEventArgumentsUntyped);
|
return Children[0].EvaluateObject(dataModelEvent.LastEventArgumentsUntyped);
|
||||||
|
|
||||||
// If there are no children, we always evaluate to true whenever the event triggered
|
// If there are no children, we always evaluate to true whenever the event triggered
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -172,16 +170,9 @@ namespace Artemis.Core
|
|||||||
Entity.Children.Clear();
|
Entity.Children.Clear();
|
||||||
AddChild(new DataModelConditionGroup(this));
|
AddChild(new DataModelConditionGroup(this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void SubscribeToDataModelEvent(IDataModelEvent dataModelEvent)
|
if (EventPath?.GetValue() is IDataModelEvent dataModelEvent)
|
||||||
{
|
_lastTrigger = dataModelEvent.LastTrigger;
|
||||||
if (_event != null)
|
|
||||||
_event.EventTriggered -= OnEventTriggered;
|
|
||||||
|
|
||||||
_event = dataModelEvent;
|
|
||||||
if (_event != null)
|
|
||||||
_event.EventTriggered += OnEventTriggered;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private Type? GetEventArgumentType()
|
private Type? GetEventArgumentType()
|
||||||
@ -212,11 +203,6 @@ namespace Artemis.Core
|
|||||||
|
|
||||||
#region Event handlers
|
#region Event handlers
|
||||||
|
|
||||||
private void OnEventTriggered(object? sender, EventArgs e)
|
|
||||||
{
|
|
||||||
_eventTriggered = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void EventPathOnPathValidated(object? sender, EventArgs e)
|
private void EventPathOnPathValidated(object? sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (_reinitializing)
|
if (_reinitializing)
|
||||||
|
|||||||
@ -0,0 +1,71 @@
|
|||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Artemis.Core.DataModelExpansions;
|
||||||
|
using Artemis.Core.Modules;
|
||||||
|
using EmbedIO;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace Artemis.Core.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Represents a plugin web endpoint receiving an object of type <typeparamref name="T" /> and returning any
|
||||||
|
/// <see cref="object" /> or <see langword="null" />.
|
||||||
|
/// <para>Note: Both will be deserialized and serialized respectively using JSON.</para>
|
||||||
|
/// </summary>
|
||||||
|
public class DataModelJsonPluginEndPoint<T> : PluginEndPoint where T : DataModel
|
||||||
|
{
|
||||||
|
private readonly Module<T>? _module;
|
||||||
|
private readonly DataModelExpansion<T>? _dataModelExpansion;
|
||||||
|
|
||||||
|
internal DataModelJsonPluginEndPoint(Module<T> module, string name, PluginsModule pluginsModule) : base(module, name, pluginsModule)
|
||||||
|
{
|
||||||
|
_module = module ?? throw new ArgumentNullException(nameof(module));
|
||||||
|
|
||||||
|
ThrowOnFail = true;
|
||||||
|
Accepts = MimeType.Json;
|
||||||
|
}
|
||||||
|
|
||||||
|
internal DataModelJsonPluginEndPoint(DataModelExpansion<T> dataModelExpansion, string name, PluginsModule pluginsModule) : base(dataModelExpansion, name, pluginsModule)
|
||||||
|
{
|
||||||
|
_dataModelExpansion = dataModelExpansion ?? throw new ArgumentNullException(nameof(dataModelExpansion));
|
||||||
|
|
||||||
|
ThrowOnFail = true;
|
||||||
|
Accepts = MimeType.Json;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether or not the end point should throw an exception if deserializing the received JSON fails.
|
||||||
|
/// If set to <see langword="false" /> malformed JSON is silently ignored; if set to <see langword="true" /> malformed
|
||||||
|
/// JSON throws a <see cref="JsonException" />.
|
||||||
|
/// </summary>
|
||||||
|
public bool ThrowOnFail { get; set; }
|
||||||
|
|
||||||
|
#region Overrides of PluginEndPoint
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override async Task ProcessRequest(IHttpContext context)
|
||||||
|
{
|
||||||
|
if (context.Request.HttpVerb != HttpVerbs.Post && context.Request.HttpVerb != HttpVerbs.Put)
|
||||||
|
throw HttpException.MethodNotAllowed("This end point only accepts POST and PUT calls");
|
||||||
|
|
||||||
|
context.Response.ContentType = MimeType.Json;
|
||||||
|
|
||||||
|
using TextReader reader = context.OpenRequestText();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (_module != null)
|
||||||
|
JsonConvert.PopulateObject(await reader.ReadToEndAsync(), _module.DataModel);
|
||||||
|
else
|
||||||
|
JsonConvert.PopulateObject(await reader.ReadToEndAsync(), _dataModelExpansion!.DataModel);
|
||||||
|
}
|
||||||
|
catch (JsonException)
|
||||||
|
{
|
||||||
|
if (ThrowOnFail)
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using EmbedIO;
|
||||||
|
|
||||||
|
namespace Artemis.Core.Services
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Provides data about endpoint request related events
|
||||||
|
/// </summary>
|
||||||
|
public class EndpointRequestEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
internal EndpointRequestEventArgs(IHttpContext context)
|
||||||
|
{
|
||||||
|
Context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the HTTP context of the request
|
||||||
|
/// </summary>
|
||||||
|
public IHttpContext Context { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -57,6 +57,16 @@ namespace Artemis.Core.Services
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public event EventHandler<EndpointExceptionEventArgs>? RequestException;
|
public event EventHandler<EndpointExceptionEventArgs>? RequestException;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs whenever a request is about to be processed
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<EndpointRequestEventArgs>? ProcessingRequest;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Occurs whenever a request was processed
|
||||||
|
/// </summary>
|
||||||
|
public event EventHandler<EndpointRequestEventArgs>? ProcessedRequest;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called whenever the end point has to process a request
|
/// Called whenever the end point has to process a request
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -72,11 +82,29 @@ namespace Artemis.Core.Services
|
|||||||
RequestException?.Invoke(this, new EndpointExceptionEventArgs(e));
|
RequestException?.Invoke(this, new EndpointExceptionEventArgs(e));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invokes the <see cref="ProcessingRequest" /> event
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void OnProcessingRequest(IHttpContext context)
|
||||||
|
{
|
||||||
|
ProcessingRequest?.Invoke(this, new EndpointRequestEventArgs(context));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invokes the <see cref="ProcessedRequest" /> event
|
||||||
|
/// </summary>
|
||||||
|
protected virtual void OnProcessedRequest(IHttpContext context)
|
||||||
|
{
|
||||||
|
ProcessedRequest?.Invoke(this, new EndpointRequestEventArgs(context));
|
||||||
|
}
|
||||||
|
|
||||||
internal async Task InternalProcessRequest(IHttpContext context)
|
internal async Task InternalProcessRequest(IHttpContext context)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
OnProcessingRequest(context);
|
||||||
await ProcessRequest(context);
|
await ProcessRequest(context);
|
||||||
|
OnProcessedRequest(context);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Artemis.Core.DataModelExpansions;
|
||||||
|
using Artemis.Core.Modules;
|
||||||
using EmbedIO;
|
using EmbedIO;
|
||||||
using EmbedIO.WebApi;
|
using EmbedIO.WebApi;
|
||||||
|
|
||||||
@ -43,6 +45,24 @@ namespace Artemis.Core.Services
|
|||||||
/// <returns>The resulting end point</returns>
|
/// <returns>The resulting end point</returns>
|
||||||
JsonPluginEndPoint<T> AddResponsiveJsonEndPoint<T>(PluginFeature feature, string endPointName, Func<T, object?> requestHandler);
|
JsonPluginEndPoint<T> AddResponsiveJsonEndPoint<T>(PluginFeature feature, string endPointName, Func<T, object?> requestHandler);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a new endpoint that directly maps received JSON to the data model of the provided <paramref name="module" />.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">The data model type of the module</typeparam>
|
||||||
|
/// <param name="module">The module whose datamodel to apply the received JSON to</param>
|
||||||
|
/// <param name="endPointName">The name of the end point, must be unique</param>
|
||||||
|
/// <returns>The resulting end point</returns>
|
||||||
|
DataModelJsonPluginEndPoint<T> AddDataModelJsonEndPoint<T>(Module<T> module, string endPointName) where T : DataModel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a new endpoint that directly maps received JSON to the data model of the provided <paramref name="dataModelExpansion" />.
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T">The data model type of the module</typeparam>
|
||||||
|
/// <param name="dataModelExpansion">The data model expansion whose datamodel to apply the received JSON to</param>
|
||||||
|
/// <param name="endPointName">The name of the end point, must be unique</param>
|
||||||
|
/// <returns>The resulting end point</returns>
|
||||||
|
DataModelJsonPluginEndPoint<T> AddDataModelJsonEndPoint<T>(DataModelExpansion<T> dataModelExpansion, string endPointName) where T : DataModel;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Adds a new endpoint for the given plugin feature receiving an a <see cref="string" />.
|
/// Adds a new endpoint for the given plugin feature receiving an a <see cref="string" />.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -3,6 +3,8 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Artemis.Core.DataModelExpansions;
|
||||||
|
using Artemis.Core.Modules;
|
||||||
using EmbedIO;
|
using EmbedIO;
|
||||||
using EmbedIO.WebApi;
|
using EmbedIO.WebApi;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@ -125,6 +127,29 @@ namespace Artemis.Core.Services
|
|||||||
return endPoint;
|
return endPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public DataModelJsonPluginEndPoint<T> AddDataModelJsonEndPoint<T>(Module<T> module, string endPointName) where T : DataModel
|
||||||
|
{
|
||||||
|
if (module == null) throw new ArgumentNullException(nameof(module));
|
||||||
|
if (endPointName == null) throw new ArgumentNullException(nameof(endPointName));
|
||||||
|
DataModelJsonPluginEndPoint<T> endPoint = new(module, endPointName, PluginsModule);
|
||||||
|
PluginsModule.AddPluginEndPoint(endPoint);
|
||||||
|
return endPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
public DataModelJsonPluginEndPoint<T> AddDataModelJsonEndPoint<T>(DataModelExpansion<T> dataModelExpansion, string endPointName) where T : DataModel
|
||||||
|
{
|
||||||
|
if (dataModelExpansion == null) throw new ArgumentNullException(nameof(dataModelExpansion));
|
||||||
|
if (endPointName == null) throw new ArgumentNullException(nameof(endPointName));
|
||||||
|
DataModelJsonPluginEndPoint<T> endPoint = new(dataModelExpansion, endPointName, PluginsModule);
|
||||||
|
PluginsModule.AddPluginEndPoint(endPoint);
|
||||||
|
return endPoint;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleDataModelRequest<T>(Module<T> module, T value) where T : DataModel
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public void RemovePluginEndPoint(PluginEndPoint endPoint)
|
public void RemovePluginEndPoint(PluginEndPoint endPoint)
|
||||||
{
|
{
|
||||||
PluginsModule.RemovePluginEndPoint(endPoint);
|
PluginsModule.RemovePluginEndPoint(endPoint);
|
||||||
|
|||||||
@ -200,7 +200,7 @@
|
|||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<RadioButton Grid.Column="0"
|
<RadioButton Grid.Column="0"
|
||||||
Style="{StaticResource MaterialDesignTabRadioButton}"
|
Style="{StaticResource MaterialDesignTabRadioButton}"
|
||||||
IsChecked="{Binding Path=RenderProfileElement.Timeline.EventOverlapMode, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static core:TimeLineEventOverlapMode.Restart}}">
|
IsChecked="{Binding Path=EventOverlapMode, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static core:TimeLineEventOverlapMode.Restart}}">
|
||||||
<TextBlock VerticalAlignment="Center" FontSize="12">
|
<TextBlock VerticalAlignment="Center" FontSize="12">
|
||||||
<materialDesign:PackIcon Kind="Repeat" VerticalAlignment="Center" Margin="-3 0 0 -3" />
|
<materialDesign:PackIcon Kind="Repeat" VerticalAlignment="Center" Margin="-3 0 0 -3" />
|
||||||
RESTART
|
RESTART
|
||||||
@ -215,7 +215,7 @@
|
|||||||
</RadioButton>
|
</RadioButton>
|
||||||
<RadioButton Grid.Column="1"
|
<RadioButton Grid.Column="1"
|
||||||
Style="{StaticResource MaterialDesignTabRadioButton}"
|
Style="{StaticResource MaterialDesignTabRadioButton}"
|
||||||
IsChecked="{Binding Path=RenderProfileElement.Timeline.EventOverlapMode, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static core:TimeLineEventOverlapMode.Ignore}}">
|
IsChecked="{Binding Path=EventOverlapMode, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static core:TimeLineEventOverlapMode.Ignore}}">
|
||||||
<TextBlock VerticalAlignment="Center" FontSize="12">
|
<TextBlock VerticalAlignment="Center" FontSize="12">
|
||||||
<materialDesign:PackIcon Kind="EarHearingOff" VerticalAlignment="Center" Margin="-3 0 0 -3" />
|
<materialDesign:PackIcon Kind="EarHearingOff" VerticalAlignment="Center" Margin="-3 0 0 -3" />
|
||||||
IGNORE
|
IGNORE
|
||||||
@ -230,7 +230,7 @@
|
|||||||
</RadioButton>
|
</RadioButton>
|
||||||
<RadioButton Grid.Column="2"
|
<RadioButton Grid.Column="2"
|
||||||
Style="{StaticResource MaterialDesignTabRadioButton}"
|
Style="{StaticResource MaterialDesignTabRadioButton}"
|
||||||
IsChecked="{Binding Path=RenderProfileElement.Timeline.EventOverlapMode, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static core:TimeLineEventOverlapMode.Copy}}">
|
IsChecked="{Binding Path=EventOverlapMode, Converter={StaticResource ComparisonConverter}, ConverterParameter={x:Static core:TimeLineEventOverlapMode.Copy}}">
|
||||||
<TextBlock VerticalAlignment="Center" FontSize="12">
|
<TextBlock VerticalAlignment="Center" FontSize="12">
|
||||||
<materialDesign:PackIcon Kind="ContentCopy" VerticalAlignment="Center" Margin="-3 0 0 -3" />
|
<materialDesign:PackIcon Kind="ContentCopy" VerticalAlignment="Center" Margin="-3 0 0 -3" />
|
||||||
COPY
|
COPY
|
||||||
|
|||||||
@ -38,7 +38,13 @@ namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions
|
|||||||
public RenderProfileElement RenderProfileElement
|
public RenderProfileElement RenderProfileElement
|
||||||
{
|
{
|
||||||
get => _renderProfileElement;
|
get => _renderProfileElement;
|
||||||
set => SetAndNotify(ref _renderProfileElement, value);
|
set
|
||||||
|
{
|
||||||
|
if (!SetAndNotify(ref _renderProfileElement, value)) return;
|
||||||
|
NotifyOfPropertyChange(nameof(DisplayContinuously));
|
||||||
|
NotifyOfPropertyChange(nameof(AlwaysFinishTimeline));
|
||||||
|
NotifyOfPropertyChange(nameof(EventOverlapMode));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DisplayContinuously
|
public bool DisplayContinuously
|
||||||
@ -65,6 +71,17 @@ namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TimeLineEventOverlapMode EventOverlapMode
|
||||||
|
{
|
||||||
|
get => RenderProfileElement?.Timeline.EventOverlapMode ?? TimeLineEventOverlapMode.Restart;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (RenderProfileElement == null || RenderProfileElement?.Timeline.EventOverlapMode == value) return;
|
||||||
|
RenderProfileElement.Timeline.EventOverlapMode = value;
|
||||||
|
_profileEditorService.UpdateSelectedProfileElement();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public bool ConditionBehaviourEnabled => RenderProfileElement != null;
|
public bool ConditionBehaviourEnabled => RenderProfileElement != null;
|
||||||
|
|
||||||
protected override void OnInitialActivate()
|
protected override void OnInitialActivate()
|
||||||
@ -119,5 +136,10 @@ namespace Artemis.UI.Screens.ProfileEditor.DisplayConditions
|
|||||||
DisplayStartHint = !RenderProfileElement.DisplayCondition.Children.Any();
|
DisplayStartHint = !RenderProfileElement.DisplayCondition.Children.Any();
|
||||||
IsEventCondition = RenderProfileElement.DisplayCondition.Children.Any(c => c is DataModelConditionEvent);
|
IsEventCondition = RenderProfileElement.DisplayCondition.Children.Any(c => c is DataModelConditionEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void EventTriggerModeSelected()
|
||||||
|
{
|
||||||
|
_profileEditorService.UpdateSelectedProfileElement();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -127,7 +127,7 @@ namespace Artemis.UI.Screens.Settings.Debug.Tabs
|
|||||||
|
|
||||||
lock (MainDataModel)
|
lock (MainDataModel)
|
||||||
{
|
{
|
||||||
MainDataModel.Update(_dataModelUIService, null);
|
MainDataModel.Update(_dataModelUIService, new DataModelUpdateConfiguration(true));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user