mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Removed ugly null reference try-catch. Layers are propertly drawn to keyboard now
This commit is contained in:
parent
e95b33e9bb
commit
399a6f97ca
@ -120,6 +120,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="Antlr3.Runtime, Version=3.5.0.2, Culture=neutral, PublicKeyToken=eb42632606e9261f, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Antlr.3.5.0.2\lib\Antlr3.Runtime.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Autofac, Version=4.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
<Reference Include="Autofac, Version=4.0.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Autofac.4.0.0-rc1-177\lib\net45\Autofac.dll</HintPath>
|
<HintPath>..\packages\Autofac.4.0.0-rc1-177\lib\net45\Autofac.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@ -148,6 +152,10 @@
|
|||||||
<HintPath>..\packages\CUE.NET.1.0.2.2\lib\net45\CUE.NET.dll</HintPath>
|
<HintPath>..\packages\CUE.NET.1.0.2.2\lib\net45\CUE.NET.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="ExpressionEvaluator, Version=2.0.4.0, Culture=neutral, PublicKeyToken=90d9f15d622e2348, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ExpressionEvaluator.2.0.4.0\lib\net40\ExpressionEvaluator.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.5\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
|
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.5\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq.Dynamic;
|
using System.Linq.Dynamic;
|
||||||
using Artemis.Models.Interfaces;
|
using Artemis.Models.Interfaces;
|
||||||
|
using Artemis.Utilities;
|
||||||
|
|
||||||
namespace Artemis.Models.Profiles
|
namespace Artemis.Models.Profiles
|
||||||
{
|
{
|
||||||
@ -16,19 +16,17 @@ namespace Artemis.Models.Profiles
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(Field) || string.IsNullOrEmpty(Value) || string.IsNullOrEmpty(Type))
|
if (string.IsNullOrEmpty(Field) || string.IsNullOrEmpty(Value) || string.IsNullOrEmpty(Type))
|
||||||
return false;
|
return false;
|
||||||
try
|
|
||||||
{
|
var inspect = GeneralHelpers.GetPropertyValue(subject, Field);
|
||||||
// Put the subject in a list, allowing Dynamic Linq to be used.
|
if (inspect == null)
|
||||||
var subjectList = new List<T> {(T) subject};
|
|
||||||
var res = Type == "String"
|
|
||||||
? subjectList.Where($"{Field}.ToLower() {Operator} @0", Value.ToLower()).Any()
|
|
||||||
: subjectList.Where($"{Field} {Operator} {Value}").Any();
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
catch (NullReferenceException)
|
|
||||||
{
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
// Put the subject in a list, allowing Dynamic Linq to be used.
|
||||||
|
var subjectList = new List<T> {(T) subject};
|
||||||
|
var res = Type == "String"
|
||||||
|
? subjectList.Where($"{Field}.ToLower() {Operator} @0", Value.ToLower()).Any()
|
||||||
|
: subjectList.Where($"{Field} {Operator} {Value}").Any();
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace Artemis.Models.Profiles
|
namespace Artemis.Models.Profiles
|
||||||
{
|
{
|
||||||
@ -7,11 +8,13 @@ namespace Artemis.Models.Profiles
|
|||||||
public ProfileModel()
|
public ProfileModel()
|
||||||
{
|
{
|
||||||
Layers = new List<LayerModel>();
|
Layers = new List<LayerModel>();
|
||||||
|
DrawingVisual = new DrawingVisual();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string KeyboardName { get; set; }
|
public string KeyboardName { get; set; }
|
||||||
public string GameName { get; set; }
|
public string GameName { get; set; }
|
||||||
|
public DrawingVisual DrawingVisual { get; set; }
|
||||||
|
|
||||||
public List<LayerModel> Layers { get; set; }
|
public List<LayerModel> Layers { get; set; }
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +1,11 @@
|
|||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Artemis.Utilities.GameState;
|
using Artemis.Utilities.GameState;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using Color = System.Windows.Media.Color;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.CounterStrike
|
namespace Artemis.Modules.Games.CounterStrike
|
||||||
{
|
{
|
||||||
@ -52,24 +52,32 @@ namespace Artemis.Modules.Games.CounterStrike
|
|||||||
|
|
||||||
public override Bitmap GenerateBitmap()
|
public override Bitmap GenerateBitmap()
|
||||||
{
|
{
|
||||||
var keyboardRect = MainManager.KeyboardManager.ActiveKeyboard.KeyboardRectangle(Scale);
|
if (Profile == null || GameDataModel == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
var visual = new DrawingVisual();
|
var keyboardRect = MainManager.KeyboardManager.ActiveKeyboard.KeyboardRectangle(Scale);
|
||||||
using (var drawingContext = visual.RenderOpen())
|
Bitmap bitmap = null;
|
||||||
|
Profile.DrawingVisual.Dispatcher.Invoke(delegate
|
||||||
{
|
{
|
||||||
// Setup the DrawingVisual's size
|
var visual = new DrawingVisual();
|
||||||
drawingContext.PushClip(new RectangleGeometry(keyboardRect));
|
using (var drawingContext = visual.RenderOpen())
|
||||||
drawingContext.DrawRectangle(new SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0)), null, keyboardRect);
|
{
|
||||||
|
// Setup the DrawingVisual's size
|
||||||
|
drawingContext.PushClip(new RectangleGeometry(keyboardRect));
|
||||||
|
drawingContext.DrawRectangle(new SolidColorBrush(Color.FromArgb(0, 0, 0, 0)),
|
||||||
|
null, keyboardRect);
|
||||||
|
|
||||||
// Draw the layers
|
// Draw the layers
|
||||||
foreach (var layerModel in Profile.Layers)
|
foreach (var layerModel in Profile.Layers)
|
||||||
layerModel.Draw<CounterStrikeDataModel>(GameDataModel, drawingContext);
|
layerModel.Draw<CounterStrikeDataModel>(GameDataModel, drawingContext);
|
||||||
|
|
||||||
// Remove the clip
|
// Remove the clip
|
||||||
drawingContext.Pop();
|
drawingContext.Pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ImageUtilities.DrawinVisualToBitmap(visual, keyboardRect);
|
bitmap = ImageUtilities.DrawinVisualToBitmap(visual, keyboardRect);
|
||||||
|
});
|
||||||
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void HandleGameData(object sender, GameDataReceivedEventArgs e)
|
public void HandleGameData(object sender, GameDataReceivedEventArgs e)
|
||||||
|
|||||||
@ -55,6 +55,19 @@ namespace Artemis.Utilities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static object GetPropertyValue(object o, string path)
|
||||||
|
{
|
||||||
|
var propertyNames = path.Split('.');
|
||||||
|
var value = o.GetType().GetProperty(propertyNames[0]).GetValue(o, null);
|
||||||
|
|
||||||
|
if (propertyNames.Length == 1 || value == null)
|
||||||
|
return value;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return GetPropertyValue(value, path.Replace(propertyNames[0] + ".", ""));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static List<PropertyCollection> GenerateTypeMap(object o) => GenerateTypeMap(o.GetType().GetProperties());
|
public static List<PropertyCollection> GenerateTypeMap(object o) => GenerateTypeMap(o.GetType().GetProperties());
|
||||||
public static List<PropertyCollection> GenerateTypeMap<T>() => GenerateTypeMap(typeof (T).GetProperties());
|
public static List<PropertyCollection> GenerateTypeMap<T>() => GenerateTypeMap(typeof (T).GetProperties());
|
||||||
|
|
||||||
@ -66,11 +79,11 @@ namespace Artemis.Utilities
|
|||||||
{
|
{
|
||||||
var friendlyName = Empty;
|
var friendlyName = Empty;
|
||||||
if (propertyInfo.PropertyType.Name == "Int32")
|
if (propertyInfo.PropertyType.Name == "Int32")
|
||||||
friendlyName = "(Number) ";
|
friendlyName = "(Number)";
|
||||||
else if (propertyInfo.PropertyType.Name == "String")
|
else if (propertyInfo.PropertyType.Name == "String")
|
||||||
friendlyName = "(Text) ";
|
friendlyName = "(Text)";
|
||||||
if (propertyInfo.PropertyType.BaseType?.Name == "Enum")
|
if (propertyInfo.PropertyType.BaseType?.Name == "Enum")
|
||||||
friendlyName = "(Choice) ";
|
friendlyName = "(Choice)";
|
||||||
|
|
||||||
var parent = new PropertyCollection
|
var parent = new PropertyCollection
|
||||||
{
|
{
|
||||||
|
|||||||
@ -25,8 +25,6 @@ namespace Artemis.Utilities
|
|||||||
{
|
{
|
||||||
if (_layerModel.LayerCalculatedProperties.Brush == null)
|
if (_layerModel.LayerCalculatedProperties.Brush == null)
|
||||||
return;
|
return;
|
||||||
if (!_layerModel.LayerCalculatedProperties.Brush.IsFrozen)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// Set up variables for this frame
|
// Set up variables for this frame
|
||||||
_rectangle = new Rect(_layerModel.LayerCalculatedProperties.X*Scale,
|
_rectangle = new Rect(_layerModel.LayerCalculatedProperties.X*Scale,
|
||||||
@ -95,13 +93,15 @@ namespace Artemis.Utilities
|
|||||||
|
|
||||||
public void DrawRectangle(DrawingContext c)
|
public void DrawRectangle(DrawingContext c)
|
||||||
{
|
{
|
||||||
c.DrawRectangle(_layerModel.LayerCalculatedProperties.Brush, null, _rectangle);
|
_layerModel.LayerCalculatedProperties.Brush.Dispatcher.Invoke(
|
||||||
|
() => c.DrawRectangle(_layerModel.LayerCalculatedProperties.Brush, null, _rectangle));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawEllipse(DrawingContext c)
|
public void DrawEllipse(DrawingContext c)
|
||||||
{
|
{
|
||||||
c.DrawEllipse(_layerModel.LayerCalculatedProperties.Brush, null,
|
_layerModel.LayerCalculatedProperties.Brush.Dispatcher.Invoke(
|
||||||
new Point(_rectangle.Width/2, _rectangle.Height/2), _rectangle.Width, _rectangle.Height);
|
() => c.DrawEllipse(_layerModel.LayerCalculatedProperties.Brush, null,
|
||||||
|
new Point(_rectangle.Width/2, _rectangle.Height/2), _rectangle.Width, _rectangle.Height));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DrawGif(DrawingContext bmp)
|
public void DrawGif(DrawingContext bmp)
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@ -35,8 +36,7 @@ namespace Artemis.ViewModels
|
|||||||
new BindableCollection<LayerConditionViewModel<T>>(
|
new BindableCollection<LayerConditionViewModel<T>>(
|
||||||
layer.LayerConditions.Select(c => new LayerConditionViewModel<T>(this, c, DataModelProps)));
|
layer.LayerConditions.Select(c => new LayerConditionViewModel<T>(this, c, DataModelProps)));
|
||||||
|
|
||||||
_previewWorker = new BackgroundWorker();
|
_previewWorker = new BackgroundWorker {WorkerSupportsCancellation = true};
|
||||||
_previewWorker.WorkerSupportsCancellation = true;
|
|
||||||
_previewWorker.DoWork += PreviewWorkerOnDoWork;
|
_previewWorker.DoWork += PreviewWorkerOnDoWork;
|
||||||
_previewWorker.RunWorkerAsync();
|
_previewWorker.RunWorkerAsync();
|
||||||
|
|
||||||
@ -75,8 +75,6 @@ namespace Artemis.ViewModels
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
// For the preview, put the proposed properties into the calculated properties
|
|
||||||
_layer.LayerCalculatedProperties = ProposedProperties;
|
|
||||||
var keyboardRect = _activeKeyboard.KeyboardRectangle(4);
|
var keyboardRect = _activeKeyboard.KeyboardRectangle(4);
|
||||||
|
|
||||||
var visual = new DrawingVisual();
|
var visual = new DrawingVisual();
|
||||||
@ -103,7 +101,7 @@ namespace Artemis.ViewModels
|
|||||||
while (!_previewWorker.CancellationPending)
|
while (!_previewWorker.CancellationPending)
|
||||||
{
|
{
|
||||||
NotifyOfPropertyChange(() => LayerImage);
|
NotifyOfPropertyChange(() => LayerImage);
|
||||||
Thread.Sleep(1000/25);
|
Thread.Sleep(1000 / 25);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -44,10 +44,6 @@ namespace Artemis.ViewModels
|
|||||||
{
|
{
|
||||||
if (Equals(value, _selectedProfileModel)) return;
|
if (Equals(value, _selectedProfileModel)) return;
|
||||||
_selectedProfileModel = value;
|
_selectedProfileModel = value;
|
||||||
foreach (var layerModel in SelectedProfileModel.Layers)
|
|
||||||
{
|
|
||||||
layerModel.LayerUserProperties.Brush?.Freeze();
|
|
||||||
}
|
|
||||||
NotifyOfPropertyChange();
|
NotifyOfPropertyChange();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -48,21 +48,12 @@
|
|||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="Auto" />
|
||||||
<RowDefinition Height="Auto" />
|
<RowDefinition Height="*" />
|
||||||
<RowDefinition Height="Auto" MinHeight="42" />
|
|
||||||
<RowDefinition Height="Auto" MinHeight="128" />
|
|
||||||
<RowDefinition />
|
<RowDefinition />
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Header -->
|
<!-- Header -->
|
||||||
<Label Grid.Row="0" Grid.ColumnSpan="4" FontSize="20">
|
<Label Grid.Row="0" Grid.ColumnSpan="4" FontSize="20" Content="Basics" />
|
||||||
<Label.Content>
|
|
||||||
<StackPanel Orientation="Horizontal">
|
|
||||||
<TextBlock Text="{Binding Path=Layer.Name}" />
|
|
||||||
<TextBlock Text=" - Basics" />
|
|
||||||
</StackPanel>
|
|
||||||
</Label.Content>
|
|
||||||
</Label>
|
|
||||||
|
|
||||||
<!-- Layer name -->
|
<!-- Layer name -->
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" Margin="10,12" FontSize="13.333" Text="Name:"
|
<TextBlock Grid.Row="1" Grid.Column="0" Margin="10,12" FontSize="13.333" Text="Name:"
|
||||||
@ -70,17 +61,6 @@
|
|||||||
<TextBox Grid.Row="1" Grid.Column="1" x:Name="Name" Margin="10" Text="{Binding Path=Layer.Name}" />
|
<TextBox Grid.Row="1" Grid.Column="1" x:Name="Name" Margin="10" Text="{Binding Path=Layer.Name}" />
|
||||||
|
|
||||||
<!-- Layer type -->
|
<!-- Layer type -->
|
||||||
<TextBlock Grid.Row="1" Grid.Column="2" Margin="10,12" FontSize="13.333" Text="Type:"
|
|
||||||
VerticalAlignment="Center" Height="18" />
|
|
||||||
|
|
||||||
<ComboBox Grid.Row="1" Grid.Column="3" ItemsSource="{Binding Source={StaticResource LayerEnumValues}}"
|
|
||||||
Margin="10" SelectedItem="{Binding Path=Layer.LayerType}">
|
|
||||||
<ComboBox.ItemTemplate>
|
|
||||||
<DataTemplate>
|
|
||||||
<TextBlock Text="{Binding Converter={StaticResource HEnumDescriptionConverter}}" />
|
|
||||||
</DataTemplate>
|
|
||||||
</ComboBox.ItemTemplate>
|
|
||||||
</ComboBox>
|
|
||||||
|
|
||||||
<!-- Condition editor -->
|
<!-- Condition editor -->
|
||||||
<Label Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" FontSize="20" Content="Display if.." />
|
<Label Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="4" FontSize="20" Content="Display if.." />
|
||||||
@ -96,69 +76,44 @@
|
|||||||
</ListBox.Template>
|
</ListBox.Template>
|
||||||
</ListBox>
|
</ListBox>
|
||||||
</Border>
|
</Border>
|
||||||
<Button Grid.Row="4" Grid.Column="3" x:Name="AddCondition" Content="Add condition"
|
<Button Grid.Row="4" Grid.Column="3" x:Name="AddCondition" Content="Add condition" VerticalAlignment="Center"
|
||||||
VerticalAlignment="Center"
|
|
||||||
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Right" Height="30"
|
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Right" Height="30"
|
||||||
Margin="0,10,10,27" ScrollViewer.VerticalScrollBarVisibility="Auto" Grid.RowSpan="2" />
|
Margin="0,10,10,10" ScrollViewer.VerticalScrollBarVisibility="Auto" />
|
||||||
|
|
||||||
<!-- Advanced -->
|
<!-- Advanced -->
|
||||||
<Label Grid.Row="5" Grid.Column="0" FontSize="20" HorizontalAlignment="Left"
|
<Label Grid.Row="4" Grid.Column="0" FontSize="20" HorizontalAlignment="Left"
|
||||||
Content="Advanced" Width="97" />
|
Content="Advanced" Width="97" VerticalAlignment="Bottom" />
|
||||||
|
|
||||||
<!-- X -->
|
|
||||||
<TextBlock Grid.Row="6" Grid.Column="0" Margin="10" FontSize="13.333" Text="X Position:"
|
|
||||||
VerticalAlignment="Center" Height="18" />
|
|
||||||
<TextBox Grid.Row="6" Grid.Column="1" Margin="10" Text="{Binding Path=ProposedProperties.X}" />
|
|
||||||
|
|
||||||
<!-- Y -->
|
|
||||||
<TextBlock Grid.Row="6" Grid.Column="2" Margin="10" FontSize="13.333" Text="Y Position:"
|
|
||||||
VerticalAlignment="Center" Height="18" />
|
|
||||||
<TextBox Grid.Row="6" Grid.Column="3" Margin="10" Text="{Binding Path=ProposedProperties.Y}" />
|
|
||||||
|
|
||||||
<!-- Height -->
|
<!-- Height -->
|
||||||
<TextBlock Grid.Row="7" Grid.Column="0" Margin="10" FontSize="13.333" Text="Height:" VerticalAlignment="Center"
|
<TextBlock Grid.Row="5" Grid.Column="0" Margin="10" FontSize="13.333" Text="Height:" VerticalAlignment="Center"
|
||||||
Height="18" />
|
Height="18" />
|
||||||
<TextBox Grid.Row="7" Grid.Column="1" Margin="10" Text="{Binding Path=ProposedProperties.Height}" />
|
<TextBox Grid.Row="5" Grid.Column="1" Margin="10" Text="{Binding Path=ProposedProperties.Height}" />
|
||||||
|
|
||||||
<!-- Width -->
|
<!-- Width -->
|
||||||
<TextBlock Grid.Row="7" Grid.Column="2" Margin="10" FontSize="13.333" Text="Width:" VerticalAlignment="Center"
|
<TextBlock Grid.Row="5" Grid.Column="2" Margin="10" FontSize="13.333" Text="Width:" VerticalAlignment="Center"
|
||||||
Height="18" />
|
Height="18" />
|
||||||
<TextBox Grid.Row="7" Grid.Column="3" Margin="10" Text="{Binding Path=ProposedProperties.Width}" />
|
<TextBox Grid.Row="5" Grid.Column="3" Margin="10" Text="{Binding Path=ProposedProperties.Width}" />
|
||||||
|
|
||||||
<!-- Opacity -->
|
<!-- Colors -->
|
||||||
<TextBlock Grid.Row="8" Grid.Column="0" Margin="10" FontSize="13.333" Text="Opacity:"
|
<TextBlock Grid.Row="6" Grid.Column="0" Margin="10,13,10,0" FontSize="13.333" Text="Color(s):"
|
||||||
VerticalAlignment="Center" Height="18" />
|
VerticalAlignment="Top" Height="18" />
|
||||||
<Slider x:Name="Sensitivity" Grid.Row="8" Grid.Column="1" VerticalAlignment="Center"
|
<Border Grid.Row="6" Grid.Column="1" Margin="10" BorderThickness="1"
|
||||||
TickPlacement="BottomRight" TickFrequency="20"
|
BorderBrush="{StaticResource ControlBorderBrush}" ToolTip="Click to edit">
|
||||||
Value="{Binding Path=ProposedProperties.Opacity, Mode=TwoWay}" Minimum="1" Maximum="255"
|
<ncore:ColorBox Brush="{Binding Path=ProposedProperties.Brush, Mode=TwoWay}" />
|
||||||
SmallChange="1" Margin="10,7" Height="24" />
|
</Border>
|
||||||
|
|
||||||
<!-- ContainedBrush -->
|
<!-- ContainedBrush -->
|
||||||
<TextBlock Grid.Row="8" Grid.Column="2" Margin="10" FontSize="13.333" Text="Contained colors:"
|
<TextBlock Grid.Row="6" Grid.Column="2" Margin="10" FontSize="13.333" Text="Contained colors:"
|
||||||
VerticalAlignment="Center" Height="18" />
|
VerticalAlignment="Center" Height="18" />
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=ProposedProperties.ContainedBrush, Mode=TwoWay}" Grid.Row="8"
|
<controls:ToggleSwitch IsChecked="{Binding Path=ProposedProperties.ContainedBrush, Mode=TwoWay}" Grid.Row="6"
|
||||||
Grid.Column="3" OnLabel="Yes" OffLabel="No" Margin="10,1,5,1" VerticalAlignment="Center"
|
Grid.Column="3" OnLabel="Yes" OffLabel="No" Margin="10,1,5,1" VerticalAlignment="Center"
|
||||||
Height="36" />
|
Height="36" />
|
||||||
|
|
||||||
<!-- Rotate -->
|
<!-- Animation -->
|
||||||
<TextBlock Grid.Row="9" Grid.Column="0" Margin="10" FontSize="13.333" Text="Rotate:" VerticalAlignment="Center"
|
<TextBlock Grid.Row="7" Grid.Column="0" Margin="10" FontSize="13.333" Text="Animation:"
|
||||||
|
VerticalAlignment="Center"
|
||||||
Height="18" />
|
Height="18" />
|
||||||
<controls:ToggleSwitch IsChecked="{Binding Path=ProposedProperties.Rotate, Mode=TwoWay}" Grid.Row="9"
|
<ComboBox Grid.Row="7" Grid.Column="1" ItemsSource="{Binding Source={StaticResource ColorEnumValues}}"
|
||||||
Grid.Column="1" OnLabel="Yes" OffLabel="No" Margin="10,1,5,1" VerticalAlignment="Center"
|
|
||||||
Height="36" />
|
|
||||||
|
|
||||||
<!-- RotateSpeed -->
|
|
||||||
<TextBlock Grid.Row="9" Grid.Column="2" Margin="10" FontSize="13.333" Text="Rotation speed:"
|
|
||||||
VerticalAlignment="Center" Height="18" />
|
|
||||||
<Slider x:Name="RotationSpeed" Grid.Row="9" Grid.Column="3" VerticalAlignment="Center"
|
|
||||||
TickPlacement="BottomRight" TickFrequency="0.1"
|
|
||||||
Value="{Binding Path=ProposedProperties.RotateSpeed, Mode=TwoWay}" Minimum="0.1" Maximum="3"
|
|
||||||
SmallChange="1" IsSnapToTickEnabled="True" Margin="10,7" Height="24" />
|
|
||||||
|
|
||||||
<!-- Color direction -->
|
|
||||||
<TextBlock Grid.Row="10" Grid.Column="0" Margin="10,13,10,0" FontSize="13.333" Text="Color direction:"
|
|
||||||
VerticalAlignment="Top" Height="18" />
|
|
||||||
<ComboBox Grid.Row="10" Grid.Column="1" ItemsSource="{Binding Source={StaticResource ColorEnumValues}}"
|
|
||||||
Margin="10,10,10,0" SelectedItem="{Binding Path=ProposedProperties.ColorMode}"
|
Margin="10,10,10,0" SelectedItem="{Binding Path=ProposedProperties.ColorMode}"
|
||||||
VerticalAlignment="Top" Height="22">
|
VerticalAlignment="Top" Height="22">
|
||||||
<ComboBox.ItemTemplate>
|
<ComboBox.ItemTemplate>
|
||||||
@ -168,24 +123,34 @@
|
|||||||
</ComboBox.ItemTemplate>
|
</ComboBox.ItemTemplate>
|
||||||
</ComboBox>
|
</ComboBox>
|
||||||
|
|
||||||
<!-- Colors -->
|
<!-- Animation Speed -->
|
||||||
<TextBlock Grid.Row="10" Grid.Column="2" Margin="10,13,10,0" FontSize="13.333" Text="Color(s):"
|
<TextBlock Grid.Row="7" Grid.Column="2" Margin="10" FontSize="13.333" Text="Animation speed:"
|
||||||
VerticalAlignment="Top" Height="18" />
|
VerticalAlignment="Center" Height="18" />
|
||||||
<Border Grid.Row="10" Grid.Column="3" Margin="10" BorderThickness="1" BorderBrush="{StaticResource ControlBorderBrush}" ToolTip="Click to edit">
|
<Slider x:Name="RotationSpeed" Grid.Row="7" Grid.Column="3" VerticalAlignment="Center"
|
||||||
<ncore:ColorBox Brush="{Binding Path=ProposedProperties.Brush, Mode=TwoWay}" />
|
TickPlacement="BottomRight" TickFrequency="0.1"
|
||||||
</Border>
|
Value="{Binding Path=ProposedProperties.RotateSpeed, Mode=TwoWay}" Minimum="0.1" Maximum="3"
|
||||||
|
SmallChange="1" IsSnapToTickEnabled="True" Margin="10,7" Height="24" />
|
||||||
|
|
||||||
|
<!-- Opacity -->
|
||||||
|
<TextBlock Grid.Row="8" Grid.Column="0" Margin="10" FontSize="13.333" Text="Opacity:"
|
||||||
|
VerticalAlignment="Center" Height="18" />
|
||||||
|
<Slider x:Name="Sensitivity" Grid.Row="8" Grid.Column="1" VerticalAlignment="Center"
|
||||||
|
TickPlacement="BottomRight" TickFrequency="20"
|
||||||
|
Value="{Binding Path=ProposedProperties.Opacity, Mode=TwoWay}" Minimum="1" Maximum="255"
|
||||||
|
SmallChange="1" Margin="10,7" Height="24" />
|
||||||
|
|
||||||
<!-- Preview -->
|
<!-- Preview -->
|
||||||
<TextBlock Grid.Row="11" Grid.Column="0" Margin="10,13,10,0" FontSize="13.333" Text="Preview:"
|
<TextBlock Grid.Row="9" Grid.Column="0" Margin="10,13,10,0" FontSize="13.333" Text="Preview:"
|
||||||
VerticalAlignment="Top" Height="18" />
|
VerticalAlignment="Top" Height="18" />
|
||||||
<Border Grid.Row="11" Grid.Column="1" Grid.ColumnSpan="2" Margin="10" BorderThickness="1"
|
<Border Grid.Row="9" Grid.Column="1" Grid.ColumnSpan="2" Margin="10" BorderThickness="1"
|
||||||
BorderBrush="{StaticResource ControlBorderBrush}" Width="280" Height="105">
|
BorderBrush="{StaticResource ControlBorderBrush}">
|
||||||
<Image Source="{Binding LayerImage}" />
|
<Image Source="{Binding LayerImage}" />
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<Button Grid.Row="12" Grid.Column="0" x:Name="Apply" Content="Apply" VerticalAlignment="Bottom"
|
<Button Grid.Row="10" Grid.Column="0" x:Name="Apply" Content="Apply" VerticalAlignment="Bottom"
|
||||||
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left" Margin="10,0,0,20"
|
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left" Margin="10,0,0,20"
|
||||||
Height="30" />
|
Height="30" />
|
||||||
<Button Grid.Row="12" Grid.Column="1" x:Name="PreSelect" Content="Reset" VerticalAlignment="Bottom"
|
<Button Grid.Row="10" Grid.Column="1" x:Name="PreSelect" Content="Reset" VerticalAlignment="Bottom"
|
||||||
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left" Margin="10,0,0,20"
|
Style="{DynamicResource SquareButtonStyle}" Width="95" HorizontalAlignment="Left" Margin="10,0,0,20"
|
||||||
Height="30" />
|
Height="30" />
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -1,11 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
|
<package id="Antlr" version="3.5.0.2" targetFramework="net452" />
|
||||||
<package id="Autofac" version="4.0.0-rc1-177" targetFramework="net452" />
|
<package id="Autofac" version="4.0.0-rc1-177" targetFramework="net452" />
|
||||||
<package id="Caliburn.Micro" version="2.0.2" targetFramework="net452" />
|
<package id="Caliburn.Micro" version="2.0.2" targetFramework="net452" />
|
||||||
<package id="Caliburn.Micro.AutofacBootstrap" version="2.0.9-beta" targetFramework="net452" />
|
<package id="Caliburn.Micro.AutofacBootstrap" version="2.0.9-beta" targetFramework="net452" />
|
||||||
<package id="Caliburn.Micro.Core" version="2.0.2" targetFramework="net452" />
|
<package id="Caliburn.Micro.Core" version="2.0.2" targetFramework="net452" />
|
||||||
<package id="Colore" version="4.0.0" targetFramework="net452" />
|
<package id="Colore" version="4.0.0" targetFramework="net452" />
|
||||||
<package id="CUE.NET" version="1.0.2.2" targetFramework="net452" />
|
<package id="CUE.NET" version="1.0.2.2" targetFramework="net452" />
|
||||||
|
<package id="ExpressionEvaluator" version="2.0.4.0" targetFramework="net452" />
|
||||||
<package id="Extended.Wpf.Toolkit" version="2.6" targetFramework="net452" />
|
<package id="Extended.Wpf.Toolkit" version="2.6" targetFramework="net452" />
|
||||||
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.5" targetFramework="net452" />
|
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.5" targetFramework="net452" />
|
||||||
<package id="ImageLibrary" version="2.0.5" targetFramework="net452" />
|
<package id="ImageLibrary" version="2.0.5" targetFramework="net452" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user