Resharper cleanup on entire project

This commit is contained in:
SpoinkyNL committed 2016-04-27 20:40:41 +02:00
1 parent 1a3ce2203b
commit 3ec88714c7
45 files changed
+193 -216

No files matched your search

+44 -15
View File
@@ -2,21 +2,50 @@
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <sectionGroup name="userSettings"
<section name="Artemis.Modules.Games.TheDivision.TheDivision" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="Artemis.Modules.Games.Dota2.Dota2" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="Artemis.Modules.Games.TheDivision.TheDivision"
<section name="Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
<section name="Artemis.Modules.Games.RocketLeague.RocketLeague" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Settings.Offsets" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="Artemis.Modules.Games.Dota2.Dota2"
<section name="Artemis.Modules.Games.Witcher3.Witcher3" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
<section name="Artemis.Modules.Effects.AudioVisualizer.AudioVisualization" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Modules.Games.CounterStrike.CounterStrike" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay"
<section name="Artemis.Settings.CounterStrike" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
<section name="Artemis.Settings.AudioVisualization" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Settings.RocketLeague" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="Artemis.Modules.Games.RocketLeague.RocketLeague"
<section name="Artemis.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
<section name="Artemis.Settings.TypeWave" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Settings.General" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="Artemis.Settings.Offsets"
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Modules.Games.Witcher3.Witcher3"
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Modules.Effects.AudioVisualizer.AudioVisualization"
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Modules.Games.CounterStrike.CounterStrike"
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Settings.CounterStrike"
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Settings.AudioVisualization"
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Settings.RocketLeague"
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Properties.Settings"
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Settings.TypeWave"
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
<section name="Artemis.Settings.General"
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<connectionStrings /> <connectionStrings />
@@ -76,7 +76,7 @@ namespace Artemis.KeyboardProviders.Corsair
case "K95 RGB": case "K95 RGB":
Height = 7; Height = 7;
Width = 25; Width = 25;
PreviewSettings = new PreviewSettings(626, 175, new Thickness(0,-15,0,0), Resources.k95); PreviewSettings = new PreviewSettings(626, 175, new Thickness(0, -15, 0, 0), Resources.k95);
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(0, 1), new Point(20, 1))); KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(0, 1), new Point(20, 1)));
KeyboardRegions.Add(new KeyboardRegion("NumPad", new Point(21, 2), new Point(25, 7))); KeyboardRegions.Add(new KeyboardRegion("NumPad", new Point(21, 2), new Point(25, 7)));
KeyboardRegions.Add(new KeyboardRegion("QWER", new Point(5, 3), new Point(8, 3))); KeyboardRegions.Add(new KeyboardRegion("QWER", new Point(5, 3), new Point(8, 3)));
@@ -15,6 +15,7 @@ namespace Artemis.KeyboardProviders
public Point TopLeft { get; set; } public Point TopLeft { get; set; }
public Point BottomRight { get; set; } public Point BottomRight { get; set; }
public Rectangle GetRectangle() => new Rectangle(TopLeft.X, TopLeft.Y, BottomRight.X - TopLeft.X, BottomRight.Y - TopLeft.Y); public Rectangle GetRectangle()
=> new Rectangle(TopLeft.X, TopLeft.Y, BottomRight.X - TopLeft.X, BottomRight.Y - TopLeft.Y);
} }
} }
@@ -5,7 +5,6 @@ using System.Windows;
using Artemis.KeyboardProviders.Logitech.Utilities; using Artemis.KeyboardProviders.Logitech.Utilities;
using Artemis.Properties; using Artemis.Properties;
using Artemis.Utilities; using Artemis.Utilities;
using Artemis.Utilities.LogitechDll;
using Point = System.Drawing.Point; using Point = System.Drawing.Point;
namespace Artemis.KeyboardProviders.Logitech namespace Artemis.KeyboardProviders.Logitech
@@ -27,7 +26,7 @@ namespace Artemis.KeyboardProviders.Logitech
new KeyboardRegion("TopRow", new Point(0, 0), new Point(18, 0)), new KeyboardRegion("TopRow", new Point(0, 0), new Point(18, 0)),
new KeyboardRegion("NumPad", new Point(17, 1), new Point(21, 6)), new KeyboardRegion("NumPad", new Point(17, 1), new Point(21, 6)),
new KeyboardRegion("QWER", new Point(2, 2), new Point(5, 2)) new KeyboardRegion("QWER", new Point(2, 2), new Point(5, 2))
}; };
} }
public override bool CanEnable() public override bool CanEnable()
@@ -146,7 +146,7 @@ namespace Artemis.KeyboardProviders.Logitech.Utilities
new KeyMapping(120, 121), new KeyMapping(120, 121),
new KeyMapping(121, 122), new KeyMapping(121, 122),
new KeyMapping(122, 123), new KeyMapping(122, 123),
new KeyMapping(124, 124), new KeyMapping(124, 124)
}; };
public static byte[] BitmapToByteArray(Bitmap b, bool remap = true) public static byte[] BitmapToByteArray(Bitmap b, bool remap = true)
@@ -171,10 +171,10 @@ namespace Artemis.KeyboardProviders.Logitech.Utilities
var remapped = new byte[pixels.Length]; var remapped = new byte[pixels.Length];
// Every key is 4 bytes // Every key is 4 bytes
for (var i = 0; i <= pixels.Length /4; i++) for (var i = 0; i <= pixels.Length/4; i++)
{ {
var firstSByte = Keymappings[i].Source * 4; var firstSByte = Keymappings[i].Source*4;
var firstTByte = Keymappings[i].Target * 4; var firstTByte = Keymappings[i].Target*4;
for (var j = 0; j < 4; j++) for (var j = 0; j < 4; j++)
remapped[firstTByte + j] = pixels[firstSByte + j]; remapped[firstTByte + j] = pixels[firstSByte + j];
@@ -1,6 +1,4 @@
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using Artemis.Utilities; using Artemis.Utilities;
using Corale.Colore.Razer.Keyboard.Effects; using Corale.Colore.Razer.Keyboard.Effects;
+2 -1
View File
@@ -19,7 +19,6 @@ namespace Artemis.Managers
private readonly MainManager _mainManager; private readonly MainManager _mainManager;
private EffectModel _activeEffect; private EffectModel _activeEffect;
private bool _clearing; private bool _clearing;
public EffectModel PauseEffect { get; set; }
public EffectManager(MainManager mainManager, IEventAggregator events) public EffectManager(MainManager mainManager, IEventAggregator events)
{ {
@@ -32,6 +31,8 @@ namespace Artemis.Managers
Logger.Info("Intialized EffectManager"); Logger.Info("Intialized EffectManager");
} }
public EffectModel PauseEffect { get; set; }
/// <summary> /// <summary>
/// Used by ViewModels to show a preview of the profile currently being edited /// Used by ViewModels to show a preview of the profile currently being edited
/// </summary> /// </summary>
+5 -6
View File
@@ -1,21 +1,20 @@
using Artemis.Managers; using Artemis.Managers;
using Artemis.Models.Interfaces; using Artemis.Models.Interfaces;
using Artemis.Models.Profiles; using Artemis.Models.Profiles;
using Artemis.Modules.Games.Witcher3;
namespace Artemis.Models namespace Artemis.Models
{ {
public abstract class GameModel : EffectModel public abstract class GameModel : EffectModel
{ {
protected GameModel(MainManager mainManager, GameSettings settings) : base(mainManager)
{
Settings = settings;
}
public GameSettings Settings { get; set; } public GameSettings Settings { get; set; }
public bool Enabled { get; set; } public bool Enabled { get; set; }
public string ProcessName { get; set; } public string ProcessName { get; set; }
public IGameDataModel GameDataModel { get; set; } public IGameDataModel GameDataModel { get; set; }
public ProfileModel Profile { get; set; } public ProfileModel Profile { get; set; }
protected GameModel(MainManager mainManager, GameSettings settings) : base(mainManager)
{
Settings = settings;
}
} }
} }
@@ -47,7 +47,7 @@ namespace Artemis.Models.Profiles
if (layerProp == null || userProp == null) if (layerProp == null || userProp == null)
return; return;
var percentage = ToDouble(gameProperty) / percentageSource; var percentage = ToDouble(gameProperty)/percentageSource;
layerProp.SetValue(props, (int) (percentage*(int) userProp.GetValue(userProps, null))); layerProp.SetValue(props, (int) (percentage*(int) userProp.GetValue(userProps, null)));
} }
@@ -6,7 +6,6 @@ using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using Artemis.Managers; using Artemis.Managers;
using Artemis.Models; using Artemis.Models;
using Artemis.Utilities;
using Artemis.Utilities.Keyboard; using Artemis.Utilities.Keyboard;
using Kaliko.ImageLibrary; using Kaliko.ImageLibrary;
using Kaliko.ImageLibrary.Filters; using Kaliko.ImageLibrary.Filters;
@@ -96,7 +95,8 @@ namespace Artemis.Modules.Effects.AmbientLightning
if (_colors.Count <= colorIndex) if (_colors.Count <= colorIndex)
_colors.Add(Color.FromArgb(255, averageR, averageG, averageB)); _colors.Add(Color.FromArgb(255, averageR, averageG, averageB));
else else
_colors[colorIndex] = Color.FromArgb(255, (averageR + _colors[colorIndex].R * 5) / 6, (averageG + _colors[colorIndex].G * 5) / 6, (averageB + _colors[colorIndex].B * 5) / 6); _colors[colorIndex] = Color.FromArgb(255, (averageR + _colors[colorIndex].R*5)/6,
(averageG + _colors[colorIndex].G*5)/6, (averageB + _colors[colorIndex].B*5)/6);
colorIndex++; colorIndex++;
} }
} }
@@ -108,7 +108,7 @@ namespace Artemis.Modules.Effects.AmbientLightning
{ {
for (var column = 0; column < 3; column++) for (var column = 0; column < 3; column++)
{ {
var rectBase = new Point(rectWidth * column, rectHeight * row); var rectBase = new Point(rectWidth*column, rectHeight*row);
_rectangles.Add(new Rectangle(rectBase.X, rectBase.Y, rectWidth, rectHeight)); _rectangles.Add(new Rectangle(rectBase.X, rectBase.Y, rectWidth, rectHeight));
} }
} }
@@ -133,7 +133,6 @@ namespace Artemis.Modules.Effects.AmbientLightning
test.SaveBmp(ms); test.SaveBmp(ms);
ms.Position = 0; ms.Position = 0;
return new Bitmap(ms); return new Bitmap(ms);
} }
} }
} }
@@ -1,22 +1,9 @@
using System; using System.Windows.Controls;
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.Modules.Effects.AmbientLightning namespace Artemis.Modules.Effects.AmbientLightning
{ {
/// <summary> /// <summary>
/// Interaction logic for AmbientLightningEffectView.xaml /// Interaction logic for AmbientLightningEffectView.xaml
/// </summary> /// </summary>
public partial class AmbientLightningEffectView : UserControl public partial class AmbientLightningEffectView : UserControl
{ {
@@ -21,7 +21,7 @@ namespace Artemis.Modules.Effects.AmbientLightning
private readonly Factory1 _factory; private readonly Factory1 _factory;
private readonly Texture2D _screenTexture; private readonly Texture2D _screenTexture;
private DataStream _dataStream; private DataStream _dataStream;
private OutputDuplication _duplicatedOutput; private readonly OutputDuplication _duplicatedOutput;
private Resource _screenResource; private Resource _screenResource;
private Surface _screenSurface; private Surface _screenSurface;
@@ -47,8 +47,8 @@ namespace Artemis.Modules.Effects.TypeWave
return; return;
_waves.Add(Settings.IsRandomColors _waves.Add(Settings.IsRandomColors
? new Wave(new Point(keyMatch.PosX * Scale, keyMatch.PosY * Scale), 0, _randomColor) ? new Wave(new Point(keyMatch.PosX*Scale, keyMatch.PosY*Scale), 0, _randomColor)
: new Wave(new Point(keyMatch.PosX * Scale, keyMatch.PosY * Scale), 0, : new Wave(new Point(keyMatch.PosX*Scale, keyMatch.PosY*Scale), 0,
ColorHelpers.ToDrawingColor(Settings.WaveColor))); ColorHelpers.ToDrawingColor(Settings.WaveColor)));
} }
@@ -72,7 +72,7 @@ namespace Artemis.Modules.Effects.TypeWave
// TODO: Get from settings // TODO: Get from settings
var fps = 25; var fps = 25;
_waves[i].Size += Settings.SpreadSpeed * Scale; _waves[i].Size += Settings.SpreadSpeed*Scale;
if (Settings.IsShiftColors) if (Settings.IsShiftColors)
_waves[i].Color = ColorHelpers.ShiftColor(_waves[i].Color, Settings.ShiftColorSpeed); _waves[i].Color = ColorHelpers.ShiftColor(_waves[i].Color, Settings.ShiftColorSpeed);
@@ -1,5 +1,4 @@
using System.Diagnostics; using System.Drawing;
using System.Drawing;
using Artemis.Managers; using Artemis.Managers;
using Artemis.Models; using Artemis.Models;
using Artemis.Utilities.GameState; using Artemis.Utilities.GameState;
@@ -1,16 +1,15 @@
using System.ComponentModel; using System.IO;
using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using Artemis.Managers; using Artemis.Managers;
using Artemis.Properties; using Artemis.Properties;
using Artemis.ViewModels;
using Artemis.ViewModels.Abstract; using Artemis.ViewModels.Abstract;
namespace Artemis.Modules.Games.CounterStrike namespace Artemis.Modules.Games.CounterStrike
{ {
public class CounterStrikeViewModel : GameViewModel<CounterStrikeDataModel> public class CounterStrikeViewModel : GameViewModel<CounterStrikeDataModel>
{ {
public CounterStrikeViewModel(MainManager mainManager) : base(mainManager, new CounterStrikeModel(mainManager, new CounterStrikeSettings())) public CounterStrikeViewModel(MainManager mainManager)
: base(mainManager, new CounterStrikeModel(mainManager, new CounterStrikeSettings()))
{ {
// Create effect model and add it to MainManager // Create effect model and add it to MainManager
MainManager.EffectManager.EffectModels.Add(GameModel); MainManager.EffectManager.EffectModels.Add(GameModel);
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Modules.Games.Dota2" GeneratedClassName="Dota2">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
GeneratedClassNamespace="Artemis.Modules.Games.Dota2" GeneratedClassName="Dota2">
<Profiles /> <Profiles />
<Settings> <Settings>
<Setting Name="Enabled" Type="System.Boolean" Scope="User"> <Setting Name="Enabled" Type="System.Boolean" Scope="User">
@@ -1,37 +1,16 @@
using System; using System.Windows.Media;
using System.Collections.Generic;
using System.Windows.Media;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Artemis.Models; using Artemis.Models;
namespace Artemis.Modules.Games.Dota2 namespace Artemis.Modules.Games.Dota2
{ {
class Dota2Settings : GameSettings internal class Dota2Settings : GameSettings
{ {
public Dota2Settings() public Dota2Settings()
{ {
Load(); Load();
} }
#region Variables
public string GameDirectory { get; set; }
public bool CanCastAbility { get; set; }
public bool ShowHealth { get; set; }
public bool ShowDayCycle { get; set; }
public bool ShowMana { get; set; }
public bool ShowEvents { get; set; }
public Color MainColor { get; set; }
public Color ManaColor { get; set; }
public string KeyboardLayout { get; set; }
public Color AbilityCooldownColor { get; set; }
public Color AbilityReadyColor { get; set; }
#endregion
public override void Load() public override void Load()
{ {
KeyboardLayout = Dota2.Default.KeyboardLayout; KeyboardLayout = Dota2.Default.KeyboardLayout;
@@ -68,21 +47,35 @@ namespace Artemis.Modules.Games.Dota2
public override void ToDefault() public override void ToDefault()
{ {
Enabled = true; Enabled = true;
GameDirectory = string.Empty; GameDirectory = string.Empty;
KeyboardLayout = "Default"; KeyboardLayout = "Default";
MainColor = Color.FromArgb(255,255,0,0); MainColor = Color.FromArgb(255, 255, 0, 0);
ManaColor = Color.FromArgb(255,0,0,255); ManaColor = Color.FromArgb(255, 0, 0, 255);
AbilityCooldownColor = Color.FromArgb(255,106,90,205); AbilityCooldownColor = Color.FromArgb(255, 106, 90, 205);
AbilityReadyColor = Color.FromArgb(255, 0, 255, 0); AbilityReadyColor = Color.FromArgb(255, 0, 255, 0);
ShowHealth = true; ShowHealth = true;
CanCastAbility = true; CanCastAbility = true;
ShowDayCycle = true; ShowDayCycle = true;
ShowMana = true; ShowMana = true;
ShowEvents = true; ShowEvents = true;
} }
#region Variables
public string GameDirectory { get; set; }
public bool CanCastAbility { get; set; }
public bool ShowHealth { get; set; }
public bool ShowDayCycle { get; set; }
public bool ShowMana { get; set; }
public bool ShowEvents { get; set; }
public Color MainColor { get; set; }
public Color ManaColor { get; set; }
public string KeyboardLayout { get; set; }
public Color AbilityCooldownColor { get; set; }
public Color AbilityReadyColor { get; set; }
#endregion
} }
} }
@@ -10,7 +10,7 @@
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Margin="0,0,0,-19"> <ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" Margin="0,0,0,-19">
<Grid Margin="15, 5, 15, 5"> <Grid Margin="15, 5, 15, 5">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/> <ColumnDefinition Width="Auto" />
<ColumnDefinition /> <ColumnDefinition />
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
@@ -46,7 +46,6 @@
</StackPanel> </StackPanel>
<StackPanel Grid.Row="1" <StackPanel Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Grid.ColumnSpan="2" Margin="0,0,1,0"> Grid.ColumnSpan="2" Margin="0,0,1,0">
@@ -97,9 +96,11 @@
Height="16" Margin="0,10,0,9"> Height="16" Margin="0,10,0,9">
Keyboard Template Keyboard Template
</TextBlock> </TextBlock>
<ComboBox Grid.Row="5" Grid.Column="1" x:Name="KeyboardLayouts" ItemsSource="{Binding Path=KeyboardLayouts}" SelectedIndex="{Binding Path=GameSettings.KeyboardLayout}" VerticalAlignment="Center" <ComboBox Grid.Row="5" Grid.Column="1" x:Name="KeyboardLayouts"
HorizontalAlignment="Right" ItemsSource="{Binding Path=KeyboardLayouts}"
Width="109" Margin="0,6,0,7" /> SelectedIndex="{Binding Path=GameSettings.KeyboardLayout}" VerticalAlignment="Center"
HorizontalAlignment="Right"
Width="109" Margin="0,6,0,7" />
<!-- Items Display --> <!-- Items Display -->
<TextBlock Grid.Row="6" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center" <TextBlock Grid.Row="6" Grid.Column="0" HorizontalAlignment="Left" Width="168" VerticalAlignment="Center"
@@ -144,7 +145,8 @@
Display day/night Display day/night
</TextBlock> </TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowDayCycle, Mode=TwoWay}" <controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowDayCycle, Mode=TwoWay}"
Grid.Row="10" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No" Grid.Row="10" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes"
OffLabel="No"
Margin="0,0,-5,0" Width="114" /> Margin="0,0,-5,0" Width="114" />
<!-- Dead Display --> <!-- Dead Display -->
@@ -153,12 +155,11 @@
Show events on the keyboard Show events on the keyboard
</TextBlock> </TextBlock>
<controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowEvents, Mode=TwoWay}" <controls:ToggleSwitch IsChecked="{Binding Path=GameSettings.ShowEvents, Mode=TwoWay}"
Grid.Row="11" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes" OffLabel="No" Grid.Row="11" Grid.Column="1" HorizontalAlignment="Right" OnLabel="Yes"
OffLabel="No"
Margin="0,0,-5,0" Width="114" /> Margin="0,0,-5,0" Width="114" />
<StackPanel Grid.Column="0" Grid.Row="12" Orientation="Horizontal" VerticalAlignment="Bottom"> <StackPanel Grid.Column="0" Grid.Row="12" Orientation="Horizontal" VerticalAlignment="Bottom">
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" <Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
Style="{DynamicResource SquareButtonStyle}" /> Style="{DynamicResource SquareButtonStyle}" />
@@ -9,7 +9,8 @@ namespace Artemis.Modules.Games.Dota2
{ {
public class Dota2ViewModel : GameViewModel<Dota2DataModel> public class Dota2ViewModel : GameViewModel<Dota2DataModel>
{ {
public Dota2ViewModel(MainManager mainManager) : base(mainManager, new Dota2Model(mainManager, new Dota2Settings())) public Dota2ViewModel(MainManager mainManager)
: base(mainManager, new Dota2Model(mainManager, new Dota2Settings()))
{ {
MainManager.EffectManager.EffectModels.Add(GameModel); MainManager.EffectManager.EffectModels.Add(GameModel);
PlaceConfigFile(); PlaceConfigFile();
@@ -11,7 +11,8 @@ namespace Artemis.Modules.Games.RocketLeague
{ {
private string _versionText; private string _versionText;
public RocketLeagueViewModel(MainManager mainManager) : base(mainManager, new RocketLeagueModel(mainManager, new RocketLeagueSettings())) public RocketLeagueViewModel(MainManager mainManager)
: base(mainManager, new RocketLeagueModel(mainManager, new RocketLeagueSettings()))
{ {
MainManager.EffectManager.EffectModels.Add(GameModel); MainManager.EffectManager.EffectModels.Add(GameModel);
SetVersionText(); SetVersionText();
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Modules.Games.TheDivision" GeneratedClassName="TheDivision">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
GeneratedClassNamespace="Artemis.Modules.Games.TheDivision" GeneratedClassName="TheDivision">
<Profiles /> <Profiles />
<Settings> <Settings>
<Setting Name="Enabled" Type="System.Boolean" Scope="User"> <Setting Name="Enabled" Type="System.Boolean" Scope="User">
@@ -1,5 +1,4 @@
using System; using Artemis.Models.Interfaces;
using Artemis.Models.Interfaces;
namespace Artemis.Modules.Games.TheDivision namespace Artemis.Modules.Games.TheDivision
{ {
@@ -1,22 +1,9 @@
using System; using System.Windows.Controls;
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.Modules.Games.TheDivision namespace Artemis.Modules.Games.TheDivision
{ {
/// <summary> /// <summary>
/// Interaction logic for TheDivisionView.xaml /// Interaction logic for TheDivisionView.xaml
/// </summary> /// </summary>
public partial class TheDivisionView : UserControl public partial class TheDivisionView : UserControl
{ {
@@ -1,12 +1,12 @@
using Artemis.Managers; using Artemis.Managers;
using Artemis.ViewModels;
using Artemis.ViewModels.Abstract; using Artemis.ViewModels.Abstract;
namespace Artemis.Modules.Games.TheDivision namespace Artemis.Modules.Games.TheDivision
{ {
public class TheDivisionViewModel : GameViewModel<TheDivisionDataModel> public class TheDivisionViewModel : GameViewModel<TheDivisionDataModel>
{ {
public TheDivisionViewModel(MainManager mainManager) : base(mainManager, new TheDivisionModel(mainManager, new TheDivisionSettings())) public TheDivisionViewModel(MainManager mainManager)
: base(mainManager, new TheDivisionModel(mainManager, new TheDivisionSettings()))
{ {
MainManager.EffectManager.EffectModels.Add(GameModel); MainManager.EffectManager.EffectModels.Add(GameModel);
} }
@@ -12,7 +12,8 @@ namespace Artemis.Modules.Games.Witcher3
{ {
public class Witcher3ViewModel : GameViewModel<Witcher3DataModel> public class Witcher3ViewModel : GameViewModel<Witcher3DataModel>
{ {
public Witcher3ViewModel(MainManager mainManager) : base(mainManager, new Witcher3Model(mainManager, new Witcher3Settings())) public Witcher3ViewModel(MainManager mainManager)
: base(mainManager, new Witcher3Model(mainManager, new Witcher3Settings()))
{ {
MainManager = mainManager; MainManager = mainManager;
+3 -1
View File
@@ -1,5 +1,7 @@
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Settings" GeneratedClassName="General">
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
GeneratedClassNamespace="Artemis.Settings" GeneratedClassName="General">
<Profiles /> <Profiles />
<Settings> <Settings>
<Setting Name="LastEffect" Type="System.String" Scope="User"> <Setting Name="LastEffect" Type="System.String" Scope="User">
@@ -35,19 +35,29 @@
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" options:Freeze="True" /> <SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" options:Freeze="True" />
<Color x:Key="IdealForegroundColor">White</Color> <Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}" options:Freeze="True" /> <SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"
<SolidColorBrush x:Key="IdealForegroundDisabledBrush" Color="{StaticResource IdealForegroundColor}" Opacity="0.4" options:Freeze="True" /> options:Freeze="True" />
<SolidColorBrush x:Key="AccentSelectedColorBrush" Color="{StaticResource IdealForegroundColor}" options:Freeze="True" /> <SolidColorBrush x:Key="IdealForegroundDisabledBrush" Color="{StaticResource IdealForegroundColor}" Opacity="0.4"
options:Freeze="True" />
<SolidColorBrush x:Key="AccentSelectedColorBrush" Color="{StaticResource IdealForegroundColor}"
options:Freeze="True" />
<!-- DataGrid brushes --> <!-- DataGrid brushes -->
<SolidColorBrush x:Key="MetroDataGrid.HighlightBrush" Color="{StaticResource AccentColor}" options:Freeze="True" /> <SolidColorBrush x:Key="MetroDataGrid.HighlightBrush" Color="{StaticResource AccentColor}" options:Freeze="True" />
<SolidColorBrush x:Key="MetroDataGrid.HighlightTextBrush" Color="{StaticResource IdealForegroundColor}" options:Freeze="True" /> <SolidColorBrush x:Key="MetroDataGrid.HighlightTextBrush" Color="{StaticResource IdealForegroundColor}"
<SolidColorBrush x:Key="MetroDataGrid.MouseOverHighlightBrush" Color="{StaticResource AccentColor3}" options:Freeze="True" /> options:Freeze="True" />
<SolidColorBrush x:Key="MetroDataGrid.MouseOverHighlightBrush" Color="{StaticResource AccentColor3}"
options:Freeze="True" />
<SolidColorBrush x:Key="MetroDataGrid.FocusBorderBrush" Color="{StaticResource AccentColor}" options:Freeze="True" /> <SolidColorBrush x:Key="MetroDataGrid.FocusBorderBrush" Color="{StaticResource AccentColor}" options:Freeze="True" />
<SolidColorBrush x:Key="MetroDataGrid.InactiveSelectionHighlightBrush" Color="{StaticResource AccentColor2}" options:Freeze="True" /> <SolidColorBrush x:Key="MetroDataGrid.InactiveSelectionHighlightBrush" Color="{StaticResource AccentColor2}"
<SolidColorBrush x:Key="MetroDataGrid.InactiveSelectionHighlightTextBrush" Color="{StaticResource IdealForegroundColor}" options:Freeze="True" /> options:Freeze="True" />
<SolidColorBrush x:Key="MetroDataGrid.InactiveSelectionHighlightTextBrush"
Color="{StaticResource IdealForegroundColor}" options:Freeze="True" />
<SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.OnSwitchBrush.Win10" Color="{StaticResource AccentColor}" options:Freeze="True" /> <SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.OnSwitchBrush.Win10"
<SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.OnSwitchMouseOverBrush.Win10" Color="{StaticResource AccentColor2}" options:Freeze="True" /> Color="{StaticResource AccentColor}" options:Freeze="True" />
<SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.ThumbIndicatorCheckedBrush.Win10" Color="{StaticResource IdealForegroundColor}" options:Freeze="True" /> <SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.OnSwitchMouseOverBrush.Win10"
Color="{StaticResource AccentColor2}" options:Freeze="True" />
<SolidColorBrush x:Key="MahApps.Metro.Brushes.ToggleSwitchButton.ThumbIndicatorCheckedBrush.Win10"
Color="{StaticResource IdealForegroundColor}" options:Freeze="True" />
</ResourceDictionary> </ResourceDictionary>
+12 -7
View File
@@ -33,7 +33,7 @@
<Setter Property="IsMoveToPointEnabled" Value="True" /> <Setter Property="IsMoveToPointEnabled" Value="True" />
<Setter Property="Minimum" Value="0" /> <Setter Property="Minimum" Value="0" />
<Setter Property="Maximum" Value="1" /> <Setter Property="Maximum" Value="1" />
<Setter Property="Margin" Value="2,8,2,0"/> <Setter Property="Margin" Value="2,8,2,0" />
</Style> </Style>
<BooleanToVisibilityConverter x:Key="BoolToVis" /> <BooleanToVisibilityConverter x:Key="BoolToVis" />
@@ -156,7 +156,8 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type nc:ColorBox}"> <ControlTemplate TargetType="{x:Type nc:ColorBox}">
<Border x:Name="PART_Root" Background="{TemplateBinding Background}" BorderBrush="{StaticResource ControlBorderBrush}"> <Border x:Name="PART_Root" Background="{TemplateBinding Background}"
BorderBrush="{StaticResource ControlBorderBrush}">
<Border.InputBindings> <Border.InputBindings>
<KeyBinding Key="Delete" Command="{x:Static nc:ColorBox.RemoveGradientStop}" /> <KeyBinding Key="Delete" Command="{x:Static nc:ColorBox.RemoveGradientStop}" />
</Border.InputBindings> </Border.InputBindings>
@@ -220,7 +221,8 @@
Padding="0,3"> Padding="0,3">
<Path x:Name="Icon" Height="12" Width="20" <Path x:Name="Icon" Height="12" Width="20"
Stretch="Fill" Fill="#FF403C3C" Stretch="Fill" Fill="#FF403C3C"
StrokeThickness="1" Stroke="{StaticResource ControlBorderBrush}" StrokeThickness="1"
Stroke="{StaticResource ControlBorderBrush}"
Data="M371,190L557,190 557,293 371,293 371,190z" /> Data="M371,190L557,190 557,293 371,293 371,190z" />
</Border> </Border>
@@ -488,7 +490,8 @@
SelectedGradient="{Binding}" SelectedGradient="{Binding}"
Margin="0,0,0,2"> Margin="0,0,0,2">
<nc:GradientStopSlider.Background> <nc:GradientStopSlider.Background>
<SolidColorBrush Color="{Binding Color}"/> <SolidColorBrush
Color="{Binding Color}" />
</nc:GradientStopSlider.Background> </nc:GradientStopSlider.Background>
</nc:GradientStopSlider> </nc:GradientStopSlider>
@@ -549,11 +552,13 @@
<Button Grid.Column="1" ToolTip="Reverse gradient stops" <Button Grid.Column="1" ToolTip="Reverse gradient stops"
Command="{x:Static nc:ColorBox.ReverseGradientStop}" Command="{x:Static nc:ColorBox.ReverseGradientStop}"
x:Name="Delete" Width="50" Height="50" x:Name="Delete" Width="50" Height="50"
Style="{DynamicResource MetroCircleButtonStyle}" VerticalAlignment="Top" Style="{DynamicResource MetroCircleButtonStyle}"
VerticalAlignment="Top"
HorizontalAlignment="Right" Margin="0,-4,0,0"> HorizontalAlignment="Right" Margin="0,-4,0,0">
<Button.Content> <Button.Content>
<Rectangle Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" <Rectangle
Width="20" Height="20"> Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
Width="20" Height="20">
<Rectangle.OpacityMask> <Rectangle.OpacityMask>
<VisualBrush <VisualBrush
Visual="{StaticResource appbar_arrow_left_right}" Visual="{StaticResource appbar_arrow_left_right}"
+3 -5
View File
@@ -4,8 +4,6 @@ using System.ComponentModel;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Reflection; using System.Reflection;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Security.Principal; using System.Security.Principal;
using System.Windows; using System.Windows;
using System.Xml.Serialization; using System.Xml.Serialization;
@@ -57,7 +55,7 @@ namespace Artemis.Utilities
} }
/// <summary> /// <summary>
/// Perform a deep Copy of the object. /// Perform a deep Copy of the object.
/// </summary> /// </summary>
/// <typeparam name="T">The type of object being copied.</typeparam> /// <typeparam name="T">The type of object being copied.</typeparam>
/// <param name="source">The object instance to copy.</param> /// <param name="source">The object instance to copy.</param>
@@ -68,13 +66,13 @@ namespace Artemis.Utilities
if (ReferenceEquals(source, null)) if (ReferenceEquals(source, null))
return default(T); return default(T);
var serializer = new XmlSerializer(typeof(T)); var serializer = new XmlSerializer(typeof (T));
Stream stream = new MemoryStream(); Stream stream = new MemoryStream();
using (stream) using (stream)
{ {
serializer.Serialize(stream, source); serializer.Serialize(stream, source);
stream.Seek(0, SeekOrigin.Begin); stream.Seek(0, SeekOrigin.Begin);
return (T)serializer.Deserialize(stream); return (T) serializer.Deserialize(stream);
} }
} }
@@ -1,6 +1,5 @@
using System; using System;
using System.IO; using System.IO;
using System.IO.Pipes;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
@@ -184,6 +183,4 @@ namespace Artemis.Utilities.LogitechDll
public string Data { get; set; } public string Data { get; set; }
} }
} }
@@ -16,8 +16,8 @@ namespace Artemis.Utilities.ParentChild
where P : class where P : class
where T : IChildItem<P> where T : IChildItem<P>
{ {
private IList<T> _collection;
private readonly P _parent; private readonly P _parent;
private IList<T> _collection;
public ChildItemCollection(P parent) public ChildItemCollection(P parent)
{ {
@@ -49,6 +49,11 @@ namespace Artemis.Utilities.ParentChild
#endregion #endregion
public void Sort(Func<T, object> func)
{
_collection = _collection.OrderBy(func).ToList();
}
#region IList<T> Members #region IList<T> Members
public int IndexOf(T item) public int IndexOf(T item)
@@ -129,10 +134,5 @@ namespace Artemis.Utilities.ParentChild
} }
#endregion #endregion
public void Sort(Func<T, object> func)
{
_collection = _collection.OrderBy(func).ToList();
}
} }
} }
@@ -4,7 +4,6 @@ using System.Threading.Tasks;
using Artemis.Managers; using Artemis.Managers;
using Artemis.Models; using Artemis.Models;
using Artemis.Modules.Effects.ProfilePreview; using Artemis.Modules.Effects.ProfilePreview;
using Artemis.Modules.Games.Witcher3;
using Caliburn.Micro; using Caliburn.Micro;
namespace Artemis.ViewModels.Abstract namespace Artemis.ViewModels.Abstract
@@ -122,8 +121,8 @@ namespace Artemis.ViewModels.Abstract
if (gameModel != null) if (gameModel != null)
if (!gameModel.Enabled) if (!gameModel.Enabled)
MainManager.EffectManager.GetLastEffect(); MainManager.EffectManager.GetLastEffect();
else else
MainManager.EffectManager.ChangeEffect(_lastEffect, true); MainManager.EffectManager.ChangeEffect(_lastEffect, true);
} }
else else
MainManager.EffectManager.ClearEffect(); MainManager.EffectManager.ClearEffect();
@@ -1,5 +1,4 @@
using Artemis.Managers; using Artemis.Managers;
using Artemis.Modules.Effects.AmbientLightning;
using Artemis.Modules.Effects.AudioVisualizer; using Artemis.Modules.Effects.AudioVisualizer;
using Artemis.Modules.Effects.Debug; using Artemis.Modules.Effects.Debug;
using Artemis.Modules.Effects.TypeHole; using Artemis.Modules.Effects.TypeHole;
+1 -1
View File
@@ -11,10 +11,10 @@ namespace Artemis.ViewModels
public class GamesViewModel : Conductor<IScreen>.Collection.OneActive public class GamesViewModel : Conductor<IScreen>.Collection.OneActive
{ {
private readonly CounterStrikeViewModel _counterStrikeVm; private readonly CounterStrikeViewModel _counterStrikeVm;
private readonly TheDivisionViewModel _divisionVm;
private readonly Dota2ViewModel _dota2Vm; private readonly Dota2ViewModel _dota2Vm;
private readonly RocketLeagueViewModel _rocketLeagueVm; private readonly RocketLeagueViewModel _rocketLeagueVm;
private readonly Witcher3ViewModel _witcher3Vm; private readonly Witcher3ViewModel _witcher3Vm;
private readonly TheDivisionViewModel _divisionVm;
public GamesViewModel(MainManager mainManager) public GamesViewModel(MainManager mainManager)
{ {
@@ -1,7 +1,6 @@
using System; using System;
using System.Windows; using System.Windows;
using Artemis.Events; using Artemis.Events;
using Artemis.Properties;
using Artemis.Settings; using Artemis.Settings;
using Artemis.Utilities; using Artemis.Utilities;
using Caliburn.Micro; using Caliburn.Micro;
@@ -57,7 +57,9 @@
<Button Grid.Column="1" x:Name="Delete" Width="26" Height="26" Style="{DynamicResource SquareButtonStyle}" <Button Grid.Column="1" x:Name="Delete" Width="26" Height="26" Style="{DynamicResource SquareButtonStyle}"
VerticalAlignment="Top" HorizontalAlignment="Right"> VerticalAlignment="Top" HorizontalAlignment="Right">
<Button.Content> <Button.Content>
<Rectangle Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}" Width="12" Height="12"> <Rectangle
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Button}}}"
Width="12" Height="12">
<Rectangle.OpacityMask> <Rectangle.OpacityMask>
<VisualBrush Visual="{StaticResource appbar_delete}" Stretch="Fill" /> <VisualBrush Visual="{StaticResource appbar_delete}" Stretch="Fill" />
</Rectangle.OpacityMask> </Rectangle.OpacityMask>
@@ -1,22 +1,9 @@
using System; using System.Windows.Controls;
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 namespace Artemis.Views.LayerEditor
{ {
/// <summary> /// <summary>
/// Interaction logic for LayerConditionView.xaml /// Interaction logic for LayerConditionView.xaml
/// </summary> /// </summary>
public partial class LayerConditionView : UserControl public partial class LayerConditionView : UserControl
{ {
@@ -81,7 +81,8 @@
<!-- PercentageOf --> <!-- PercentageOf -->
<StackPanel Grid.Column="3" x:Name="UserSourceIsVisible" VerticalAlignment="Center"> <StackPanel Grid.Column="3" x:Name="UserSourceIsVisible" VerticalAlignment="Center">
<controls:NumericUpDown Margin="10,0" Height="22" Value="{Binding Path=LayerDynamicPropertiesModelProposed.PercentageSource, Mode=TwoWay}" /> <controls:NumericUpDown Margin="10,0" Height="22"
Value="{Binding Path=LayerDynamicPropertiesModelProposed.PercentageSource, Mode=TwoWay}" />
</StackPanel> </StackPanel>
</Grid> </Grid>
</UserControl> </UserControl>
@@ -1,22 +1,9 @@
using System; using System.Windows.Controls;
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 namespace Artemis.Views.LayerEditor
{ {
/// <summary> /// <summary>
/// Interaction logic for LayerDynamicPropertiesView.xaml /// Interaction logic for LayerDynamicPropertiesView.xaml
/// </summary> /// </summary>
public partial class LayerDynamicPropertiesView : UserControl public partial class LayerDynamicPropertiesView : UserControl
{ {
@@ -10,7 +10,8 @@
Title="Artemis | Edit Layer" Height="750" Width="630" Title="Artemis | Edit Layer" Height="750" Width="630"
xmlns:profileEnumerations="clr-namespace:Artemis.Models.Profiles" xmlns:profileEnumerations="clr-namespace:Artemis.Models.Profiles"
xmlns:ncore="http://schemas.ncore.com/wpf/xaml/colorbox" xmlns:ncore="http://schemas.ncore.com/wpf/xaml/colorbox"
GlowBrush="{DynamicResource AccentColorBrush}" Icon="../../Resources/bow.png" ResizeMode="NoResize"> GlowBrush="{DynamicResource AccentColorBrush}" Icon="../../Resources/bow.png"
ResizeMode="NoResize">
<controls:MetroWindow.Resources> <controls:MetroWindow.Resources>
<utilities:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" /> <utilities:EnumDescriptionConverter x:Key="HEnumDescriptionConverter" />
<ObjectDataProvider MethodName="GetValues" <ObjectDataProvider MethodName="GetValues"
@@ -3,7 +3,7 @@
namespace Artemis.Views.LayerEditor namespace Artemis.Views.LayerEditor
{ {
/// <summary> /// <summary>
/// Interaction logic for LayerEditorView.xaml /// Interaction logic for LayerEditorView.xaml
/// </summary> /// </summary>
public partial class LayerEditorView : MetroWindow public partial class LayerEditorView : MetroWindow
{ {
+8 -5
View File
@@ -63,7 +63,8 @@
<Label Grid.Column="1" Grid.Row="0" FontSize="20" HorizontalAlignment="Left" Content="Layers" Margin="10,0,0,0" /> <Label Grid.Column="1" Grid.Row="0" FontSize="20" HorizontalAlignment="Left" Content="Layers" Margin="10,0,0,0" />
<Border Grid.Column="1" Grid.Row="1" Background="#FF232323" BorderBrush="{DynamicResource HighlightBrush}" <Border Grid.Column="1" Grid.Row="1" Background="#FF232323" BorderBrush="{DynamicResource HighlightBrush}"
BorderThickness="3" Margin="10,0,0,0" Height="400" Width="233"> BorderThickness="3" Margin="10,0,0,0" Height="400" Width="233">
<TreeView x:Name="ProfileTree" ItemsSource="{Binding Path=Layers, Converter={StaticResource LayerOrderConverter}, ConverterParameter=Order}"> <TreeView x:Name="ProfileTree"
ItemsSource="{Binding Path=Layers, Converter={StaticResource LayerOrderConverter}, ConverterParameter=Order}">
<i:Interaction.Behaviors> <i:Interaction.Behaviors>
<itemBehaviours:BindableSelectedItemBehavior SelectedItem="{Binding SelectedLayer, Mode=TwoWay}" /> <itemBehaviours:BindableSelectedItemBehavior SelectedItem="{Binding SelectedLayer, Mode=TwoWay}" />
</i:Interaction.Behaviors> </i:Interaction.Behaviors>
@@ -72,14 +73,15 @@
Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" /> Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
</TreeView.Resources> </TreeView.Resources>
<TreeView.ItemTemplate> <TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children, Converter={StaticResource LayerOrderConverter}, ConverterParameter=Order}"> <HierarchicalDataTemplate
ItemsSource="{Binding Children, Converter={StaticResource LayerOrderConverter}, ConverterParameter=Order}">
<StackPanel Orientation="Horizontal" Tag="{Binding DataContext, ElementName=ProfileTree}"> <StackPanel Orientation="Horizontal" Tag="{Binding DataContext, ElementName=ProfileTree}">
<StackPanel.ContextMenu> <StackPanel.ContextMenu>
<ContextMenu <ContextMenu
cal:Action.TargetWithoutContext="{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Self}}"> cal:Action.TargetWithoutContext="{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Self}}">
<MenuItem Header="Rename" /> <MenuItem Header="Rename" />
<MenuItem Header="Duplicate" cal:Message.Attach="CloneLayer($datacontext)"/> <MenuItem Header="Duplicate" cal:Message.Attach="CloneLayer($datacontext)" />
<MenuItem Header="Delete" cal:Message.Attach="RemoveLayerFromMenu($datacontext)"/> <MenuItem Header="Delete" cal:Message.Attach="RemoveLayerFromMenu($datacontext)" />
<MenuItem Header="Properties" cal:Message.Attach="LayerEditor($datacontext)" /> <MenuItem Header="Properties" cal:Message.Attach="LayerEditor($datacontext)" />
</ContextMenu> </ContextMenu>
</StackPanel.ContextMenu> </StackPanel.ContextMenu>
@@ -106,7 +108,8 @@
</Grid> </Grid>
<!-- Layer movement --> <!-- Layer movement -->
<StackPanel Grid.Column="2" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10,0,0,0"> <StackPanel Grid.Column="2" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"
Margin="10,0,0,0">
<Button x:Name="LayerUp" Width="40" Height="40" Style="{DynamicResource MetroCircleButtonStyle}"> <Button x:Name="LayerUp" Width="40" Height="40" Style="{DynamicResource MetroCircleButtonStyle}">
<Button.Content> <Button.Content>
<Rectangle <Rectangle
@@ -1,22 +1,9 @@
using System; using System.Windows.Controls;
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 namespace Artemis.Views
{ {
/// <summary> /// <summary>
/// Interaction logic for ProfileEditorView.xaml /// Interaction logic for ProfileEditorView.xaml
/// </summary> /// </summary>
public partial class ProfileEditorView : UserControl public partial class ProfileEditorView : UserControl
{ {
+2 -1
View File
@@ -64,7 +64,8 @@
<ResourceDictionary <ResourceDictionary
Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" /> Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.AnimatedSingleRowTabControl.xaml" />
</Grid.Resources> </Grid.Resources>
<TabControl Margin="0,10,10,10" TabStripPlacement="Left" x:Name="Items" cal:Message.Attach="[Event GotFocus] = [Action CloseSettings]"> <TabControl Margin="0,10,10,10" TabStripPlacement="Left" x:Name="Items"
cal:Message.Attach="[Event GotFocus] = [Action CloseSettings]">
<TabControl.ItemTemplate> <TabControl.ItemTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding DisplayName}" /> <TextBlock Text="{Binding DisplayName}" />
+1
View File
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<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" />