Profile editor - Continue updating datamodel in editor

Display conditions - Added setting to display current values while selecting condition targets
This commit is contained in:
SpoinkyNL committed 2020-08-06 22:09:28 +02:00
1 parent 35c46a4825
commit f3cbd819f5
26 files changed
+382 -93

No files matched your search

+10 -14
View File
@@ -60,7 +60,6 @@ namespace Artemis.Core.Services
}
public TimeSpan FrameTime { get; private set; }
public bool PluginUpdatingDisabled { get; set; }
public bool ModuleRenderingDisabled { get; set; }
public List<string> StartupArguments { get; set; }
@@ -140,21 +139,18 @@ namespace Artemis.Core.Services
try
{
_frameStopWatch.Restart();
if (!PluginUpdatingDisabled)
lock (_dataModelExpansions)
{
lock (_dataModelExpansions)
{
// Update all active modules
foreach (var dataModelExpansion in _dataModelExpansions)
dataModelExpansion.Update(args.DeltaTime);
}
// Update all active modules
foreach (var dataModelExpansion in _dataModelExpansions)
dataModelExpansion.Update(args.DeltaTime);
}
lock (_modules)
{
// Update all active modules
foreach (var module in _modules)
module.Update(args.DeltaTime);
}
lock (_modules)
{
// Update all active modules
foreach (var module in _modules)
module.Update(args.DeltaTime);
}
// If there is no ready bitmap brush, skip the frame
+10 -1
View File
@@ -12,6 +12,8 @@ using Artemis.Core.Plugins.Abstract.DataModels;
using Artemis.Core.Plugins.Exceptions;
using Artemis.Core.Plugins.Models;
using Artemis.Core.Services.Interfaces;
using Newtonsoft.Json;
using Serilog;
namespace Artemis.Core.Services
{
@@ -22,11 +24,13 @@ namespace Artemis.Core.Services
{
private readonly List<DataModel> _dataModelExpansions;
private readonly IPluginService _pluginService;
private readonly ILogger _logger;
private readonly List<DisplayConditionOperator> _registeredConditionOperators;
internal DataModelService(IPluginService pluginService)
internal DataModelService(IPluginService pluginService, ILogger logger)
{
_pluginService = pluginService;
_logger = logger;
_dataModelExpansions = new List<DataModel>();
_registeredConditionOperators = new List<DisplayConditionOperator>();
@@ -174,6 +178,11 @@ namespace Artemis.Core.Services
return RegisteredConditionOperators.FirstOrDefault(o => o.PluginInfo.Guid == operatorPluginGuid && o.GetType().Name == operatorType);
}
public void LogDeserializationFailure(DisplayConditionPredicate displayConditionPredicate, JsonSerializationException exception)
{
_logger.Warning(exception, "Failed to deserialize display condition predicate {predicate}", displayConditionPredicate);
}
private void RegisterBuiltInConditionOperators()
{
// General usage for any type
@@ -15,12 +15,7 @@ namespace Artemis.Core.Services.Interfaces
/// The time the last frame took to render
/// </summary>
TimeSpan FrameTime { get; }
/// <summary>
/// Gets or sets whether modules are updated each frame by calling their Update method
/// </summary>
bool PluginUpdatingDisabled { get; set; }
/// <summary>
/// Gets or sets whether modules are rendered each frame by calling their Render method
/// </summary>
@@ -5,6 +5,7 @@ using Artemis.Core.Models.Profile.Conditions;
using Artemis.Core.Plugins.Abstract;
using Artemis.Core.Plugins.Abstract.DataModels;
using Artemis.Core.Plugins.Models;
using Newtonsoft.Json;
namespace Artemis.Core.Services.Interfaces
{
@@ -59,5 +60,6 @@ namespace Artemis.Core.Services.Interfaces
List<DisplayConditionOperator> GetCompatibleConditionOperators(Type type);
DisplayConditionOperator GetConditionOperator(Guid operatorPluginGuid, string operatorType);
void LogDeserializationFailure(DisplayConditionPredicate displayConditionPredicate, JsonSerializationException exception);
}
}