diff --git a/Artemis/Artemis/Artemis.csproj b/Artemis/Artemis/Artemis.csproj
index 802b21a7b..22820281f 100644
--- a/Artemis/Artemis/Artemis.csproj
+++ b/Artemis/Artemis/Artemis.csproj
@@ -131,6 +131,10 @@
LocalIntranet
+
+ False
+ lib\AssettoCorsaSharedMemory.dll
+
..\packages\Betwixt.1.4.1\lib\net35\Betwixt.dll
True
@@ -371,6 +375,13 @@
+
+
+
+
+ AssettoCorsaView.xaml
+
+
@@ -784,7 +795,7 @@
-
+
PreserveNewest
@@ -831,6 +842,10 @@
Designer
MSBuild:Compile
+
+ MSBuild:Compile
+ Designer
+
Designer
MSBuild:Compile
diff --git a/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaDataModel.cs b/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaDataModel.cs
new file mode 100644
index 000000000..75c21b4cb
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaDataModel.cs
@@ -0,0 +1,164 @@
+using Artemis.Modules.Abstract;
+using AssettoCorsaSharedMemory;
+using MoonSharp.Interpreter;
+
+namespace Artemis.Modules.Games.AssettoCorsa
+{
+ [MoonSharpUserData]
+ public class AssettoCorsaDataModel : ModuleDataModel
+ {
+ public AssettoCorsaDataModel()
+ {
+ Physics = new Physics();
+ Interface = new Graphics();
+ StaticInfo = new StaticInfo();
+ }
+
+ public Physics Physics { get; set; }
+ public Graphics Interface { get; set; }
+ public StaticInfo StaticInfo { get; set; }
+ }
+
+ [MoonSharpUserData]
+ public class Physics
+ {
+ public float Abs { get; set; }
+ public float Gas { get; set; }
+ public float Brake { get; set; }
+ public float Fuel { get; set; }
+ public int Gear { get; set; }
+ public int Rpms { get; set; }
+ public float SteerAngle { get; set; }
+ public float SpeedKmh { get; set; }
+ public float[] Velocity { get; set; }
+ public float[] AccG { get; set; }
+ public float[] WheelSlip { get; set; }
+ public float[] WheelLoad { get; set; }
+ public float[] WheelsPressure { get; set; }
+ public float[] WheelAngularSpeed { get; set; }
+ public float[] TyreWear { get; set; }
+ public float[] TyreDirtyLevel { get; set; }
+ public float[] TyreCoreTemperature { get; set; }
+ public float[] CamberRad { get; set; }
+ public float[] SuspensionTravel { get; set; }
+ public float Drs { get; set; }
+ public float TC { get; set; }
+ public float Heading { get; set; }
+ public float Pitch { get; set; }
+ public float Roll { get; set; }
+ public float CgHeight { get; set; }
+ public float[] CarDamage { get; set; }
+ public int NumberOfTyresOut { get; set; }
+ public int PitLimiterOn { get; set; }
+ public float KersCharge { get; set; }
+ public float KersInput { get; set; }
+ public int AutoShifterOn { get; set; }
+ public float[] RideHeight { get; set; }
+ public float TurboBoost { get; set; }
+ public float Ballast { get; set; }
+ public float AirDensity { get; set; }
+ public float AirTemp { get; set; }
+ public float RoadTemp { get; set; }
+ public float[] LocalAngularVelocity { get; set; }
+ public float FinalFF { get; set; }
+ public float PerformanceMeter { get; set; }
+ public int EngineBrake { get; set; }
+ public int ErsRecoveryLevel { get; set; }
+ public int ErsPowerLevel { get; set; }
+ public int ErsHeatCharging { get; set; }
+ public int ErsisCharging { get; set; }
+ public float KersCurrentKJ { get; set; }
+ public int DrsAvailable { get; set; }
+ public int DrsEnabled { get; set; }
+ public float[] BrakeTemp { get; set; }
+ public float Clutch { get; set; }
+ public float[] TyreTempI { get; set; }
+ public float[] TyreTempM { get; set; }
+ public float[] TyreTempO { get; set; }
+ public int IsAIControlled { get; set; }
+ public Coordinates[] TyreContactPoint { get; set; }
+ public Coordinates[] TyreContactNormal { get; set; }
+ public Coordinates[] TyreContactHeading { get; set; }
+ public float BrakeBias { get; set; }
+ }
+
+ [MoonSharpUserData]
+ public class Graphics
+ {
+ public AC_STATUS Status { get; set; }
+ public AC_SESSION_TYPE Session { get; set; }
+ public string CurrentTime { get; set; }
+ public string LastTime { get; set; }
+ public string BestTime { get; set; }
+ public string Split { get; set; }
+ public int Position { get; set; }
+ public int iCurrentTime { get; set; }
+ public int iBestTime { get; set; }
+ public int iLastTime { get; set; }
+ public float SessionTimeLeft { get; set; }
+ public float DistanceTraveled { get; set; }
+ public int IsInPit { get; set; }
+ public int CurrentSectorIndex { get; set; }
+ public int LastSectorTime { get; set; }
+ public int NumberOfLaps { get; set; }
+ public string TyreCompound { get; set; }
+ public float ReplayTimeMultiplier { get; set; }
+ public float NormalizedCarPosition { get; set; }
+ }
+
+ [MoonSharpUserData]
+ public class StaticInfo
+ {
+ public StaticInfo()
+ {
+ Session = new Session();
+ Car = new Car();
+ }
+
+ public string SMVersion { get; set; }
+ public string ACVersion { get; set; }
+ public Session Session { get; set; }
+ public Car Car { get; set; }
+ }
+
+ [MoonSharpUserData]
+ public class Session
+ {
+ public int NumberOfSessions { get; set; }
+ public int NumCars { get; set; }
+ public string Track { get; set; }
+ public string TrackConfiguration { get; set; }
+ public float TrackSPlineLength { get; set; }
+ public string PlayerName { get; set; }
+ public string PlayerSurname { get; set; }
+ public string PlayerNick { get; set; }
+ public int SectorCount { get; set; }
+ public int PenaltiesEnabled { get; set; }
+ }
+
+ [MoonSharpUserData]
+ public class Car
+ {
+ public string CarModel { get; set; }
+ public float MaxTorque { get; set; }
+ public float MaxPower { get; set; }
+ public int MaxRpm { get; set; }
+ public float MaxFuel { get; set; }
+ public float[] SuspensionMaxTravel { get; set; }
+ public float[] TyreRadius { get; set; }
+ public float MaxTurboBoost { get; set; }
+ public float AidFuelRate { get; set; }
+ public float AidTireRate { get; set; }
+ public float AidMechanicalDamage { get; set; }
+ public int AidAllowTyreBlankets { get; set; }
+ public float AidStability { get; set; }
+ public int AidAutoClutch { get; set; }
+ public int AidAutoBlip { get; set; }
+ public int HasDRS { get; set; }
+ public int HasERS { get; set; }
+ public int HasKERS { get; set; }
+ public float KersMaxJoules { get; set; }
+ public int EngineBrakeSettingsCount { get; set; }
+ public int ErsPowerControllerCount { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaModel.cs b/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaModel.cs
new file mode 100644
index 000000000..f4a574fd6
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaModel.cs
@@ -0,0 +1,173 @@
+using System;
+using Artemis.DAL;
+using Artemis.Managers;
+using Artemis.Modules.Abstract;
+using AssettoCorsaSharedMemory;
+
+namespace Artemis.Modules.Games.AssettoCorsa
+{
+ public class AssettoCorsaModel : ModuleModel
+ {
+ private AssettoCorsaSharedMemory.AssettoCorsa _ac;
+
+ public AssettoCorsaModel(DeviceManager deviceManager, LuaManager luaManager) : base(deviceManager, luaManager)
+ {
+ Settings = SettingsProvider.Load();
+ DataModel = new AssettoCorsaDataModel();
+ ProcessNames.Add("AssettoCorsa");
+ }
+
+ public override string Name => "AssettoCorsa";
+ public override bool IsOverlay => false;
+ public override bool IsBoundToProcess => true;
+
+ public override void Enable()
+ {
+ _ac = new AssettoCorsaSharedMemory.AssettoCorsa {PhysicsInterval = 40};
+ // The event handlers map their respecive enums to the datamodel, not pretty but fastest way possible
+ _ac.StaticInfoUpdated += AcOnStaticInfoUpdated;
+ _ac.GraphicsUpdated += AcOnGraphicsUpdated;
+ _ac.PhysicsUpdated += AcOnPhysicsUpdated;
+ _ac.Start();
+
+ base.Enable();
+ }
+
+ public override void Dispose()
+ {
+ base.Dispose();
+ _ac.Stop();
+ _ac = null;
+ }
+
+ private void AcOnStaticInfoUpdated(object sender, StaticInfoEventArgs e)
+ {
+ var dataModel = (AssettoCorsaDataModel)DataModel;
+ dataModel.StaticInfo.SMVersion = e.StaticInfo.SMVersion;
+ dataModel.StaticInfo.ACVersion = e.StaticInfo.ACVersion;
+ dataModel.StaticInfo.Session.NumberOfSessions = e.StaticInfo.NumberOfSessions;
+ dataModel.StaticInfo.Session.NumCars = e.StaticInfo.NumCars;
+ dataModel.StaticInfo.Session.Track = e.StaticInfo.Track;
+ dataModel.StaticInfo.Session.TrackConfiguration = e.StaticInfo.TrackConfiguration;
+ dataModel.StaticInfo.Session.TrackSPlineLength = e.StaticInfo.TrackSPlineLength;
+ dataModel.StaticInfo.Session.PlayerName = e.StaticInfo.PlayerName;
+ dataModel.StaticInfo.Session.PlayerSurname = e.StaticInfo.PlayerSurname;
+ dataModel.StaticInfo.Session.PlayerNick = e.StaticInfo.PlayerNick;
+ dataModel.StaticInfo.Session.SectorCount = e.StaticInfo.SectorCount;
+ dataModel.StaticInfo.Session.PenaltiesEnabled = e.StaticInfo.PenaltiesEnabled;
+ dataModel.StaticInfo.Car.CarModel = e.StaticInfo.CarModel;
+ dataModel.StaticInfo.Car.MaxTorque = e.StaticInfo.MaxTorque;
+ dataModel.StaticInfo.Car.MaxPower = e.StaticInfo.MaxPower;
+ dataModel.StaticInfo.Car.MaxRpm = e.StaticInfo.MaxRpm;
+ dataModel.StaticInfo.Car.MaxFuel = e.StaticInfo.MaxFuel;
+ dataModel.StaticInfo.Car.SuspensionMaxTravel = e.StaticInfo.SuspensionMaxTravel;
+ dataModel.StaticInfo.Car.TyreRadius = e.StaticInfo.TyreRadius;
+ dataModel.StaticInfo.Car.MaxTurboBoost = e.StaticInfo.MaxTurboBoost;
+ dataModel.StaticInfo.Car.AidFuelRate = e.StaticInfo.AidFuelRate;
+ dataModel.StaticInfo.Car.AidTireRate = e.StaticInfo.AidTireRate;
+ dataModel.StaticInfo.Car.AidMechanicalDamage = e.StaticInfo.AidMechanicalDamage;
+ dataModel.StaticInfo.Car.AidAllowTyreBlankets = e.StaticInfo.AidAllowTyreBlankets;
+ dataModel.StaticInfo.Car.AidStability = e.StaticInfo.AidStability;
+ dataModel.StaticInfo.Car.AidAutoClutch = e.StaticInfo.AidAutoClutch;
+ dataModel.StaticInfo.Car.AidAutoBlip = e.StaticInfo.AidAutoBlip;
+ dataModel.StaticInfo.Car.HasDRS = e.StaticInfo.HasDRS;
+ dataModel.StaticInfo.Car.HasERS = e.StaticInfo.HasERS;
+ dataModel.StaticInfo.Car.HasKERS = e.StaticInfo.HasKERS;
+ dataModel.StaticInfo.Car.KersMaxJoules = e.StaticInfo.KersMaxJoules;
+ dataModel.StaticInfo.Car.EngineBrakeSettingsCount = e.StaticInfo.EngineBrakeSettingsCount;
+ dataModel.StaticInfo.Car.ErsPowerControllerCount = e.StaticInfo.ErsPowerControllerCount;
+ }
+
+ private void AcOnGraphicsUpdated(object sender, GraphicsEventArgs e)
+ {
+ var dataModel = (AssettoCorsaDataModel)DataModel;
+ dataModel.Interface.Status = e.Graphics.Status;
+ dataModel.Interface.Session = e.Graphics.Session;
+ dataModel.Interface.CurrentTime = e.Graphics.CurrentTime;
+ dataModel.Interface.LastTime = e.Graphics.LastTime;
+ dataModel.Interface.BestTime = e.Graphics.BestTime;
+ dataModel.Interface.Split = e.Graphics.Split;
+ dataModel.Interface.Position = e.Graphics.Position;
+ dataModel.Interface.iCurrentTime = e.Graphics.iCurrentTime;
+ dataModel.Interface.iLastTime = e.Graphics.iLastTime;
+ dataModel.Interface.iBestTime = e.Graphics.iBestTime;
+ dataModel.Interface.SessionTimeLeft = e.Graphics.SessionTimeLeft;
+ dataModel.Interface.DistanceTraveled = e.Graphics.DistanceTraveled;
+ dataModel.Interface.IsInPit = e.Graphics.IsInPit;
+ dataModel.Interface.CurrentSectorIndex = e.Graphics.CurrentSectorIndex;
+ dataModel.Interface.LastSectorTime = e.Graphics.LastSectorTime;
+ dataModel.Interface.NumberOfLaps = e.Graphics.NumberOfLaps;
+ dataModel.Interface.TyreCompound = e.Graphics.TyreCompound;
+ dataModel.Interface.ReplayTimeMultiplier = e.Graphics.ReplayTimeMultiplier;
+ dataModel.Interface.NormalizedCarPosition = e.Graphics.NormalizedCarPosition;
+ }
+
+ private void AcOnPhysicsUpdated(object sender, PhysicsEventArgs e)
+ {
+ var dataModel = (AssettoCorsaDataModel)DataModel;
+ dataModel.Physics.Abs = e.Physics.Abs;
+ dataModel.Physics.Gas = e.Physics.Gas;
+ dataModel.Physics.Brake = e.Physics.Brake;
+ dataModel.Physics.Fuel = e.Physics.Fuel;
+ dataModel.Physics.Gear = e.Physics.Gear;
+ dataModel.Physics.Rpms = e.Physics.Rpms;
+ dataModel.Physics.SteerAngle = e.Physics.SteerAngle;
+ dataModel.Physics.SpeedKmh = e.Physics.SpeedKmh;
+ dataModel.Physics.Velocity = e.Physics.Velocity;
+ dataModel.Physics.AccG = e.Physics.AccG;
+ dataModel.Physics.WheelSlip = e.Physics.WheelSlip;
+ dataModel.Physics.WheelLoad = e.Physics.WheelLoad;
+ dataModel.Physics.WheelsPressure = e.Physics.WheelsPressure;
+ dataModel.Physics.WheelAngularSpeed = e.Physics.WheelAngularSpeed;
+ dataModel.Physics.TyreWear = e.Physics.TyreWear;
+ dataModel.Physics.TyreDirtyLevel = e.Physics.TyreDirtyLevel;
+ dataModel.Physics.TyreCoreTemperature = e.Physics.TyreCoreTemperature;
+ dataModel.Physics.CamberRad = e.Physics.CamberRad;
+ dataModel.Physics.SuspensionTravel = e.Physics.SuspensionTravel;
+ dataModel.Physics.Drs = e.Physics.Drs;
+ dataModel.Physics.TC = e.Physics.TC;
+ dataModel.Physics.Heading = e.Physics.Heading;
+ dataModel.Physics.Pitch = e.Physics.Pitch;
+ dataModel.Physics.Roll = e.Physics.Roll;
+ dataModel.Physics.CgHeight = e.Physics.CgHeight;
+ dataModel.Physics.CarDamage = e.Physics.CarDamage;
+ dataModel.Physics.NumberOfTyresOut = e.Physics.NumberOfTyresOut;
+ dataModel.Physics.PitLimiterOn = e.Physics.PitLimiterOn;
+ dataModel.Physics.KersCharge = e.Physics.KersCharge;
+ dataModel.Physics.KersInput = e.Physics.KersInput;
+ dataModel.Physics.AutoShifterOn = e.Physics.AutoShifterOn;
+ dataModel.Physics.RideHeight = e.Physics.RideHeight;
+ dataModel.Physics.TurboBoost = e.Physics.TurboBoost;
+ dataModel.Physics.Ballast = e.Physics.Ballast;
+ dataModel.Physics.AirDensity = e.Physics.AirDensity;
+ dataModel.Physics.AirTemp = e.Physics.AirTemp;
+ dataModel.Physics.RoadTemp = e.Physics.RoadTemp;
+ dataModel.Physics.LocalAngularVelocity = e.Physics.LocalAngularVelocity;
+ dataModel.Physics.FinalFF = e.Physics.FinalFF;
+ dataModel.Physics.PerformanceMeter = e.Physics.PerformanceMeter;
+ dataModel.Physics.EngineBrake = e.Physics.EngineBrake;
+ dataModel.Physics.ErsRecoveryLevel = e.Physics.ErsRecoveryLevel;
+ dataModel.Physics.ErsPowerLevel = e.Physics.ErsPowerLevel;
+ dataModel.Physics.ErsHeatCharging = e.Physics.ErsHeatCharging;
+ dataModel.Physics.ErsisCharging = e.Physics.ErsisCharging;
+ dataModel.Physics.KersCurrentKJ = e.Physics.KersCurrentKJ;
+ dataModel.Physics.DrsAvailable = e.Physics.DrsAvailable;
+ dataModel.Physics.DrsEnabled = e.Physics.DrsEnabled;
+ dataModel.Physics.BrakeTemp = e.Physics.BrakeTemp;
+ dataModel.Physics.Clutch = e.Physics.Clutch;
+ dataModel.Physics.TyreTempI = e.Physics.TyreTempI;
+ dataModel.Physics.TyreTempM = e.Physics.TyreTempM;
+ dataModel.Physics.TyreTempO = e.Physics.TyreTempO;
+ dataModel.Physics.IsAIControlled = e.Physics.IsAIControlled;
+ dataModel.Physics.TyreContactPoint = e.Physics.TyreContactPoint;
+ dataModel.Physics.TyreContactNormal = e.Physics.TyreContactNormal;
+ dataModel.Physics.TyreContactHeading = e.Physics.TyreContactHeading;
+ dataModel.Physics.BrakeBias = e.Physics.BrakeBias;
+ }
+
+ public override void Update()
+ {
+ // Updating is done by the events
+ }
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaSettings.cs b/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaSettings.cs
new file mode 100644
index 000000000..ecba09fc2
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaSettings.cs
@@ -0,0 +1,8 @@
+using Artemis.Modules.Abstract;
+
+namespace Artemis.Modules.Games.AssettoCorsa
+{
+ public class AssettoCorsaSettings : ModuleSettings
+ {
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaView.xaml b/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaView.xaml
new file mode 100644
index 000000000..f531cbb36
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaView.xaml
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The Assetto Corsa module uses the
+
+ Assetto Corsa Shared Memory Library
+
+ project by mdjarv
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaView.xaml.cs b/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaView.xaml.cs
new file mode 100644
index 000000000..37aec9ee8
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaView.xaml.cs
@@ -0,0 +1,18 @@
+using System.Windows.Controls;
+using System.Windows.Navigation;
+
+namespace Artemis.Modules.Games.AssettoCorsa
+{
+ public partial class AssettoCorsaView : UserControl
+ {
+ public AssettoCorsaView()
+ {
+ InitializeComponent();
+ }
+
+ private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
+ {
+ System.Diagnostics.Process.Start(e.Uri.ToString());
+ }
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaViewModel.cs b/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaViewModel.cs
new file mode 100644
index 000000000..3fd02a28c
--- /dev/null
+++ b/Artemis/Artemis/Modules/Games/AssettoCorsa/AssettoCorsaViewModel.cs
@@ -0,0 +1,17 @@
+using Artemis.Managers;
+using Artemis.Modules.Abstract;
+using Ninject;
+
+namespace Artemis.Modules.Games.AssettoCorsa
+{
+ public sealed class AssettoCorsaViewModel : ModuleViewModel
+ {
+ public AssettoCorsaViewModel(MainManager mainManager, [Named(nameof(AssettoCorsaModel))] ModuleModel moduleModel,
+ IKernel kernel) : base(mainManager, moduleModel, kernel)
+ {
+ DisplayName = "Assetto Corsa";
+ }
+
+ public override bool UsesProfileEditor => true;
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2DataModel.cs b/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2DataModel.cs
index bb45aab72..b97d7df89 100644
--- a/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2DataModel.cs
+++ b/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2DataModel.cs
@@ -1,33 +1,33 @@
-using Artemis.Modules.Abstract;
-using Artemis.Modules.Games.EurotruckSimulator2.Data;
-using MoonSharp.Interpreter;
-
-namespace Artemis.Modules.Games.EurotruckSimulator2
-{
- [MoonSharpUserData]
- public class EurotruckSimulator2DataModel : ModuleDataModel
- {
- public EurotruckSimulator2DataModel()
- {
- // Register types for LUA
- UserData.RegisterType();
- UserData.RegisterType();
- UserData.RegisterType();
- UserData.RegisterType();
- UserData.RegisterType();
- }
-
- public TruckSimulatorGameName GameName { get; set; }
- public IEts2Game Game { get; set; }
- public IEts2Job Job { get; set; }
- public IEts2Navigation Navigation { get; set; }
- public IEts2Trailer Trailer { get; set; }
+using Artemis.Modules.Abstract;
+using Artemis.Modules.Games.EurotruckSimulator2.Data;
+using MoonSharp.Interpreter;
+
+namespace Artemis.Modules.Games.EurotruckSimulator2
+{
+ [MoonSharpUserData]
+ public class EurotruckSimulator2DataModel : ModuleDataModel
+ {
+ public EurotruckSimulator2DataModel()
+ {
+ // Register types for LUA
+ UserData.RegisterType();
+ UserData.RegisterType();
+ UserData.RegisterType();
+ UserData.RegisterType();
+ UserData.RegisterType();
+ }
+
+ public TruckSimulatorGameName GameName { get; set; }
+ public IEts2Game Game { get; set; }
+ public IEts2Job Job { get; set; }
+ public IEts2Navigation Navigation { get; set; }
+ public IEts2Trailer Trailer { get; set; }
public IEts2Truck Truck { get; set; }
- public enum TruckSimulatorGameName
- {
- EuroTruckSimulator2,
- AmericanTruckSimulator
- }
- }
+ public enum TruckSimulatorGameName
+ {
+ EuroTruckSimulator2,
+ AmericanTruckSimulator
+ }
+ }
}
\ No newline at end of file
diff --git a/Artemis/Artemis/Profiles/Layers/Conditions/DataModelCondition.cs b/Artemis/Artemis/Profiles/Layers/Conditions/DataModelCondition.cs
index 190d7e1e3..797b0f1a5 100644
--- a/Artemis/Artemis/Profiles/Layers/Conditions/DataModelCondition.cs
+++ b/Artemis/Artemis/Profiles/Layers/Conditions/DataModelCondition.cs
@@ -1,7 +1,7 @@
using System;
+using System.Collections.Generic;
using System.Linq;
using System.Windows;
-using System.Windows.Forms;
using Artemis.Modules.Abstract;
using Artemis.Profiles.Layers.Interfaces;
using Artemis.Profiles.Layers.Models;
@@ -10,15 +10,18 @@ namespace Artemis.Profiles.Layers.Conditions
{
public class DataModelCondition : ILayerCondition
{
+ private static readonly TimeSpan Delay = TimeSpan.FromMilliseconds((SystemParameters.KeyboardDelay + 1) * 250);
private DateTime _lastKeypress;
public bool HotKeyMet { get; set; }
- private static readonly TimeSpan Delay = TimeSpan.FromMilliseconds((SystemParameters.KeyboardDelay + 1) * 250);
public bool ConditionsMet(LayerModel layerModel, ModuleDataModel dataModel)
{
lock (layerModel.Properties.Conditions)
{
- var checkConditions = layerModel.Properties.Conditions.Where(c => !c.Field.Contains("hotkey"));
+ var checkConditions = layerModel.Properties.Conditions.Where(c => !c.Field.Contains("hotkey")).ToList();
+ if (checkConditions.Count == layerModel.Properties.Conditions.Count)
+ return SimpleConditionsMet(layerModel, dataModel, checkConditions);
+
var conditionMet = false;
switch (layerModel.Properties.ConditionType)
{
@@ -34,14 +37,16 @@ namespace Artemis.Profiles.Layers.Conditions
}
// If there is a held down keybind on it, reset every 2 frames, after 500 ms
- if (layerModel.Properties.Conditions.Any(c => c.Operator == "held") && DateTime.Now - _lastKeypress > Delay)
+ if (layerModel.Properties.Conditions.Any(c => c.Operator == "held") &&
+ DateTime.Now - _lastKeypress > Delay)
+ {
HotKeyMet = false;
+ }
return conditionMet;
}
}
-
public void KeybindTask(LayerConditionModel condition)
{
_lastKeypress = DateTime.Now;
@@ -58,5 +63,21 @@ namespace Artemis.Profiles.Layers.Conditions
break;
}
}
+
+ private static bool SimpleConditionsMet(LayerModel layerModel, ModuleDataModel dataModel,
+ IEnumerable checkConditions)
+ {
+ switch (layerModel.Properties.ConditionType)
+ {
+ case ConditionType.AnyMet:
+ return checkConditions.Any(cm => cm.ConditionMet(dataModel));
+ case ConditionType.AllMet:
+ return checkConditions.All(cm => cm.ConditionMet(dataModel));
+ case ConditionType.NoneMet:
+ return !checkConditions.Any(cm => cm.ConditionMet(dataModel));
+ default:
+ return false;
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Artemis/Artemis/Profiles/Layers/Conditions/EventCondition.cs b/Artemis/Artemis/Profiles/Layers/Conditions/EventCondition.cs
index f7cb9ada3..1700c6b5e 100644
--- a/Artemis/Artemis/Profiles/Layers/Conditions/EventCondition.cs
+++ b/Artemis/Artemis/Profiles/Layers/Conditions/EventCondition.cs
@@ -1,4 +1,5 @@
-using System.Linq;
+using System.Collections.Generic;
+using System.Linq;
using Artemis.Modules.Abstract;
using Artemis.Profiles.Layers.Interfaces;
using Artemis.Profiles.Layers.Models;
@@ -9,13 +10,16 @@ namespace Artemis.Profiles.Layers.Conditions
public class EventCondition : ILayerCondition
{
[JsonIgnore]
- public bool HotKeyMet { get;set; }
+ public bool HotKeyMet { get; set; }
public bool ConditionsMet(LayerModel layerModel, ModuleDataModel dataModel)
{
lock (layerModel.Properties.Conditions)
{
- var checkConditions = layerModel.Properties.Conditions.Where(c => !c.Field.Contains("hotkey"));
+ var checkConditions = layerModel.Properties.Conditions.Where(c => !c.Field.Contains("hotkey")).ToList();
+ if (checkConditions.Count == layerModel.Properties.Conditions.Count)
+ return SimpleConditionsMet(layerModel, dataModel, checkConditions);
+
var conditionsMet = false;
switch (layerModel.Properties.ConditionType)
{
@@ -56,5 +60,21 @@ namespace Artemis.Profiles.Layers.Conditions
break;
}
}
+
+ private static bool SimpleConditionsMet(LayerModel layerModel, ModuleDataModel dataModel,
+ IEnumerable checkConditions)
+ {
+ switch (layerModel.Properties.ConditionType)
+ {
+ case ConditionType.AnyMet:
+ return checkConditions.Any(cm => cm.ConditionMet(dataModel));
+ case ConditionType.AllMet:
+ return checkConditions.All(cm => cm.ConditionMet(dataModel));
+ case ConditionType.NoneMet:
+ return !checkConditions.Any(cm => cm.ConditionMet(dataModel));
+ default:
+ return false;
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Artemis/Artemis/Profiles/Lua/Wrappers/LuaDrawWrapper.cs b/Artemis/Artemis/Profiles/Lua/Wrappers/LuaDrawWrapper.cs
index c66b33234..32a034d95 100644
--- a/Artemis/Artemis/Profiles/Lua/Wrappers/LuaDrawWrapper.cs
+++ b/Artemis/Artemis/Profiles/Lua/Wrappers/LuaDrawWrapper.cs
@@ -22,7 +22,7 @@ namespace Artemis.Profiles.Lua.Wrappers
public LuaDrawWrapper(DrawingContext ctx, string updateType)
{
_ctx = ctx;
- _scale = updateType == "keyboard" ? 4 : 2;
+ _scale = updateType == "keyboard" || updateType == "preview" ? 4 : 2;
}
public void DrawEllipse(LuaBrush luaBrush, double x, double y, double height, double width)
diff --git a/Artemis/Artemis/lib/AssettoCorsaSharedMemory.dll b/Artemis/Artemis/lib/AssettoCorsaSharedMemory.dll
new file mode 100644
index 000000000..e56aae8dc
Binary files /dev/null and b/Artemis/Artemis/lib/AssettoCorsaSharedMemory.dll differ