diff --git a/Artemis/Artemis/Modules/Games/FormulaOne2017/FormulaOne2017DataModel.cs b/Artemis/Artemis/Modules/Games/FormulaOne2017/FormulaOne2017DataModel.cs
index 60a7c3156..484005a11 100644
--- a/Artemis/Artemis/Modules/Games/FormulaOne2017/FormulaOne2017DataModel.cs
+++ b/Artemis/Artemis/Modules/Games/FormulaOne2017/FormulaOne2017DataModel.cs
@@ -196,11 +196,6 @@ namespace Artemis.Modules.Games.FormulaOne2017
public float LateralG { get; set; }
public float LongitudinalG { get; set; }
-
- public float WheelSpeedFrontLeft { get; set; }
- public float WheelSpeedFrontRight { get; set; }
- public float WheelSpeedRearLeft { get; set; }
- public float WheelSpeedRearRight { get; set; }
}
[MoonSharpUserData]
diff --git a/Artemis/Artemis/Modules/Games/FormulaOne2017/FormulaOne2017Model.cs b/Artemis/Artemis/Modules/Games/FormulaOne2017/FormulaOne2017Model.cs
index e6b2596a9..4dfcc8684 100644
--- a/Artemis/Artemis/Modules/Games/FormulaOne2017/FormulaOne2017Model.cs
+++ b/Artemis/Artemis/Modules/Games/FormulaOne2017/FormulaOne2017Model.cs
@@ -13,7 +13,6 @@ namespace Artemis.Modules.Games.FormulaOne2017
{
private bool _mustListen;
private UdpClient _udpClient;
- private UdpClient _udpListener;
private DateTime _lastUpdate;
private int _revAtZeroFrames;
@@ -105,11 +104,6 @@ namespace Artemis.Modules.Games.FormulaOne2017
dataModel.Car.Details.LateralG = msg.m_gforce_lat;
dataModel.Car.Details.LongitudinalG = msg.m_gforce_lon;
-// dataModel.Car.Details.WheelSpeedFrontLeft = msg.m_wheel_speed_fl;
-// dataModel.Car.Details.WheelSpeedFrontRight = msg.m_wheel_speed_fr;
-// dataModel.Car.Details.WheelSpeedRearLeft = msg.m_wheel_speed_bl;
-// dataModel.Car.Details.WheelSpeedRearRight = msg.m_wheel_speed_br;
-
dataModel.Session.SessionType = (SessionType) msg.m_sessionType;
// It's unknown in time trial but lets overwrite that to race
if (dataModel.Session.SessionType == SessionType.Unknown && dataModel.Car.SpeedMph > 0)
diff --git a/Artemis/Artemis/Modules/Games/FormulaOne2017/FormulaOne2017View.xaml b/Artemis/Artemis/Modules/Games/FormulaOne2017/FormulaOne2017View.xaml
index c758c77f2..1b59889aa 100644
--- a/Artemis/Artemis/Modules/Games/FormulaOne2017/FormulaOne2017View.xaml
+++ b/Artemis/Artemis/Modules/Games/FormulaOne2017/FormulaOne2017View.xaml
@@ -22,10 +22,15 @@
+
+
+ The F1 2017 module requires UDP Telemetry to be enabled in the ingame settings menu.
+
+
diff --git a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueViewModel.cs b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueViewModel.cs
index a1f168377..59ef8c499 100644
--- a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueViewModel.cs
+++ b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueViewModel.cs
@@ -41,7 +41,7 @@ namespace Artemis.Modules.Games.RocketLeague
}
Updater.GetPointers();
- var version = SettingsProvider.Load().RocketLeague.GameVersion;
+ var version = SettingsProvider.Load().RocketLeague?.GameVersion;
VersionText = $"Requires patch {version}. When a new patch is released Artemis downloads new pointers for the latest version (unless disabled in settings).";
}
}
diff --git a/Artemis/Artemis/Modules/Games/WoW/WoWView.xaml b/Artemis/Artemis/Modules/Games/WoW/WoWView.xaml
index 032a99375..21a1555c6 100644
--- a/Artemis/Artemis/Modules/Games/WoW/WoWView.xaml
+++ b/Artemis/Artemis/Modules/Games/WoW/WoWView.xaml
@@ -16,7 +16,7 @@
diff --git a/Artemis/Artemis/Profiles/Layers/Models/LayerConditionModel.cs b/Artemis/Artemis/Profiles/Layers/Models/LayerConditionModel.cs
index b05d15b13..9b54a81ab 100644
--- a/Artemis/Artemis/Profiles/Layers/Models/LayerConditionModel.cs
+++ b/Artemis/Artemis/Profiles/Layers/Models/LayerConditionModel.cs
@@ -1,174 +1,174 @@
-using System;
-using System.Collections;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Text.RegularExpressions;
-using System.Windows.Documents;
-using Artemis.Modules.Abstract;
-using Artemis.Utilities;
-using DynamicExpresso;
-using MahApps.Metro.Controls;
-
-namespace Artemis.Profiles.Layers.Models
-{
- public class LayerConditionModel
- {
- private readonly Interpreter _interpreter;
- private object _lastValue;
- private Regex _rgx;
-
- public LayerConditionModel()
- {
- _interpreter = new Interpreter();
- _rgx = new Regex("\\((.*?)\\)");
- }
-
- public string Field { get; set; }
- public string Value { get; set; }
- public string Operator { get; set; }
- public string Type { get; set; }
- public HotKey HotKey { get; set; }
-
- public bool ConditionMet(ModuleDataModel subject)
- {
- lock (subject)
- {
- if (string.IsNullOrEmpty(Field) || string.IsNullOrEmpty(Type))
- return false;
-
- // If the path points to a collection, look inside this collection
- if (Field.Contains("("))
- {
- // Find the collection in the field path
- var collectionField = _rgx.Match(Field).Groups[1].Value;
- var collectionInspect = (IEnumerable) GeneralHelpers.GetPropertyValue(subject, collectionField);
- var operatorParts = Operator.Split('|');
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text.RegularExpressions;
+using System.Windows.Documents;
+using Artemis.Modules.Abstract;
+using Artemis.Utilities;
+using DynamicExpresso;
+using MahApps.Metro.Controls;
+
+namespace Artemis.Profiles.Layers.Models
+{
+ public class LayerConditionModel
+ {
+ private readonly Interpreter _interpreter;
+ private object _lastValue;
+ private Regex _rgx;
+
+ public LayerConditionModel()
+ {
+ _interpreter = new Interpreter();
+ _rgx = new Regex("\\((.*?)\\)");
+ }
+
+ public string Field { get; set; }
+ public string Value { get; set; }
+ public string Operator { get; set; }
+ public string Type { get; set; }
+ public HotKey HotKey { get; set; }
+
+ public bool ConditionMet(ModuleDataModel subject)
+ {
+ lock (subject)
+ {
+ if (string.IsNullOrEmpty(Field) || string.IsNullOrEmpty(Type))
+ return false;
+
+ // If the path points to a collection, look inside this collection
+ if (Field.Contains("("))
+ {
+ // Find the collection in the field path
+ var collectionField = _rgx.Match(Field).Groups[1].Value;
+ var collectionInspect = (IEnumerable) GeneralHelpers.GetPropertyValue(subject, collectionField);
+ var operatorParts = Operator.Split('|');
var field = Field.Split(')').Last().Substring(1);
- _lastValue = collectionInspect;
-
- if (operatorParts[0] == "any")
- {
- var anyMatch = false;
- foreach (var collectionValue in collectionInspect)
- {
- anyMatch = EvaluateOperator(collectionValue, field, operatorParts[1]);
- if (anyMatch)
- break;
- }
- return anyMatch;
- }
- if (operatorParts[0] == "all")
- {
- var allMatch = true;
- foreach (var collectionValue in collectionInspect)
- {
- allMatch = EvaluateOperator(collectionValue, field, operatorParts[1]);
- if (!allMatch)
- break;
- }
- return allMatch;
- }
- if (operatorParts[0] == "none")
- {
- var noneMatch = true;
- foreach (var collectionValue in collectionInspect)
- {
- noneMatch = !EvaluateOperator(collectionValue, field, operatorParts[1]);
- if (!noneMatch)
- break;
- }
- return noneMatch;
- }
- }
-
- var inspect = GeneralHelpers.GetPropertyValue(subject, Field);
- if (inspect == null)
- {
- _lastValue = null;
- return false;
- }
-
- bool returnValue;
- if (Operator == "changed" || Operator == "decreased" || Operator == "increased")
- returnValue = EvaluateEventOperator(subject, inspect);
- else
- returnValue = EvaluateOperator(subject, Field);
-
- _lastValue = inspect;
- return returnValue;
- }
- }
-
- private bool EvaluateEventOperator(ModuleDataModel subject, object inspect)
- {
- // DynamicExpresso doesn't want a null so when it was previously null (should only happen first iteration)
- // return false since that would be the only possible outcome
- if (_lastValue == null)
- return false;
-
- // Assign the right parameter
- var rightParam = new Parameter("value", _lastValue);
-
- // Come up with the proper operator
- var changeOperator = "";
- if (Operator == "changed")
- changeOperator = "!=";
- else if (Operator == "decreased")
- changeOperator = "<";
- else if (Operator == "increased")
- changeOperator = ">";
-
- // Evaluate the result and store it
- var returnValue = _interpreter.Eval($"subject.{Field} {changeOperator} value", new Parameter("subject", subject.GetType(), subject), rightParam);
-
- // Set the last value to the new value
- _lastValue = inspect;
- // Return the evaluated result
- return returnValue;
- }
-
- private bool EvaluateOperator(object subject, string field, string operatorOverwrite = null)
- {
- // Since _lastValue won't be used, rely on Value to not be null
- if (string.IsNullOrEmpty(Value))
- return false;
-
- if (Type == "String")
- {
- var stringExpressionText = operatorOverwrite == null
- ? $"subject.{field}.ToLower(){Operator}(value)"
- : $"subject.{field}.ToLower(){operatorOverwrite}(value)";
-
- return _interpreter.Eval(stringExpressionText, new Parameter("subject", subject.GetType(), subject), new Parameter("value", Value.ToLower()));
- }
-
- Parameter rightParam = null;
- switch (Type)
- {
- case "Enum":
- var enumType = GeneralHelpers.GetPropertyValue(subject, field).GetType();
- rightParam = new Parameter("value", Enum.Parse(enumType, Value));
- break;
- case "Boolean":
- rightParam = new Parameter("value", bool.Parse(Value));
- break;
- case "Int32":
- rightParam = new Parameter("value", int.Parse(Value));
- break;
- case "Single":
- // Parse commas as decimals
- rightParam = new Parameter("value", float.Parse(Value.Replace(",", "."),
- CultureInfo.InvariantCulture));
- break;
- }
-
- var expressionText = operatorOverwrite == null
- ? $"subject.{field} {Operator} value"
- : $"subject.{field} {operatorOverwrite} value";
-
- return _interpreter.Eval(expressionText, new Parameter("subject", subject.GetType(), subject), rightParam);
- }
- }
-}
+ _lastValue = collectionInspect;
+
+ if (operatorParts[0] == "any")
+ {
+ var anyMatch = false;
+ foreach (var collectionValue in collectionInspect)
+ {
+ anyMatch = EvaluateOperator(collectionValue, field, operatorParts[1]);
+ if (anyMatch)
+ break;
+ }
+ return anyMatch;
+ }
+ if (operatorParts[0] == "all")
+ {
+ var allMatch = true;
+ foreach (var collectionValue in collectionInspect)
+ {
+ allMatch = EvaluateOperator(collectionValue, field, operatorParts[1]);
+ if (!allMatch)
+ break;
+ }
+ return allMatch;
+ }
+ if (operatorParts[0] == "none")
+ {
+ var noneMatch = true;
+ foreach (var collectionValue in collectionInspect)
+ {
+ noneMatch = !EvaluateOperator(collectionValue, field, operatorParts[1]);
+ if (!noneMatch)
+ break;
+ }
+ return noneMatch;
+ }
+ }
+
+ var inspect = GeneralHelpers.GetPropertyValue(subject, Field);
+ if (inspect == null)
+ {
+ _lastValue = null;
+ return false;
+ }
+
+ bool returnValue;
+ if (Operator == "changed" || Operator == "decreased" || Operator == "increased")
+ returnValue = EvaluateEventOperator(subject, inspect);
+ else
+ returnValue = EvaluateOperator(subject, Field);
+
+ _lastValue = inspect;
+ return returnValue;
+ }
+ }
+
+ private bool EvaluateEventOperator(ModuleDataModel subject, object inspect)
+ {
+ // DynamicExpresso doesn't want a null so when it was previously null (should only happen first iteration)
+ // return false since that would be the only possible outcome
+ if (_lastValue == null)
+ return false;
+
+ // Assign the right parameter
+ var rightParam = new Parameter("value", _lastValue);
+
+ // Come up with the proper operator
+ var changeOperator = "";
+ if (Operator == "changed")
+ changeOperator = "!=";
+ else if (Operator == "decreased")
+ changeOperator = "<";
+ else if (Operator == "increased")
+ changeOperator = ">";
+
+ // Evaluate the result and store it
+ var returnValue = _interpreter.Eval($"subject.{Field} {changeOperator} value", new Parameter("subject", subject.GetType(), subject), rightParam);
+
+ // Set the last value to the new value
+ _lastValue = inspect;
+ // Return the evaluated result
+ return returnValue;
+ }
+
+ private bool EvaluateOperator(object subject, string field, string operatorOverwrite = null)
+ {
+ // Since _lastValue won't be used, rely on Value to not be null
+ if (string.IsNullOrEmpty(Value))
+ return false;
+
+ if (Type == "String")
+ {
+ var stringExpressionText = operatorOverwrite == null
+ ? $"subject.{field}.ToLower(){Operator}(value)"
+ : $"subject.{field}.ToLower(){operatorOverwrite}(value)";
+
+ return _interpreter.Eval(stringExpressionText, new Parameter("subject", subject.GetType(), subject), new Parameter("value", Value.ToLower()));
+ }
+
+ Parameter rightParam = null;
+ switch (Type)
+ {
+ case "Enum":
+ var enumType = GeneralHelpers.GetPropertyValue(subject, field).GetType();
+ rightParam = new Parameter("value", Enum.Parse(enumType, Value));
+ break;
+ case "Boolean":
+ rightParam = new Parameter("value", bool.Parse(Value));
+ break;
+ case "Int32":
+ rightParam = new Parameter("value", int.Parse(Value));
+ break;
+ case "Single":
+ // Parse commas as decimals
+ rightParam = new Parameter("value", float.Parse(Value.Replace(",", "."),
+ CultureInfo.InvariantCulture));
+ break;
+ }
+
+ var expressionText = operatorOverwrite == null
+ ? $"subject.{field} {Operator} value"
+ : $"subject.{field} {operatorOverwrite} value";
+
+ return _interpreter.Eval(expressionText, new Parameter("subject", subject.GetType(), subject), rightParam);
+ }
+ }
+}
diff --git a/Artemis/Artemis/Profiles/Layers/Models/LayerModel.cs b/Artemis/Artemis/Profiles/Layers/Models/LayerModel.cs
index d88ee2191..709c86a73 100644
--- a/Artemis/Artemis/Profiles/Layers/Models/LayerModel.cs
+++ b/Artemis/Artemis/Profiles/Layers/Models/LayerModel.cs
@@ -53,7 +53,7 @@ namespace Artemis.Profiles.Layers.Models
if (!Enabled)
return false;
- _fadeTweener?.Update(40);
+ FadeTweener?.Update(40);
var conditionsMet = LayerCondition.ConditionsMet(this, dataModel);
if (conditionsMet && !_conditionsMetLastFrame)
OnLayerConditionsMet();
@@ -61,7 +61,7 @@ namespace Artemis.Profiles.Layers.Models
OnLayerConditionsUnmet();
_conditionsMetLastFrame = conditionsMet;
- return _fadeTweener != null && _fadeTweener.Running || conditionsMet;
+ return FadeTweener != null && FadeTweener.Running || conditionsMet;
}
///
@@ -74,7 +74,7 @@ namespace Artemis.Profiles.Layers.Models
{
if (LayerType == null)
return;
-
+
LayerType.Update(this, dataModel, preview);
LayerAnimation?.Update(this, updateAnimations);
@@ -114,12 +114,37 @@ namespace Artemis.Profiles.Layers.Models
if (Brush == null || !preview && !RenderAllowed)
return;
- // If fading in/out, push transparency on the entire context
- if (_fadeTweener != null && _fadeTweener.Running)
- c.PushOpacity(_fadeTweener.Value);
+ ApplyHierarchyOpacity(c);
LayerType.Draw(this, c);
- if (_fadeTweener != null && _fadeTweener.Running)
+ PopHierarchyOpacity(c);
+ }
+
+ private void ApplyHierarchyOpacity(DrawingContext c)
+ {
+ if (FadeTweener != null && FadeTweener.Running)
+ c.PushOpacity(FadeTweener.Value);
+
+ var current = this;
+ while (current.Parent != null)
+ {
+ current = current.Parent;
+ if (current.FadeTweener != null && current.FadeTweener.Running)
+ c.PushOpacity(current.FadeTweener.Value);
+ }
+ }
+
+ private void PopHierarchyOpacity(DrawingContext c)
+ {
+ if (FadeTweener != null && FadeTweener.Running)
c.Pop();
+
+ var current = this;
+ while (current.Parent != null)
+ {
+ current = current.Parent;
+ if (current.FadeTweener != null && current.FadeTweener.Running)
+ c.Pop();
+ }
}
///
@@ -128,7 +153,7 @@ namespace Artemis.Profiles.Layers.Models
public void SetupProperties()
{
LayerType.SetupProperties(this);
-
+
// If the type is an event, set it up
if (IsEvent && EventProperties == null)
EventProperties = new KeyboardEventPropertiesModel
@@ -330,11 +355,11 @@ namespace Artemis.Profiles.Layers.Models
{
if (FadeInTime <= 0)
return;
- if (_fadeTweener != null && _fadeTweener.Running)
- _fadeTweener = new Tweener(_fadeTweener.Value, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
+ if (FadeTweener != null && FadeTweener.Running)
+ FadeTweener = new Tweener(FadeTweener.Value, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
else
- _fadeTweener = new Tweener(0, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
- _fadeTweener.Start();
+ FadeTweener = new Tweener(0, 1, FadeInTime, Ease.Quint.Out, TweenModel.LerpFuncFloat);
+ FadeTweener.Start();
}
private void OnLayerConditionsUnmet(object sender, EventArgs eventArgs)
@@ -342,11 +367,11 @@ namespace Artemis.Profiles.Layers.Models
if (FadeOutTime <= 0)
return;
- if (_fadeTweener != null && _fadeTweener.Running)
- _fadeTweener = new Tweener(_fadeTweener.Value, 0, FadeOutTime, Ease.Quint.In, TweenModel.LerpFuncFloat);
+ if (FadeTweener != null && FadeTweener.Running)
+ FadeTweener = new Tweener(FadeTweener.Value, 0, FadeOutTime, Ease.Quint.In, TweenModel.LerpFuncFloat);
else
- _fadeTweener = new Tweener(1, 0, FadeOutTime, Ease.Quint.In, TweenModel.LerpFuncFloat);
- _fadeTweener.Start();
+ FadeTweener = new Tweener(1, 0, FadeOutTime, Ease.Quint.In, TweenModel.LerpFuncFloat);
+ FadeTweener.Start();
}
#region Properties
@@ -390,7 +415,9 @@ namespace Artemis.Profiles.Layers.Models
[JsonIgnore] private Brush _brush;
[JsonIgnore] private bool _conditionsMetLastFrame;
- [JsonIgnore] private Tweener _fadeTweener;
+
+ [JsonIgnore]
+ public Tweener FadeTweener { get; set; }
[JsonIgnore]
public double X { get; set; }
@@ -440,7 +467,7 @@ namespace Artemis.Profiles.Layers.Models
[JsonIgnore]
public DateTime LastRender { get; set; }
-
+
#endregion
#endregion