diff --git a/Artemis/Artemis/Artemis.csproj b/Artemis/Artemis/Artemis.csproj
index 349c3cfcd..32e761669 100644
--- a/Artemis/Artemis/Artemis.csproj
+++ b/Artemis/Artemis/Artemis.csproj
@@ -451,6 +451,7 @@
+
@@ -490,6 +491,9 @@
Witcher3View.xaml
+
+ LayerKeyboardView.xaml
+
LayerConditionView.xaml
@@ -499,6 +503,9 @@
LayerEditorView.xaml
+
+ LayerMouseView.xaml
+
OverlaysView.xaml
@@ -666,6 +673,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
@@ -678,6 +689,10 @@
MSBuild:Compile
Designer
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/Artemis/Artemis/Models/Profiles/LayerDynamicPropertiesModel.cs b/Artemis/Artemis/Models/Profiles/LayerDynamicPropertiesModel.cs
index 0ffd2bd86..3740627b6 100644
--- a/Artemis/Artemis/Models/Profiles/LayerDynamicPropertiesModel.cs
+++ b/Artemis/Artemis/Models/Profiles/LayerDynamicPropertiesModel.cs
@@ -27,7 +27,7 @@ namespace Artemis.Models.Profiles
///
public LayerPropertyType LayerPropertyType { get; set; }
- internal void ApplyProperty(IGameDataModel data, LayerPropertiesModel userProps, LayerPropertiesModel props)
+ internal void ApplyProperty(IGameDataModel data, LayerPropertiesModel userProps, LayerPropertiesModel props)
{
if (LayerPropertyType == LayerPropertyType.PercentageOf)
Apply(props, userProps, data, int.Parse(PercentageSource));
diff --git a/Artemis/Artemis/Models/Profiles/LayerModel.cs b/Artemis/Artemis/Models/Profiles/LayerModel.cs
index f9c8afd3e..1d60ad829 100644
--- a/Artemis/Artemis/Models/Profiles/LayerModel.cs
+++ b/Artemis/Artemis/Models/Profiles/LayerModel.cs
@@ -100,7 +100,7 @@ namespace Artemis.Models.Profiles
if (preview)
return;
foreach (var dynamicProperty in LayerProperties)
- dynamicProperty.ApplyProperty(dataModel, UserProps, CalcProps);
+ dynamicProperty.ApplyProperty(dataModel, UserProps, CalcProps);
}
public void Reorder(LayerModel selectedLayer, bool moveUp)
diff --git a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs
index 128ffb205..a0bf77546 100644
--- a/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs
+++ b/Artemis/Artemis/Modules/Games/CounterStrike/CounterStrikeModel.cs
@@ -1,8 +1,10 @@
-using System.Drawing;
+using System;
+using System.Drawing;
using Artemis.Managers;
using Artemis.Models;
using Artemis.Utilities.GameState;
using Newtonsoft.Json;
+using Ninject.Extensions.Logging;
namespace Artemis.Modules.Games.CounterStrike
{
@@ -17,6 +19,7 @@ namespace Artemis.Modules.Games.CounterStrike
Initialized = false;
}
+ public ILogger Logger { get; set; }
public int Scale { get; set; }
public override void Dispose()
@@ -61,7 +64,16 @@ namespace Artemis.Modules.Games.CounterStrike
return;
// Parse the JSON
- GameDataModel = JsonConvert.DeserializeObject(jsonString);
+ try
+ {
+ GameDataModel = JsonConvert.DeserializeObject(jsonString);
+ }
+ catch (Exception ex)
+ {
+ Logger.Error(ex, "Failed to deserialize CS:GO JSON");
+ throw;
+ }
+
}
}
}
\ No newline at end of file
diff --git a/Artemis/Artemis/Utilities/GifImage.cs b/Artemis/Artemis/Utilities/GifImage.cs
index ff3db6e75..70d90cfeb 100644
--- a/Artemis/Artemis/Utilities/GifImage.cs
+++ b/Artemis/Artemis/Utilities/GifImage.cs
@@ -57,7 +57,7 @@ namespace Artemis.Utilities
public Image GetFrame(int index)
{
_gifImage.SelectActiveFrame(_dimension, index); //find the frame
- return (Image) _gifImage.Clone(); //return a copy of it
+ return _gifImage;
}
}
}
\ No newline at end of file
diff --git a/Artemis/Artemis/ViewModels/LayerEditor/LayerDynamicPropertiesViewModel.cs b/Artemis/Artemis/ViewModels/LayerEditor/LayerDynamicPropertiesViewModel.cs
index 18d5b8b6d..499760e9d 100644
--- a/Artemis/Artemis/ViewModels/LayerEditor/LayerDynamicPropertiesViewModel.cs
+++ b/Artemis/Artemis/ViewModels/LayerEditor/LayerDynamicPropertiesViewModel.cs
@@ -6,7 +6,7 @@ using Caliburn.Micro;
namespace Artemis.ViewModels.LayerEditor
{
- public class LayerDynamicPropertiesViewModel : Screen
+ public class LayerDynamicPropertiesViewModel : PropertyChangedBase
{
private readonly LayerModel _layer;
private readonly string _property;
diff --git a/Artemis/Artemis/ViewModels/LayerEditor/LayerEditorViewModel.cs b/Artemis/Artemis/ViewModels/LayerEditor/LayerEditorViewModel.cs
index 148e45ffd..f068fb14d 100644
--- a/Artemis/Artemis/ViewModels/LayerEditor/LayerEditorViewModel.cs
+++ b/Artemis/Artemis/ViewModels/LayerEditor/LayerEditorViewModel.cs
@@ -26,6 +26,7 @@ namespace Artemis.ViewModels.LayerEditor
private LayerType _layerType;
private LayerModel _proposedLayer;
private LayerPropertiesModel _proposedProperties;
+ private LayerKeyboardViewModel _layerKeyboardViewModel;
public LayerEditorViewModel(IGameDataModel gameDataModel, KeyboardProvider activeKeyboard, LayerModel layer)
{
@@ -161,10 +162,27 @@ namespace Artemis.ViewModels.LayerEditor
return;
Layer.LayerType = LayerType;
+
+ if (LayerType != LayerType.Keyboard && LayerType != LayerType.KeyboardGif)
+ LayerKeyboardViewModel = null;
+ if ((LayerType == LayerType.Keyboard || LayerType == LayerType.KeyboardGif) && LayerKeyboardViewModel == null)
+ LayerKeyboardViewModel = new LayerKeyboardViewModel();
+
NotifyOfPropertyChange(() => KeyboardGridIsVisible);
NotifyOfPropertyChange(() => GifGridIsVisible);
}
+ public LayerKeyboardViewModel LayerKeyboardViewModel
+ {
+ get { return _layerKeyboardViewModel; }
+ set
+ {
+ if (Equals(value, _layerKeyboardViewModel)) return;
+ _layerKeyboardViewModel = value;
+ NotifyOfPropertyChange(() => LayerKeyboardViewModel);
+ }
+ }
+
public void AddCondition()
{
var condition = new LayerConditionModel();
diff --git a/Artemis/Artemis/ViewModels/LayerEditor/LayerKeyboardViewModel.cs b/Artemis/Artemis/ViewModels/LayerEditor/LayerKeyboardViewModel.cs
new file mode 100644
index 000000000..608863693
--- /dev/null
+++ b/Artemis/Artemis/ViewModels/LayerEditor/LayerKeyboardViewModel.cs
@@ -0,0 +1,8 @@
+using Caliburn.Micro;
+
+namespace Artemis.ViewModels.LayerEditor
+{
+ public class LayerKeyboardViewModel : PropertyChangedBase
+ {
+ }
+}
\ No newline at end of file
diff --git a/Artemis/Artemis/Views/LayerEditor/LayerEditorView.xaml b/Artemis/Artemis/Views/LayerEditor/LayerEditorView.xaml
index 2353e757c..2a41c912d 100644
--- a/Artemis/Artemis/Views/LayerEditor/LayerEditorView.xaml
+++ b/Artemis/Artemis/Views/LayerEditor/LayerEditorView.xaml
@@ -98,103 +98,17 @@
Content="Advanced" Width="97" VerticalAlignment="Bottom" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
\ No newline at end of file
diff --git a/Artemis/Artemis/Views/LayerEditor/LayerKeyboardView.xaml b/Artemis/Artemis/Views/LayerEditor/LayerKeyboardView.xaml
new file mode 100644
index 000000000..64afc9203
--- /dev/null
+++ b/Artemis/Artemis/Views/LayerEditor/LayerKeyboardView.xaml
@@ -0,0 +1,103 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Artemis/Artemis/Views/LayerEditor/LayerKeyboardView.xaml.cs b/Artemis/Artemis/Views/LayerEditor/LayerKeyboardView.xaml.cs
new file mode 100644
index 000000000..7b6d06df8
--- /dev/null
+++ b/Artemis/Artemis/Views/LayerEditor/LayerKeyboardView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Artemis.Views.LayerEditor
+{
+ ///
+ /// Interaction logic for LayerKeyboardView.xaml
+ ///
+ public partial class LayerKeyboardView : UserControl
+ {
+ public LayerKeyboardView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Artemis/Artemis/Views/LayerEditor/LayerMouseView.xaml b/Artemis/Artemis/Views/LayerEditor/LayerMouseView.xaml
new file mode 100644
index 000000000..1dbd0585b
--- /dev/null
+++ b/Artemis/Artemis/Views/LayerEditor/LayerMouseView.xaml
@@ -0,0 +1,12 @@
+
+
+
+
+
diff --git a/Artemis/Artemis/Views/LayerEditor/LayerMouseView.xaml.cs b/Artemis/Artemis/Views/LayerEditor/LayerMouseView.xaml.cs
new file mode 100644
index 000000000..cfd0d3efd
--- /dev/null
+++ b/Artemis/Artemis/Views/LayerEditor/LayerMouseView.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Artemis.Views.LayerEditor
+{
+ ///
+ /// Interaction logic for LayerMouseView.xaml
+ ///
+ public partial class LayerMouseView : UserControl
+ {
+ public LayerMouseView()
+ {
+ InitializeComponent();
+ }
+ }
+}