diff --git a/Artemis/Artemis/Artemis.csproj b/Artemis/Artemis/Artemis.csproj
index 2181a19b4..d7ddc8851 100644
--- a/Artemis/Artemis/Artemis.csproj
+++ b/Artemis/Artemis/Artemis.csproj
@@ -163,8 +163,8 @@
..\packages\CSCore.1.2.0\lib\net35-client\CSCore.dll
True
-
- ..\packages\CUE.NET.1.1.2.1\lib\net45\CUE.NET.dll
+
+ ..\packages\CUE.NET.1.1.3.0\lib\net45\CUE.NET.dll
True
@@ -199,8 +199,8 @@
..\packages\squirrel.windows.1.4.4\lib\Net45\ICSharpCode.SharpZipLib.dll
True
-
- ..\packages\log4net.2.0.7\lib\net45-full\log4net.dll
+
+ ..\packages\log4net.2.0.8\lib\net45-full\log4net.dll
True
@@ -248,7 +248,7 @@
True
- ..\packages\NLog.4.4.3\lib\net45\NLog.dll
+ ..\packages\NLog.4.4.4\lib\net45\NLog.dll
True
@@ -272,7 +272,7 @@
True
- ..\packages\SpotifyAPI-NET.2.12.0\lib\SpotifyAPI.dll
+ ..\packages\SpotifyAPI-NET.2.13.1\lib\SpotifyAPI.dll
True
@@ -778,6 +778,7 @@
Designer
+
@@ -1064,12 +1065,12 @@
-
+
This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
+
-
+
+
-
-
- The Assetto Corsa module uses the Assetto Corsa Shared Memory Library project by mdjarv.
-
+
+
+ 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/CounterStrike/CounterStrikeModel.cs b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs
index dd80b03d7..08cc13339 100644
--- a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs
+++ b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs
@@ -8,6 +8,7 @@ using Artemis.Services;
using Artemis.Utilities;
using Artemis.Utilities.GameState;
using Newtonsoft.Json;
+using ErrorEventArgs = Newtonsoft.Json.Serialization.ErrorEventArgs;
namespace Artemis.Modules.Games.CounterStrike
{
@@ -56,7 +57,7 @@ namespace Artemis.Modules.Games.CounterStrike
return;
var dm = (CounterStrikeDataModel) DataModel;
- if (dm.player != null)
+ if (dm.player != null && dm.player.weapons != null)
{
// Detect active weapon
if (dm.player.weapons.weapon_0?.state == "active")
@@ -147,7 +148,7 @@ namespace Artemis.Modules.Games.CounterStrike
{
if (DataModel == null)
DataModel = new CounterStrikeDataModel();
- JsonConvert.PopulateObject(jsonString, DataModel);
+ JsonConvert.PopulateObject(jsonString, DataModel, new JsonSerializerSettings {Error = HandleGameDataError});
}
catch (Exception ex)
{
@@ -155,5 +156,11 @@ namespace Artemis.Modules.Games.CounterStrike
throw;
}
}
+
+ private void HandleGameDataError(object sender, ErrorEventArgs e)
+ {
+ // Ignore errors and leave them null
+ e.ErrorContext.Handled = true;
+ }
}
-}
\ No newline at end of file
+}
diff --git a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeView.xaml b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeView.xaml
index 6e736595f..358b995e0 100644
--- a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeView.xaml
+++ b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeView.xaml
@@ -7,51 +7,49 @@
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
d:DesignHeight="476.986" d:DesignWidth="538.772">
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/Dota2/Dota2View.xaml b/Artemis/Artemis/Modules/Games/Dota2/Dota2View.xaml
index b82f9d0a1..469979334 100644
--- a/Artemis/Artemis/Modules/Games/Dota2/Dota2View.xaml
+++ b/Artemis/Artemis/Modules/Games/Dota2/Dota2View.xaml
@@ -1,57 +1,55 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
+ mc:Ignorable="d"
+ d:DesignHeight="476.986" d:DesignWidth="538.772">
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2View.xaml b/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2View.xaml
index 3721dc0eb..bdaa887ee 100644
--- a/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2View.xaml
+++ b/Artemis/Artemis/Modules/Games/EurotruckSimulator2/EurotruckSimulator2View.xaml
@@ -1,77 +1,75 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The Truck Simulator module uses code from the ETS2 Telemetry Web Server project by Funbit.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
+ mc:Ignorable="d"
+ d:DesignHeight="559.725" d:DesignWidth="882.696">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ The Truck Simulator module uses code from the ETS2 Telemetry Web Server project by Funbit.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/GtaV/GtaVView.xaml b/Artemis/Artemis/Modules/Games/GtaV/GtaVView.xaml
index c759de8b6..0441bb12e 100644
--- a/Artemis/Artemis/Modules/Games/GtaV/GtaVView.xaml
+++ b/Artemis/Artemis/Modules/Games/GtaV/GtaVView.xaml
@@ -7,41 +7,39 @@
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/LightFx/LightFxView.xaml b/Artemis/Artemis/Modules/Games/LightFx/LightFxView.xaml
index b996b5697..f0ffbdb95 100644
--- a/Artemis/Artemis/Modules/Games/LightFx/LightFxView.xaml
+++ b/Artemis/Artemis/Modules/Games/LightFx/LightFxView.xaml
@@ -1,47 +1,45 @@
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
+ mc:Ignorable="d"
+ d:DesignHeight="559.725" d:DesignWidth="882.696">
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/Overwatch/OverwatchView.xaml b/Artemis/Artemis/Modules/Games/Overwatch/OverwatchView.xaml
index e9dfaa05f..7fa2840a1 100644
--- a/Artemis/Artemis/Modules/Games/Overwatch/OverwatchView.xaml
+++ b/Artemis/Artemis/Modules/Games/Overwatch/OverwatchView.xaml
@@ -1,62 +1,60 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
+ mc:Ignorable="d"
+ d:DesignHeight="410.933" d:DesignWidth="732.154">
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
- Note: If you're having trouble getting the profile to work, check out the wiki.
-
+
+
+ Note: If you're having trouble getting the profile to work, check out the wiki.
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/ProjectCars/ProjectCarsView.xaml b/Artemis/Artemis/Modules/Games/ProjectCars/ProjectCarsView.xaml
index 6a82788e5..9e1f9c44f 100644
--- a/Artemis/Artemis/Modules/Games/ProjectCars/ProjectCarsView.xaml
+++ b/Artemis/Artemis/Modules/Games/ProjectCars/ProjectCarsView.xaml
@@ -1,52 +1,50 @@
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
+ mc:Ignorable="d"
+ d:DesignHeight="559.725" d:DesignWidth="882.696">
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
- The Project CARS module uses code from the pCars API Demo project by MikeyTT.
-
+
+
+ The Project CARS module uses code from the pCars API Demo project by MikeyTT.
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueView.xaml b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueView.xaml
index 5046e14e6..48f923d27 100644
--- a/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueView.xaml
+++ b/Artemis/Artemis/Modules/Games/RocketLeague/RocketLeagueView.xaml
@@ -1,50 +1,48 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
+ mc:Ignorable="d"
+ d:DesignHeight="476.986" d:DesignWidth="538.772">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/TheDivision/TheDivisionView.xaml b/Artemis/Artemis/Modules/Games/TheDivision/TheDivisionView.xaml
index 78b321d09..cce9cf955 100644
--- a/Artemis/Artemis/Modules/Games/TheDivision/TheDivisionView.xaml
+++ b/Artemis/Artemis/Modules/Games/TheDivision/TheDivisionView.xaml
@@ -8,46 +8,44 @@
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
d:DesignHeight="416.495" d:DesignWidth="553.608">
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
- For this game to work with Artemis, please open up your Division settings, navigate to 3rd Party and set LED keyboard support to Yes. (This only works if you have Artemis running before starting the game)
-
+
+
+ For this game to work with Artemis, please open up your Division settings, navigate to 3rd Party and set LED keyboard support to Yes. (This only works if you have Artemis running before starting the game)
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/UnrealTournament/UnrealTournamentView.xaml b/Artemis/Artemis/Modules/Games/UnrealTournament/UnrealTournamentView.xaml
index 2c06fbc5f..b796f07a8 100644
--- a/Artemis/Artemis/Modules/Games/UnrealTournament/UnrealTournamentView.xaml
+++ b/Artemis/Artemis/Modules/Games/UnrealTournament/UnrealTournamentView.xaml
@@ -1,58 +1,56 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
+ mc:Ignorable="d"
+ d:DesignHeight="476.986" d:DesignWidth="538.772">
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3View.xaml b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3View.xaml
index 6b2f98c2e..a66e53f99 100644
--- a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3View.xaml
+++ b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3View.xaml
@@ -1,57 +1,55 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
+ mc:Ignorable="d"
+ d:DesignHeight="386.842" d:DesignWidth="554.887">
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
- Artemis requires the latest Witcher 3 version and mod to be installed in order to work. If you don't use any (conflicting) Witcher 3 mods, the mod can automatically be installed.
-
+
+
+ Artemis requires the latest Witcher 3 version and mod to be installed in order to work. If you don't use any (conflicting) Witcher 3 mods, the mod can automatically be installed.
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/WoW/WoWView.xaml b/Artemis/Artemis/Modules/Games/WoW/WoWView.xaml
index 8837ba776..9537d78fd 100644
--- a/Artemis/Artemis/Modules/Games/WoW/WoWView.xaml
+++ b/Artemis/Artemis/Modules/Games/WoW/WoWView.xaml
@@ -1,53 +1,51 @@
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
+ mc:Ignorable="d"
+ d:DesignHeight="476.986" d:DesignWidth="538.772">
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
- This module hasn't been approved by Blizzard and could lead to an account ban. Even though the risk is minimal, it's still your own risk.
-
+
+
+ This module hasn't been approved by Blizzard and could lead to an account ban. Even though the risk is minimal, it's still your own risk.
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/General/GeneralProfile/GeneralProfileView.xaml b/Artemis/Artemis/Modules/General/GeneralProfile/GeneralProfileView.xaml
index b16a5bbc2..ba95e4a36 100644
--- a/Artemis/Artemis/Modules/General/GeneralProfile/GeneralProfileView.xaml
+++ b/Artemis/Artemis/Modules/General/GeneralProfile/GeneralProfileView.xaml
@@ -1,47 +1,45 @@
-
-
-
-
-
-
-
-
-
-
-
-
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:cal="http://www.caliburnproject.org"
+ xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
+ mc:Ignorable="d"
+ d:DesignHeight="476.986" d:DesignWidth="538.772">
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Overlays/OverlayProfile/OverlayProfileView.xaml b/Artemis/Artemis/Modules/Overlays/OverlayProfile/OverlayProfileView.xaml
index 9bb57f30c..99e9fd1e6 100644
--- a/Artemis/Artemis/Modules/Overlays/OverlayProfile/OverlayProfileView.xaml
+++ b/Artemis/Artemis/Modules/Overlays/OverlayProfile/OverlayProfileView.xaml
@@ -7,41 +7,39 @@
xmlns:controls="http://metro.mahapps.com/winfx/xaml/controls"
mc:Ignorable="d"
d:DesignHeight="476.986" d:DesignWidth="538.772">
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
-
-
-
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/NLog.xsd b/Artemis/Artemis/NLog.xsd
index f1ff205fa..78043e413 100644
--- a/Artemis/Artemis/NLog.xsd
+++ b/Artemis/Artemis/NLog.xsd
@@ -42,12 +42,32 @@
- Pass NLog internal exceptions to the application. Default value is: false.
+ Throw an exception when there is an internal error. Default value is: false.
+
+
+
+
+ Throw an exception when there is a configuration error. If not set, determined by throwExceptions.
+
+
+
+
+ Gets or sets a value indicating whether Variables should be kept on configuration reload. Default value is: false.
- Write internal NLog messages to the the System.Diagnostics.Trace. Default value is: false
+ Write internal NLog messages to the System.Diagnostics.Trace. Default value is: false.
+
+
+
+
+ Write timestamps for internal NLog messages. Default value is: true.
+
+
+
+
+ Use InvariantCulture as default culture instead of CurrentCulture. Default value is: false.
@@ -174,7 +194,7 @@
- Name of the file to be included. The name is relative to the name of the current config file.
+ Name of the file to be included. You could use * wildcard. The name is relative to the name of the current config file.
@@ -1327,6 +1347,13 @@
+
+
+
+
+
+
+
diff --git a/Artemis/Artemis/Profiles/Layers/Models/LayerModel.cs b/Artemis/Artemis/Profiles/Layers/Models/LayerModel.cs
index eec55dbb9..8ae1736f8 100644
--- a/Artemis/Artemis/Profiles/Layers/Models/LayerModel.cs
+++ b/Artemis/Artemis/Profiles/Layers/Models/LayerModel.cs
@@ -244,6 +244,7 @@ namespace Artemis.Profiles.Layers.Models
return new Rect(X * scale, Y * scale, width * scale, height * scale);
}
+ // TODO: Make this and ProfileModel's GetRenderLayers the same through inheritance
///
/// Generates a flat list containing all layers that must be rendered on the keyboard,
/// the first mouse layer to be rendered and the first headset layer to be rendered
@@ -254,20 +255,22 @@ namespace Artemis.Profiles.Layers.Models
/// A flat list containing all layers that must be rendered
public List GetRenderLayers(ModuleDataModel dataModel, bool keyboardOnly, bool ignoreConditions = false)
{
- var layers = new List();
- foreach (var layerModel in Children.OrderByDescending(l => l.Order))
- {
- if (!layerModel.Enabled || keyboardOnly && layerModel.LayerType.DrawType != DrawType.Keyboard)
- continue;
-
- if (!ignoreConditions)
- if (!layerModel.AreConditionsMet(dataModel))
- continue;
-
- layers.Add(layerModel);
- layers.AddRange(layerModel.GetRenderLayers(dataModel, keyboardOnly, ignoreConditions));
- }
-
+ var layers = new List();
+ foreach (var layerModel in Children.OrderByDescending(l => l.Order))
+ {
+ if (!layerModel.Enabled || keyboardOnly && layerModel.LayerType.DrawType != DrawType.Keyboard)
+ continue;
+
+ if (!ignoreConditions)
+ {
+ if (!layerModel.AreConditionsMet(dataModel) || !layerModel.RenderAllowed)
+ continue;
+ }
+
+ layers.Add(layerModel);
+ layers.AddRange(layerModel.GetRenderLayers(dataModel, keyboardOnly, ignoreConditions));
+ }
+
return layers;
}
@@ -312,7 +315,7 @@ namespace Artemis.Profiles.Layers.Models
public string Name { get; set; }
public int Order { get; set; }
public bool Enabled { get; set; }
- public bool RenderAllowed { get; set; }
+ public bool RenderAllowed { get; set; } = true;
public bool Expanded { get; set; }
public bool IsEvent { get; set; }
public LayerPropertiesModel Properties { get; set; }
@@ -404,5 +407,11 @@ namespace Artemis.Profiles.Layers.Models
}
#endregion
+
+ ///
+ public override string ToString()
+ {
+ return $"{nameof(Name)}: {Name}, {nameof(Order)}: {Order}, {nameof(X)}: {X}, {nameof(Y)}: {Y}, {nameof(Width)}: {Width}, {nameof(Height)}: {Height}";
+ }
}
}
diff --git a/Artemis/Artemis/Profiles/ProfileModel.cs b/Artemis/Artemis/Profiles/ProfileModel.cs
index eea4ad237..f54714c0f 100644
--- a/Artemis/Artemis/Profiles/ProfileModel.cs
+++ b/Artemis/Artemis/Profiles/ProfileModel.cs
@@ -74,6 +74,7 @@ namespace Artemis.Profiles
return layers;
}
+ // TODO: Make this and LayerModel's GetRenderLayers the same through inheritance
///
/// Generates a flat list containing all layers that must be rendered on the keyboard,
/// the first mouse layer to be rendered and the first headset layer to be rendered
@@ -82,8 +83,7 @@ namespace Artemis.Profiles
/// Whether or not to ignore anything but keyboards
///
/// A flat list containing all layers that must be rendered
- public List GetRenderLayers(ModuleDataModel dataModel, bool keyboardOnly,
- bool ignoreConditions = false)
+ public List GetRenderLayers(ModuleDataModel dataModel, bool keyboardOnly, bool ignoreConditions = false)
{
var layers = new List();
foreach (var layerModel in Layers.OrderByDescending(l => l.Order))
@@ -92,8 +92,10 @@ namespace Artemis.Profiles
continue;
if (!ignoreConditions)
- if (!layerModel.AreConditionsMet(dataModel))
+ {
+ if (!layerModel.AreConditionsMet(dataModel) || !layerModel.RenderAllowed)
continue;
+ }
layers.Add(layerModel);
layers.AddRange(layerModel.GetRenderLayers(dataModel, keyboardOnly, ignoreConditions));
@@ -109,8 +111,7 @@ namespace Artemis.Profiles
/// The layers to render
/// The data model to base the layer's properties on
/// Indicates wheter the layer is drawn as a preview, ignoring dynamic properties
- internal void DrawLayers(DeviceVisualModel deviceVisualModel, List renderLayers,
- ModuleDataModel dataModel, bool preview)
+ internal void DrawLayers(DeviceVisualModel deviceVisualModel, List renderLayers, ModuleDataModel dataModel, bool preview)
{
renderLayers = renderLayers.Where(rl => rl.LayerType.DrawType == deviceVisualModel.DrawType).ToList();
if (!renderLayers.Any())
@@ -209,9 +210,7 @@ namespace Artemis.Profiles
var layer = LayerModel.CreateLayer();
if (afterLayer != null)
- {
afterLayer.InsertAfter(layer);
- }
else
{
Layers.Add(layer);
@@ -233,6 +232,12 @@ namespace Artemis.Profiles
layerModel.RemoveKeybinds();
}
+ ///
+ public override string ToString()
+ {
+ return $"{nameof(Name)}: {Name}, {nameof(KeyboardSlug)}: {KeyboardSlug}, {nameof(GameName)}: {GameName}";
+ }
+
#region Compare
protected bool Equals(ProfileModel other)
diff --git a/Artemis/Artemis/Properties/Resources.Designer.cs b/Artemis/Artemis/Properties/Resources.Designer.cs
index a77b26a2d..2ae2a31ad 100644
--- a/Artemis/Artemis/Properties/Resources.Designer.cs
+++ b/Artemis/Artemis/Properties/Resources.Designer.cs
@@ -22,7 +22,7 @@ namespace Artemis.Properties {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- public class Resources {
+ internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
@@ -278,6 +278,16 @@ namespace Artemis.Properties {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
+ internal static System.Drawing.Bitmap k95_platinum {
+ get {
+ object obj = ResourceManager.GetObject("k95_platinum", resourceCulture);
+ return ((System.Drawing.Bitmap)(obj));
+ }
+ }
+
///
/// Looks up a localized resource of type System.Drawing.Bitmap.
///
diff --git a/Artemis/Artemis/Properties/Resources.resx b/Artemis/Artemis/Properties/Resources.resx
index fe9b237c2..fa4d5de48 100644
--- a/Artemis/Artemis/Properties/Resources.resx
+++ b/Artemis/Artemis/Properties/Resources.resx
@@ -220,4 +220,7 @@
..\Resources\Keyboards\masterkeys-pro-s.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
+ ..\Resources\Keyboards\k95-platinum.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Resources/CounterStrike/csgoGamestateConfiguration.txt b/Artemis/Artemis/Resources/CounterStrike/csgoGamestateConfiguration.txt
index 6263805ee..1ddb49d11 100644
--- a/Artemis/Artemis/Resources/CounterStrike/csgoGamestateConfiguration.txt
+++ b/Artemis/Artemis/Resources/CounterStrike/csgoGamestateConfiguration.txt
@@ -2,6 +2,7 @@
{
"uri" "http://localhost:{{port}}/csgo_game_event"
"timeout" "0.1"
+ "heartbeat" "0.1"
"data"
{
"provider" "1"
diff --git a/Artemis/Artemis/Resources/Keyboards/default-profiles.zip b/Artemis/Artemis/Resources/Keyboards/default-profiles.zip
index 6e056031f..9dd65e7aa 100644
Binary files a/Artemis/Artemis/Resources/Keyboards/default-profiles.zip and b/Artemis/Artemis/Resources/Keyboards/default-profiles.zip differ
diff --git a/Artemis/Artemis/Resources/Keyboards/k95-platinum.png b/Artemis/Artemis/Resources/Keyboards/k95-platinum.png
new file mode 100644
index 000000000..8c430db2b
Binary files /dev/null and b/Artemis/Artemis/Resources/Keyboards/k95-platinum.png differ
diff --git a/Artemis/Artemis/Utilities/DataReaders/DllManager.cs b/Artemis/Artemis/Utilities/DataReaders/DllManager.cs
index e803449c6..d733fcd3a 100644
--- a/Artemis/Artemis/Utilities/DataReaders/DllManager.cs
+++ b/Artemis/Artemis/Utilities/DataReaders/DllManager.cs
@@ -59,29 +59,34 @@ namespace Artemis.Utilities.DataReaders
{
if (DllPlaced())
return;
-
- // Create directory structure, just in case
- Directory.CreateDirectory(LogitechPath + @"");
-
- // Backup the existing DLL
- if (File.Exists(LogitechPath + @"\LogitechLed.dll"))
- {
- if (File.Exists(LogitechPath + @"\LogitechLed.dll.bak"))
- File.Delete(LogitechPath + @"\LogitechLed.dll.bak");
- File.Move(LogitechPath + @"\LogitechLed.dll", LogitechPath + @"\LogitechLed.dll.bak");
+
+ try
+ {
+ // Create directory structure, just in case
+ Directory.CreateDirectory(LogitechPath + @"");
+
+ // Backup the existing DLL
+ if (File.Exists(LogitechPath + @"\LogitechLed.dll"))
+ {
+ if (!File.Exists(LogitechPath + @"\LogitechLed.dll.bak"))
+ File.Move(LogitechPath + @"\LogitechLed.dll", LogitechPath + @"\LogitechLed.dll.bak");
+ }
+
+ // Copy our own DLL in place
+ File.WriteAllBytes(LogitechPath + @"\LogitechLED.dll", Resources.LogitechLED);
+
+ // A token to show the file is placed
+ File.Create(LogitechPath + @"\artemis.txt");
+
+ // If the user doesn't have a Logitech device, the CLSID will be missing
+ // and we should create it ourselves.
+ if (!RegistryKeyPlaced())
+ PlaceRegistryKey();
+ }
+ catch (Exception e)
+ {
+ Logger.Error(e, "Failed to place Logitech DLL");
}
-
- // Copy our own DLL in place
- File.WriteAllBytes(LogitechPath + @"\LogitechLED.dll",
- Resources.LogitechLED);
-
- // A token to show the file is placed
- File.Create(LogitechPath + @"\artemis.txt");
-
- // If the user doesn't have a Logitech device, the CLSID will be missing
- // and we should create it ourselves.
- if (!RegistryKeyPlaced())
- PlaceRegistryKey();
}
public static bool DllPlaced()
diff --git a/Artemis/Artemis/Utilities/Keyboard/KeyboardHook.cs b/Artemis/Artemis/Utilities/Keyboard/KeyboardHook.cs
index 84ba6f6e0..d27ac4e05 100644
--- a/Artemis/Artemis/Utilities/Keyboard/KeyboardHook.cs
+++ b/Artemis/Artemis/Utilities/Keyboard/KeyboardHook.cs
@@ -1,6 +1,8 @@
-using System.Threading.Tasks;
+using System.Diagnostics;
+using System.Threading.Tasks;
using System.Windows.Forms;
using Gma.System.MouseKeyHook;
+using NLog;
namespace Artemis.Utilities.Keyboard
{
@@ -15,6 +17,15 @@ namespace Artemis.Utilities.Keyboard
public static void Start()
{
_globalHook = Hook.GlobalEvents();
+
+ // When hitting breakpoints all user input freezes for ~10 seconds due to Windows waiting on the hooks to time out.
+ // By simply not hooking when the debugger is attached this no longer happens but keybinds obviously wont work.
+ if (Debugger.IsAttached)
+ {
+ LogManager.GetCurrentClassLogger().Fatal("Debugger attached so not enabling any global hooks, keybinds won't work!");
+ return;
+ }
+
_globalHook.KeyDown += GlobalHookOnKeyDown;
_globalHook.KeyUp += GlobalHookOnKeyUp;
_globalHook.MouseDown += GlobalHookOnMouseDown;
diff --git a/Artemis/Artemis/ViewModels/ProfileEditorViewModel.cs b/Artemis/Artemis/ViewModels/ProfileEditorViewModel.cs
index a46c22ed1..3f6ee7588 100644
--- a/Artemis/Artemis/ViewModels/ProfileEditorViewModel.cs
+++ b/Artemis/Artemis/ViewModels/ProfileEditorViewModel.cs
@@ -68,7 +68,7 @@ namespace Artemis.ViewModels
_dialogService = dialogService;
_copyKeybind = new KeybindModel("copy", new HotKey(Key.C, ModifierKeys.Control), PressType.Down, LayerToClipboard);
_pasteKeybind = new KeybindModel("paste", new HotKey(Key.V, ModifierKeys.Control), PressType.Up, ClipboardToLayer);
-
+ _placeholderKeyboard = KeyboardPreview = ImageUtilities.BitmapToBitmapImage(Resources.none);
ProfileNames = new ObservableCollection();
Layers = new ObservableCollection();
ProfileEditorModel = profileEditorModel;
@@ -325,7 +325,7 @@ namespace Artemis.ViewModels
public void LayerToClipboard()
{
- if (SelectedLayer == null)
+ if (SelectedLayer == null || !ActiveWindowHelper.MainWindowActive)
return;
// Probably not how the cool kids do it but leveraging on JsonConvert gives flawless serialization
@@ -334,6 +334,9 @@ namespace Artemis.ViewModels
public void ClipboardToLayer()
{
+ if (!ActiveWindowHelper.MainWindowActive)
+ return;
+
GeneralHelpers.ExecuteSta(() =>
{
var data = (string) Clipboard.GetData("layer");
@@ -503,17 +506,20 @@ namespace Artemis.ViewModels
#region Rendering
+ private readonly ImageSource _placeholderKeyboard;
+
private void LoopManagerOnRenderCompleted(object sender, EventArgs eventArgs)
{
// Besides the usual checks, also check if the ActiveKeyboard isn't the NoneKeyboard
if (SelectedProfile == null || _deviceManager.ActiveKeyboard == null || _deviceManager.ActiveKeyboard.Slug == "none")
{
- KeyboardPreview = null;
-
// Setup layers for the next frame
if (_moduleModel.IsInitialized && ActiveWindowHelper.MainWindowActive)
_moduleModel.PreviewLayers = new List();
+ if (!Equals(KeyboardPreview, _placeholderKeyboard))
+ KeyboardPreview = _placeholderKeyboard;
+
return;
}
diff --git a/Artemis/Artemis/ViewModels/Profiles/LayerConditionViewModel.cs b/Artemis/Artemis/ViewModels/Profiles/LayerConditionViewModel.cs
index c0fc4d2f1..596b6b1ea 100644
--- a/Artemis/Artemis/ViewModels/Profiles/LayerConditionViewModel.cs
+++ b/Artemis/Artemis/ViewModels/Profiles/LayerConditionViewModel.cs
@@ -16,19 +16,6 @@ namespace Artemis.ViewModels.Profiles
private readonly LayerEditorViewModel _editorViewModel;
- private readonly NamedOperator[] _hotkeyOperators =
- {
- new NamedOperator("Pressed", "enable"),
- new NamedOperator("Held down", "held")
- };
-
- private readonly GeneralHelpers.PropertyCollection[] _hotkeyProperties =
- {
- new GeneralHelpers.PropertyCollection {Display = "Enable when hotkey", Type = "hotkeyEnable", Path = "hotkeyEnable"},
- new GeneralHelpers.PropertyCollection {Display = "Disable when hotkey", Type = "hotkeyDisable", Path = "hotkeyDisable"},
- new GeneralHelpers.PropertyCollection {Display = "Toggle when hotkey", Type = "hotkeyToggle", Path = "hotkeyToggle"}
- };
-
private readonly NamedOperator[] _int32Operators =
{
new NamedOperator("Lower than", "<"),
@@ -55,12 +42,10 @@ namespace Artemis.ViewModels.Profiles
};
private HotKey _hotKey;
-
private bool _keybindIsVisible;
private GeneralHelpers.PropertyCollection _selectedDataModelProp;
private string _selectedDropdownValue;
private NamedOperator _selectedOperator;
-
private bool _userDropdownValueIsVisible;
private string _userValue;
private bool _userValueIsVisible;
@@ -72,7 +57,7 @@ namespace Artemis.ViewModels.Profiles
ConditionModel = conditionModel;
Operators = new BindableCollection();
DropdownValues = new BindableCollection();
- DataModelProps = new BindableCollection(_hotkeyProperties);
+ DataModelProps = new BindableCollection();
DataModelProps.AddRange(editorViewModel.DataModelProps);
PropertyChanged += MapViewToModel;
@@ -80,9 +65,7 @@ namespace Artemis.ViewModels.Profiles
}
public LayerConditionModel ConditionModel { get; set; }
-
public BindableCollection DataModelProps { get; set; }
-
public BindableCollection Operators { get; set; }
public BindableCollection DropdownValues { get; set; }
@@ -91,7 +74,8 @@ namespace Artemis.ViewModels.Profiles
get { return _userValue; }
set
{
- if (value == _userValue) return;
+ if (value == _userValue)
+ return;
_userValue = value;
NotifyOfPropertyChange(() => UserValue);
}
@@ -102,7 +86,8 @@ namespace Artemis.ViewModels.Profiles
get { return _hotKey; }
set
{
- if (Equals(value, _hotKey)) return;
+ if (Equals(value, _hotKey))
+ return;
_hotKey = value;
NotifyOfPropertyChange(() => HotKey);
}
@@ -113,7 +98,8 @@ namespace Artemis.ViewModels.Profiles
get { return _selectedDataModelProp; }
set
{
- if (value.Equals(_selectedDataModelProp)) return;
+ if (value.Equals(_selectedDataModelProp))
+ return;
_selectedDataModelProp = value;
SetupPropertyInput();
NotifyOfPropertyChange(() => SelectedDataModelProp);
@@ -125,7 +111,8 @@ namespace Artemis.ViewModels.Profiles
get { return _userValueIsVisible; }
set
{
- if (value == _userValueIsVisible) return;
+ if (value == _userValueIsVisible)
+ return;
_userValueIsVisible = value;
NotifyOfPropertyChange(() => UserValueIsVisible);
}
@@ -136,7 +123,8 @@ namespace Artemis.ViewModels.Profiles
get { return _userDropdownValueIsVisible; }
set
{
- if (value == _userDropdownValueIsVisible) return;
+ if (value == _userDropdownValueIsVisible)
+ return;
_userDropdownValueIsVisible = value;
NotifyOfPropertyChange(() => UserDropdownValueIsVisible);
}
@@ -147,7 +135,8 @@ namespace Artemis.ViewModels.Profiles
get { return _keybindIsVisible; }
set
{
- if (value == _keybindIsVisible) return;
+ if (value == _keybindIsVisible)
+ return;
_keybindIsVisible = value;
NotifyOfPropertyChange();
}
@@ -169,7 +158,8 @@ namespace Artemis.ViewModels.Profiles
get { return _selectedDropdownValue; }
set
{
- if (value == _selectedDropdownValue) return;
+ if (value == _selectedDropdownValue)
+ return;
_selectedDropdownValue = value;
NotifyOfPropertyChange(() => SelectedDropdownValue);
}
@@ -233,15 +223,6 @@ namespace Artemis.ViewModels.Profiles
Operators.AddRange(_stringOperators);
UserValueIsVisible = true;
break;
- case "hotkeyEnable":
- case "hotkeyDisable":
- Operators.AddRange(_hotkeyOperators);
- KeybindIsVisible = true;
- break;
- case "hotkeyToggle":
- Operators.Add(_hotkeyOperators[0]);
- KeybindIsVisible = true;
- break;
default:
Operators.AddRange(_operators);
UserValueIsVisible = true;
@@ -270,8 +251,7 @@ namespace Artemis.ViewModels.Profiles
KeybindIsVisible = false;
// Event operators don't have any form of input
- if (SelectedOperator.Value == "changed" || SelectedOperator.Value == "decreased" ||
- SelectedOperator.Value == "increased")
+ if (SelectedOperator.Value == "changed" || SelectedOperator.Value == "decreased" || SelectedOperator.Value == "increased")
return;
if (SelectedDataModelProp.Type != null && SelectedDataModelProp.Type.Contains("hotkey"))
@@ -314,4 +294,4 @@ namespace Artemis.ViewModels.Profiles
}
}
}
-}
\ No newline at end of file
+}
diff --git a/Artemis/Artemis/Views/ProfileEditorView.xaml b/Artemis/Artemis/Views/ProfileEditorView.xaml
index 842173278..73bb14f49 100644
--- a/Artemis/Artemis/Views/ProfileEditorView.xaml
+++ b/Artemis/Artemis/Views/ProfileEditorView.xaml
@@ -28,7 +28,7 @@
-
+
diff --git a/Artemis/Artemis/Views/Profiles/LayerKeybindView.xaml b/Artemis/Artemis/Views/Profiles/LayerKeybindView.xaml
index 9919b348a..4e213873e 100644
--- a/Artemis/Artemis/Views/Profiles/LayerKeybindView.xaml
+++ b/Artemis/Artemis/Views/Profiles/LayerKeybindView.xaml
@@ -52,18 +52,18 @@
-