mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Spotify fixes and project cleanup
This commit is contained in:
parent
390e93b6b6
commit
a9aa9f4df6
@ -2,22 +2,56 @@
|
||||
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<section name="Artemis.Modules.Games.Overwatch.Overwatch" 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" 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" 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" 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" 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 name="userSettings"
|
||||
type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<section name="Artemis.Modules.Effects.WindowsProfile.WindowsProfile"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.Overwatch.Overwatch"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
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"
|
||||
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>
|
||||
</configSections>
|
||||
<connectionStrings />
|
||||
@ -25,6 +59,11 @@
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
|
||||
</startup>
|
||||
<userSettings>
|
||||
<Artemis.Modules.Effects.WindowsProfile.WindowsProfile>
|
||||
<setting name="LastProfile" serializeAs="String">
|
||||
<value>Demo (Duplicate to keep changes)</value>
|
||||
</setting>
|
||||
</Artemis.Modules.Effects.WindowsProfile.WindowsProfile>
|
||||
<Artemis.Modules.Games.Overwatch.Overwatch>
|
||||
<setting name="Enabled" serializeAs="String">
|
||||
<value>True</value>
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
using System.Security.Principal;
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
using Artemis.Utilities;
|
||||
using NLog;
|
||||
using WpfExceptionViewer;
|
||||
|
||||
@ -21,6 +20,8 @@ namespace Artemis
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public bool DoHandle { get; set; }
|
||||
|
||||
private static bool IsRunAsAdministrator()
|
||||
{
|
||||
var wi = WindowsIdentity.GetCurrent();
|
||||
@ -29,8 +30,6 @@ namespace Artemis
|
||||
return wp.IsInRole(WindowsBuiltInRole.Administrator);
|
||||
}
|
||||
|
||||
public bool DoHandle { get; set; }
|
||||
|
||||
private void Application_Startup(object sender, StartupEventArgs e)
|
||||
{
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
|
||||
@ -219,6 +219,8 @@
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.IO.Compression" />
|
||||
<Reference Include="System.IO.Compression.FileSystem" />
|
||||
<Reference Include="System.Linq.Dynamic, Version=1.0.5840.25917, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.Linq.Dynamic.1.0.6\lib\net40\System.Linq.Dynamic.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
@ -339,6 +341,12 @@
|
||||
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualizerModel.cs" />
|
||||
<Compile Include="Modules\Effects\AudioVisualizer\Utilities\FftEventArgs.cs" />
|
||||
<Compile Include="Modules\Effects\AudioVisualizer\Utilities\SampleAggregator.cs" />
|
||||
<Compile Include="Modules\Effects\WindowsProfile\WindowsProfile.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
<DependentUpon>WindowsProfile.settings</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Modules\Effects\WindowsProfile\WindowsProfileSettings.cs" />
|
||||
<Compile Include="Modules\Effects\WindowsProfile\WindowsProfileView.xaml.cs">
|
||||
<DependentUpon>WindowsProfileView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@ -583,6 +591,10 @@
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>TypeWave.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Modules\Effects\WindowsProfile\WindowsProfile.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>WindowsProfile.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Modules\Games\CounterStrike\CounterStrike.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>CounterStrike.Designer.cs</LastGenOutput>
|
||||
@ -644,6 +656,7 @@
|
||||
<Resource Include="Resources\Entypo-license.txt" />
|
||||
<None Include="Resources\RzChromaSDK64.dll" />
|
||||
<Resource Include="Resources\Keyboards\blackwidow.png" />
|
||||
<None Include="Resources\Keyboards\none.png" />
|
||||
<Content Include="Resources\Witcher3\playerWitcher.txt" />
|
||||
<Content Include="Resources\Witcher3\artemis.txt" />
|
||||
<None Include="Settings\Offsets.settings">
|
||||
|
||||
@ -1,22 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Xml.Serialization;
|
||||
using Artemis.DeviceProviders;
|
||||
using Artemis.Models;
|
||||
using Artemis.Models.Profiles;
|
||||
using Artemis.Utilities;
|
||||
using NLog;
|
||||
|
||||
namespace Artemis.DAL
|
||||
{
|
||||
public static class ProfileProvider
|
||||
{
|
||||
private static readonly Logger _logger = LogManager.GetCurrentClassLogger();
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private static readonly string ProfileFolder =
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis\profiles";
|
||||
private static readonly string ProfileFolder = Environment
|
||||
.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis\profiles";
|
||||
|
||||
private static bool _installedDefaults;
|
||||
|
||||
/// <summary>
|
||||
/// Get all profiles
|
||||
@ -93,7 +97,7 @@ namespace Artemis.DAL
|
||||
}
|
||||
catch (InvalidOperationException e)
|
||||
{
|
||||
_logger.Error("Failed to load profile: {0} - {1}", path, e.InnerException.Message);
|
||||
Logger.Error("Failed to load profile: {0} - {1}", path, e.InnerException.Message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,13 +109,20 @@ namespace Artemis.DAL
|
||||
/// </summary>
|
||||
private static void InstallDefaults()
|
||||
{
|
||||
var test = Assembly.GetExecutingAssembly().GetManifestResourceNames();
|
||||
//var stream =
|
||||
// Assembly.GetExecutingAssembly()
|
||||
// .GetManifestResourceStream("Artemis.Properties.Resources.logo.jpg");
|
||||
// Only install the defaults once per session
|
||||
if (_installedDefaults)
|
||||
return;
|
||||
_installedDefaults = true;
|
||||
|
||||
//Resources.
|
||||
//ZipPackage.Open(Re.defaultProfiles)
|
||||
// Load the ZIP from resources
|
||||
var stream = Assembly.GetExecutingAssembly()
|
||||
.GetManifestResourceStream("Artemis.Resources.Keyboards.default-profiles.zip");
|
||||
|
||||
// Extract it over the old defaults in case one was updated
|
||||
if (stream == null)
|
||||
return;
|
||||
var archive = new ZipArchive(stream);
|
||||
archive.ExtractToDirectory(ProfileFolder, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
using Microsoft.Win32;
|
||||
using Artemis.DeviceProviders.Logitech.Utilities;
|
||||
using Artemis.Properties;
|
||||
using Artemis.Utilities;
|
||||
using Artemis.Utilities.LogitechDll;
|
||||
using Microsoft.Win32;
|
||||
|
||||
namespace Artemis.DeviceProviders.Logitech
|
||||
{
|
||||
@ -28,7 +28,9 @@ namespace Artemis.DeviceProviders.Logitech
|
||||
{
|
||||
//Check to see if VC++ 2012 x64 is installed.
|
||||
|
||||
if (Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Classes\Installer\Dependencies\{ca67548a-5ebe-413a-b50c-4b9ceb6d66c6}") == null)
|
||||
if (
|
||||
Registry.LocalMachine.OpenSubKey(
|
||||
@"SOFTWARE\Classes\Installer\Dependencies\{ca67548a-5ebe-413a-b50c-4b9ceb6d66c6}") == null)
|
||||
{
|
||||
CantEnableText = "Couldn't connect to your Logitech G910.\n" +
|
||||
"The Visual C 2012 Redistributable could not be found, which is required.\n" +
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Models.Profiles;
|
||||
using Artemis.Services;
|
||||
using Artemis.ViewModels.Profiles;
|
||||
|
||||
namespace Artemis.InjectionFactories
|
||||
|
||||
@ -15,8 +15,8 @@ namespace Artemis.Managers
|
||||
/// </summary>
|
||||
public class EffectManager
|
||||
{
|
||||
private readonly IEventAggregator _events;
|
||||
private readonly DeviceManager _deviceManager;
|
||||
private readonly IEventAggregator _events;
|
||||
private readonly ILogger _logger;
|
||||
private EffectModel _activeEffect;
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
@ -19,7 +18,6 @@ namespace Artemis.Managers
|
||||
private readonly IEventAggregator _events;
|
||||
private readonly ILogger _logger;
|
||||
private readonly Timer _loopTimer;
|
||||
private int _fpsCount;
|
||||
|
||||
public LoopManager(ILogger logger, IEventAggregator events, EffectManager effectManager,
|
||||
DeviceManager deviceManager)
|
||||
@ -33,14 +31,6 @@ namespace Artemis.Managers
|
||||
_loopTimer = new Timer(40);
|
||||
_loopTimer.Elapsed += Render;
|
||||
_loopTimer.Start();
|
||||
|
||||
var fpsTimer = new Timer(1000);
|
||||
fpsTimer.Elapsed += delegate
|
||||
{
|
||||
Debug.WriteLine(_fpsCount);
|
||||
_fpsCount = 0;
|
||||
};
|
||||
fpsTimer.Start();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -155,10 +145,7 @@ namespace Artemis.Managers
|
||||
|
||||
// If no bitmap was generated this frame is done
|
||||
if (bitmap == null)
|
||||
{
|
||||
_fpsCount++;
|
||||
return;
|
||||
}
|
||||
|
||||
// Fill the bitmap's background with black to avoid trailing colors on some keyboards
|
||||
var fixedBmp = new Bitmap(bitmap.Width, bitmap.Height);
|
||||
@ -172,8 +159,6 @@ namespace Artemis.Managers
|
||||
|
||||
// Update the keyboard
|
||||
_deviceManager.ActiveKeyboard?.DrawBitmap(bitmap);
|
||||
|
||||
_fpsCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ namespace Artemis.Models
|
||||
mouse = null;
|
||||
headset = null;
|
||||
|
||||
if (Profile == null || DataModel == null)
|
||||
if (Profile == null || DataModel == null || MainManager.DeviceManager.ActiveKeyboard == null)
|
||||
return;
|
||||
|
||||
// Get all enabled layers who's conditions are met
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Models.Profiles;
|
||||
|
||||
namespace Artemis.Models
|
||||
{
|
||||
public abstract class GameModel : EffectModel
|
||||
{
|
||||
protected GameModel(MainManager mainManager, GameSettings settings, IDataModel dataModel) : base(mainManager, dataModel)
|
||||
protected GameModel(MainManager mainManager, GameSettings settings, IDataModel dataModel)
|
||||
: base(mainManager, dataModel)
|
||||
{
|
||||
Settings = settings;
|
||||
}
|
||||
|
||||
@ -214,22 +214,6 @@ namespace Artemis.Models.Profiles
|
||||
}
|
||||
}
|
||||
|
||||
#region IChildItem<Parent> Members
|
||||
|
||||
LayerModel IChildItem<LayerModel>.Parent
|
||||
{
|
||||
get { return Parent; }
|
||||
set { Parent = value; }
|
||||
}
|
||||
|
||||
ProfileModel IChildItem<ProfileModel>.Parent
|
||||
{
|
||||
get { return Profile; }
|
||||
set { Profile = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 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
|
||||
@ -240,7 +224,8 @@ namespace Artemis.Models.Profiles
|
||||
/// <param name="includeHeadsets">Whether or not to include headsets in the list</param>
|
||||
/// <param name="ignoreConditions"></param>
|
||||
/// <returns>A flat list containing all layers that must be rendered</returns>
|
||||
public List<LayerModel> GetRenderLayers<T>(IDataModel dataModel, bool includeMice, bool includeHeadsets, bool ignoreConditions = false)
|
||||
public List<LayerModel> GetRenderLayers<T>(IDataModel dataModel, bool includeMice, bool includeHeadsets,
|
||||
bool ignoreConditions = false)
|
||||
{
|
||||
var layers = new List<LayerModel>();
|
||||
foreach (var layerModel in Children.OrderByDescending(c => c.Order))
|
||||
@ -262,6 +247,22 @@ namespace Artemis.Models.Profiles
|
||||
|
||||
return layers;
|
||||
}
|
||||
|
||||
#region IChildItem<Parent> Members
|
||||
|
||||
LayerModel IChildItem<LayerModel>.Parent
|
||||
{
|
||||
get { return Parent; }
|
||||
set { Parent = value; }
|
||||
}
|
||||
|
||||
ProfileModel IChildItem<ProfileModel>.Parent
|
||||
{
|
||||
get { return Profile; }
|
||||
set { Profile = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
public enum LayerType
|
||||
|
||||
@ -126,7 +126,8 @@ namespace Artemis.Models.Profiles
|
||||
/// <param name="includeHeadsets">Whether or not to include headsets in the list</param>
|
||||
/// <param name="ignoreConditions"></param>
|
||||
/// <returns>A flat list containing all layers that must be rendered</returns>
|
||||
public List<LayerModel> GetRenderLayers<T>(IDataModel dataModel, bool includeMice, bool includeHeadsets, bool ignoreConditions = false)
|
||||
public List<LayerModel> GetRenderLayers<T>(IDataModel dataModel, bool includeMice, bool includeHeadsets,
|
||||
bool ignoreConditions = false)
|
||||
{
|
||||
var layers = new List<LayerModel>();
|
||||
foreach (var layerModel in Layers.OrderByDescending(l => l.Order))
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Utilities;
|
||||
|
||||
namespace Artemis.Models.Profiles.Properties
|
||||
{
|
||||
|
||||
@ -2,10 +2,8 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Xml.Serialization;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Utilities;
|
||||
|
||||
namespace Artemis.Models.Profiles.Properties
|
||||
{
|
||||
|
||||
@ -2,7 +2,6 @@ using System.Collections.Generic;
|
||||
using System.Windows.Media;
|
||||
using System.Xml.Serialization;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Utilities;
|
||||
|
||||
namespace Artemis.Models.Profiles.Properties
|
||||
{
|
||||
|
||||
@ -190,7 +190,8 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice, bool renderHeadsets)
|
||||
public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice,
|
||||
bool renderHeadsets)
|
||||
{
|
||||
keyboard = null;
|
||||
mouse = null;
|
||||
|
||||
@ -35,7 +35,8 @@ namespace Artemis.Modules.Effects.ProfilePreview
|
||||
return Profile.GetRenderLayers<ProfilePreviewDataModel>(DataModel, renderMice, renderHeadsets, true);
|
||||
}
|
||||
|
||||
public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice, bool renderHeadsets)
|
||||
public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice,
|
||||
bool renderHeadsets)
|
||||
{
|
||||
keyboard = null;
|
||||
mouse = null;
|
||||
@ -48,11 +49,13 @@ namespace Artemis.Modules.Effects.ProfilePreview
|
||||
var renderLayers = GetRenderLayers(renderMice, renderHeadsets);
|
||||
|
||||
// Render the keyboard layer-by-layer
|
||||
keyboard = Profile?.GenerateBitmap(renderLayers, DataModel, MainManager.DeviceManager.ActiveKeyboard.KeyboardRectangle(4), true, true);
|
||||
keyboard = Profile?.GenerateBitmap(renderLayers, DataModel,
|
||||
MainManager.DeviceManager.ActiveKeyboard.KeyboardRectangle(4), true, true);
|
||||
// Render the first enabled mouse (will default to null if renderMice was false)
|
||||
mouse = Profile?.GenerateBrush(renderLayers.LastOrDefault(l => l.LayerType == LayerType.Mouse), DataModel);
|
||||
// Render the first enabled headset (will default to null if renderHeadsets was false)
|
||||
headset = Profile?.GenerateBrush(renderLayers.LastOrDefault(l => l.LayerType == LayerType.Headset), DataModel);
|
||||
headset = Profile?.GenerateBrush(renderLayers.LastOrDefault(l => l.LayerType == LayerType.Headset),
|
||||
DataModel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -98,7 +98,8 @@ namespace Artemis.Modules.Effects.TypeWave
|
||||
return null;
|
||||
}
|
||||
|
||||
public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice, bool renderHeadsets)
|
||||
public override void Render(out Bitmap keyboard, out Brush mouse, out Brush headset, bool renderMice,
|
||||
bool renderHeadsets)
|
||||
{
|
||||
keyboard = null;
|
||||
mouse = null;
|
||||
|
||||
38
Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfile.Designer.cs
generated
Normal file
38
Artemis/Artemis/Modules/Effects/WindowsProfile/WindowsProfile.Designer.cs
generated
Normal file
@ -0,0 +1,38 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Artemis.Modules.Effects.WindowsProfile {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
||||
internal sealed partial class WindowsProfile : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static WindowsProfile defaultInstance = ((WindowsProfile)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new WindowsProfile())));
|
||||
|
||||
public static WindowsProfile Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("Demo (Duplicate to keep changes)")]
|
||||
public string LastProfile {
|
||||
get {
|
||||
return ((string)(this["LastProfile"]));
|
||||
}
|
||||
set {
|
||||
this["LastProfile"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||
GeneratedClassNamespace="Artemis.Modules.Effects.WindowsProfile" GeneratedClassName="WindowsProfile">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="LastProfile" Type="System.String" Scope="User">
|
||||
<Value Profile="(Default)">Demo (Duplicate to keep changes)</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
@ -1,18 +1,17 @@
|
||||
using Artemis.Models.Interfaces;
|
||||
using SpotifyAPI.Local.Models;
|
||||
|
||||
namespace Artemis.Modules.Effects.WindowsProfile
|
||||
{
|
||||
public class WindowsProfileDataModel : IDataModel
|
||||
{
|
||||
public CpuDataModel Cpu { get; set; }
|
||||
public Spotify Spotify { get; set; }
|
||||
|
||||
public WindowsProfileDataModel()
|
||||
{
|
||||
Spotify = new Spotify();
|
||||
Cpu = new CpuDataModel();
|
||||
}
|
||||
|
||||
public CpuDataModel Cpu { get; set; }
|
||||
public Spotify Spotify { get; set; }
|
||||
}
|
||||
|
||||
public class CpuDataModel
|
||||
@ -26,6 +25,7 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
public int Core7Usage { get; set; }
|
||||
public int Core8Usage { get; set; }
|
||||
}
|
||||
|
||||
public class Spotify
|
||||
{
|
||||
public bool Running { get; set; }
|
||||
@ -37,5 +37,6 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
public bool Repeat { get; set; }
|
||||
public bool Shuffle { get; set; }
|
||||
public bool Playing { get; set; }
|
||||
public int SongLength { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,11 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Models;
|
||||
using Artemis.Models.Profiles;
|
||||
using SpotifyAPI.Local;
|
||||
using SpotifyAPI.Local.Models;
|
||||
|
||||
namespace Artemis.Modules.Effects.WindowsProfile
|
||||
{
|
||||
@ -13,14 +14,14 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
{
|
||||
private List<PerformanceCounter> _cores;
|
||||
private int _cpuFrames;
|
||||
private readonly SpotifyLocalAPI _spotify;
|
||||
private SpotifyLocalAPI _spotify;
|
||||
private bool _spotifySetupBusy;
|
||||
|
||||
public WindowsProfileModel(MainManager mainManager, WindowsProfileSettings settings)
|
||||
: base(mainManager, new WindowsProfileDataModel())
|
||||
{
|
||||
Name = "WindowsProfile";
|
||||
Settings = settings;
|
||||
_spotify = new SpotifyLocalAPI();
|
||||
}
|
||||
|
||||
public WindowsProfileSettings Settings { get; set; }
|
||||
@ -32,19 +33,8 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
// Setup CPU cores
|
||||
_cores = GetPerformanceCounters();
|
||||
var coreCount = _cores.Count;
|
||||
while (coreCount < 8)
|
||||
{
|
||||
_cores.Add(null);
|
||||
coreCount++;
|
||||
}
|
||||
|
||||
if (SpotifyLocalAPI.IsSpotifyRunning())
|
||||
{
|
||||
_spotify.Connect();
|
||||
}
|
||||
SetupCpu();
|
||||
SetupSpotify();
|
||||
|
||||
Initialized = true;
|
||||
}
|
||||
@ -56,6 +46,19 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
UpdateSpotify(dataModel);
|
||||
}
|
||||
|
||||
#region CPU
|
||||
|
||||
private void SetupCpu()
|
||||
{
|
||||
_cores = GetPerformanceCounters();
|
||||
var coreCount = _cores.Count;
|
||||
while (coreCount < 8)
|
||||
{
|
||||
_cores.Add(null);
|
||||
coreCount++;
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateCpu(WindowsProfileDataModel dataModel)
|
||||
{
|
||||
// CPU is only updated every 15 frames, the performance counter gives 0 if updated too often
|
||||
@ -86,7 +89,7 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
|
||||
public override List<LayerModel> GetRenderLayers(bool renderMice, bool renderHeadsets)
|
||||
{
|
||||
return Profile.GetRenderLayers<WindowsProfileDataModel>(DataModel, renderMice, renderHeadsets, true);
|
||||
return Profile.GetRenderLayers<WindowsProfileDataModel>(DataModel, renderMice, renderHeadsets, false);
|
||||
}
|
||||
|
||||
public static List<PerformanceCounter> GetPerformanceCounters()
|
||||
@ -101,29 +104,66 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
return performanceCounters;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Spotify
|
||||
|
||||
public void SetupSpotify()
|
||||
{
|
||||
if (_spotifySetupBusy)
|
||||
return;
|
||||
|
||||
_spotifySetupBusy = true;
|
||||
_spotify = new SpotifyLocalAPI {ListenForEvents = true};
|
||||
_spotify.OnPlayStateChange += UpdateSpotifyPlayState;
|
||||
_spotify.OnTrackChange += UpdateSpotifyTrack;
|
||||
_spotify.OnTrackTimeChange += UpdateSpotifyTrackTime;
|
||||
|
||||
// Connecting can sometimes use a little bit more conviction
|
||||
Task.Factory.StartNew(() =>
|
||||
{
|
||||
var tryCount = 0;
|
||||
while (tryCount <= 10)
|
||||
{
|
||||
tryCount++;
|
||||
var connected = _spotify.Connect();
|
||||
if (connected)
|
||||
break;
|
||||
Thread.Sleep(1000);
|
||||
}
|
||||
_spotifySetupBusy = false;
|
||||
});
|
||||
}
|
||||
|
||||
public void UpdateSpotify(WindowsProfileDataModel dataModel)
|
||||
{
|
||||
StatusResponse status = _spotify.GetStatus();
|
||||
if (status == null)
|
||||
if (!dataModel.Spotify.Running && SpotifyLocalAPI.IsSpotifyRunning())
|
||||
SetupSpotify();
|
||||
|
||||
dataModel.Spotify.Running = SpotifyLocalAPI.IsSpotifyRunning();
|
||||
}
|
||||
|
||||
private void UpdateSpotifyPlayState(object sender, PlayStateEventArgs e)
|
||||
{
|
||||
dataModel.Spotify.Running = false;
|
||||
return;
|
||||
((WindowsProfileDataModel) DataModel).Spotify.Playing = e.Playing;
|
||||
}
|
||||
|
||||
dataModel.Spotify.Running = true;
|
||||
dataModel.Spotify.SpotifyVolume = (int)(status.Volume * 100);
|
||||
dataModel.Spotify.Repeat = status.Repeat;
|
||||
dataModel.Spotify.Shuffle = status.Shuffle;
|
||||
dataModel.Spotify.Playing = status.Playing;
|
||||
private void UpdateSpotifyTrack(object sender, TrackChangeEventArgs e)
|
||||
{
|
||||
var dataModel = (WindowsProfileDataModel) DataModel;
|
||||
dataModel.Spotify.Artist = e.NewTrack.ArtistResource?.Name;
|
||||
dataModel.Spotify.SongName = e.NewTrack.TrackResource?.Name;
|
||||
dataModel.Spotify.Album = e.NewTrack.AlbumResource?.Name;
|
||||
dataModel.Spotify.SongLength = e.NewTrack.Length;
|
||||
}
|
||||
|
||||
// Only update track info if not null
|
||||
if (status.Track == null)
|
||||
return;
|
||||
private void UpdateSpotifyTrackTime(object sender, TrackTimeChangeEventArgs e)
|
||||
{
|
||||
var dataModel = (WindowsProfileDataModel) DataModel;
|
||||
if (dataModel.Spotify.SongLength > 0)
|
||||
dataModel.Spotify.SongPercentCompleted = (int) (e.TrackTime/dataModel.Spotify.SongLength*100.0);
|
||||
}
|
||||
|
||||
dataModel.Spotify.Artist = status.Track.ArtistResource?.Name;
|
||||
dataModel.Spotify.SongName = status.Track.TrackResource?.Name;
|
||||
dataModel.Spotify.SongPercentCompleted = (int)(status.PlayingPosition / status.Track.Length * 100.0);
|
||||
dataModel.Spotify.Album = status.Track.AlbumResource?.Name;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
using Artemis.Models;
|
||||
|
||||
namespace Artemis.Modules.Effects.WindowsProfile
|
||||
{
|
||||
public class WindowsProfileSettings : GameSettings
|
||||
{
|
||||
public WindowsProfileSettings()
|
||||
{
|
||||
Load();
|
||||
}
|
||||
|
||||
public sealed override void Load()
|
||||
{
|
||||
LastProfile = WindowsProfile.Default.LastProfile;
|
||||
}
|
||||
|
||||
public sealed override void Save()
|
||||
{
|
||||
WindowsProfile.Default.LastProfile = LastProfile;
|
||||
|
||||
WindowsProfile.Default.Save();
|
||||
}
|
||||
|
||||
public sealed override void ToDefault()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,7 +2,6 @@
|
||||
using Artemis.Events;
|
||||
using Artemis.InjectionFactories;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Models;
|
||||
using Artemis.Modules.Effects.ProfilePreview;
|
||||
using Artemis.ViewModels.Abstract;
|
||||
using Artemis.ViewModels.Profiles;
|
||||
@ -35,6 +34,11 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
public IProfileEditorVmFactory PFactory { get; set; }
|
||||
public ProfilePreviewModel ProfilePreviewModel { get; set; }
|
||||
|
||||
public void Handle(ActiveEffectChanged message)
|
||||
{
|
||||
NotifyOfPropertyChange(() => EffectEnabled);
|
||||
}
|
||||
|
||||
private void ProfileUpdater(object sender, PropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.PropertyName != "SelectedProfile" && IsActive)
|
||||
@ -60,25 +64,5 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
||||
base.OnDeactivate(close);
|
||||
ProfileEditor.ProfileViewModel.Deactivate();
|
||||
}
|
||||
|
||||
public void Handle(ActiveEffectChanged message)
|
||||
{
|
||||
NotifyOfPropertyChange(() => EffectEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
public class WindowsProfileSettings : GameSettings
|
||||
{
|
||||
public override void Load()
|
||||
{
|
||||
}
|
||||
|
||||
public override void Save()
|
||||
{
|
||||
}
|
||||
|
||||
public override void ToDefault()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Modules.Games.CounterStrike" GeneratedClassName="CounterStrike">
|
||||
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||
GeneratedClassNamespace="Artemis.Modules.Games.CounterStrike" GeneratedClassName="CounterStrike">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Modules.Games.Overwatch" GeneratedClassName="Overwatch">
|
||||
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||
GeneratedClassNamespace="Artemis.Modules.Games.Overwatch" GeneratedClassName="Overwatch">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
||||
|
||||
@ -9,6 +9,8 @@ namespace Artemis.Modules.Games.Overwatch
|
||||
Load();
|
||||
}
|
||||
|
||||
public string GameDirectory { get; set; }
|
||||
|
||||
public sealed override void Load()
|
||||
{
|
||||
Enabled = Overwatch.Default.Enabled;
|
||||
@ -25,8 +27,6 @@ namespace Artemis.Modules.Games.Overwatch
|
||||
Overwatch.Default.Save();
|
||||
}
|
||||
|
||||
public string GameDirectory { get; set; }
|
||||
|
||||
public sealed override void ToDefault()
|
||||
{
|
||||
Enabled = true;
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Artemis.Modules.Games.RocketLeague" GeneratedClassName="RocketLeague">
|
||||
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
||||
GeneratedClassNamespace="Artemis.Modules.Games.RocketLeague" GeneratedClassName="RocketLeague">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System.Windows.Media;
|
||||
using Artemis.Models;
|
||||
using Artemis.Models;
|
||||
|
||||
namespace Artemis.Modules.Games.RocketLeague
|
||||
{
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Artemis.Managers;
|
||||
@ -7,7 +6,6 @@ using Artemis.Models;
|
||||
using Artemis.Models.Profiles;
|
||||
using Artemis.Utilities;
|
||||
using Artemis.Utilities.LogitechDll;
|
||||
using Brush = System.Windows.Media.Brush;
|
||||
|
||||
namespace Artemis.Modules.Games.TheDivision
|
||||
{
|
||||
@ -94,7 +92,7 @@ namespace Artemis.Modules.Games.TheDivision
|
||||
newState = PlayerState.Offline;
|
||||
|
||||
if (playerId == 1)
|
||||
gameDataModel.LowHp = (newState == PlayerState.Hit);
|
||||
gameDataModel.LowHp = newState == PlayerState.Hit;
|
||||
else if (playerId == 2)
|
||||
gameDataModel.PartyMember1 = newState;
|
||||
else if (playerId == 3)
|
||||
|
||||
@ -39,7 +39,9 @@
|
||||
TextAlignment="Justify" Margin="5,0,0,10">
|
||||
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.
|
||||
</TextBlock>
|
||||
<Button Grid.Row="2" Grid.Column="0" Margin="5,0,0,0" x:Name="AutoInstall" Content="Try automatic mod install" Width="160" Style="{DynamicResource SquareButtonStyle}" HorizontalAlignment="Left" />
|
||||
<Button Grid.Row="2" Grid.Column="0" Margin="5,0,0,0" x:Name="AutoInstall"
|
||||
Content="Try automatic mod install" Width="160" Style="{DynamicResource SquareButtonStyle}"
|
||||
HorizontalAlignment="Left" />
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-30,0" />
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
|
||||
|
||||
10
Artemis/Artemis/Properties/Resources.Designer.cs
generated
10
Artemis/Artemis/Properties/Resources.Designer.cs
generated
@ -265,6 +265,16 @@ namespace Artemis.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap none {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("none", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to /***********************************************************************/
|
||||
////** © 2015 CD PROJEKT S.A. All rights reserved.
|
||||
|
||||
@ -178,4 +178,7 @@
|
||||
<data name="defaultProfiles" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Keyboards\default-profiles.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="none" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Keyboards\none.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
Binary file not shown.
BIN
Artemis/Artemis/Resources/Keyboards/none.png
Normal file
BIN
Artemis/Artemis/Resources/Keyboards/none.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 68 KiB |
@ -27,7 +27,6 @@ using Caliburn.Micro;
|
||||
using MahApps.Metro.Controls;
|
||||
using MahApps.Metro.Controls.Dialogs;
|
||||
using Microsoft.Win32;
|
||||
using Ninject;
|
||||
|
||||
namespace Artemis.Services
|
||||
{
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
<?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 />
|
||||
<Settings>
|
||||
<Setting Name="LastEffect" Type="System.String" Scope="User">
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Windows.Media;
|
||||
using Brush = System.Windows.Media.Brush;
|
||||
using Color = System.Drawing.Color;
|
||||
|
||||
namespace Artemis.Utilities
|
||||
{
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace Artemis.Utilities
|
||||
{
|
||||
@ -19,6 +21,30 @@ namespace Artemis.Utilities
|
||||
|
||||
#endregion
|
||||
|
||||
#region Zip files
|
||||
|
||||
public static void ExtractToDirectory(this ZipArchive archive, string destinationDirectoryName, bool overwrite)
|
||||
{
|
||||
if (!overwrite)
|
||||
{
|
||||
archive.ExtractToDirectory(destinationDirectoryName);
|
||||
return;
|
||||
}
|
||||
foreach (var file in archive.Entries)
|
||||
{
|
||||
var completeFileName = Path.Combine(destinationDirectoryName, file.FullName);
|
||||
if (file.Name == "")
|
||||
{
|
||||
// Assuming Empty for Directory
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(completeFileName));
|
||||
continue;
|
||||
}
|
||||
file.ExtractToFile(completeFileName, true);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Color
|
||||
|
||||
// TODO: Convert ColorHelpers to ExtensionMethods
|
||||
|
||||
@ -5,8 +5,6 @@ using System.IO;
|
||||
using System.Reflection;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows;
|
||||
using System.Windows.Markup;
|
||||
using System.Xml;
|
||||
using System.Xml.Serialization;
|
||||
using Microsoft.Win32;
|
||||
using static System.String;
|
||||
|
||||
@ -1,12 +1,9 @@
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using PixelFormat = System.Drawing.Imaging.PixelFormat;
|
||||
|
||||
namespace Artemis.Utilities
|
||||
{
|
||||
|
||||
@ -31,7 +31,6 @@ namespace Artemis.Utilities.LogitechDll
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void PlaceDll()
|
||||
|
||||
@ -21,6 +21,7 @@ namespace Artemis.ViewModels.Abstract
|
||||
|
||||
[Inject]
|
||||
public MetroDialogService DialogService { get; set; }
|
||||
|
||||
public EffectSettings EffectSettings
|
||||
{
|
||||
get { return _effectSettings; }
|
||||
|
||||
@ -18,6 +18,7 @@ namespace Artemis.ViewModels.Abstract
|
||||
|
||||
[Inject]
|
||||
public MetroDialogService DialogService { get; set; }
|
||||
|
||||
public OverlayModel OverlayModel { get; set; }
|
||||
|
||||
public OverlaySettings OverlaySettings
|
||||
|
||||
@ -145,7 +145,6 @@ namespace Artemis.ViewModels.Flyouts
|
||||
|
||||
if (EnableDebug)
|
||||
rule.EnableLoggingForLevel(LogLevel.Debug);
|
||||
else
|
||||
rule.DisableLoggingForLevel(LogLevel.Debug);
|
||||
|
||||
LogManager.ReconfigExistingLoggers();
|
||||
|
||||
@ -8,7 +8,8 @@ namespace Artemis.ViewModels
|
||||
{
|
||||
private readonly GameViewModel[] _gameViewModels;
|
||||
|
||||
public GamesViewModel(GameViewModel[] gameViewModels, ProfileManager profileManager, ProfilePreviewModel profilePreviewModel)
|
||||
public GamesViewModel(GameViewModel[] gameViewModels, ProfileManager profileManager,
|
||||
ProfilePreviewModel profilePreviewModel)
|
||||
{
|
||||
DisplayName = "Games";
|
||||
_gameViewModels = gameViewModels;
|
||||
|
||||
@ -2,8 +2,6 @@
|
||||
using System.ComponentModel;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Timers;
|
||||
using System.Xml.Serialization;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Models.Profiles;
|
||||
using Artemis.Models.Profiles.Properties;
|
||||
@ -11,7 +9,6 @@ using Artemis.Services;
|
||||
using Artemis.Utilities;
|
||||
using Artemis.ViewModels.Profiles.Properties;
|
||||
using Caliburn.Micro;
|
||||
using Newtonsoft.Json;
|
||||
using Ninject;
|
||||
|
||||
namespace Artemis.ViewModels.Profiles
|
||||
@ -169,7 +166,6 @@ namespace Artemis.ViewModels.Profiles
|
||||
Layer.Properties.Conditions.Clear();
|
||||
foreach (var conditionViewModel in LayerConditionVms)
|
||||
{
|
||||
|
||||
Layer.Properties.Conditions.Add(conditionViewModel.LayerConditionModel);
|
||||
}
|
||||
|
||||
@ -206,7 +202,8 @@ namespace Artemis.ViewModels.Profiles
|
||||
return;
|
||||
}
|
||||
|
||||
var close = await DialogService.ShowQuestionMessageBox("Unsaved changes", "Do you want to discard your changes?");
|
||||
var close =
|
||||
await DialogService.ShowQuestionMessageBox("Unsaved changes", "Do you want to discard your changes?");
|
||||
callback(close.Value);
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,7 +69,10 @@ namespace Artemis.ViewModels.Profiles
|
||||
|
||||
public ProfileViewModel ProfileViewModel { get; set; }
|
||||
|
||||
public bool EditorEnabled => SelectedProfile != null && !SelectedProfile.IsDefault;
|
||||
public bool EditorEnabled
|
||||
=>
|
||||
SelectedProfile != null && !SelectedProfile.IsDefault &&
|
||||
_mainManager.DeviceManager.ActiveKeyboard != null;
|
||||
|
||||
public BindableCollection<ProfileModel> Profiles
|
||||
{
|
||||
@ -457,6 +460,13 @@ namespace Artemis.ViewModels.Profiles
|
||||
/// </summary>
|
||||
public async void AddProfile()
|
||||
{
|
||||
if (_mainManager.DeviceManager.ActiveKeyboard == null)
|
||||
{
|
||||
DialogService.ShowMessageBox("Cannot add profile.",
|
||||
"To add a profile, please select a keyboard in the options menu first.");
|
||||
return;
|
||||
}
|
||||
|
||||
var name = await DialogService.ShowInputDialog("Add new profile",
|
||||
"Please provide a profile name unique to this game and keyboard.");
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ using Artemis.Managers;
|
||||
using Artemis.Models.Profiles;
|
||||
using Artemis.Models.Profiles.Properties;
|
||||
using Artemis.Modules.Effects.ProfilePreview;
|
||||
using Artemis.Properties;
|
||||
using Artemis.Utilities;
|
||||
using Caliburn.Micro;
|
||||
using MahApps.Metro;
|
||||
@ -74,10 +75,8 @@ namespace Artemis.ViewModels.Profiles
|
||||
}
|
||||
}
|
||||
|
||||
public ImageSource KeyboardImage
|
||||
{
|
||||
get { return ImageUtilities.BitmapToBitmapImage(_deviceManager.ActiveKeyboard?.PreviewSettings.Image); }
|
||||
}
|
||||
public ImageSource KeyboardImage => ImageUtilities
|
||||
.BitmapToBitmapImage(_deviceManager.ActiveKeyboard?.PreviewSettings.Image ?? Resources.none);
|
||||
|
||||
public bool Activated { get; set; }
|
||||
|
||||
|
||||
@ -7,8 +7,8 @@ namespace Artemis.ViewModels.Profiles.Properties
|
||||
{
|
||||
public class HeadsetPropertiesViewModel : LayerPropertiesViewModel
|
||||
{
|
||||
private LayerPropertiesModel _proposedProperties;
|
||||
private Brush _brush;
|
||||
private LayerPropertiesModel _proposedProperties;
|
||||
|
||||
public HeadsetPropertiesViewModel(IDataModel dataModel, LayerPropertiesModel properties)
|
||||
: base(dataModel)
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System.Windows.Media;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Models.Profiles.Properties;
|
||||
using Caliburn.Micro;
|
||||
|
||||
@ -7,13 +6,13 @@ namespace Artemis.ViewModels.Profiles.Properties
|
||||
{
|
||||
public abstract class LayerPropertiesViewModel : PropertyChangedBase
|
||||
{
|
||||
public IDataModel DataModel { get; set; }
|
||||
|
||||
protected LayerPropertiesViewModel(IDataModel dataModel)
|
||||
{
|
||||
DataModel = dataModel;
|
||||
}
|
||||
|
||||
public IDataModel DataModel { get; set; }
|
||||
|
||||
public abstract LayerPropertiesModel GetAppliedProperties();
|
||||
}
|
||||
}
|
||||
@ -1,5 +1,4 @@
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Navigation;
|
||||
using Artemis.Models.Interfaces;
|
||||
using Artemis.Models.Profiles.Properties;
|
||||
using Artemis.Utilities;
|
||||
@ -8,8 +7,8 @@ namespace Artemis.ViewModels.Profiles.Properties
|
||||
{
|
||||
public class MousePropertiesViewModel : LayerPropertiesViewModel
|
||||
{
|
||||
private LayerPropertiesModel _proposedProperties;
|
||||
private Brush _brush;
|
||||
private LayerPropertiesModel _proposedProperties;
|
||||
|
||||
public MousePropertiesViewModel(IDataModel dataModel, LayerPropertiesModel properties)
|
||||
: base(dataModel)
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows;
|
||||
using Artemis.Events;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Services;
|
||||
@ -37,6 +36,7 @@ namespace Artemis.ViewModels
|
||||
|
||||
[Inject]
|
||||
public MetroDialogService DialogService { get; set; }
|
||||
|
||||
public MainManager MainManager { get; set; }
|
||||
|
||||
public bool CanShowWindow => !_shellViewModel.IsActive;
|
||||
|
||||
@ -34,8 +34,10 @@
|
||||
BlurRadius="{Binding Path=ProfileViewModel.BlurRadius, Mode=OneWay}" />
|
||||
</Border.Effect>
|
||||
<Grid>
|
||||
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=ProfileViewModel.KeyboardImage}" Margin="50" />
|
||||
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=ProfileViewModel.KeyboardPreview}" Opacity="0.8"
|
||||
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=ProfileViewModel.KeyboardImage}"
|
||||
Margin="50" />
|
||||
<Image Grid.Column="0" Grid.Row="0" Source="{Binding Path=ProfileViewModel.KeyboardPreview}"
|
||||
Opacity="0.8"
|
||||
Width="{Binding Path=PreviewSettings.Width}"
|
||||
Height="{Binding Path=PreviewSettings.Height}"
|
||||
Margin="{Binding Path=PreviewSettings.Margin}"
|
||||
@ -51,7 +53,7 @@
|
||||
<StackPanel Grid.Column="0" Grid.Row="2">
|
||||
<StackPanel Orientation="Horizontal" Margin="0,5,0,0">
|
||||
<Label Content="Active profile" />
|
||||
<ComboBox Width="145" VerticalAlignment="Top" x:Name="Profiles" DisplayMemberPath="Name"
|
||||
<ComboBox Width="220" VerticalAlignment="Top" x:Name="Profiles" DisplayMemberPath="Name"
|
||||
Margin="5,0,0,0" />
|
||||
<Button x:Name="AddProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Add profile">
|
||||
@ -79,7 +81,8 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
<Button x:Name="DuplicateProfile" VerticalAlignment="Top" Style="{DynamicResource SquareButtonStyle}"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0" ToolTip="Duplicate profile"
|
||||
Width="26" Height="26" HorizontalAlignment="Right" Margin="10,0,0,0"
|
||||
ToolTip="Duplicate profile"
|
||||
IsEnabled="{Binding Path=ProfileSelected, Mode=OneWay}">
|
||||
<Button.Content>
|
||||
<Rectangle
|
||||
@ -105,7 +108,8 @@
|
||||
</Button.Content>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock VerticalAlignment="Top" Foreground="{DynamicResource HighlightBrush}" HorizontalAlignment="Left" Margin="5,5,0,0" Text="Note: To edit a default profile, duplicate it first." FontWeight="Bold"/>
|
||||
<TextBlock VerticalAlignment="Top" Foreground="{DynamicResource HighlightBrush}" HorizontalAlignment="Left"
|
||||
Margin="5,5,0,0" Text="Note: To edit a default profile, duplicate it first." FontWeight="Bold" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="0" Grid.Row="2" Orientation="Horizontal" Margin="0,6,0,0" HorizontalAlignment="Right">
|
||||
@ -152,7 +156,8 @@
|
||||
ItemsSource="{Binding Path=Layers, Converter={StaticResource LayerOrderConverter}, ConverterParameter=Order}"
|
||||
IsEnabled="{Binding Path=EditorEnabled, Mode=OneWay}">
|
||||
<i:Interaction.Behaviors>
|
||||
<itemBehaviours:BindableSelectedItemBehavior SelectedItem="{Binding ProfileViewModel.SelectedLayer, Mode=TwoWay}" />
|
||||
<itemBehaviours:BindableSelectedItemBehavior
|
||||
SelectedItem="{Binding ProfileViewModel.SelectedLayer, Mode=TwoWay}" />
|
||||
</i:Interaction.Behaviors>
|
||||
<TreeView.Resources>
|
||||
<ResourceDictionary
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<packages>
|
||||
<package id="Caliburn.Micro" version="3.0.1" targetFramework="net452" />
|
||||
<package id="Caliburn.Micro.Core" version="3.0.1" targetFramework="net452" />
|
||||
|
||||
@ -141,8 +141,6 @@ namespace ChromaSDK
|
||||
// {0201203B-62F3-4C50-83DD-598BABD208E0}
|
||||
static const GUID CORE_CHROMA =
|
||||
{0x201203b, 0x62f3, 0x4c50,{0x83, 0xdd, 0x59, 0x8b, 0xab, 0xd2, 0x8, 0xe0}};
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@ -148,7 +148,6 @@ namespace ChromaSDK
|
||||
DURATION_MEDIUM, //!< Medium duration.
|
||||
DURATION_LONG //!< Long duration.
|
||||
} Duration; //!< The time taken for the effect to fade away.
|
||||
|
||||
} STARLIGHT_EFFECT_TYPE;
|
||||
|
||||
//! Static effect.
|
||||
@ -355,6 +354,7 @@ namespace ChromaSDK
|
||||
RANDOM_COLORS, //!< Random colors
|
||||
INVALID //!< Invalid type
|
||||
} Type;
|
||||
|
||||
COLORREF Color1; //!< First color.
|
||||
COLORREF Color2; //!< Second color.
|
||||
} BREATHING_EFFECT_TYPE;
|
||||
@ -408,7 +408,6 @@ namespace ChromaSDK
|
||||
DURATION_MEDIUM, //!< Medium duration.
|
||||
DURATION_LONG //!< Long duration.
|
||||
} Duration; //!< The time taken for the effect to fade away.
|
||||
|
||||
} STARLIGHT_EFFECT_TYPE;
|
||||
|
||||
//! Static effect type
|
||||
@ -669,6 +668,7 @@ namespace ChromaSDK
|
||||
RANDOM_COLORS, //!< Random colors
|
||||
INVALID
|
||||
} Type;
|
||||
|
||||
COLORREF Color1; //!< First color.
|
||||
COLORREF Color2; //!< Second color.
|
||||
} BREATHING_EFFECT_TYPE;
|
||||
@ -736,6 +736,7 @@ namespace ChromaSDK
|
||||
RANDOM_COLORS, //!< Random colors
|
||||
INVALID //!< Invalid type
|
||||
} Type;
|
||||
|
||||
COLORREF Color1; //!< First color.
|
||||
COLORREF Color2; //!< Second color.
|
||||
} BREATHING_EFFECT_TYPE;
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
//! \file RzErrors.h
|
||||
//! \brief Error codes for Chroma SDK. If the error is not defined here, refer to WinError.h from the Windows SDK.
|
||||
|
||||
|
||||
@ -84,7 +84,8 @@ RZRESULT CreateEffect(RZDEVICEID DeviceId, ChromaSDK::EFFECT_TYPE Effect, PRZPAR
|
||||
RZRESULT CreateKeyboardEffect(ChromaSDK::Keyboard::EFFECT_TYPE Effect, PRZPARAM pParam, RZEFFECTID* pEffectId)
|
||||
{
|
||||
std::string res = "";
|
||||
if (Effect == Keyboard::CHROMA_CUSTOM) {
|
||||
if (Effect == Keyboard::CHROMA_CUSTOM)
|
||||
{
|
||||
res += "0|";
|
||||
auto keys = *static_cast<struct Keyboard::CUSTOM_EFFECT_TYPE*>(pParam);
|
||||
|
||||
@ -99,7 +100,8 @@ RZRESULT CreateKeyboardEffect(ChromaSDK::Keyboard::EFFECT_TYPE Effect, PRZPARAM
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (Effect == Keyboard::CHROMA_CUSTOM_KEY) {
|
||||
else if (Effect == Keyboard::CHROMA_CUSTOM_KEY)
|
||||
{
|
||||
res += "1|";
|
||||
auto keys = *static_cast<struct Keyboard::CUSTOM_KEY_EFFECT_TYPE*>(pParam);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user