mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
commit
7c3bdf1b91
@ -3,6 +3,7 @@
|
|||||||
<configuration>
|
<configuration>
|
||||||
<configSections>
|
<configSections>
|
||||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
|
<section name="Artemis.Modules.Games.EurotruckSimulator2.EurotruckSimulator2" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
<section name="Artemis.Modules.Games.UnrealTournament.UnrealTournament" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
<section name="Artemis.Modules.Games.UnrealTournament.UnrealTournament" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
<section name="Artemis.Modules.Games.WoW.WoW" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
<section name="Artemis.Modules.Games.WoW.WoW" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
<section name="Artemis.Modules.Effects.Bubbles.Bubbles" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
<section name="Artemis.Modules.Effects.Bubbles.Bubbles" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||||
@ -29,6 +30,17 @@
|
|||||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
|
||||||
</startup>
|
</startup>
|
||||||
<userSettings>
|
<userSettings>
|
||||||
|
<Artemis.Modules.Games.EurotruckSimulator2.EurotruckSimulator2>
|
||||||
|
<setting name="Enabled" serializeAs="String">
|
||||||
|
<value>True</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="LastProfile" serializeAs="String">
|
||||||
|
<value>Default</value>
|
||||||
|
</setting>
|
||||||
|
<setting name="GameDirectory" serializeAs="String">
|
||||||
|
<value />
|
||||||
|
</setting>
|
||||||
|
</Artemis.Modules.Games.EurotruckSimulator2.EurotruckSimulator2>
|
||||||
<Artemis.Modules.Games.UnrealTournament.UnrealTournament>
|
<Artemis.Modules.Games.UnrealTournament.UnrealTournament>
|
||||||
<setting name="Enabled" serializeAs="String">
|
<setting name="Enabled" serializeAs="String">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
@ -276,7 +288,7 @@
|
|||||||
<setting name="ShowOnStartup" serializeAs="String">
|
<setting name="ShowOnStartup" serializeAs="String">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="CheckForUpdates" serializeAs="String">
|
<setting name="AutoUpdate" serializeAs="String">
|
||||||
<value>True</value>
|
<value>True</value>
|
||||||
</setting>
|
</setting>
|
||||||
<setting name="Theme" serializeAs="String">
|
<setting name="Theme" serializeAs="String">
|
||||||
|
|||||||
@ -1,8 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Security.Principal;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using Artemis.Utilities;
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using WpfExceptionViewer;
|
using WpfExceptionViewer;
|
||||||
|
|
||||||
@ -13,28 +11,17 @@ namespace Artemis
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
protected override void OnExit(ExitEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnExit(e);
|
|
||||||
Environment.Exit(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public App()
|
public App()
|
||||||
{
|
{
|
||||||
if (!IsRunAsAdministrator())
|
|
||||||
GeneralHelpers.RunAsAdministrator();
|
|
||||||
|
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DoHandle { get; set; }
|
public bool DoHandle { get; set; }
|
||||||
|
|
||||||
private static bool IsRunAsAdministrator()
|
protected override void OnExit(ExitEventArgs e)
|
||||||
{
|
{
|
||||||
var wi = WindowsIdentity.GetCurrent();
|
base.OnExit(e);
|
||||||
var wp = new WindowsPrincipal(wi);
|
Environment.Exit(0);
|
||||||
|
|
||||||
return wp.IsInRole(WindowsBuiltInRole.Administrator);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
private void Application_DispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 53 KiB |
@ -40,7 +40,7 @@
|
|||||||
<ProductName>Artemis</ProductName>
|
<ProductName>Artemis</ProductName>
|
||||||
<PublisherName>Artemis</PublisherName>
|
<PublisherName>Artemis</PublisherName>
|
||||||
<ApplicationRevision>0</ApplicationRevision>
|
<ApplicationRevision>0</ApplicationRevision>
|
||||||
<ApplicationVersion>1.2.3.0</ApplicationVersion>
|
<ApplicationVersion>1.3.0.0</ApplicationVersion>
|
||||||
<UseApplicationTrust>false</UseApplicationTrust>
|
<UseApplicationTrust>false</UseApplicationTrust>
|
||||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||||
@ -73,7 +73,7 @@
|
|||||||
<ManifestKeyFile>Artemis_TemporaryKey.pfx</ManifestKeyFile>
|
<ManifestKeyFile>Artemis_TemporaryKey.pfx</ManifestKeyFile>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<GenerateManifests>true</GenerateManifests>
|
<GenerateManifests>false</GenerateManifests>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<SignManifests>false</SignManifests>
|
<SignManifests>false</SignManifests>
|
||||||
@ -120,6 +120,12 @@
|
|||||||
<Prefer32Bit>true</Prefer32Bit>
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup />
|
<PropertyGroup />
|
||||||
|
<PropertyGroup>
|
||||||
|
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetZone>LocalIntranet</TargetZone>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Caliburn.Micro, Version=3.0.1.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f, processorArchitecture=MSIL">
|
<Reference Include="Caliburn.Micro, Version=3.0.1.0, Culture=neutral, PublicKeyToken=8e5891231f2ed21f, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Caliburn.Micro.Core.3.0.1\lib\net45\Caliburn.Micro.dll</HintPath>
|
<HintPath>..\packages\Caliburn.Micro.Core.3.0.1\lib\net45\Caliburn.Micro.dll</HintPath>
|
||||||
@ -149,10 +155,26 @@
|
|||||||
<HintPath>..\packages\CUE.NET.1.0.3\lib\net45\CUE.NET.dll</HintPath>
|
<HintPath>..\packages\CUE.NET.1.0.3\lib\net45\CUE.NET.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="DeltaCompressionDotNet, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d14d6e5194e7f4a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DeltaCompressionDotNet.MsDelta, Version=1.0.0.0, Culture=neutral, PublicKeyToken=46b2138a390abf55, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.MsDelta.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="DeltaCompressionDotNet.PatchApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3e8888ee913ed789, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\DeltaCompressionDotNet.1.0.0\lib\net45\DeltaCompressionDotNet.PatchApi.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="DynamicExpresso.Core, Version=1.3.1.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="DynamicExpresso.Core, Version=1.3.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\DynamicExpresso.Core.1.3.1.0\lib\net40\DynamicExpresso.Core.dll</HintPath>
|
<HintPath>..\packages\DynamicExpresso.Core.1.3.1.0\lib\net40\DynamicExpresso.Core.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Ets2SdkClient, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>lib\Ets2SdkClient.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
<Reference Include="GongSolutions.Wpf.DragDrop, Version=0.1.4.3, Culture=neutral, PublicKeyToken=d19974ea350ccea1, processorArchitecture=MSIL">
|
<Reference Include="GongSolutions.Wpf.DragDrop, Version=0.1.4.3, Culture=neutral, PublicKeyToken=d19974ea350ccea1, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\gong-wpf-dragdrop.0.1.4.3\lib\net40\GongSolutions.Wpf.DragDrop.dll</HintPath>
|
<HintPath>..\packages\gong-wpf-dragdrop.0.1.4.3\lib\net40\GongSolutions.Wpf.DragDrop.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@ -161,6 +183,10 @@
|
|||||||
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
|
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\squirrel.windows.1.4.4\lib\Net45\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
<Reference Include="log4net, Version=1.2.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\log4net.2.0.5\lib\net45-full\log4net.dll</HintPath>
|
<HintPath>..\packages\log4net.2.0.5\lib\net45-full\log4net.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@ -172,6 +198,22 @@
|
|||||||
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
<Reference Include="Microsoft.QualityTools.Testing.Fakes, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Mono.Cecil.Mdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Mdb.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Mono.Cecil.Pdb, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Pdb.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Mono.Cecil.Rocks, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Mono.Cecil.0.9.6.1\lib\net45\Mono.Cecil.Rocks.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="NAudio, Version=1.7.3.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="NAudio, Version=1.7.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NAudio.1.7.3\lib\net35\NAudio.dll</HintPath>
|
<HintPath>..\packages\NAudio.1.7.3\lib\net35\NAudio.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@ -184,6 +226,10 @@
|
|||||||
<HintPath>..\packages\Ninject.3.2.2.0\lib\net45-full\Ninject.dll</HintPath>
|
<HintPath>..\packages\Ninject.3.2.2.0\lib\net45-full\Ninject.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Ninject.Extensions.Conventions, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Ninject.Extensions.Conventions.3.2.0.0\lib\net45-full\Ninject.Extensions.Conventions.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="Ninject.Extensions.Factory, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
|
<Reference Include="Ninject.Extensions.Factory, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Ninject.Extensions.Factory.3.2.1.0\lib\net45-full\Ninject.Extensions.Factory.dll</HintPath>
|
<HintPath>..\packages\Ninject.Extensions.Factory.3.2.1.0\lib\net45-full\Ninject.Extensions.Factory.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
@ -200,15 +246,24 @@
|
|||||||
<HintPath>..\packages\NLog.4.3.7\lib\net45\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.4.3.7\lib\net45\NLog.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Process.NET, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\packages\squirrel.windows.1.4.4\lib\Net45\NuGet.Squirrel.dll</HintPath>
|
||||||
<HintPath>D:\Downloads\Chome Downloads\Process.NET-master\Process.NET-master\src\Process.NET\bin\Release\Process.NET.dll</HintPath>
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Splat, Version=1.6.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Splat.1.6.2\lib\Net45\Splat.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="SpotifyAPI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="SpotifyAPI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\SpotifyAPI-NET.2.11.0\lib\SpotifyAPI.dll</HintPath>
|
<HintPath>..\packages\SpotifyAPI-NET.2.11.0\lib\SpotifyAPI.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
<Reference Include="Squirrel, Version=1.4.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\squirrel.windows.1.4.4\lib\Net45\Squirrel.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.ComponentModel.Composition" />
|
||||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Drawing" />
|
<Reference Include="System.Drawing" />
|
||||||
@ -241,28 +296,28 @@
|
|||||||
<Reference Include="WindowsBase" />
|
<Reference Include="WindowsBase" />
|
||||||
<Reference Include="PresentationCore" />
|
<Reference Include="PresentationCore" />
|
||||||
<Reference Include="PresentationFramework" />
|
<Reference Include="PresentationFramework" />
|
||||||
<Reference Include="Xceed.Wpf.AvalonDock, Version=2.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
<Reference Include="Xceed.Wpf.AvalonDock, Version=2.9.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.7\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
|
<HintPath>..\packages\Extended.Wpf.Toolkit.2.9\lib\net40\Xceed.Wpf.AvalonDock.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=2.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=2.9.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.7\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
|
<HintPath>..\packages\Extended.Wpf.Toolkit.2.9\lib\net40\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=2.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=2.9.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.7\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
|
<HintPath>..\packages\Extended.Wpf.Toolkit.2.9\lib\net40\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=2.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=2.9.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.7\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
|
<HintPath>..\packages\Extended.Wpf.Toolkit.2.9\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xceed.Wpf.DataGrid, Version=2.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
<Reference Include="Xceed.Wpf.DataGrid, Version=2.9.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.7\lib\net40\Xceed.Wpf.DataGrid.dll</HintPath>
|
<HintPath>..\packages\Extended.Wpf.Toolkit.2.9\lib\net40\Xceed.Wpf.DataGrid.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Xceed.Wpf.Toolkit, Version=2.7.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
<Reference Include="Xceed.Wpf.Toolkit, Version=2.9.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Extended.Wpf.Toolkit.2.7\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
|
<HintPath>..\packages\Extended.Wpf.Toolkit.2.9\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@ -277,6 +332,7 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="ArtemisBootstrapper.cs" />
|
<Compile Include="ArtemisBootstrapper.cs" />
|
||||||
<Compile Include="DAL\ProfileProvider.cs" />
|
<Compile Include="DAL\ProfileProvider.cs" />
|
||||||
|
<Compile Include="DAL\SettingsProvider.cs" />
|
||||||
<Compile Include="DeviceProviders\Corsair\CorsairMice.cs" />
|
<Compile Include="DeviceProviders\Corsair\CorsairMice.cs" />
|
||||||
<Compile Include="DeviceProviders\Corsair\CorsairHeadsets.cs" />
|
<Compile Include="DeviceProviders\Corsair\CorsairHeadsets.cs" />
|
||||||
<Compile Include="DeviceProviders\Corsair\Utilities\KeyMap.cs" />
|
<Compile Include="DeviceProviders\Corsair\Utilities\KeyMap.cs" />
|
||||||
@ -284,12 +340,16 @@
|
|||||||
<Compile Include="DeviceProviders\Logitech\G810.cs" />
|
<Compile Include="DeviceProviders\Logitech\G810.cs" />
|
||||||
<Compile Include="DeviceProviders\Logitech\LogitechGeneric.cs" />
|
<Compile Include="DeviceProviders\Logitech\LogitechGeneric.cs" />
|
||||||
<Compile Include="DeviceProviders\Logitech\LogitechKeyboard.cs" />
|
<Compile Include="DeviceProviders\Logitech\LogitechKeyboard.cs" />
|
||||||
<Compile Include="Events\ActiveKeyboardChanged.cs" />
|
<Compile Include="Events\EffectChangedEventArgs.cs" />
|
||||||
|
<Compile Include="Events\EnabledChangedEventArgs.cs" />
|
||||||
|
<Compile Include="Events\KeyboardChangedEventArgs.cs" />
|
||||||
<Compile Include="Events\RazerColorArrayChanged.cs" />
|
<Compile Include="Events\RazerColorArrayChanged.cs" />
|
||||||
<Compile Include="Events\ToggleEnabled.cs" />
|
<Compile Include="Events\RazerColorsChangedEventArgs.cs" />
|
||||||
<Compile Include="Events\ActiveEffectChanged.cs" />
|
|
||||||
<Compile Include="InjectionFactories\ILayerEditorVmFactory.cs" />
|
<Compile Include="InjectionFactories\ILayerEditorVmFactory.cs" />
|
||||||
<Compile Include="InjectionFactories\IProfileEditorVmFactory.cs" />
|
<Compile Include="InjectionFactories\IProfileEditorVmFactory.cs" />
|
||||||
|
<Compile Include="InjectionModules\DeviceModules.cs" />
|
||||||
|
<Compile Include="InjectionModules\EffectModules.cs" />
|
||||||
|
<Compile Include="InjectionModules\ProfileModules.cs" />
|
||||||
<Compile Include="ItemBehaviours\BindableSelectedItemBehavior.cs" />
|
<Compile Include="ItemBehaviours\BindableSelectedItemBehavior.cs" />
|
||||||
<Compile Include="DeviceProviders\Corsair\CorsairKeyboards.cs" />
|
<Compile Include="DeviceProviders\Corsair\CorsairKeyboards.cs" />
|
||||||
<Compile Include="DeviceProviders\KeyboardProvider.cs" />
|
<Compile Include="DeviceProviders\KeyboardProvider.cs" />
|
||||||
@ -306,17 +366,17 @@
|
|||||||
<Compile Include="Managers\MainManager.cs" />
|
<Compile Include="Managers\MainManager.cs" />
|
||||||
<Compile Include="Managers\ProfileManager.cs" />
|
<Compile Include="Managers\ProfileManager.cs" />
|
||||||
<Compile Include="Models\EffectModel.cs" />
|
<Compile Include="Models\EffectModel.cs" />
|
||||||
<Compile Include="Models\EffectSettings.cs" />
|
<Compile Include="Models\Interfaces\IDataModel.cs" />
|
||||||
<Compile Include="Models\GameSettings.cs" />
|
|
||||||
<Compile Include="Models\Interfaces\GameDataModel.cs" />
|
|
||||||
<Compile Include="Models\OverlaySettings.cs" />
|
|
||||||
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualization.cs" />
|
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualization.cs" />
|
||||||
<Compile Include="Modules\Effects\Bubbles\Bubbles.cs" />
|
<Compile Include="Modules\Effects\Bubbles\Bubbles.cs" />
|
||||||
<Compile Include="Modules\Games\UnrealTournament\UnrealTournament.Designer.cs">
|
<Compile Include="Modules\Effects\WindowsProfile\PerformanceInfo.cs" />
|
||||||
<AutoGen>True</AutoGen>
|
<Compile Include="Modules\Games\EurotruckSimulator2\EurotruckSimulator2DataModel.cs" />
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<Compile Include="Modules\Games\EurotruckSimulator2\EurotruckSimulator2Model.cs" />
|
||||||
<DependentUpon>UnrealTournament.settings</DependentUpon>
|
<Compile Include="Modules\Games\EurotruckSimulator2\EurotruckSimulator2Settings.cs" />
|
||||||
|
<Compile Include="Modules\Games\EurotruckSimulator2\EurotruckSimulator2View.xaml.cs">
|
||||||
|
<DependentUpon>EurotruckSimulator2View.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Modules\Games\EurotruckSimulator2\EurotruckSimulator2ViewModel.cs" />
|
||||||
<Compile Include="Modules\Games\UnrealTournament\UnrealTournamentDataModel.cs" />
|
<Compile Include="Modules\Games\UnrealTournament\UnrealTournamentDataModel.cs" />
|
||||||
<Compile Include="Modules\Games\UnrealTournament\UnrealTournamentModel.cs" />
|
<Compile Include="Modules\Games\UnrealTournament\UnrealTournamentModel.cs" />
|
||||||
<Compile Include="Modules\Games\UnrealTournament\UnrealTournamentSettings.cs" />
|
<Compile Include="Modules\Games\UnrealTournament\UnrealTournamentSettings.cs" />
|
||||||
@ -324,11 +384,6 @@
|
|||||||
<DependentUpon>UnrealTournamentView.xaml</DependentUpon>
|
<DependentUpon>UnrealTournamentView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Modules\Games\UnrealTournament\UnrealTournamentViewModel.cs" />
|
<Compile Include="Modules\Games\UnrealTournament\UnrealTournamentViewModel.cs" />
|
||||||
<Compile Include="Modules\Games\WorldofWarcraft\WoW.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
<DependentUpon>WoW.settings</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Modules\Games\WorldofWarcraft\WoWDataModel.cs" />
|
<Compile Include="Modules\Games\WorldofWarcraft\WoWDataModel.cs" />
|
||||||
<Compile Include="Modules\Games\WorldofWarcraft\WoWModel.cs" />
|
<Compile Include="Modules\Games\WorldofWarcraft\WoWModel.cs" />
|
||||||
<Compile Include="Modules\Games\WorldofWarcraft\WoWSettings.cs" />
|
<Compile Include="Modules\Games\WorldofWarcraft\WoWSettings.cs" />
|
||||||
@ -357,31 +412,16 @@
|
|||||||
<Compile Include="Profiles\ProfileModel.cs" />
|
<Compile Include="Profiles\ProfileModel.cs" />
|
||||||
<Compile Include="Profiles\Layers\Models\SimplePropertiesModel.cs" />
|
<Compile Include="Profiles\Layers\Models\SimplePropertiesModel.cs" />
|
||||||
<Compile Include="Profiles\Layers\Types\Keyboard\KeyboardPropertiesModel.cs" />
|
<Compile Include="Profiles\Layers\Types\Keyboard\KeyboardPropertiesModel.cs" />
|
||||||
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualization.Designer.cs">
|
|
||||||
<DependentUpon>AudioVisualization.settings</DependentUpon>
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualizerModel.cs" />
|
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualizerModel.cs" />
|
||||||
<Compile Include="Modules\Effects\AudioVisualizer\Utilities\FftEventArgs.cs" />
|
<Compile Include="Modules\Effects\AudioVisualizer\Utilities\FftEventArgs.cs" />
|
||||||
<Compile Include="Modules\Effects\AudioVisualizer\Utilities\SampleAggregator.cs" />
|
<Compile Include="Modules\Effects\AudioVisualizer\Utilities\SampleAggregator.cs" />
|
||||||
<Compile Include="Modules\Effects\Bubbles\Bubble.cs" />
|
<Compile Include="Modules\Effects\Bubbles\Bubble.cs" />
|
||||||
<Compile Include="Modules\Effects\Bubbles\Bubbles.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
<DependentUpon>Bubbles.settings</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Modules\Effects\Bubbles\BubblesSettings.cs" />
|
<Compile Include="Modules\Effects\Bubbles\BubblesSettings.cs" />
|
||||||
<Compile Include="Modules\Effects\Bubbles\BubblesModel.cs" />
|
<Compile Include="Modules\Effects\Bubbles\BubblesModel.cs" />
|
||||||
<Compile Include="Modules\Effects\Bubbles\BubblesView.xaml.cs">
|
<Compile Include="Modules\Effects\Bubbles\BubblesView.xaml.cs">
|
||||||
<DependentUpon>BubblesView.xaml</DependentUpon>
|
<DependentUpon>BubblesView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Modules\Effects\Bubbles\BubblesViewModel.cs" />
|
<Compile Include="Modules\Effects\Bubbles\BubblesViewModel.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\WindowsProfileSettings.cs" />
|
||||||
<Compile Include="Modules\Effects\WindowsProfile\WindowsProfileView.xaml.cs">
|
<Compile Include="Modules\Effects\WindowsProfile\WindowsProfileView.xaml.cs">
|
||||||
<DependentUpon>WindowsProfileView.xaml</DependentUpon>
|
<DependentUpon>WindowsProfileView.xaml</DependentUpon>
|
||||||
@ -391,37 +431,17 @@
|
|||||||
<Compile Include="Modules\Effects\WindowsProfile\WindowsProfileModel.cs" />
|
<Compile Include="Modules\Effects\WindowsProfile\WindowsProfileModel.cs" />
|
||||||
<Compile Include="Modules\Effects\ProfilePreview\ProfilePreviewModel.cs" />
|
<Compile Include="Modules\Effects\ProfilePreview\ProfilePreviewModel.cs" />
|
||||||
<Compile Include="Models\GameModel.cs" />
|
<Compile Include="Models\GameModel.cs" />
|
||||||
<Compile Include="Modules\Games\CounterStrike\CounterStrike.Designer.cs">
|
|
||||||
<DependentUpon>CounterStrike.settings</DependentUpon>
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Modules\Games\CounterStrike\CounterStrikeDataModel.cs" />
|
<Compile Include="Modules\Games\CounterStrike\CounterStrikeDataModel.cs" />
|
||||||
<Compile Include="Modules\Games\CounterStrike\CounterStrikeModel.cs" />
|
<Compile Include="Modules\Games\CounterStrike\CounterStrikeModel.cs" />
|
||||||
<Compile Include="Modules\Games\CounterStrike\CounterStrikeSettings.cs" />
|
<Compile Include="Modules\Games\CounterStrike\CounterStrikeSettings.cs" />
|
||||||
<Compile Include="Modules\Games\Dota2\Dota2.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
<DependentUpon>Dota2.settings</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Modules\Games\Dota2\Dota2DataModel.cs" />
|
<Compile Include="Modules\Games\Dota2\Dota2DataModel.cs" />
|
||||||
<Compile Include="Modules\Games\Dota2\Dota2Model.cs" />
|
<Compile Include="Modules\Games\Dota2\Dota2Model.cs" />
|
||||||
<Compile Include="Modules\Games\Dota2\Dota2Settings.cs" />
|
<Compile Include="Modules\Games\Dota2\Dota2Settings.cs" />
|
||||||
<Compile Include="Modules\Games\Overwatch\OverwatchView.xaml.cs">
|
<Compile Include="Modules\Games\Overwatch\OverwatchView.xaml.cs">
|
||||||
<DependentUpon>OverwatchView.xaml</DependentUpon>
|
<DependentUpon>OverwatchView.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Modules\Games\RocketLeague\RocketLeague.Designer.cs">
|
|
||||||
<DependentUpon>RocketLeague.settings</DependentUpon>
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Modules\Games\RocketLeague\RocketLeagueDataModel.cs" />
|
<Compile Include="Modules\Games\RocketLeague\RocketLeagueDataModel.cs" />
|
||||||
<Compile Include="Modules\Games\RocketLeague\RocketLeagueModel.cs" />
|
<Compile Include="Modules\Games\RocketLeague\RocketLeagueModel.cs" />
|
||||||
<Compile Include="Modules\Games\TheDivision\TheDivision.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
<DependentUpon>TheDivision.settings</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Modules\Games\TheDivision\TheDivisionDataModel.cs" />
|
<Compile Include="Modules\Games\TheDivision\TheDivisionDataModel.cs" />
|
||||||
<Compile Include="Modules\Games\TheDivision\TheDivisionModel.cs" />
|
<Compile Include="Modules\Games\TheDivision\TheDivisionModel.cs" />
|
||||||
<Compile Include="Modules\Games\TheDivision\TheDivisionSettings.cs" />
|
<Compile Include="Modules\Games\TheDivision\TheDivisionSettings.cs" />
|
||||||
@ -430,21 +450,11 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Modules\Games\TheDivision\TheDivisionViewModel.cs" />
|
<Compile Include="Modules\Games\TheDivision\TheDivisionViewModel.cs" />
|
||||||
<Compile Include="Modules\Games\Overwatch\OverwatchDataModel.cs" />
|
<Compile Include="Modules\Games\Overwatch\OverwatchDataModel.cs" />
|
||||||
<Compile Include="Modules\Games\Overwatch\Overwatch.Designer.cs">
|
|
||||||
<DependentUpon>Overwatch.settings</DependentUpon>
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Modules\Games\Overwatch\OverwatchModel.cs" />
|
<Compile Include="Modules\Games\Overwatch\OverwatchModel.cs" />
|
||||||
<Compile Include="Modules\Games\Overwatch\OverwatchSettings.cs" />
|
<Compile Include="Modules\Games\Overwatch\OverwatchSettings.cs" />
|
||||||
<Compile Include="Modules\Games\Overwatch\OverwatchViewModel.cs" />
|
<Compile Include="Modules\Games\Overwatch\OverwatchViewModel.cs" />
|
||||||
<Compile Include="Modules\Games\Witcher3\Witcher3DataModel.cs" />
|
<Compile Include="Modules\Games\Witcher3\Witcher3DataModel.cs" />
|
||||||
<Compile Include="Modules\Games\Witcher3\Witcher3Settings.cs" />
|
<Compile Include="Modules\Games\Witcher3\Witcher3Settings.cs" />
|
||||||
<Compile Include="Modules\Games\Witcher3\Witcher3.Designer.cs">
|
|
||||||
<AutoGen>True</AutoGen>
|
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
<DependentUpon>Witcher3.settings</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Modules\Games\Witcher3\Witcher3Model.cs" />
|
<Compile Include="Modules\Games\Witcher3\Witcher3Model.cs" />
|
||||||
<Compile Include="Models\OverlayModel.cs" />
|
<Compile Include="Models\OverlayModel.cs" />
|
||||||
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplay.cs" />
|
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplay.cs" />
|
||||||
@ -454,10 +464,8 @@
|
|||||||
<DependentUpon>VolumeDisplay.settings</DependentUpon>
|
<DependentUpon>VolumeDisplay.settings</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplayModel.cs" />
|
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplayModel.cs" />
|
||||||
<Compile Include="Modules\Effects\AudioVisualizer\AudioVisualizerSettings.cs" />
|
|
||||||
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplaySettings.cs" />
|
<Compile Include="Modules\Overlays\VolumeDisplay\VolumeDisplaySettings.cs" />
|
||||||
<Compile Include="Modules\Games\RocketLeague\RocketLeagueSettings.cs" />
|
<Compile Include="Modules\Games\RocketLeague\RocketLeagueSettings.cs" />
|
||||||
<Compile Include="InjectionModules\ArtemisModules.cs" />
|
|
||||||
<Compile Include="InjectionModules\BaseModules.cs" />
|
<Compile Include="InjectionModules\BaseModules.cs" />
|
||||||
<Compile Include="InjectionModules\ManagerModules.cs" />
|
<Compile Include="InjectionModules\ManagerModules.cs" />
|
||||||
<Compile Include="Profiles\Layers\Animations\GrowAnimation.cs" />
|
<Compile Include="Profiles\Layers\Animations\GrowAnimation.cs" />
|
||||||
@ -488,17 +496,12 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Services\DialogService.cs" />
|
<Compile Include="Services\DialogService.cs" />
|
||||||
<Compile Include="Services\MetroDialogService.cs" />
|
<Compile Include="Services\MetroDialogService.cs" />
|
||||||
<Compile Include="Settings\General.Designer.cs">
|
<Compile Include="Settings\EffectSettings.cs" />
|
||||||
<AutoGen>True</AutoGen>
|
<Compile Include="Settings\GameSettings.cs" />
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
|
||||||
<DependentUpon>General.settings</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Settings\GeneralSettings.cs" />
|
<Compile Include="Settings\GeneralSettings.cs" />
|
||||||
<Compile Include="Settings\Offsets.Designer.cs">
|
<Compile Include="Settings\IArtemisSettings.cs" />
|
||||||
<AutoGen>True</AutoGen>
|
<Compile Include="Settings\OffsetSettings.cs" />
|
||||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
<Compile Include="Settings\OverlaySettings.cs" />
|
||||||
<DependentUpon>Offsets.settings</DependentUpon>
|
|
||||||
</Compile>
|
|
||||||
<Compile Include="Styles\DropTargetAdorners\DropTargetMetroHighlightAdorner.cs" />
|
<Compile Include="Styles\DropTargetAdorners\DropTargetMetroHighlightAdorner.cs" />
|
||||||
<Compile Include="Styles\DropTargetAdorners\DropTargetMetroInsertionAdorner.cs" />
|
<Compile Include="Styles\DropTargetAdorners\DropTargetMetroInsertionAdorner.cs" />
|
||||||
<Compile Include="Utilities\ColorHelpers.cs" />
|
<Compile Include="Utilities\ColorHelpers.cs" />
|
||||||
@ -522,7 +525,6 @@
|
|||||||
<Compile Include="Utilities\Memory\Win32.cs" />
|
<Compile Include="Utilities\Memory\Win32.cs" />
|
||||||
<Compile Include="Utilities\ParentChild\ChildItemCollection.cs" />
|
<Compile Include="Utilities\ParentChild\ChildItemCollection.cs" />
|
||||||
<Compile Include="Utilities\ParentChild\IChildItem.cs" />
|
<Compile Include="Utilities\ParentChild\IChildItem.cs" />
|
||||||
<Compile Include="Utilities\ShellLink.cs" />
|
|
||||||
<Compile Include="Utilities\StickyValue.cs" />
|
<Compile Include="Utilities\StickyValue.cs" />
|
||||||
<Compile Include="Utilities\Updater.cs" />
|
<Compile Include="Utilities\Updater.cs" />
|
||||||
<Compile Include="ViewModels\Abstract\BaseViewModel.cs" />
|
<Compile Include="ViewModels\Abstract\BaseViewModel.cs" />
|
||||||
@ -630,14 +632,9 @@
|
|||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
<EmbeddedResource Include="Modules\Games\UnrealTournament\Resources\ut-plugin.zip" />
|
<EmbeddedResource Include="Modules\Games\UnrealTournament\Resources\ut-plugin.zip" />
|
||||||
<None Include="Modules\Games\UnrealTournament\UnrealTournament.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>UnrealTournament.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
<EmbeddedResource Include="Modules\Games\Witcher3\Resources\witcher3-mod.zip" />
|
<EmbeddedResource Include="Modules\Games\Witcher3\Resources\witcher3-mod.zip" />
|
||||||
<None Include="Modules\Games\WorldofWarcraft\WoW.settings">
|
<None Include="app.manifest">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<SubType>Designer</SubType>
|
||||||
<LastGenOutput>WoW.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
</None>
|
||||||
<None Include="NLog.xsd">
|
<None Include="NLog.xsd">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
@ -649,42 +646,6 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
<None Include="Modules\Effects\AudioVisualizer\AudioVisualization.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>AudioVisualization.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
<None Include="Modules\Effects\Bubbles\Bubbles.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>Bubbles.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>
|
|
||||||
</None>
|
|
||||||
<None Include="Modules\Games\Dota2\Dota2.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>Dota2.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
<None Include="Modules\Games\RocketLeague\RocketLeague.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>RocketLeague.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
<None Include="Modules\Games\TheDivision\TheDivision.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>TheDivision.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
<None Include="Modules\Games\Overwatch\Overwatch.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>Overwatch.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
<None Include="Modules\Games\Witcher3\Witcher3.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>Witcher3.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
<None Include="Modules\Overlays\VolumeDisplay\VolumeDisplay.settings">
|
<None Include="Modules\Overlays\VolumeDisplay\VolumeDisplay.settings">
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
<Generator>SettingsSingleFileGenerator</Generator>
|
||||||
<LastGenOutput>VolumeDisplay.Designer.cs</LastGenOutput>
|
<LastGenOutput>VolumeDisplay.Designer.cs</LastGenOutput>
|
||||||
@ -694,6 +655,8 @@
|
|||||||
</None>
|
</None>
|
||||||
<AppDesigner Include="Properties\" />
|
<AppDesigner Include="Properties\" />
|
||||||
<Resource Include="Resources\bow.png" />
|
<Resource Include="Resources\bow.png" />
|
||||||
|
<Content Include="lib\ColorBox.dll" />
|
||||||
|
<Content Include="lib\Ets2SdkClient.dll" />
|
||||||
<Content Include="logo.ico">
|
<Content Include="logo.ico">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
@ -718,14 +681,6 @@
|
|||||||
<Resource Include="Resources\Keyboards\blackwidow.png" />
|
<Resource Include="Resources\Keyboards\blackwidow.png" />
|
||||||
<None Include="Resources\Keyboards\none.png" />
|
<None Include="Resources\Keyboards\none.png" />
|
||||||
<None Include="Resources\Keyboards\demo-gif.gif" />
|
<None Include="Resources\Keyboards\demo-gif.gif" />
|
||||||
<None Include="Settings\Offsets.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>Offsets.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
<None Include="Settings\General.settings">
|
|
||||||
<Generator>SettingsSingleFileGenerator</Generator>
|
|
||||||
<LastGenOutput>General.Designer.cs</LastGenOutput>
|
|
||||||
</None>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="App.config">
|
<None Include="App.config">
|
||||||
@ -741,6 +696,10 @@
|
|||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="Modules\Games\EurotruckSimulator2\EurotruckSimulator2View.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Include="Modules\Games\Overwatch\OverwatchView.xaml">
|
<Page Include="Modules\Games\Overwatch\OverwatchView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Input;
|
||||||
|
using Artemis.DAL;
|
||||||
using Artemis.InjectionModules;
|
using Artemis.InjectionModules;
|
||||||
using Artemis.Settings;
|
using Artemis.Settings;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
@ -12,9 +12,6 @@ using Artemis.ViewModels;
|
|||||||
using Caliburn.Micro;
|
using Caliburn.Micro;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using Application = System.Windows.Application;
|
|
||||||
using MessageBox = System.Windows.Forms.MessageBox;
|
|
||||||
using MouseEventArgs = System.Windows.Input.MouseEventArgs;
|
|
||||||
|
|
||||||
namespace Artemis
|
namespace Artemis
|
||||||
{
|
{
|
||||||
@ -25,15 +22,12 @@ namespace Artemis
|
|||||||
public ArtemisBootstrapper()
|
public ArtemisBootstrapper()
|
||||||
{
|
{
|
||||||
// Start logging before anything else
|
// Start logging before anything else
|
||||||
Logging.SetupLogging(General.Default.LogLevel);
|
Logging.SetupLogging(SettingsProvider.Load<GeneralSettings>().LogLevel);
|
||||||
|
|
||||||
CheckDuplicateInstances();
|
|
||||||
Initialize();
|
Initialize();
|
||||||
BindSpecialValues();
|
BindSpecialValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Mutex Mutex { get; set; }
|
|
||||||
|
|
||||||
private void BindSpecialValues()
|
private void BindSpecialValues()
|
||||||
{
|
{
|
||||||
MessageBinder.SpecialValues.Add("$scaledmousex", ctx =>
|
MessageBinder.SpecialValues.Add("$scaledmousex", ctx =>
|
||||||
@ -43,14 +37,14 @@ namespace Artemis
|
|||||||
var e = ctx.EventArgs as MouseEventArgs;
|
var e = ctx.EventArgs as MouseEventArgs;
|
||||||
|
|
||||||
// If there is an image control, get the scaled position
|
// If there is an image control, get the scaled position
|
||||||
if (img != null && e != null)
|
if ((img != null) && (e != null))
|
||||||
{
|
{
|
||||||
var position = e.GetPosition(img);
|
var position = e.GetPosition(img);
|
||||||
return (int) (img.Source.Width*(position.X/img.ActualWidth));
|
return (int) (img.Source.Width*(position.X/img.ActualWidth));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is another type of of IInputControl get the non-scaled position - or do some processing to get a scaled position, whatever needs to happen
|
// If there is another type of of IInputControl get the non-scaled position - or do some processing to get a scaled position, whatever needs to happen
|
||||||
if (e != null && input != null)
|
if ((e != null) && (input != null))
|
||||||
return e.GetPosition(input).X;
|
return e.GetPosition(input).X;
|
||||||
|
|
||||||
// Return 0 if no processing could be done
|
// Return 0 if no processing could be done
|
||||||
@ -63,14 +57,14 @@ namespace Artemis
|
|||||||
var e = ctx.EventArgs as MouseEventArgs;
|
var e = ctx.EventArgs as MouseEventArgs;
|
||||||
|
|
||||||
// If there is an image control, get the scaled position
|
// If there is an image control, get the scaled position
|
||||||
if (img != null && e != null)
|
if ((img != null) && (e != null))
|
||||||
{
|
{
|
||||||
var position = e.GetPosition(img);
|
var position = e.GetPosition(img);
|
||||||
return (int) (img.Source.Width*(position.Y/img.ActualWidth));
|
return (int) (img.Source.Width*(position.Y/img.ActualWidth));
|
||||||
}
|
}
|
||||||
|
|
||||||
// If there is another type of of IInputControl get the non-scaled position - or do some processing to get a scaled position, whatever needs to happen
|
// If there is another type of of IInputControl get the non-scaled position - or do some processing to get a scaled position, whatever needs to happen
|
||||||
if (e != null && input != null)
|
if ((e != null) && (input != null))
|
||||||
return e.GetPosition(input).Y;
|
return e.GetPosition(input).Y;
|
||||||
|
|
||||||
// Return 0 if no processing could be done
|
// Return 0 if no processing could be done
|
||||||
@ -80,7 +74,9 @@ namespace Artemis
|
|||||||
|
|
||||||
protected override void Configure()
|
protected override void Configure()
|
||||||
{
|
{
|
||||||
_kernel = new StandardKernel(new BaseModules(), new ArtemisModules(), new ManagerModules());
|
_kernel = new StandardKernel(new BaseModules(), new ManagerModules(), new DeviceModules(),
|
||||||
|
new EffectModules(), new ProfileModules());
|
||||||
|
|
||||||
_kernel.Bind<IWindowManager>().To<WindowManager>().InSingletonScope();
|
_kernel.Bind<IWindowManager>().To<WindowManager>().InSingletonScope();
|
||||||
_kernel.Bind<IEventAggregator>().To<EventAggregator>().InSingletonScope();
|
_kernel.Bind<IEventAggregator>().To<EventAggregator>().InSingletonScope();
|
||||||
|
|
||||||
@ -95,7 +91,6 @@ namespace Artemis
|
|||||||
protected override void OnExit(object sender, EventArgs e)
|
protected override void OnExit(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
_kernel.Dispose();
|
_kernel.Dispose();
|
||||||
// Enviroment.Exit(0);
|
|
||||||
base.OnExit(sender, e);
|
base.OnExit(sender, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,17 +116,5 @@ namespace Artemis
|
|||||||
{
|
{
|
||||||
DisplayRootViewFor<SystemTrayViewModel>();
|
DisplayRootViewFor<SystemTrayViewModel>();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CheckDuplicateInstances()
|
|
||||||
{
|
|
||||||
bool aIsNewInstance;
|
|
||||||
Mutex = new Mutex(true, "ArtemisMutex", out aIsNewInstance);
|
|
||||||
if (aIsNewInstance)
|
|
||||||
return;
|
|
||||||
|
|
||||||
MessageBox.Show("An instance of Artemis is already running (check your system tray).",
|
|
||||||
"Artemis (╯°□°)╯︵ ┻━┻", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
|
||||||
Application.Current.Shutdown();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
105
Artemis/Artemis/DAL/SettingsProvider.cs
Normal file
105
Artemis/Artemis/DAL/SettingsProvider.cs
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using Artemis.Settings;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using NLog;
|
||||||
|
|
||||||
|
namespace Artemis.DAL
|
||||||
|
{
|
||||||
|
public static class SettingsProvider
|
||||||
|
{
|
||||||
|
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||||
|
|
||||||
|
private static readonly string SettingsFolder =
|
||||||
|
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis\settings";
|
||||||
|
|
||||||
|
private static readonly List<IArtemisSettings> Settings = new List<IArtemisSettings>();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Loads settings with the given name from the filesystem
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public static T Load<T>() where T : new()
|
||||||
|
{
|
||||||
|
if (!AreSettings(typeof(T)))
|
||||||
|
throw new ArgumentException("Type doesn't implement IArtemisSettings");
|
||||||
|
|
||||||
|
// Attempt to load from memory first
|
||||||
|
var inMemory = Settings.FirstOrDefault(s => s.GetType() == typeof(T));
|
||||||
|
if (inMemory != null)
|
||||||
|
return (T) inMemory;
|
||||||
|
|
||||||
|
CheckSettings();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var loadSettings = (IArtemisSettings) JsonConvert
|
||||||
|
.DeserializeObject<T>(File.ReadAllText(SettingsFolder + $@"\{typeof(T)}.json"));
|
||||||
|
|
||||||
|
if (loadSettings == null)
|
||||||
|
{
|
||||||
|
loadSettings = (IArtemisSettings) new T();
|
||||||
|
loadSettings.Reset(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
Settings.Add(loadSettings);
|
||||||
|
return (T) loadSettings;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Error(e, "Couldn't load settings '{0}.json'", typeof(T));
|
||||||
|
|
||||||
|
// Not sure about this, I've seen prettier code
|
||||||
|
var loadSettings = (IArtemisSettings) new T();
|
||||||
|
loadSettings.Reset(true);
|
||||||
|
Settings.Add(loadSettings);
|
||||||
|
return (T) loadSettings;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Saves the settings object to the filesystem
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="artemisSettings"></param>
|
||||||
|
public static void Save(IArtemisSettings artemisSettings)
|
||||||
|
{
|
||||||
|
CheckSettings();
|
||||||
|
|
||||||
|
string json;
|
||||||
|
// Should saving fail for whatever reason, catch the exception and log it
|
||||||
|
// But DON'T touch the settings file.
|
||||||
|
try
|
||||||
|
{
|
||||||
|
json = JsonConvert.SerializeObject(artemisSettings, Formatting.Indented);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Error(e, "Couldn't save settings '{0}.json'", artemisSettings.GetType());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
File.WriteAllText(SettingsFolder + $@"\{artemisSettings.GetType()}.json", json);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Ensures the settings folder exists
|
||||||
|
/// </summary>
|
||||||
|
private static void CheckSettings()
|
||||||
|
{
|
||||||
|
if (!Directory.Exists(SettingsFolder))
|
||||||
|
Directory.CreateDirectory(SettingsFolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Checks to see if the given type is a setting
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="t"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
private static bool AreSettings(Type t)
|
||||||
|
{
|
||||||
|
return typeof(IArtemisSettings).IsAssignableFrom(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -78,11 +78,6 @@ namespace Artemis.DeviceProviders.Corsair
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Height = 7;
|
|
||||||
// Width = 18;
|
|
||||||
// Slug = "corsair-k65-rgb";
|
|
||||||
// PreviewSettings = new PreviewSettings(610, 240, new Thickness(0, -30, 0, 0), Resources.k65);
|
|
||||||
|
|
||||||
Logger.Debug("Corsair SDK reported device as: {0}", _keyboard.DeviceInfo.Model);
|
Logger.Debug("Corsair SDK reported device as: {0}", _keyboard.DeviceInfo.Model);
|
||||||
_keyboard.Brush = _keyboardBrush ?? (_keyboardBrush = new ImageBrush());
|
_keyboard.Brush = _keyboardBrush ?? (_keyboardBrush = new ImageBrush());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using Artemis.DeviceProviders.Logitech.Utilities;
|
using Artemis.DeviceProviders.Logitech.Utilities;
|
||||||
using Artemis.Utilities;
|
|
||||||
using Artemis.Utilities.DataReaders;
|
using Artemis.Utilities.DataReaders;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
|
||||||
@ -12,7 +11,7 @@ namespace Artemis.DeviceProviders.Logitech
|
|||||||
{
|
{
|
||||||
public override bool CanEnable()
|
public override bool CanEnable()
|
||||||
{
|
{
|
||||||
//Check to see if VC++ 2012 x64 is installed.
|
// Check to see if VC++ 2012 x64 is installed.
|
||||||
if (Registry.LocalMachine.OpenSubKey(
|
if (Registry.LocalMachine.OpenSubKey(
|
||||||
@"SOFTWARE\Classes\Installer\Dependencies\{ca67548a-5ebe-413a-b50c-4b9ceb6d66c6}") == null)
|
@"SOFTWARE\Classes\Installer\Dependencies\{ca67548a-5ebe-413a-b50c-4b9ceb6d66c6}") == null)
|
||||||
{
|
{
|
||||||
@ -49,10 +48,7 @@ namespace Artemis.DeviceProviders.Logitech
|
|||||||
"Artemis couldn't enable your Logitech keyboard, because the required files are not in place.\n\n" +
|
"Artemis couldn't enable your Logitech keyboard, because the required files are not in place.\n\n" +
|
||||||
"This happens when you run The Division and shut down Artemis before shutting down The Division\n" +
|
"This happens when you run The Division and shut down Artemis before shutting down The Division\n" +
|
||||||
"It can be fixed automatically by clicking OK, but to avoid this message in the future please\n" +
|
"It can be fixed automatically by clicking OK, but to avoid this message in the future please\n" +
|
||||||
"shut down The Division before shutting down Artemis.\n\n" +
|
"shut down The Division before shutting down Artemis.");
|
||||||
"Click OK to fix the issue and restart Artemis");
|
|
||||||
|
|
||||||
GeneralHelpers.RunAsAdministrator();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Enable()
|
public override void Enable()
|
||||||
|
|||||||
@ -1,12 +0,0 @@
|
|||||||
namespace Artemis.Events
|
|
||||||
{
|
|
||||||
public class ActiveEffectChanged
|
|
||||||
{
|
|
||||||
public ActiveEffectChanged(string activeEffect)
|
|
||||||
{
|
|
||||||
ActiveEffect = activeEffect;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string ActiveEffect { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
using Artemis.DeviceProviders;
|
|
||||||
|
|
||||||
namespace Artemis.Events
|
|
||||||
{
|
|
||||||
public class ActiveKeyboardChanged
|
|
||||||
{
|
|
||||||
public ActiveKeyboardChanged(KeyboardProvider oldKeyboard, KeyboardProvider newKeyboard)
|
|
||||||
{
|
|
||||||
OldKeyboard = oldKeyboard;
|
|
||||||
NewKeyboard = newKeyboard;
|
|
||||||
}
|
|
||||||
|
|
||||||
public KeyboardProvider OldKeyboard { get; set; }
|
|
||||||
public KeyboardProvider NewKeyboard { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
15
Artemis/Artemis/Events/EffectChangedEventArgs.cs
Normal file
15
Artemis/Artemis/Events/EffectChangedEventArgs.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using Artemis.Models;
|
||||||
|
|
||||||
|
namespace Artemis.Events
|
||||||
|
{
|
||||||
|
public class EffectChangedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public EffectChangedEventArgs(EffectModel effect)
|
||||||
|
{
|
||||||
|
Effect = effect;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EffectModel Effect { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
14
Artemis/Artemis/Events/EnabledChangedEventArgs.cs
Normal file
14
Artemis/Artemis/Events/EnabledChangedEventArgs.cs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Artemis.Events
|
||||||
|
{
|
||||||
|
public class EnabledChangedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public EnabledChangedEventArgs(bool enabled)
|
||||||
|
{
|
||||||
|
Enabled = enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Enabled { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
17
Artemis/Artemis/Events/KeyboardChangedEventArgs.cs
Normal file
17
Artemis/Artemis/Events/KeyboardChangedEventArgs.cs
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using Artemis.DeviceProviders;
|
||||||
|
|
||||||
|
namespace Artemis.Events
|
||||||
|
{
|
||||||
|
public class KeyboardChangedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public KeyboardChangedEventArgs(KeyboardProvider oldKeyboard, KeyboardProvider newKeyboard)
|
||||||
|
{
|
||||||
|
OldKeyboard = oldKeyboard;
|
||||||
|
NewKeyboard = newKeyboard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public KeyboardProvider OldKeyboard { get; }
|
||||||
|
public KeyboardProvider NewKeyboard { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
15
Artemis/Artemis/Events/RazerColorsChangedEventArgs.cs
Normal file
15
Artemis/Artemis/Events/RazerColorsChangedEventArgs.cs
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
using System;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace Artemis.Events
|
||||||
|
{
|
||||||
|
public class RazerColorsChangedEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public RazerColorsChangedEventArgs(Color[,] colors)
|
||||||
|
{
|
||||||
|
Colors = colors;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Color[,] Colors { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,12 +0,0 @@
|
|||||||
namespace Artemis.Events
|
|
||||||
{
|
|
||||||
public class ToggleEnabled
|
|
||||||
{
|
|
||||||
public ToggleEnabled(bool enabled)
|
|
||||||
{
|
|
||||||
Enabled = enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool Enabled { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,13 +1,11 @@
|
|||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.ViewModels.Profiles;
|
using Artemis.ViewModels.Profiles;
|
||||||
using Caliburn.Micro;
|
|
||||||
|
|
||||||
namespace Artemis.InjectionFactories
|
namespace Artemis.InjectionFactories
|
||||||
{
|
{
|
||||||
public interface IProfileEditorVmFactory
|
public interface IProfileEditorVmFactory
|
||||||
{
|
{
|
||||||
ProfileEditorViewModel CreateProfileEditorVm(IEventAggregator events, MainManager mainManager,
|
ProfileEditorViewModel CreateProfileEditorVm(MainManager mainManager, EffectModel gameModel, string lastProfile);
|
||||||
EffectModel gameModel, string lastProfile);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,105 +0,0 @@
|
|||||||
using Artemis.DeviceProviders;
|
|
||||||
using Artemis.DeviceProviders.Corsair;
|
|
||||||
using Artemis.DeviceProviders.Logitech;
|
|
||||||
using Artemis.DeviceProviders.Razer;
|
|
||||||
using Artemis.Modules.Effects.AudioVisualizer;
|
|
||||||
using Artemis.Modules.Effects.Bubbles;
|
|
||||||
using Artemis.Modules.Effects.WindowsProfile;
|
|
||||||
using Artemis.Modules.Games.CounterStrike;
|
|
||||||
using Artemis.Modules.Games.Dota2;
|
|
||||||
using Artemis.Modules.Games.Overwatch;
|
|
||||||
using Artemis.Modules.Games.RocketLeague;
|
|
||||||
using Artemis.Modules.Games.TheDivision;
|
|
||||||
using Artemis.Modules.Games.UnrealTournament;
|
|
||||||
using Artemis.Modules.Games.Witcher3;
|
|
||||||
using Artemis.Modules.Overlays.VolumeDisplay;
|
|
||||||
using Artemis.Profiles.Layers.Animations;
|
|
||||||
using Artemis.Profiles.Layers.Conditions;
|
|
||||||
using Artemis.Profiles.Layers.Interfaces;
|
|
||||||
using Artemis.Profiles.Layers.Types.Audio;
|
|
||||||
using Artemis.Profiles.Layers.Types.Folder;
|
|
||||||
using Artemis.Profiles.Layers.Types.Generic;
|
|
||||||
using Artemis.Profiles.Layers.Types.Headset;
|
|
||||||
using Artemis.Profiles.Layers.Types.Keyboard;
|
|
||||||
using Artemis.Profiles.Layers.Types.KeyboardGif;
|
|
||||||
using Artemis.Profiles.Layers.Types.KeyPress;
|
|
||||||
using Artemis.Profiles.Layers.Types.Mouse;
|
|
||||||
using Artemis.ViewModels.Abstract;
|
|
||||||
using Ninject.Modules;
|
|
||||||
|
|
||||||
namespace Artemis.InjectionModules
|
|
||||||
{
|
|
||||||
public class ArtemisModules : NinjectModule
|
|
||||||
{
|
|
||||||
public override void Load()
|
|
||||||
{
|
|
||||||
#region Modules
|
|
||||||
|
|
||||||
// Effects
|
|
||||||
Bind<EffectViewModel>().To<AudioVisualizerViewModel>().InSingletonScope();
|
|
||||||
Bind<EffectViewModel>().To<BubblesViewModel>().InSingletonScope();
|
|
||||||
Bind<EffectViewModel>().To<WindowsProfileViewModel>().InSingletonScope();
|
|
||||||
|
|
||||||
// Games
|
|
||||||
Bind<GameViewModel>().To<CounterStrikeViewModel>().InSingletonScope();
|
|
||||||
Bind<GameViewModel>().To<Dota2ViewModel>().InSingletonScope();
|
|
||||||
Bind<GameViewModel>().To<RocketLeagueViewModel>().InSingletonScope();
|
|
||||||
Bind<GameViewModel>().To<TheDivisionViewModel>().InSingletonScope();
|
|
||||||
Bind<GameViewModel>().To<Witcher3ViewModel>().InSingletonScope();
|
|
||||||
Bind<GameViewModel>().To<OverwatchViewModel>().InSingletonScope();
|
|
||||||
Bind<GameViewModel>().To<UnrealTournamentViewModel>().InSingletonScope();
|
|
||||||
|
|
||||||
// Overlays
|
|
||||||
Bind<OverlayViewModel>().To<VolumeDisplayViewModel>().InSingletonScope();
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Devices
|
|
||||||
|
|
||||||
// Keyboards
|
|
||||||
Bind<DeviceProvider>().To<CorsairKeyboards>().InSingletonScope();
|
|
||||||
Bind<DeviceProvider>().To<G910>().InSingletonScope();
|
|
||||||
Bind<DeviceProvider>().To<G810>().InSingletonScope();
|
|
||||||
Bind<DeviceProvider>().To<BlackWidow>().InSingletonScope();
|
|
||||||
// Mice
|
|
||||||
Bind<DeviceProvider>().To<CorsairMice>().InSingletonScope();
|
|
||||||
// Headsets
|
|
||||||
Bind<DeviceProvider>().To<CorsairHeadsets>().InSingletonScope();
|
|
||||||
// Other
|
|
||||||
Bind<DeviceProvider>().To<LogitechGeneric>().InSingletonScope();
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Layers
|
|
||||||
|
|
||||||
// Animations
|
|
||||||
Bind<ILayerAnimation>().To<NoneAnimation>();
|
|
||||||
Bind<ILayerAnimation>().To<GrowAnimation>();
|
|
||||||
Bind<ILayerAnimation>().To<PulseAnimation>();
|
|
||||||
Bind<ILayerAnimation>().To<SlideDownAnimation>();
|
|
||||||
Bind<ILayerAnimation>().To<SlideLeftAnimation>();
|
|
||||||
Bind<ILayerAnimation>().To<SlideRightAnimation>();
|
|
||||||
Bind<ILayerAnimation>().To<SlideUpAnimation>();
|
|
||||||
|
|
||||||
// Conditions
|
|
||||||
Bind<ILayerCondition>().To<DataModelCondition>();
|
|
||||||
Bind<ILayerCondition>().To<EventCondition>();
|
|
||||||
|
|
||||||
// Types
|
|
||||||
Bind<ILayerType>().To<FolderType>();
|
|
||||||
Bind<ILayerType>().To<HeadsetType>();
|
|
||||||
Bind<ILayerType>().To<KeyboardType>();
|
|
||||||
Bind<ILayerType>().To<KeyboardGifType>();
|
|
||||||
Bind<ILayerType>().To<MouseType>();
|
|
||||||
Bind<ILayerType>().To<GenericType>();
|
|
||||||
Bind<ILayerType>().To<KeyPressType>();
|
|
||||||
Bind<ILayerType>().To<AudioType>();
|
|
||||||
|
|
||||||
// Bind some Layer Types to self as well in order to allow JSON.NET injection
|
|
||||||
Bind<KeyPressType>().ToSelf();
|
|
||||||
Bind<AudioType>().ToSelf();
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
29
Artemis/Artemis/InjectionModules/DeviceModules.cs
Normal file
29
Artemis/Artemis/InjectionModules/DeviceModules.cs
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
using Artemis.DeviceProviders;
|
||||||
|
using Artemis.DeviceProviders.Corsair;
|
||||||
|
using Artemis.DeviceProviders.Logitech;
|
||||||
|
using Artemis.DeviceProviders.Razer;
|
||||||
|
using Ninject.Modules;
|
||||||
|
|
||||||
|
namespace Artemis.InjectionModules
|
||||||
|
{
|
||||||
|
public class DeviceModules : NinjectModule
|
||||||
|
{
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
// Keyboards
|
||||||
|
Bind<DeviceProvider>().To<CorsairKeyboards>().InSingletonScope();
|
||||||
|
Bind<DeviceProvider>().To<G910>().InSingletonScope();
|
||||||
|
Bind<DeviceProvider>().To<G810>().InSingletonScope();
|
||||||
|
Bind<DeviceProvider>().To<BlackWidow>().InSingletonScope();
|
||||||
|
|
||||||
|
// Mice
|
||||||
|
Bind<DeviceProvider>().To<CorsairMice>().InSingletonScope();
|
||||||
|
|
||||||
|
// Headsets
|
||||||
|
Bind<DeviceProvider>().To<CorsairHeadsets>().InSingletonScope();
|
||||||
|
|
||||||
|
// Other
|
||||||
|
Bind<DeviceProvider>().To<LogitechGeneric>().InSingletonScope();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
70
Artemis/Artemis/InjectionModules/EffectModules.cs
Normal file
70
Artemis/Artemis/InjectionModules/EffectModules.cs
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
using Artemis.Models;
|
||||||
|
using Artemis.ViewModels.Abstract;
|
||||||
|
using Ninject.Extensions.Conventions;
|
||||||
|
using Ninject.Modules;
|
||||||
|
|
||||||
|
namespace Artemis.InjectionModules
|
||||||
|
{
|
||||||
|
public class EffectModules : NinjectModule
|
||||||
|
{
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
// Effects
|
||||||
|
Kernel.Bind(x =>
|
||||||
|
{
|
||||||
|
x.FromThisAssembly()
|
||||||
|
.SelectAllClasses()
|
||||||
|
.InheritedFrom<EffectModel>()
|
||||||
|
.BindBase()
|
||||||
|
.Configure(b => b.InSingletonScope());
|
||||||
|
});
|
||||||
|
|
||||||
|
Kernel.Bind(x =>
|
||||||
|
{
|
||||||
|
x.FromThisAssembly()
|
||||||
|
.SelectAllClasses()
|
||||||
|
.InheritedFrom<EffectViewModel>()
|
||||||
|
.BindBase()
|
||||||
|
.Configure(b => b.InSingletonScope());
|
||||||
|
});
|
||||||
|
|
||||||
|
// Games
|
||||||
|
Kernel.Bind(x =>
|
||||||
|
{
|
||||||
|
x.FromThisAssembly()
|
||||||
|
.SelectAllClasses()
|
||||||
|
.InheritedFrom<GameModel>()
|
||||||
|
.BindBase()
|
||||||
|
.Configure(b => b.InSingletonScope());
|
||||||
|
});
|
||||||
|
|
||||||
|
Kernel.Bind(x =>
|
||||||
|
{
|
||||||
|
x.FromThisAssembly()
|
||||||
|
.SelectAllClasses()
|
||||||
|
.InheritedFrom<GameViewModel>()
|
||||||
|
.BindBase()
|
||||||
|
.Configure(b => b.InSingletonScope());
|
||||||
|
});
|
||||||
|
|
||||||
|
// Overlays
|
||||||
|
Kernel.Bind(x =>
|
||||||
|
{
|
||||||
|
x.FromThisAssembly()
|
||||||
|
.SelectAllClasses()
|
||||||
|
.InheritedFrom<OverlayModel>()
|
||||||
|
.BindBase()
|
||||||
|
.Configure(b => b.InSingletonScope());
|
||||||
|
});
|
||||||
|
|
||||||
|
Kernel.Bind(x =>
|
||||||
|
{
|
||||||
|
x.FromThisAssembly()
|
||||||
|
.SelectAllClasses()
|
||||||
|
.InheritedFrom<OverlayViewModel>()
|
||||||
|
.BindBase()
|
||||||
|
.Configure(b => b.InSingletonScope());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
48
Artemis/Artemis/InjectionModules/ProfileModules.cs
Normal file
48
Artemis/Artemis/InjectionModules/ProfileModules.cs
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
using Artemis.Profiles.Layers.Animations;
|
||||||
|
using Artemis.Profiles.Layers.Conditions;
|
||||||
|
using Artemis.Profiles.Layers.Interfaces;
|
||||||
|
using Artemis.Profiles.Layers.Types.Audio;
|
||||||
|
using Artemis.Profiles.Layers.Types.Folder;
|
||||||
|
using Artemis.Profiles.Layers.Types.Generic;
|
||||||
|
using Artemis.Profiles.Layers.Types.Headset;
|
||||||
|
using Artemis.Profiles.Layers.Types.Keyboard;
|
||||||
|
using Artemis.Profiles.Layers.Types.KeyboardGif;
|
||||||
|
using Artemis.Profiles.Layers.Types.KeyPress;
|
||||||
|
using Artemis.Profiles.Layers.Types.Mouse;
|
||||||
|
using Ninject.Modules;
|
||||||
|
|
||||||
|
namespace Artemis.InjectionModules
|
||||||
|
{
|
||||||
|
public class ProfileModules : NinjectModule
|
||||||
|
{
|
||||||
|
public override void Load()
|
||||||
|
{
|
||||||
|
// Animations
|
||||||
|
Bind<ILayerAnimation>().To<NoneAnimation>();
|
||||||
|
Bind<ILayerAnimation>().To<GrowAnimation>();
|
||||||
|
Bind<ILayerAnimation>().To<PulseAnimation>();
|
||||||
|
Bind<ILayerAnimation>().To<SlideDownAnimation>();
|
||||||
|
Bind<ILayerAnimation>().To<SlideLeftAnimation>();
|
||||||
|
Bind<ILayerAnimation>().To<SlideRightAnimation>();
|
||||||
|
Bind<ILayerAnimation>().To<SlideUpAnimation>();
|
||||||
|
|
||||||
|
// Conditions
|
||||||
|
Bind<ILayerCondition>().To<DataModelCondition>();
|
||||||
|
Bind<ILayerCondition>().To<EventCondition>();
|
||||||
|
|
||||||
|
// Types
|
||||||
|
Bind<ILayerType>().To<FolderType>();
|
||||||
|
Bind<ILayerType>().To<HeadsetType>();
|
||||||
|
Bind<ILayerType>().To<KeyboardType>();
|
||||||
|
Bind<ILayerType>().To<KeyboardGifType>();
|
||||||
|
Bind<ILayerType>().To<MouseType>();
|
||||||
|
Bind<ILayerType>().To<GenericType>();
|
||||||
|
Bind<ILayerType>().To<KeyPressType>();
|
||||||
|
Bind<ILayerType>().To<AudioType>();
|
||||||
|
|
||||||
|
// Bind some Layer Types to self as well in order to allow JSON.NET injection
|
||||||
|
Bind<KeyPressType>().ToSelf();
|
||||||
|
Bind<AudioType>().ToSelf();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,12 +0,0 @@
|
|||||||
<Window x:Class="Artemis.MainWindow"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
||||||
xmlns:local="clr-namespace:Artemis"
|
|
||||||
mc:Ignorable="d"
|
|
||||||
Title="MainWindow" Height="350" Width="525">
|
|
||||||
<Grid>
|
|
||||||
|
|
||||||
</Grid>
|
|
||||||
</Window>
|
|
||||||
@ -1,28 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows.Documents;
|
|
||||||
using System.Windows.Input;
|
|
||||||
using System.Windows.Media;
|
|
||||||
using System.Windows.Media.Imaging;
|
|
||||||
using System.Windows.Navigation;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
|
|
||||||
namespace Artemis
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Interaction logic for MainWindow.xaml
|
|
||||||
/// </summary>
|
|
||||||
public partial class MainWindow : Window
|
|
||||||
{
|
|
||||||
public MainWindow()
|
|
||||||
{
|
|
||||||
InitializeComponent();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -2,11 +2,11 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Artemis.DAL;
|
||||||
using Artemis.DeviceProviders;
|
using Artemis.DeviceProviders;
|
||||||
using Artemis.Events;
|
using Artemis.Events;
|
||||||
using Artemis.Services;
|
using Artemis.Services;
|
||||||
using Artemis.Settings;
|
using Artemis.Settings;
|
||||||
using Caliburn.Micro;
|
|
||||||
using MahApps.Metro.Controls.Dialogs;
|
using MahApps.Metro.Controls.Dialogs;
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using Ninject.Extensions.Logging;
|
using Ninject.Extensions.Logging;
|
||||||
@ -18,13 +18,13 @@ namespace Artemis.Managers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class DeviceManager
|
public class DeviceManager
|
||||||
{
|
{
|
||||||
private readonly IEventAggregator _events;
|
private readonly GeneralSettings _generalSettings;
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
|
|
||||||
public DeviceManager(IEventAggregator events, ILogger logger, List<DeviceProvider> deviceProviders)
|
public DeviceManager(ILogger logger, List<DeviceProvider> deviceProviders)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_events = events;
|
_generalSettings = SettingsProvider.Load<GeneralSettings>();
|
||||||
|
|
||||||
KeyboardProviders = deviceProviders.Where(d => d.Type == DeviceType.Keyboard)
|
KeyboardProviders = deviceProviders.Where(d => d.Type == DeviceType.Keyboard)
|
||||||
.Cast<KeyboardProvider>().ToList();
|
.Cast<KeyboardProvider>().ToList();
|
||||||
@ -47,17 +47,18 @@ namespace Artemis.Managers
|
|||||||
public KeyboardProvider ActiveKeyboard { get; set; }
|
public KeyboardProvider ActiveKeyboard { get; set; }
|
||||||
|
|
||||||
public bool ChangingKeyboard { get; private set; }
|
public bool ChangingKeyboard { get; private set; }
|
||||||
|
public event EventHandler<KeyboardChangedEventArgs> OnKeyboardChangedEvent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Enables the last keyboard according to the settings file
|
/// Enables the last keyboard according to the settings file
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void EnableLastKeyboard()
|
public void EnableLastKeyboard()
|
||||||
{
|
{
|
||||||
_logger.Debug("Getting last keyboard: {0}", General.Default.LastKeyboard);
|
_logger.Debug("Getting last keyboard: {0}", _generalSettings.LastKeyboard);
|
||||||
if (string.IsNullOrEmpty(General.Default.LastKeyboard))
|
if (string.IsNullOrEmpty(_generalSettings.LastKeyboard))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var keyboard = KeyboardProviders.FirstOrDefault(k => k.Name == General.Default.LastKeyboard);
|
var keyboard = KeyboardProviders.FirstOrDefault(k => k.Name == _generalSettings.LastKeyboard);
|
||||||
EnableKeyboard(keyboard);
|
EnableKeyboard(keyboard);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +71,7 @@ namespace Artemis.Managers
|
|||||||
if (keyboardProvider == null)
|
if (keyboardProvider == null)
|
||||||
throw new ArgumentNullException(nameof(keyboardProvider));
|
throw new ArgumentNullException(nameof(keyboardProvider));
|
||||||
|
|
||||||
if (ChangingKeyboard || ActiveKeyboard?.Name == keyboardProvider.Name)
|
if (ChangingKeyboard || (ActiveKeyboard?.Name == keyboardProvider.Name))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_logger.Debug("Trying to enable keyboard: {0}", keyboardProvider.Name);
|
_logger.Debug("Trying to enable keyboard: {0}", keyboardProvider.Name);
|
||||||
@ -102,8 +103,8 @@ namespace Artemis.Managers
|
|||||||
|
|
||||||
DialogService.ShowErrorMessageBox(keyboardProvider.CantEnableText);
|
DialogService.ShowErrorMessageBox(keyboardProvider.CantEnableText);
|
||||||
ActiveKeyboard = null;
|
ActiveKeyboard = null;
|
||||||
General.Default.LastKeyboard = null;
|
_generalSettings.LastKeyboard = null;
|
||||||
General.Default.Save();
|
_generalSettings.Save();
|
||||||
_logger.Warn("Failed enabling keyboard: {0}", keyboardProvider.Name);
|
_logger.Warn("Failed enabling keyboard: {0}", keyboardProvider.Name);
|
||||||
ChangingKeyboard = false;
|
ChangingKeyboard = false;
|
||||||
return;
|
return;
|
||||||
@ -116,10 +117,10 @@ namespace Artemis.Managers
|
|||||||
await ActiveKeyboard.EnableAsync(dialog);
|
await ActiveKeyboard.EnableAsync(dialog);
|
||||||
EnableUsableDevices();
|
EnableUsableDevices();
|
||||||
|
|
||||||
General.Default.LastKeyboard = ActiveKeyboard.Name;
|
_generalSettings.LastKeyboard = ActiveKeyboard.Name;
|
||||||
General.Default.Save();
|
_generalSettings.Save();
|
||||||
|
|
||||||
await _events.PublishOnUIThreadAsync(new ActiveKeyboardChanged(oldKeyboard, ActiveKeyboard));
|
RaiseKeyboardChangedEvent(new KeyboardChangedEventArgs(oldKeyboard, ActiveKeyboard));
|
||||||
_logger.Debug("Enabled keyboard: {0}", keyboardProvider.Name);
|
_logger.Debug("Enabled keyboard: {0}", keyboardProvider.Name);
|
||||||
|
|
||||||
if (dialog != null)
|
if (dialog != null)
|
||||||
@ -158,13 +159,21 @@ namespace Artemis.Managers
|
|||||||
|
|
||||||
if (save)
|
if (save)
|
||||||
{
|
{
|
||||||
General.Default.LastKeyboard = null;
|
_generalSettings.LastKeyboard = null;
|
||||||
General.Default.Save();
|
_generalSettings.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
_events.PublishOnUIThread(new ActiveKeyboardChanged(oldKeyboard, null));
|
RaiseKeyboardChangedEvent(new KeyboardChangedEventArgs(oldKeyboard, null));
|
||||||
_logger.Debug("Released keyboard: {0}", releaseName);
|
_logger.Debug("Released keyboard: {0}", releaseName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual void RaiseKeyboardChangedEvent(KeyboardChangedEventArgs e)
|
||||||
|
{
|
||||||
|
// I do this in all to avoid a possible race condition
|
||||||
|
// https://msdn.microsoft.com/en-us/library/w369ty8x.aspx
|
||||||
|
var handler = OnKeyboardChangedEvent;
|
||||||
|
handler?.Invoke(this, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5,7 +5,6 @@ using Artemis.Events;
|
|||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Modules.Effects.ProfilePreview;
|
using Artemis.Modules.Effects.ProfilePreview;
|
||||||
using Artemis.Settings;
|
using Artemis.Settings;
|
||||||
using Caliburn.Micro;
|
|
||||||
using Ninject.Extensions.Logging;
|
using Ninject.Extensions.Logging;
|
||||||
|
|
||||||
namespace Artemis.Managers
|
namespace Artemis.Managers
|
||||||
@ -16,18 +15,20 @@ namespace Artemis.Managers
|
|||||||
public class EffectManager
|
public class EffectManager
|
||||||
{
|
{
|
||||||
private readonly DeviceManager _deviceManager;
|
private readonly DeviceManager _deviceManager;
|
||||||
private readonly IEventAggregator _events;
|
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private EffectModel _activeEffect;
|
private EffectModel _activeEffect;
|
||||||
|
private LoopManager _waitLoopManager;
|
||||||
|
private EffectModel _waitEffect;
|
||||||
|
private readonly GeneralSettings _generalSettings;
|
||||||
|
|
||||||
public EffectManager(ILogger logger, IEventAggregator events, DeviceManager deviceManager)
|
public EffectManager(ILogger logger, DeviceManager deviceManager)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
|
||||||
_events = events;
|
|
||||||
_deviceManager = deviceManager;
|
|
||||||
|
|
||||||
EffectModels = new List<EffectModel>();
|
EffectModels = new List<EffectModel>();
|
||||||
|
|
||||||
|
_generalSettings = DAL.SettingsProvider.Load<GeneralSettings>();
|
||||||
|
_logger = logger;
|
||||||
|
_deviceManager = deviceManager;
|
||||||
|
|
||||||
_logger.Info("Intialized EffectManager");
|
_logger.Info("Intialized EffectManager");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +45,7 @@ namespace Artemis.Managers
|
|||||||
private set
|
private set
|
||||||
{
|
{
|
||||||
_activeEffect = value;
|
_activeEffect = value;
|
||||||
_events.PublishOnUIThread(new ActiveEffectChanged(value?.Name));
|
RaiseEffectChangedEvent(new EffectChangedEventArgs(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,16 +65,18 @@ namespace Artemis.Managers
|
|||||||
get { return EffectModels.OfType<GameModel>().Where(g => g.Enabled); }
|
get { return EffectModels.OfType<GameModel>().Where(g => g.Enabled); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public event EventHandler<EffectChangedEventArgs> OnEffectChangedEvent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads the last active effect from settings and enables it.
|
/// Loads the last active effect from settings and enables it.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>Whether enabling was successful or not.</returns>
|
/// <returns>Whether enabling was successful or not.</returns>
|
||||||
public EffectModel GetLastEffect()
|
public EffectModel GetLastEffect()
|
||||||
{
|
{
|
||||||
_logger.Debug("Getting last effect: {0}", General.Default.LastEffect);
|
_logger.Debug("Getting last effect: {0}", _generalSettings.LastEffect);
|
||||||
return General.Default.LastEffect == null
|
return _generalSettings.LastEffect == null
|
||||||
? null
|
? null
|
||||||
: EffectModels.FirstOrDefault(e => e.Name == General.Default.LastEffect);
|
: EffectModels.FirstOrDefault(e => e.Name == _generalSettings.LastEffect);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -83,17 +86,24 @@ namespace Artemis.Managers
|
|||||||
/// <param name="loopManager">Optionally pass the LoopManager to automatically start it, if it's not running.</param>
|
/// <param name="loopManager">Optionally pass the LoopManager to automatically start it, if it's not running.</param>
|
||||||
public void ChangeEffect(EffectModel effectModel, LoopManager loopManager = null)
|
public void ChangeEffect(EffectModel effectModel, LoopManager loopManager = null)
|
||||||
{
|
{
|
||||||
|
if (_waitEffect != null)
|
||||||
|
{
|
||||||
|
_logger.Debug("Stopping effect because a change is already queued");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (effectModel == null)
|
if (effectModel == null)
|
||||||
throw new ArgumentNullException(nameof(effectModel));
|
throw new ArgumentNullException(nameof(effectModel));
|
||||||
if (effectModel is OverlayModel)
|
if (effectModel is OverlayModel)
|
||||||
throw new ArgumentException("Can't set an Overlay effect as the active effect");
|
throw new ArgumentException("Can't set an Overlay effect as the active effect");
|
||||||
|
|
||||||
if (_deviceManager.ActiveKeyboard == null)
|
|
||||||
_deviceManager.EnableLastKeyboard();
|
|
||||||
// If still null, no last keyboard, so stop.
|
|
||||||
if (_deviceManager.ActiveKeyboard == null)
|
if (_deviceManager.ActiveKeyboard == null)
|
||||||
{
|
{
|
||||||
_logger.Debug("Cancelling effect change, no LastKeyboard");
|
_logger.Debug("Stopping effect change until keyboard is enabled");
|
||||||
|
_waitEffect = effectModel;
|
||||||
|
_waitLoopManager = loopManager;
|
||||||
|
_deviceManager.OnKeyboardChangedEvent += DeviceManagerOnOnKeyboardChangedEvent;
|
||||||
|
_deviceManager.EnableLastKeyboard();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,8 +151,21 @@ namespace Artemis.Managers
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Non-game effects are stored as the new LastEffect.
|
// Non-game effects are stored as the new LastEffect.
|
||||||
General.Default.LastEffect = ActiveEffect?.Name;
|
_generalSettings.LastEffect = ActiveEffect?.Name;
|
||||||
General.Default.Save();
|
_generalSettings.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DeviceManagerOnOnKeyboardChangedEvent(object sender, KeyboardChangedEventArgs e)
|
||||||
|
{
|
||||||
|
_deviceManager.OnKeyboardChangedEvent -= DeviceManagerOnOnKeyboardChangedEvent;
|
||||||
|
_logger.Debug("Resuming effect change");
|
||||||
|
|
||||||
|
var effect = _waitEffect;
|
||||||
|
_waitEffect = null;
|
||||||
|
var loopManager = _waitLoopManager;
|
||||||
|
_waitLoopManager = null;
|
||||||
|
|
||||||
|
ChangeEffect(effect, loopManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -159,11 +182,10 @@ namespace Artemis.Managers
|
|||||||
ActiveEffect.Dispose();
|
ActiveEffect.Dispose();
|
||||||
ActiveEffect = null;
|
ActiveEffect = null;
|
||||||
|
|
||||||
General.Default.LastEffect = null;
|
_generalSettings.LastEffect = null;
|
||||||
General.Default.Save();
|
_generalSettings.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
_logger.Debug("Cleared active effect");
|
_logger.Debug("Cleared active effect");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,5 +214,11 @@ namespace Artemis.Managers
|
|||||||
|
|
||||||
DisableGame(ActiveEffect);
|
DisableGame(ActiveEffect);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual void RaiseEffectChangedEvent(EffectChangedEventArgs e)
|
||||||
|
{
|
||||||
|
var handler = OnEffectChangedEvent;
|
||||||
|
handler?.Invoke(this, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -21,10 +21,8 @@ namespace Artemis.Managers
|
|||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private readonly Timer _loopTimer;
|
private readonly Timer _loopTimer;
|
||||||
|
|
||||||
public LoopManager(IEventAggregator events, ILogger logger, EffectManager effectManager,
|
public LoopManager(ILogger logger, EffectManager effectManager, DeviceManager deviceManager)
|
||||||
DeviceManager deviceManager)
|
|
||||||
{
|
{
|
||||||
events.Subscribe(this);
|
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_effectManager = effectManager;
|
_effectManager = effectManager;
|
||||||
_deviceManager = deviceManager;
|
_deviceManager = deviceManager;
|
||||||
|
|||||||
@ -1,12 +1,15 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
using Artemis.Events;
|
using Artemis.Events;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
|
using Artemis.Utilities;
|
||||||
using Artemis.Utilities.DataReaders;
|
using Artemis.Utilities.DataReaders;
|
||||||
using Artemis.Utilities.GameState;
|
using Artemis.Utilities.GameState;
|
||||||
using Artemis.ViewModels;
|
using Artemis.ViewModels;
|
||||||
using Caliburn.Micro;
|
|
||||||
using Ninject;
|
using Ninject;
|
||||||
using Ninject.Extensions.Logging;
|
using Ninject.Extensions.Logging;
|
||||||
|
|
||||||
@ -17,16 +20,11 @@ namespace Artemis.Managers
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public class MainManager : IDisposable
|
public class MainManager : IDisposable
|
||||||
{
|
{
|
||||||
public delegate void PauseCallbackHandler();
|
|
||||||
|
|
||||||
private readonly IEventAggregator _events;
|
|
||||||
private readonly Timer _processTimer;
|
private readonly Timer _processTimer;
|
||||||
|
|
||||||
public MainManager(IEventAggregator events, ILogger logger, LoopManager loopManager, DeviceManager deviceManager,
|
public MainManager(ILogger logger, LoopManager loopManager, DeviceManager deviceManager,
|
||||||
EffectManager effectManager, ProfileManager profileManager, PipeServer pipeServer)
|
EffectManager effectManager, ProfileManager profileManager, PipeServer pipeServer)
|
||||||
{
|
{
|
||||||
_events = events;
|
|
||||||
|
|
||||||
Logger = logger;
|
Logger = logger;
|
||||||
LoopManager = loopManager;
|
LoopManager = loopManager;
|
||||||
DeviceManager = deviceManager;
|
DeviceManager = deviceManager;
|
||||||
@ -42,13 +40,18 @@ namespace Artemis.Managers
|
|||||||
Running = false;
|
Running = false;
|
||||||
|
|
||||||
// Create and start the web server
|
// Create and start the web server
|
||||||
GameStateWebServer = new GameStateWebServer();
|
GameStateWebServer = new GameStateWebServer(logger);
|
||||||
GameStateWebServer.Start();
|
GameStateWebServer.Start();
|
||||||
|
|
||||||
// Start the named pipe
|
// Start the named pipe
|
||||||
PipeServer.Start("artemis");
|
PipeServer.Start("artemis");
|
||||||
|
|
||||||
|
// Start the update task
|
||||||
|
var updateTask = new Task(Updater.UpdateApp);
|
||||||
|
updateTask.Start();
|
||||||
|
|
||||||
Logger.Info("Intialized MainManager");
|
Logger.Info("Intialized MainManager");
|
||||||
|
Logger.Info($"Artemis version {Assembly.GetExecutingAssembly().GetName().Version} is ready!");
|
||||||
}
|
}
|
||||||
|
|
||||||
[Inject]
|
[Inject]
|
||||||
@ -77,6 +80,8 @@ namespace Artemis.Managers
|
|||||||
PipeServer?.Stop();
|
PipeServer?.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public event EventHandler<EnabledChangedEventArgs> OnEnabledChangedEvent;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Loads the last active effect and starts the program
|
/// Loads the last active effect and starts the program
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -85,7 +90,7 @@ namespace Artemis.Managers
|
|||||||
Logger.Debug("Enabling program");
|
Logger.Debug("Enabling program");
|
||||||
ProgramEnabled = true;
|
ProgramEnabled = true;
|
||||||
LoopManager.StartAsync();
|
LoopManager.StartAsync();
|
||||||
_events.PublishOnUIThread(new ToggleEnabled(ProgramEnabled));
|
RaiseEnabledChangedEvent(new EnabledChangedEventArgs(ProgramEnabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -96,7 +101,7 @@ namespace Artemis.Managers
|
|||||||
Logger.Debug("Disabling program");
|
Logger.Debug("Disabling program");
|
||||||
LoopManager.Stop();
|
LoopManager.Stop();
|
||||||
ProgramEnabled = false;
|
ProgramEnabled = false;
|
||||||
_events.PublishOnUIThread(new ToggleEnabled(ProgramEnabled));
|
RaiseEnabledChangedEvent(new EnabledChangedEventArgs(ProgramEnabled));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -109,7 +114,7 @@ namespace Artemis.Managers
|
|||||||
if (!ProgramEnabled)
|
if (!ProgramEnabled)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var runningProcesses = System.Diagnostics.Process.GetProcesses();
|
var runningProcesses = Process.GetProcesses();
|
||||||
|
|
||||||
// If the currently active effect is a disabled game, get rid of it.
|
// If the currently active effect is a disabled game, get rid of it.
|
||||||
if (EffectManager.ActiveEffect != null)
|
if (EffectManager.ActiveEffect != null)
|
||||||
@ -137,5 +142,11 @@ namespace Artemis.Managers
|
|||||||
Logger.Info("Detected and enabling game: {0}", newGame.Name);
|
Logger.Info("Detected and enabling game: {0}", newGame.Name);
|
||||||
EffectManager.ChangeEffect(newGame, LoopManager);
|
EffectManager.ChangeEffect(newGame, LoopManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual void RaiseEnabledChangedEvent(EnabledChangedEventArgs e)
|
||||||
|
{
|
||||||
|
var handler = OnEnabledChangedEvent;
|
||||||
|
handler?.Invoke(this, e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
|
using Artemis.DAL;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Modules.Effects.ProfilePreview;
|
using Artemis.Modules.Effects.ProfilePreview;
|
||||||
using Artemis.Settings;
|
using Artemis.Settings;
|
||||||
@ -15,6 +16,7 @@ namespace Artemis.Managers
|
|||||||
private readonly EffectManager _effectManager;
|
private readonly EffectManager _effectManager;
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private readonly LoopManager _loopManager;
|
private readonly LoopManager _loopManager;
|
||||||
|
private GeneralSettings _generalSettings;
|
||||||
|
|
||||||
public ProfileManager(ILogger logger, EffectManager effectManager, DeviceManager deviceManager,
|
public ProfileManager(ILogger logger, EffectManager effectManager, DeviceManager deviceManager,
|
||||||
LoopManager loopManager)
|
LoopManager loopManager)
|
||||||
@ -23,6 +25,7 @@ namespace Artemis.Managers
|
|||||||
_effectManager = effectManager;
|
_effectManager = effectManager;
|
||||||
_deviceManager = deviceManager;
|
_deviceManager = deviceManager;
|
||||||
_loopManager = loopManager;
|
_loopManager = loopManager;
|
||||||
|
_generalSettings = SettingsProvider.Load<GeneralSettings>();
|
||||||
|
|
||||||
GameViewModels = new List<GameViewModel>();
|
GameViewModels = new List<GameViewModel>();
|
||||||
|
|
||||||
@ -44,7 +47,7 @@ namespace Artemis.Managers
|
|||||||
/// <param name="e"></param>
|
/// <param name="e"></param>
|
||||||
private void SetupProfilePreview(object sender, ElapsedEventArgs e)
|
private void SetupProfilePreview(object sender, ElapsedEventArgs e)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(General.Default.LastKeyboard) || _deviceManager.ChangingKeyboard ||
|
if (string.IsNullOrEmpty(_generalSettings.LastKeyboard) || _deviceManager.ChangingKeyboard ||
|
||||||
ProfilePreviewModel == null)
|
ProfilePreviewModel == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@ -8,6 +8,7 @@ using Artemis.Models.Interfaces;
|
|||||||
using Artemis.Profiles;
|
using Artemis.Profiles;
|
||||||
using Artemis.Profiles.Layers.Interfaces;
|
using Artemis.Profiles.Layers.Interfaces;
|
||||||
using Artemis.Profiles.Layers.Models;
|
using Artemis.Profiles.Layers.Models;
|
||||||
|
using Artemis.Settings;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Artemis.Models
|
namespace Artemis.Models
|
||||||
@ -18,14 +19,18 @@ namespace Artemis.Models
|
|||||||
|
|
||||||
protected DateTime LastTrace;
|
protected DateTime LastTrace;
|
||||||
|
|
||||||
protected EffectModel(MainManager mainManager, IDataModel dataModel)
|
protected EffectModel(MainManager mainManager, EffectSettings settings, IDataModel dataModel)
|
||||||
{
|
{
|
||||||
MainManager = mainManager;
|
MainManager = mainManager;
|
||||||
|
Settings = settings;
|
||||||
DataModel = dataModel;
|
DataModel = dataModel;
|
||||||
|
|
||||||
|
MainManager.EffectManager.EffectModels.Add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Initialized { get; set; }
|
public bool Initialized { get; set; }
|
||||||
public MainManager MainManager { get; set; }
|
public MainManager MainManager { get; set; }
|
||||||
|
public EffectSettings Settings { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public int KeyboardScale { get; set; } = 4;
|
public int KeyboardScale { get; set; } = 4;
|
||||||
|
|
||||||
|
|||||||
@ -1,20 +0,0 @@
|
|||||||
namespace Artemis.Models
|
|
||||||
{
|
|
||||||
public abstract class EffectSettings
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// Loads the settings from the settings file
|
|
||||||
/// </summary>
|
|
||||||
public abstract void Load();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Saves the settings to the settings file
|
|
||||||
/// </summary>
|
|
||||||
public abstract void Save();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returns the settings to their default value
|
|
||||||
/// </summary>
|
|
||||||
public abstract void ToDefault();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,17 +1,18 @@
|
|||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Models.Interfaces;
|
using Artemis.Models.Interfaces;
|
||||||
|
using Artemis.Settings;
|
||||||
|
|
||||||
namespace Artemis.Models
|
namespace Artemis.Models
|
||||||
{
|
{
|
||||||
public abstract class GameModel : EffectModel
|
public abstract class GameModel : EffectModel
|
||||||
{
|
{
|
||||||
protected GameModel(MainManager mainManager, GameSettings settings, IDataModel dataModel)
|
protected GameModel(MainManager mainManager, GameSettings settings, IDataModel dataModel): base(mainManager, settings, dataModel)
|
||||||
: base(mainManager, dataModel)
|
|
||||||
{
|
{
|
||||||
|
// Override settings to the GameSettings type
|
||||||
Settings = settings;
|
Settings = settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameSettings Settings { get; set; }
|
public new GameSettings Settings { get; set; }
|
||||||
public bool Enabled { get; set; }
|
public bool Enabled { get; set; }
|
||||||
public string ProcessName { get; set; }
|
public string ProcessName { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,26 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace Artemis.Models
|
|
||||||
{
|
|
||||||
public class GamePointersCollectionModel
|
|
||||||
{
|
|
||||||
public string Game { get; set; }
|
|
||||||
public string GameVersion { get; set; }
|
|
||||||
public List<GamePointer> GameAddresses { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public class GamePointer
|
|
||||||
{
|
|
||||||
public string Description { get; set; }
|
|
||||||
public IntPtr BasePointer { get; set; }
|
|
||||||
public int[] Offsets { get; set; }
|
|
||||||
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return Offsets.Aggregate(BasePointer.ToString("X"),
|
|
||||||
(current, offset) => current + $"+{offset.ToString("X")}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
namespace Artemis.Models
|
|
||||||
{
|
|
||||||
public abstract class GameSettings : EffectSettings
|
|
||||||
{
|
|
||||||
public bool Enabled { get; set; }
|
|
||||||
public string LastProfile { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
|
using Artemis.Settings;
|
||||||
|
|
||||||
namespace Artemis.Models
|
namespace Artemis.Models
|
||||||
{
|
{
|
||||||
@ -7,8 +8,10 @@ namespace Artemis.Models
|
|||||||
private bool _enabled;
|
private bool _enabled;
|
||||||
public string ProcessName;
|
public string ProcessName;
|
||||||
|
|
||||||
protected OverlayModel(MainManager mainManager) : base(mainManager, null)
|
protected OverlayModel(MainManager mainManager, OverlaySettings settings) : base(mainManager, settings, null)
|
||||||
{
|
{
|
||||||
|
Settings = settings;
|
||||||
|
Enabled = settings.Enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Enabled
|
public bool Enabled
|
||||||
@ -27,6 +30,7 @@ namespace Artemis.Models
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public new OverlaySettings Settings { get; set; }
|
||||||
public abstract void RenderOverlay(RenderFrame frame, bool keyboardOnly);
|
public abstract void RenderOverlay(RenderFrame frame, bool keyboardOnly);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,7 +0,0 @@
|
|||||||
namespace Artemis.Models
|
|
||||||
{
|
|
||||||
public abstract class OverlaySettings : EffectSettings
|
|
||||||
{
|
|
||||||
public bool Enabled { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,110 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <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.AudioVisualizer {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
|
||||||
internal sealed partial class AudioVisualization : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static AudioVisualization defaultInstance = ((AudioVisualization)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new AudioVisualization())));
|
|
||||||
|
|
||||||
public static AudioVisualization Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("4")]
|
|
||||||
public int Sensitivity {
|
|
||||||
get {
|
|
||||||
return ((int)(this["Sensitivity"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["Sensitivity"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("21")]
|
|
||||||
public int Bars {
|
|
||||||
get {
|
|
||||||
return ((int)(this["Bars"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["Bars"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
|
||||||
public bool FromBottom {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["FromBottom"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["FromBottom"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("3")]
|
|
||||||
public int FadeSpeed {
|
|
||||||
get {
|
|
||||||
return ((int)(this["FadeSpeed"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["FadeSpeed"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("#FFF90000")]
|
|
||||||
public global::System.Windows.Media.Color TopColor {
|
|
||||||
get {
|
|
||||||
return ((global::System.Windows.Media.Color)(this["TopColor"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["TopColor"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("#FFFF761E")]
|
|
||||||
public global::System.Windows.Media.Color MiddleColor {
|
|
||||||
get {
|
|
||||||
return ((global::System.Windows.Media.Color)(this["MiddleColor"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["MiddleColor"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("#FF00DF00")]
|
|
||||||
public global::System.Windows.Media.Color BottomColor {
|
|
||||||
get {
|
|
||||||
return ((global::System.Windows.Media.Color)(this["BottomColor"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["BottomColor"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,29 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
|
||||||
|
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
|
||||||
GeneratedClassNamespace="Artemis.Modules.Effects.AudioVisualizer" GeneratedClassName="AudioVisualization">
|
|
||||||
<Profiles />
|
|
||||||
<Settings>
|
|
||||||
<Setting Name="Sensitivity" Type="System.Int32" Scope="User">
|
|
||||||
<Value Profile="(Default)">4</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="Bars" Type="System.Int32" Scope="User">
|
|
||||||
<Value Profile="(Default)">21</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="FromBottom" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="FadeSpeed" Type="System.Int32" Scope="User">
|
|
||||||
<Value Profile="(Default)">3</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="TopColor" Type="System.Windows.Media.Color" Scope="User">
|
|
||||||
<Value Profile="(Default)">#FFF90000</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="MiddleColor" Type="System.Windows.Media.Color" Scope="User">
|
|
||||||
<Value Profile="(Default)">#FFFF761E</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="BottomColor" Type="System.Windows.Media.Color" Scope="User">
|
|
||||||
<Value Profile="(Default)">#FF00DF00</Value>
|
|
||||||
</Setting>
|
|
||||||
</Settings>
|
|
||||||
</SettingsFile>
|
|
||||||
@ -23,9 +23,8 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
|||||||
private int _sensitivity;
|
private int _sensitivity;
|
||||||
private IWaveIn _waveIn;
|
private IWaveIn _waveIn;
|
||||||
|
|
||||||
public AudioVisualizerModel(MainManager mainManager, AudioVisualizerSettings settings) : base(mainManager, null)
|
public AudioVisualizerModel(MainManager mainManager) : base(mainManager, null, null)
|
||||||
{
|
{
|
||||||
Settings = settings;
|
|
||||||
Name = "Audiovisualizer";
|
Name = "Audiovisualizer";
|
||||||
DeviceIds = new List<string>();
|
DeviceIds = new List<string>();
|
||||||
SpectrumData = new List<byte>();
|
SpectrumData = new List<byte>();
|
||||||
@ -34,7 +33,6 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
|||||||
|
|
||||||
public int Lines { get; set; }
|
public int Lines { get; set; }
|
||||||
|
|
||||||
public AudioVisualizerSettings Settings { get; set; }
|
|
||||||
public List<byte> SpectrumData { get; set; }
|
public List<byte> SpectrumData { get; set; }
|
||||||
public List<KeyboardRectangle> SoundRectangles { get; set; }
|
public List<KeyboardRectangle> SoundRectangles { get; set; }
|
||||||
|
|
||||||
@ -72,15 +70,15 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
|||||||
MainManager.DeviceManager.ActiveKeyboard,
|
MainManager.DeviceManager.ActiveKeyboard,
|
||||||
0, 0, new List<Color>
|
0, 0, new List<Color>
|
||||||
{
|
{
|
||||||
ColorHelpers.ToDrawingColor(Settings.TopColor),
|
Color.Red,
|
||||||
ColorHelpers.ToDrawingColor(Settings.MiddleColor),
|
Color.Yellow,
|
||||||
ColorHelpers.ToDrawingColor(Settings.BottomColor)
|
Color.Lime
|
||||||
},
|
},
|
||||||
LinearGradientMode.Vertical)
|
LinearGradientMode.Vertical)
|
||||||
{ContainedBrush = false, Height = 0});
|
{ContainedBrush = false, Height = 0});
|
||||||
}
|
}
|
||||||
_sensitivity = Settings.Sensitivity;
|
_sensitivity = 2;
|
||||||
_fromBottom = Settings.FromBottom;
|
_fromBottom = true;
|
||||||
_sampleAggregator.FftCalculated += FftCalculated;
|
_sampleAggregator.FftCalculated += FftCalculated;
|
||||||
_sampleAggregator.PerformFFT = true;
|
_sampleAggregator.PerformFFT = true;
|
||||||
|
|
||||||
@ -126,7 +124,8 @@ namespace Artemis.Modules.Effects.AudioVisualizer
|
|||||||
if (keyboardHeight > SoundRectangles[i].Height)
|
if (keyboardHeight > SoundRectangles[i].Height)
|
||||||
SoundRectangles[i].Height = keyboardHeight;
|
SoundRectangles[i].Height = keyboardHeight;
|
||||||
else
|
else
|
||||||
SoundRectangles[i].Height = SoundRectangles[i].Height - Settings.FadeSpeed;
|
SoundRectangles[i].Height = SoundRectangles[i].Height -
|
||||||
|
5; // was FadeSpeed setting
|
||||||
// Apply Bars setting
|
// Apply Bars setting
|
||||||
SoundRectangles[i].X = i*KeyboardScale;
|
SoundRectangles[i].X = i*KeyboardScale;
|
||||||
SoundRectangles[i].Width = KeyboardScale;
|
SoundRectangles[i].Width = KeyboardScale;
|
||||||
|
|||||||
@ -1,56 +0,0 @@
|
|||||||
using System.Windows.Media;
|
|
||||||
using Artemis.Models;
|
|
||||||
|
|
||||||
namespace Artemis.Modules.Effects.AudioVisualizer
|
|
||||||
{
|
|
||||||
public class AudioVisualizerSettings : EffectSettings
|
|
||||||
{
|
|
||||||
public AudioVisualizerSettings()
|
|
||||||
{
|
|
||||||
Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Sensitivity { get; set; }
|
|
||||||
public int Bars { get; set; }
|
|
||||||
public bool FromBottom { get; set; }
|
|
||||||
public int FadeSpeed { get; set; }
|
|
||||||
public Color TopColor { get; set; }
|
|
||||||
public Color MiddleColor { get; set; }
|
|
||||||
public Color BottomColor { get; set; }
|
|
||||||
|
|
||||||
public sealed override void Load()
|
|
||||||
{
|
|
||||||
Sensitivity = AudioVisualization.Default.Sensitivity;
|
|
||||||
Bars = AudioVisualization.Default.Bars;
|
|
||||||
FromBottom = AudioVisualization.Default.FromBottom;
|
|
||||||
FadeSpeed = AudioVisualization.Default.FadeSpeed;
|
|
||||||
TopColor = AudioVisualization.Default.TopColor;
|
|
||||||
MiddleColor = AudioVisualization.Default.MiddleColor;
|
|
||||||
BottomColor = AudioVisualization.Default.BottomColor;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void Save()
|
|
||||||
{
|
|
||||||
AudioVisualization.Default.Sensitivity = Sensitivity;
|
|
||||||
AudioVisualization.Default.Bars = Bars;
|
|
||||||
AudioVisualization.Default.FromBottom = FromBottom;
|
|
||||||
AudioVisualization.Default.FadeSpeed = FadeSpeed;
|
|
||||||
AudioVisualization.Default.TopColor = TopColor;
|
|
||||||
AudioVisualization.Default.MiddleColor = MiddleColor;
|
|
||||||
AudioVisualization.Default.BottomColor = BottomColor;
|
|
||||||
|
|
||||||
AudioVisualization.Default.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void ToDefault()
|
|
||||||
{
|
|
||||||
Sensitivity = 4;
|
|
||||||
Bars = 21;
|
|
||||||
FromBottom = true;
|
|
||||||
FadeSpeed = 3;
|
|
||||||
TopColor = Color.FromArgb(255, 249, 0, 0);
|
|
||||||
MiddleColor = Color.FromArgb(255, 255, 118, 30);
|
|
||||||
BottomColor = Color.FromArgb(255, 0, 223, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,25 +1,13 @@
|
|||||||
using Artemis.Events;
|
using Artemis.Managers;
|
||||||
using Artemis.Managers;
|
|
||||||
using Artemis.ViewModels.Abstract;
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
|
||||||
|
|
||||||
namespace Artemis.Modules.Effects.AudioVisualizer
|
namespace Artemis.Modules.Effects.AudioVisualizer
|
||||||
{
|
{
|
||||||
public sealed class AudioVisualizerViewModel : EffectViewModel, IHandle<ActiveEffectChanged>
|
public sealed class AudioVisualizerViewModel : EffectViewModel
|
||||||
{
|
{
|
||||||
public AudioVisualizerViewModel(MainManager main, IEventAggregator events)
|
public AudioVisualizerViewModel(MainManager main, AudioVisualizerModel model) : base(main, model)
|
||||||
: base(main, new AudioVisualizerModel(main, new AudioVisualizerSettings()))
|
|
||||||
{
|
{
|
||||||
DisplayName = "Audio Visualization";
|
DisplayName = "Audio Visualization";
|
||||||
events.Subscribe(this);
|
|
||||||
|
|
||||||
MainManager.EffectManager.EffectModels.Add(EffectModel);
|
|
||||||
EffectSettings = ((AudioVisualizerModel) EffectModel).Settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Handle(ActiveEffectChanged message)
|
|
||||||
{
|
|
||||||
NotifyOfPropertyChange(() => EffectEnabled);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,122 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <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.Bubbles {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
|
||||||
internal sealed partial class Bubbles : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static Bubbles defaultInstance = ((Bubbles)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Bubbles())));
|
|
||||||
|
|
||||||
public static Bubbles Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
|
||||||
public bool IsRandomColors {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["IsRandomColors"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["IsRandomColors"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("#FFFF0000")]
|
|
||||||
public global::System.Windows.Media.Color BubbleColor {
|
|
||||||
get {
|
|
||||||
return ((global::System.Windows.Media.Color)(this["BubbleColor"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["BubbleColor"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
|
||||||
public bool IsShiftColors {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["IsShiftColors"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["IsShiftColors"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("25")]
|
|
||||||
public int BubbleSize {
|
|
||||||
get {
|
|
||||||
return ((int)(this["BubbleSize"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["BubbleSize"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("4")]
|
|
||||||
public int MoveSpeed {
|
|
||||||
get {
|
|
||||||
return ((int)(this["MoveSpeed"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["MoveSpeed"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("12")]
|
|
||||||
public int ShiftColorSpeed {
|
|
||||||
get {
|
|
||||||
return ((int)(this["ShiftColorSpeed"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["ShiftColorSpeed"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("14")]
|
|
||||||
public int BubbleCount {
|
|
||||||
get {
|
|
||||||
return ((int)(this["BubbleCount"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["BubbleCount"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("25")]
|
|
||||||
public int Smoothness {
|
|
||||||
get {
|
|
||||||
return ((int)(this["Smoothness"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["Smoothness"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,32 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
|
||||||
|
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
|
||||||
GeneratedClassNamespace="Artemis.Modules.Effects.Bubbles" GeneratedClassName="Bubbles">
|
|
||||||
<Profiles />
|
|
||||||
<Settings>
|
|
||||||
<Setting Name="IsRandomColors" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="BubbleColor" Type="System.Windows.Media.Color" Scope="User">
|
|
||||||
<Value Profile="(Default)">#FFFF0000</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="IsShiftColors" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="BubbleSize" Type="System.Int32" Scope="User">
|
|
||||||
<Value Profile="(Default)">25</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="MoveSpeed" Type="System.Int32" Scope="User">
|
|
||||||
<Value Profile="(Default)">4</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="ShiftColorSpeed" Type="System.Int32" Scope="User">
|
|
||||||
<Value Profile="(Default)">12</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="BubbleCount" Type="System.Int32" Scope="User">
|
|
||||||
<Value Profile="(Default)">14</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="Smoothness" Type="System.Int32" Scope="User">
|
|
||||||
<Value Profile="(Default)">25</Value>
|
|
||||||
</Setting>
|
|
||||||
</Settings>
|
|
||||||
</SettingsFile>
|
|
||||||
@ -14,12 +14,11 @@ namespace Artemis.Modules.Effects.Bubbles
|
|||||||
{
|
{
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
public BubblesModel(MainManager mainManager, BubblesSettings settings)
|
public BubblesModel(MainManager mainManager) : base(mainManager, new BubblesSettings(), null)
|
||||||
: base(mainManager, null)
|
|
||||||
{
|
{
|
||||||
Name = "Bubbles";
|
Name = "Bubbles";
|
||||||
Settings = settings;
|
|
||||||
Initialized = false;
|
Initialized = false;
|
||||||
|
Settings = (BubblesSettings) base.Settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
@ -30,7 +29,7 @@ namespace Artemis.Modules.Effects.Bubbles
|
|||||||
|
|
||||||
private readonly List<Bubble> _bubbles = new List<Bubble>();
|
private readonly List<Bubble> _bubbles = new List<Bubble>();
|
||||||
|
|
||||||
public BubblesSettings Settings { get; }
|
public new BubblesSettings Settings { get; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@ -1,60 +1,54 @@
|
|||||||
using System.Windows.Media;
|
using System.ComponentModel;
|
||||||
using Artemis.Models;
|
using System.Windows.Media;
|
||||||
|
using Artemis.DAL;
|
||||||
|
using Artemis.Settings;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Artemis.Modules.Effects.Bubbles
|
namespace Artemis.Modules.Effects.Bubbles
|
||||||
{
|
{
|
||||||
public class BubblesSettings : EffectSettings
|
public class BubblesSettings : EffectSettings
|
||||||
{
|
{
|
||||||
public BubblesSettings()
|
[DefaultValue(true)]
|
||||||
{
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||||
Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsRandomColors { get; set; }
|
public bool IsRandomColors { get; set; }
|
||||||
|
|
||||||
public Color BubbleColor { get; set; }
|
public Color BubbleColor { get; set; }
|
||||||
|
|
||||||
|
[DefaultValue(true)]
|
||||||
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||||
public bool IsShiftColors { get; set; }
|
public bool IsShiftColors { get; set; }
|
||||||
|
|
||||||
|
[DefaultValue(12)]
|
||||||
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||||
public int ShiftColorSpeed { get; set; }
|
public int ShiftColorSpeed { get; set; }
|
||||||
|
|
||||||
|
[DefaultValue(25)]
|
||||||
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||||
public int BubbleSize { get; set; }
|
public int BubbleSize { get; set; }
|
||||||
|
|
||||||
|
[DefaultValue(4)]
|
||||||
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||||
public int MoveSpeed { get; set; }
|
public int MoveSpeed { get; set; }
|
||||||
|
|
||||||
|
[DefaultValue(14)]
|
||||||
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||||
public int BubbleCount { get; set; }
|
public int BubbleCount { get; set; }
|
||||||
|
|
||||||
|
[DefaultValue(25)]
|
||||||
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
|
||||||
public int Smoothness { get; set; }
|
public int Smoothness { get; set; }
|
||||||
|
|
||||||
public sealed override void Load()
|
public new void Reset(bool save = false)
|
||||||
{
|
{
|
||||||
IsRandomColors = Bubbles.Default.IsRandomColors;
|
JsonConvert.PopulateObject("{}", this, new JsonSerializerSettings
|
||||||
BubbleColor = Bubbles.Default.BubbleColor;
|
{
|
||||||
IsShiftColors = Bubbles.Default.IsShiftColors;
|
ObjectCreationHandling = ObjectCreationHandling.Reuse
|
||||||
ShiftColorSpeed = Bubbles.Default.ShiftColorSpeed;
|
});
|
||||||
BubbleSize = Bubbles.Default.BubbleSize;
|
|
||||||
MoveSpeed = Bubbles.Default.MoveSpeed;
|
|
||||||
BubbleCount = Bubbles.Default.BubbleCount;
|
|
||||||
Smoothness = Bubbles.Default.Smoothness;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void Save()
|
BubbleColor = Colors.Red;
|
||||||
{
|
|
||||||
Bubbles.Default.IsRandomColors = IsRandomColors;
|
|
||||||
Bubbles.Default.BubbleColor = BubbleColor;
|
|
||||||
Bubbles.Default.IsShiftColors = IsShiftColors;
|
|
||||||
Bubbles.Default.ShiftColorSpeed = ShiftColorSpeed;
|
|
||||||
Bubbles.Default.BubbleSize = BubbleSize;
|
|
||||||
Bubbles.Default.MoveSpeed = MoveSpeed;
|
|
||||||
Bubbles.Default.BubbleCount = BubbleCount;
|
|
||||||
Bubbles.Default.Smoothness = Smoothness;
|
|
||||||
|
|
||||||
Bubbles.Default.Save();
|
if (save)
|
||||||
}
|
SettingsProvider.Save(this);
|
||||||
|
|
||||||
public sealed override void ToDefault()
|
|
||||||
{
|
|
||||||
IsRandomColors = true;
|
|
||||||
BubbleColor = Color.FromArgb(255, 255, 0, 0);
|
|
||||||
IsShiftColors = true;
|
|
||||||
ShiftColorSpeed = 12;
|
|
||||||
BubbleSize = 25;
|
|
||||||
MoveSpeed = 4;
|
|
||||||
BubbleCount = 14;
|
|
||||||
Smoothness = 25;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,25 +1,13 @@
|
|||||||
using Artemis.Events;
|
using Artemis.Managers;
|
||||||
using Artemis.Managers;
|
|
||||||
using Artemis.ViewModels.Abstract;
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
|
||||||
|
|
||||||
namespace Artemis.Modules.Effects.Bubbles
|
namespace Artemis.Modules.Effects.Bubbles
|
||||||
{
|
{
|
||||||
public class BubblesViewModel : EffectViewModel, IHandle<ActiveEffectChanged>
|
public sealed class BubblesViewModel : EffectViewModel
|
||||||
{
|
{
|
||||||
public BubblesViewModel(MainManager main, IEventAggregator events)
|
public BubblesViewModel(MainManager main, BubblesModel model) : base(main, model)
|
||||||
: base(main, new BubblesModel(main, new BubblesSettings()))
|
|
||||||
{
|
{
|
||||||
DisplayName = "Bubbles";
|
DisplayName = "Bubbles";
|
||||||
events.Subscribe(this);
|
|
||||||
|
|
||||||
MainManager.EffectManager.EffectModels.Add(EffectModel);
|
|
||||||
EffectSettings = ((BubblesModel) EffectModel).Settings;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Handle(ActiveEffectChanged message)
|
|
||||||
{
|
|
||||||
NotifyOfPropertyChange(() => EffectEnabled);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -14,7 +14,7 @@ namespace Artemis.Modules.Effects.ProfilePreview
|
|||||||
{
|
{
|
||||||
public class ProfilePreviewModel : EffectModel
|
public class ProfilePreviewModel : EffectModel
|
||||||
{
|
{
|
||||||
public ProfilePreviewModel(MainManager mainManager) : base(mainManager, new ProfilePreviewDataModel())
|
public ProfilePreviewModel(MainManager mainManager) : base(mainManager, null, new ProfilePreviewDataModel())
|
||||||
{
|
{
|
||||||
Name = "Profile Preview";
|
Name = "Profile Preview";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace Artemis.Modules.Effects.WindowsProfile
|
||||||
|
{
|
||||||
|
internal static class PerformanceInfo
|
||||||
|
{
|
||||||
|
[DllImport("psapi.dll", SetLastError = true)]
|
||||||
|
[return: MarshalAs(UnmanagedType.Bool)]
|
||||||
|
public static extern bool GetPerformanceInfo([Out] out PerformanceInformation performanceInformation,
|
||||||
|
[In] int size);
|
||||||
|
|
||||||
|
public static long GetPhysicalAvailableMemoryInMiB()
|
||||||
|
{
|
||||||
|
var pi = new PerformanceInformation();
|
||||||
|
if (GetPerformanceInfo(out pi, Marshal.SizeOf(pi)))
|
||||||
|
return Convert.ToInt64(pi.PhysicalAvailable.ToInt64()*pi.PageSize.ToInt64()/1048576);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long GetTotalMemoryInMiB()
|
||||||
|
{
|
||||||
|
var pi = new PerformanceInformation();
|
||||||
|
if (GetPerformanceInfo(out pi, Marshal.SizeOf(pi)))
|
||||||
|
return Convert.ToInt64(pi.PhysicalTotal.ToInt64()*pi.PageSize.ToInt64()/1048576);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct PerformanceInformation
|
||||||
|
{
|
||||||
|
public int Size;
|
||||||
|
public IntPtr CommitTotal;
|
||||||
|
public IntPtr CommitLimit;
|
||||||
|
public IntPtr CommitPeak;
|
||||||
|
public IntPtr PhysicalTotal;
|
||||||
|
public IntPtr PhysicalAvailable;
|
||||||
|
public IntPtr SystemCache;
|
||||||
|
public IntPtr KernelTotal;
|
||||||
|
public IntPtr KernelPaged;
|
||||||
|
public IntPtr KernelNonPaged;
|
||||||
|
public IntPtr PageSize;
|
||||||
|
public int HandlesCount;
|
||||||
|
public int ProcessCount;
|
||||||
|
public int ThreadCount;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,38 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
<?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,9 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Artemis.DAL;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Profiles.Layers.Models;
|
using Artemis.Profiles.Layers.Models;
|
||||||
@ -12,54 +12,6 @@ using SpotifyAPI.Local;
|
|||||||
|
|
||||||
namespace Artemis.Modules.Effects.WindowsProfile
|
namespace Artemis.Modules.Effects.WindowsProfile
|
||||||
{
|
{
|
||||||
internal static class PerformanceInfo
|
|
||||||
{
|
|
||||||
[DllImport("psapi.dll", SetLastError = true)]
|
|
||||||
[return: MarshalAs(UnmanagedType.Bool)]
|
|
||||||
public static extern bool GetPerformanceInfo([Out] out PerformanceInformation performanceInformation,
|
|
||||||
[In] int size);
|
|
||||||
|
|
||||||
public static long GetPhysicalAvailableMemoryInMiB()
|
|
||||||
{
|
|
||||||
var pi = new PerformanceInformation();
|
|
||||||
if (GetPerformanceInfo(out pi, Marshal.SizeOf(pi)))
|
|
||||||
{
|
|
||||||
return Convert.ToInt64(pi.PhysicalAvailable.ToInt64()*pi.PageSize.ToInt64()/1048576);
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static long GetTotalMemoryInMiB()
|
|
||||||
{
|
|
||||||
var pi = new PerformanceInformation();
|
|
||||||
if (GetPerformanceInfo(out pi, Marshal.SizeOf(pi)))
|
|
||||||
{
|
|
||||||
return Convert.ToInt64(pi.PhysicalTotal.ToInt64()*pi.PageSize.ToInt64()/1048576);
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential)]
|
|
||||||
public struct PerformanceInformation
|
|
||||||
{
|
|
||||||
public int Size;
|
|
||||||
public IntPtr CommitTotal;
|
|
||||||
public IntPtr CommitLimit;
|
|
||||||
public IntPtr CommitPeak;
|
|
||||||
public IntPtr PhysicalTotal;
|
|
||||||
public IntPtr PhysicalAvailable;
|
|
||||||
public IntPtr SystemCache;
|
|
||||||
public IntPtr KernelTotal;
|
|
||||||
public IntPtr KernelPaged;
|
|
||||||
public IntPtr KernelNonPaged;
|
|
||||||
public IntPtr PageSize;
|
|
||||||
public int HandlesCount;
|
|
||||||
public int ProcessCount;
|
|
||||||
public int ThreadCount;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public class WindowsProfileModel : EffectModel
|
public class WindowsProfileModel : EffectModel
|
||||||
{
|
{
|
||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
@ -69,16 +21,13 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
|||||||
private SpotifyLocalAPI _spotify;
|
private SpotifyLocalAPI _spotify;
|
||||||
private bool _spotifySetupBusy;
|
private bool _spotifySetupBusy;
|
||||||
|
|
||||||
public WindowsProfileModel(ILogger logger, MainManager mainManager, WindowsProfileSettings settings)
|
public WindowsProfileModel(ILogger logger, MainManager mainManager)
|
||||||
: base(mainManager, new WindowsProfileDataModel())
|
: base(mainManager, SettingsProvider.Load<WindowsProfileSettings>(), new WindowsProfileDataModel())
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
Name = "WindowsProfile";
|
Name = "WindowsProfile";
|
||||||
Settings = settings;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public WindowsProfileSettings Settings { get; set; }
|
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
Initialized = false;
|
Initialized = false;
|
||||||
@ -136,7 +85,7 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
|||||||
|
|
||||||
private void UpdateCpu(WindowsProfileDataModel dataModel)
|
private void UpdateCpu(WindowsProfileDataModel dataModel)
|
||||||
{
|
{
|
||||||
if (_cores == null || _overallCpu == null)
|
if ((_cores == null) || (_overallCpu == null))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// CPU is only updated every 15 frames, the performance counter gives 0 if updated too often
|
// CPU is only updated every 15 frames, the performance counter gives 0 if updated too often
|
||||||
|
|||||||
@ -1,28 +1,8 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Settings;
|
||||||
|
|
||||||
namespace Artemis.Modules.Effects.WindowsProfile
|
namespace Artemis.Modules.Effects.WindowsProfile
|
||||||
{
|
{
|
||||||
public class WindowsProfileSettings : GameSettings
|
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()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,31 +1,25 @@
|
|||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using Artemis.Events;
|
|
||||||
using Artemis.InjectionFactories;
|
using Artemis.InjectionFactories;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Modules.Effects.ProfilePreview;
|
using Artemis.Modules.Effects.ProfilePreview;
|
||||||
using Artemis.ViewModels.Abstract;
|
using Artemis.ViewModels.Abstract;
|
||||||
using Artemis.ViewModels.Profiles;
|
using Artemis.ViewModels.Profiles;
|
||||||
using Caliburn.Micro;
|
|
||||||
using Ninject.Extensions.Logging;
|
|
||||||
|
|
||||||
namespace Artemis.Modules.Effects.WindowsProfile
|
namespace Artemis.Modules.Effects.WindowsProfile
|
||||||
{
|
{
|
||||||
// TODO: This effect is a hybrid between a regular effect and a game, may want to clean this up
|
// TODO: This effect is a hybrid between a regular effect and a game, may want to clean this up
|
||||||
public sealed class WindowsProfileViewModel : EffectViewModel, IHandle<ActiveEffectChanged>
|
public sealed class WindowsProfileViewModel : EffectViewModel
|
||||||
{
|
{
|
||||||
public WindowsProfileViewModel(ILogger logger, MainManager main, IEventAggregator events,
|
public WindowsProfileViewModel(MainManager main, IProfileEditorVmFactory pFactory,
|
||||||
IProfileEditorVmFactory pFactory, ProfilePreviewModel profilePreviewModel)
|
ProfilePreviewModel profilePreviewModel, WindowsProfileModel model) : base(main, model)
|
||||||
: base(main, new WindowsProfileModel(logger, main, new WindowsProfileSettings()))
|
|
||||||
{
|
{
|
||||||
DisplayName = "Windows Profile";
|
DisplayName = "Windows Profile";
|
||||||
PFactory = pFactory;
|
PFactory = pFactory;
|
||||||
ProfilePreviewModel = profilePreviewModel;
|
ProfilePreviewModel = profilePreviewModel;
|
||||||
EffectSettings = ((WindowsProfileModel) EffectModel).Settings;
|
EffectSettings = ((WindowsProfileModel) EffectModel).Settings;
|
||||||
ProfileEditor = PFactory.CreateProfileEditorVm(events, main, (WindowsProfileModel) EffectModel,
|
ProfileEditor = PFactory.CreateProfileEditorVm(main, (WindowsProfileModel) EffectModel,
|
||||||
((WindowsProfileSettings) EffectSettings).LastProfile);
|
((WindowsProfileSettings) EffectSettings).LastProfile);
|
||||||
ProfilePreviewModel.Profile = ProfileEditor.SelectedProfile;
|
ProfilePreviewModel.Profile = ProfileEditor.SelectedProfile;
|
||||||
|
|
||||||
events.Subscribe(this);
|
|
||||||
ProfileEditor.PropertyChanged += ProfileUpdater;
|
ProfileEditor.PropertyChanged += ProfileUpdater;
|
||||||
MainManager.EffectManager.EffectModels.Add(EffectModel);
|
MainManager.EffectManager.EffectModels.Add(EffectModel);
|
||||||
}
|
}
|
||||||
@ -35,11 +29,6 @@ namespace Artemis.Modules.Effects.WindowsProfile
|
|||||||
public IProfileEditorVmFactory PFactory { get; set; }
|
public IProfileEditorVmFactory PFactory { get; set; }
|
||||||
public ProfilePreviewModel ProfilePreviewModel { get; set; }
|
public ProfilePreviewModel ProfilePreviewModel { get; set; }
|
||||||
|
|
||||||
public void Handle(ActiveEffectChanged message)
|
|
||||||
{
|
|
||||||
NotifyOfPropertyChange(() => EffectEnabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ProfileUpdater(object sender, PropertyChangedEventArgs e)
|
private void ProfileUpdater(object sender, PropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.PropertyName != "SelectedProfile" && IsActive)
|
if (e.PropertyName != "SelectedProfile" && IsActive)
|
||||||
|
|||||||
@ -1,62 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <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.Games.CounterStrike {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
|
||||||
internal sealed partial class CounterStrike : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static CounterStrike defaultInstance = ((CounterStrike)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new CounterStrike())));
|
|
||||||
|
|
||||||
public static CounterStrike Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
|
||||||
public bool Enabled {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["Enabled"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["Enabled"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Default")]
|
|
||||||
public string LastProfile {
|
|
||||||
get {
|
|
||||||
return ((string)(this["LastProfile"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["LastProfile"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
|
||||||
public string GameDirectory {
|
|
||||||
get {
|
|
||||||
return ((string)(this["GameDirectory"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["GameDirectory"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<?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">
|
|
||||||
<Profiles />
|
|
||||||
<Settings>
|
|
||||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="LastProfile" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)">Default</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="GameDirectory" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
</Settings>
|
|
||||||
</SettingsFile>
|
|
||||||
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Artemis.DAL;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Profiles.Layers.Models;
|
using Artemis.Profiles.Layers.Models;
|
||||||
@ -11,8 +12,8 @@ namespace Artemis.Modules.Games.CounterStrike
|
|||||||
{
|
{
|
||||||
public class CounterStrikeModel : GameModel
|
public class CounterStrikeModel : GameModel
|
||||||
{
|
{
|
||||||
public CounterStrikeModel(MainManager mainManager, CounterStrikeSettings settings)
|
public CounterStrikeModel(MainManager mainManager)
|
||||||
: base(mainManager, settings, new CounterStrikeDataModel())
|
: base(mainManager, SettingsProvider.Load<CounterStrikeSettings>(), new CounterStrikeDataModel())
|
||||||
{
|
{
|
||||||
Name = "CounterStrike";
|
Name = "CounterStrike";
|
||||||
ProcessName = "csgo";
|
ProcessName = "csgo";
|
||||||
|
|||||||
@ -1,35 +1,9 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Settings;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.CounterStrike
|
namespace Artemis.Modules.Games.CounterStrike
|
||||||
{
|
{
|
||||||
public class CounterStrikeSettings : GameSettings
|
public class CounterStrikeSettings : GameSettings
|
||||||
{
|
{
|
||||||
public CounterStrikeSettings()
|
|
||||||
{
|
|
||||||
Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GameDirectory { get; set; }
|
public string GameDirectory { get; set; }
|
||||||
|
|
||||||
public sealed override void Load()
|
|
||||||
{
|
|
||||||
Enabled = CounterStrike.Default.Enabled;
|
|
||||||
LastProfile = CounterStrike.Default.LastProfile;
|
|
||||||
GameDirectory = CounterStrike.Default.GameDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void Save()
|
|
||||||
{
|
|
||||||
CounterStrike.Default.Enabled = Enabled;
|
|
||||||
CounterStrike.Default.GameDirectory = GameDirectory;
|
|
||||||
|
|
||||||
CounterStrike.Default.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void ToDefault()
|
|
||||||
{
|
|
||||||
Enabled = true;
|
|
||||||
GameDirectory = string.Empty;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -40,7 +40,7 @@
|
|||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.ColumnSpan="2" Margin="0,0,1,0">
|
Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||||
|
|
||||||
<Label FontSize="20" HorizontalAlignment="Left" Content="CS:GO Directory" />
|
<Label FontSize="20" HorizontalAlignment="Left" Content="Counter-Strike Global Offensive directory" />
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
||||||
Text="{Binding Path=GameSettings.GameDirectory, Mode=TwoWay}"
|
Text="{Binding Path=GameSettings.GameDirectory, Mode=TwoWay}"
|
||||||
|
|||||||
@ -5,17 +5,15 @@ using Artemis.Managers;
|
|||||||
using Artemis.Properties;
|
using Artemis.Properties;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Artemis.ViewModels.Abstract;
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.CounterStrike
|
namespace Artemis.Modules.Games.CounterStrike
|
||||||
{
|
{
|
||||||
public sealed class CounterStrikeViewModel : GameViewModel
|
public sealed class CounterStrikeViewModel : GameViewModel
|
||||||
{
|
{
|
||||||
public CounterStrikeViewModel(MainManager main, IEventAggregator events, IProfileEditorVmFactory pFactory)
|
public CounterStrikeViewModel(MainManager main, IProfileEditorVmFactory pFactory, CounterStrikeModel model)
|
||||||
: base(main, new CounterStrikeModel(main, new CounterStrikeSettings()), events, pFactory)
|
: base(main, model, pFactory)
|
||||||
{
|
{
|
||||||
DisplayName = "CS:GO";
|
DisplayName = "CS:GO";
|
||||||
MainManager.EffectManager.EffectModels.Add(GameModel);
|
|
||||||
|
|
||||||
FindGameDir();
|
FindGameDir();
|
||||||
PlaceConfigFile();
|
PlaceConfigFile();
|
||||||
@ -25,7 +23,7 @@ namespace Artemis.Modules.Games.CounterStrike
|
|||||||
{
|
{
|
||||||
var gameSettings = (CounterStrikeSettings) GameSettings;
|
var gameSettings = (CounterStrikeSettings) GameSettings;
|
||||||
// If already propertly set up, don't do anything
|
// If already propertly set up, don't do anything
|
||||||
if (gameSettings.GameDirectory != null && File.Exists(gameSettings.GameDirectory + "csgo.exe") &&
|
if ((gameSettings.GameDirectory != null) && File.Exists(gameSettings.GameDirectory + "csgo.exe") &&
|
||||||
File.Exists(gameSettings.GameDirectory + "/csgo/cfg/gamestate_integration_artemis.cfg"))
|
File.Exists(gameSettings.GameDirectory + "/csgo/cfg/gamestate_integration_artemis.cfg"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@ -1,62 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <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.Games.Dota2 {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
|
||||||
internal sealed partial class Dota2 : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static Dota2 defaultInstance = ((Dota2)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Dota2())));
|
|
||||||
|
|
||||||
public static Dota2 Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
|
||||||
public bool Enabled {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["Enabled"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["Enabled"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Default")]
|
|
||||||
public string LastProfile {
|
|
||||||
get {
|
|
||||||
return ((string)(this["LastProfile"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["LastProfile"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
|
||||||
public string GameDirectory {
|
|
||||||
get {
|
|
||||||
return ((string)(this["GameDirectory"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["GameDirectory"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<?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">
|
|
||||||
<Profiles />
|
|
||||||
<Settings>
|
|
||||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="LastProfile" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)">Default</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="GameDirectory" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
</Settings>
|
|
||||||
</SettingsFile>
|
|
||||||
@ -1,4 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Artemis.DAL;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Profiles.Layers.Models;
|
using Artemis.Profiles.Layers.Models;
|
||||||
@ -7,21 +8,19 @@ using Newtonsoft.Json;
|
|||||||
|
|
||||||
namespace Artemis.Modules.Games.Dota2
|
namespace Artemis.Modules.Games.Dota2
|
||||||
{
|
{
|
||||||
internal class Dota2Model : GameModel
|
public class Dota2Model : GameModel
|
||||||
{
|
{
|
||||||
public Dota2Model(MainManager mainManager, Dota2Settings settings)
|
public Dota2Model(MainManager mainManager)
|
||||||
: base(mainManager, settings, new Dota2DataModel())
|
: base(mainManager, SettingsProvider.Load<Dota2Settings>(), new Dota2DataModel())
|
||||||
{
|
{
|
||||||
Name = "Dota2";
|
Name = "Dota2";
|
||||||
ProcessName = "dota2";
|
ProcessName = "dota2";
|
||||||
Settings = settings;
|
|
||||||
Enabled = Settings.Enabled;
|
Enabled = Settings.Enabled;
|
||||||
Initialized = false;
|
Initialized = false;
|
||||||
Scale = 4;
|
Scale = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Scale { get; set; }
|
public int Scale { get; set; }
|
||||||
public new Dota2Settings Settings { get; set; }
|
|
||||||
|
|
||||||
public override void Dispose()
|
public override void Dispose()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,36 +1,9 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Settings;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.Dota2
|
namespace Artemis.Modules.Games.Dota2
|
||||||
{
|
{
|
||||||
internal class Dota2Settings : GameSettings
|
internal class Dota2Settings : GameSettings
|
||||||
{
|
{
|
||||||
public Dota2Settings()
|
|
||||||
{
|
|
||||||
Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GameDirectory { get; set; }
|
public string GameDirectory { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public sealed override void Load()
|
|
||||||
{
|
|
||||||
Enabled = Dota2.Default.Enabled;
|
|
||||||
GameDirectory = Dota2.Default.GameDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void Save()
|
|
||||||
{
|
|
||||||
Dota2.Default.Enabled = Enabled;
|
|
||||||
Dota2.Default.LastProfile = LastProfile;
|
|
||||||
Dota2.Default.GameDirectory = GameDirectory;
|
|
||||||
|
|
||||||
Dota2.Default.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void ToDefault()
|
|
||||||
{
|
|
||||||
Enabled = true;
|
|
||||||
GameDirectory = string.Empty;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -39,7 +39,7 @@
|
|||||||
<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">
|
||||||
<Label FontSize="20" HorizontalAlignment="Left" Content="Dota 2 Directory" />
|
<Label FontSize="20" HorizontalAlignment="Left" Content="Dota 2 directory" />
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
||||||
Text="{Binding Path=GameSettings.GameDirectory, Mode=TwoWay}"
|
Text="{Binding Path=GameSettings.GameDirectory, Mode=TwoWay}"
|
||||||
|
|||||||
@ -5,17 +5,15 @@ using Artemis.Managers;
|
|||||||
using Artemis.Properties;
|
using Artemis.Properties;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Artemis.ViewModels.Abstract;
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.Dota2
|
namespace Artemis.Modules.Games.Dota2
|
||||||
{
|
{
|
||||||
public sealed class Dota2ViewModel : GameViewModel
|
public sealed class Dota2ViewModel : GameViewModel
|
||||||
{
|
{
|
||||||
public Dota2ViewModel(MainManager main, IEventAggregator events, IProfileEditorVmFactory pFactory)
|
public Dota2ViewModel(MainManager main, IProfileEditorVmFactory pFactory, Dota2Model model)
|
||||||
: base(main, new Dota2Model(main, new Dota2Settings()), events, pFactory)
|
: base(main, model, pFactory)
|
||||||
{
|
{
|
||||||
DisplayName = "Dota 2";
|
DisplayName = "Dota 2";
|
||||||
MainManager.EffectManager.EffectModels.Add(GameModel);
|
|
||||||
|
|
||||||
FindGameDir();
|
FindGameDir();
|
||||||
PlaceConfigFile();
|
PlaceConfigFile();
|
||||||
@ -25,7 +23,7 @@ namespace Artemis.Modules.Games.Dota2
|
|||||||
{
|
{
|
||||||
var gameSettings = (Dota2Settings) GameSettings;
|
var gameSettings = (Dota2Settings) GameSettings;
|
||||||
// If already propertly set up, don't do anything
|
// If already propertly set up, don't do anything
|
||||||
if (gameSettings.GameDirectory != null && File.Exists(gameSettings.GameDirectory + "csgo.exe") &&
|
if ((gameSettings.GameDirectory != null) && File.Exists(gameSettings.GameDirectory + "csgo.exe") &&
|
||||||
File.Exists(gameSettings.GameDirectory + "/csgo/cfg/gamestate_integration_artemis.cfg"))
|
File.Exists(gameSettings.GameDirectory + "/csgo/cfg/gamestate_integration_artemis.cfg"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,18 @@
|
|||||||
|
using Artemis.Models.Interfaces;
|
||||||
|
using Ets2SdkClient;
|
||||||
|
|
||||||
|
namespace Artemis.Modules.Games.EurotruckSimulator2
|
||||||
|
{
|
||||||
|
public class EurotruckSimulator2DataModel : IDataModel
|
||||||
|
{
|
||||||
|
public Ets2Telemetry._Axilliary Axilliary { get; set; }
|
||||||
|
public Ets2Telemetry._Controls Controls { get; set; }
|
||||||
|
public Ets2Telemetry._Damage Damage { get; set; }
|
||||||
|
public Ets2Telemetry._Drivetrain Drivetrain { get; set; }
|
||||||
|
public Ets2Telemetry._Job Job { get; set; }
|
||||||
|
public Ets2Telemetry._Lights Lights { get; set; }
|
||||||
|
public string Manufacturer { get; set; }
|
||||||
|
public string ManufacturerId { get; set; }
|
||||||
|
public Ets2Telemetry._Physics Physics { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,70 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Artemis.DAL;
|
||||||
|
using Artemis.Managers;
|
||||||
|
using Artemis.Models;
|
||||||
|
using Artemis.Profiles.Layers.Models;
|
||||||
|
using Ets2SdkClient;
|
||||||
|
using Ninject.Extensions.Logging;
|
||||||
|
|
||||||
|
namespace Artemis.Modules.Games.EurotruckSimulator2
|
||||||
|
{
|
||||||
|
public class EurotruckSimulator2Model : GameModel
|
||||||
|
{
|
||||||
|
public EurotruckSimulator2Model(MainManager mainManager)
|
||||||
|
: base(mainManager, SettingsProvider.Load<EurotruckSimulator2Settings>(), new EurotruckSimulator2DataModel()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
Name = "EurotruckSimulator2";
|
||||||
|
ProcessName = "eurotrucks2";
|
||||||
|
Scale = 4;
|
||||||
|
Enabled = Settings.Enabled;
|
||||||
|
Initialized = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ILogger Logger { get; set; }
|
||||||
|
public int Scale { get; set; }
|
||||||
|
|
||||||
|
public Ets2SdkTelemetry Telemetry { get; set; }
|
||||||
|
|
||||||
|
public override void Dispose()
|
||||||
|
{
|
||||||
|
Initialized = false;
|
||||||
|
|
||||||
|
Telemetry.Data -= TelemetryOnData;
|
||||||
|
Telemetry = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Enable()
|
||||||
|
{
|
||||||
|
Telemetry = new Ets2SdkTelemetry();
|
||||||
|
Telemetry.Data += TelemetryOnData;
|
||||||
|
if (Telemetry.Error != null)
|
||||||
|
MainManager.Logger.Error(Telemetry.Error, "Exception in the Eurotruck SDK");
|
||||||
|
|
||||||
|
Initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TelemetryOnData(Ets2Telemetry data, bool newTimestamp)
|
||||||
|
{
|
||||||
|
((EurotruckSimulator2DataModel) DataModel).Axilliary = data.Axilliary;
|
||||||
|
((EurotruckSimulator2DataModel) DataModel).Controls = data.Controls;
|
||||||
|
((EurotruckSimulator2DataModel) DataModel).Damage = data.Damage;
|
||||||
|
((EurotruckSimulator2DataModel) DataModel).Drivetrain = data.Drivetrain;
|
||||||
|
((EurotruckSimulator2DataModel) DataModel).Job = data.Job;
|
||||||
|
((EurotruckSimulator2DataModel) DataModel).Lights = data.Lights;
|
||||||
|
((EurotruckSimulator2DataModel) DataModel).Manufacturer = data.Manufacturer;
|
||||||
|
((EurotruckSimulator2DataModel) DataModel).ManufacturerId = data.ManufacturerId;
|
||||||
|
((EurotruckSimulator2DataModel) DataModel).Physics = data.Physics;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Update()
|
||||||
|
{
|
||||||
|
// Updating is handled in the TelemetryOnData event
|
||||||
|
}
|
||||||
|
|
||||||
|
public override List<LayerModel> GetRenderLayers(bool keyboardOnly)
|
||||||
|
{
|
||||||
|
return Profile.GetRenderLayers(DataModel, keyboardOnly);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
using Artemis.Settings;
|
||||||
|
|
||||||
|
namespace Artemis.Modules.Games.EurotruckSimulator2
|
||||||
|
{
|
||||||
|
public class EurotruckSimulator2Settings : GameSettings
|
||||||
|
{
|
||||||
|
public string GameDirectory { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
<UserControl x:Class="Artemis.Modules.Games.EurotruckSimulator2.EurotruckSimulator2View"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:cal="http://www.caliburnproject.org"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="476.986" d:DesignWidth="538.772">
|
||||||
|
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
|
||||||
|
<Grid Margin="15,5,5,5">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto" />
|
||||||
|
<ColumnDefinition />
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||||
|
<Label FontSize="20" HorizontalAlignment="Left">
|
||||||
|
<Label.Content>
|
||||||
|
<AccessText TextWrapping="Wrap"
|
||||||
|
Text="By default shows indicator lights, speed and engine RPM on the keyboard" />
|
||||||
|
</Label.Content>
|
||||||
|
</Label>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
|
<Label Content="Enable effect" Margin="0 3 0 0" HorizontalAlignment="Right" />
|
||||||
|
<ToggleButton x:Name="EffectEnabled" Margin="0 3 0 0" Width="25" Height="25"
|
||||||
|
IsChecked="{Binding Path=GameSettings.Enabled, Mode=TwoWay}"
|
||||||
|
Style="{DynamicResource MetroCircleToggleButtonStyle}"
|
||||||
|
cal:Message.Attach="[Event Click] = [Action ToggleEffect]" />
|
||||||
|
</StackPanel>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<StackPanel Grid.Row="1"
|
||||||
|
Grid.Column="0"
|
||||||
|
Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||||
|
|
||||||
|
<Label FontSize="20" HorizontalAlignment="Left" Content="Eurotruck Simulator 2 directory" />
|
||||||
|
<Grid>
|
||||||
|
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="5,0,30,0"
|
||||||
|
Text="{Binding Path=GameSettings.GameDirectory, Mode=TwoWay}"
|
||||||
|
cal:Message.Attach="[Event LostFocus] = [Action PlaceConfigFile]" />
|
||||||
|
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944"
|
||||||
|
HorizontalAlignment="Right" Width="25"
|
||||||
|
Style="{DynamicResource SquareButtonStyle}" Height="26" Margin="0,-2,0,0" />
|
||||||
|
</Grid>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- Profile editor -->
|
||||||
|
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" Margin="0,0,-20,0" />
|
||||||
|
|
||||||
|
<!-- Buttons -->
|
||||||
|
<StackPanel Grid.Column="0" Grid.Row="4" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||||
|
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100"
|
||||||
|
Style="{DynamicResource SquareButtonStyle}" />
|
||||||
|
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100"
|
||||||
|
Margin="10,0,0,0"
|
||||||
|
Style="{DynamicResource SquareButtonStyle}" />
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</ScrollViewer>
|
||||||
|
</UserControl>
|
||||||
@ -0,0 +1,15 @@
|
|||||||
|
using System.Windows.Controls;
|
||||||
|
|
||||||
|
namespace Artemis.Modules.Games.EurotruckSimulator2
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for CounterStrikeView.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class EurotruckSimulator2View : UserControl
|
||||||
|
{
|
||||||
|
public EurotruckSimulator2View()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,77 @@
|
|||||||
|
using System.IO;
|
||||||
|
using System.Windows.Forms;
|
||||||
|
using Artemis.InjectionFactories;
|
||||||
|
using Artemis.Managers;
|
||||||
|
using Artemis.Utilities;
|
||||||
|
using Artemis.ViewModels.Abstract;
|
||||||
|
|
||||||
|
namespace Artemis.Modules.Games.EurotruckSimulator2
|
||||||
|
{
|
||||||
|
public sealed class EurotruckSimulator2ViewModel : GameViewModel
|
||||||
|
{
|
||||||
|
public EurotruckSimulator2ViewModel(MainManager main, IProfileEditorVmFactory pFactory,
|
||||||
|
EurotruckSimulator2Model model) : base(main, model, pFactory)
|
||||||
|
{
|
||||||
|
DisplayName = "ETS 2";
|
||||||
|
|
||||||
|
FindGameDir();
|
||||||
|
PlacePlugin();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void FindGameDir()
|
||||||
|
{
|
||||||
|
var gameSettings = (EurotruckSimulator2Settings) GameSettings;
|
||||||
|
// If already propertly set up, don't do anything
|
||||||
|
//if (gameSettings.GameDirectory != null && File.Exists(gameSettings.GameDirectory + "csgo.exe") &&
|
||||||
|
// File.Exists(gameSettings.GameDirectory + "/csgo/cfg/gamestate_integration_artemis.cfg"))
|
||||||
|
// return;
|
||||||
|
|
||||||
|
// Demo is also supported but resides in a different directory
|
||||||
|
var dir = GeneralHelpers.FindSteamGame(@"\Euro Truck Simulator 2\bin\win_x86\eurotrucks2.exe") ??
|
||||||
|
GeneralHelpers.FindSteamGame(@"\Euro Truck Simulator 2 Demo\bin\win_x86\eurotrucks2.exe");
|
||||||
|
|
||||||
|
gameSettings.GameDirectory = dir ?? string.Empty;
|
||||||
|
gameSettings.Save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void BrowseDirectory()
|
||||||
|
{
|
||||||
|
var dialog = new FolderBrowserDialog
|
||||||
|
{
|
||||||
|
SelectedPath = ((EurotruckSimulator2Settings) GameSettings).GameDirectory
|
||||||
|
};
|
||||||
|
var result = dialog.ShowDialog();
|
||||||
|
if (result != DialogResult.OK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
((EurotruckSimulator2Settings) GameSettings).GameDirectory = Path.GetDirectoryName(dialog.SelectedPath);
|
||||||
|
NotifyOfPropertyChange(() => GameSettings);
|
||||||
|
|
||||||
|
GameSettings.Save();
|
||||||
|
PlacePlugin();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void PlacePlugin()
|
||||||
|
{
|
||||||
|
if (((EurotruckSimulator2Settings) GameSettings).GameDirectory == string.Empty)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var path = ((EurotruckSimulator2Settings) GameSettings).GameDirectory;
|
||||||
|
//if (Directory.Exists(path + "/csgo/cfg"))
|
||||||
|
//{
|
||||||
|
// var cfgFile = Resources.csgoGamestateConfiguration.Replace("{{port}}",
|
||||||
|
// MainManager.GameStateWebServer.Port.ToString());
|
||||||
|
// File.WriteAllText(path + "/csgo/cfg/gamestate_integration_artemis.cfg", cfgFile);
|
||||||
|
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//DialogService.ShowErrorMessageBox("Please select a valid CS:GO directory\n\n" +
|
||||||
|
// @"By default CS:GO is in \SteamApps\common\Counter-Strike Global Offensive");
|
||||||
|
|
||||||
|
//((EurotruckSimulator2Settings) GameSettings).GameDirectory = string.Empty;
|
||||||
|
//NotifyOfPropertyChange(() => GameSettings);
|
||||||
|
//GameSettings.Save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,62 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <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.Games.Overwatch {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
|
||||||
internal sealed partial class Overwatch : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static Overwatch defaultInstance = ((Overwatch)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Overwatch())));
|
|
||||||
|
|
||||||
public static Overwatch Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
|
||||||
public bool Enabled {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["Enabled"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["Enabled"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Default")]
|
|
||||||
public string LastProfile {
|
|
||||||
get {
|
|
||||||
return ((string)(this["LastProfile"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["LastProfile"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
|
||||||
public string GameDirectory {
|
|
||||||
get {
|
|
||||||
return ((string)(this["GameDirectory"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["GameDirectory"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<?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">
|
|
||||||
<Profiles />
|
|
||||||
<Settings>
|
|
||||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="LastProfile" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)">Default</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="GameDirectory" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
</Settings>
|
|
||||||
</SettingsFile>
|
|
||||||
@ -2,19 +2,18 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using Artemis.Events;
|
using Artemis.DAL;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Models.Interfaces;
|
using Artemis.Models.Interfaces;
|
||||||
using Artemis.Profiles.Layers.Models;
|
using Artemis.Profiles.Layers.Models;
|
||||||
|
using Artemis.Settings;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Caliburn.Micro;
|
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.Overwatch
|
namespace Artemis.Modules.Games.Overwatch
|
||||||
{
|
{
|
||||||
public class OverwatchModel : GameModel
|
public class OverwatchModel : GameModel
|
||||||
{
|
{
|
||||||
private readonly IEventAggregator _events;
|
|
||||||
private DateTime _characterChange;
|
private DateTime _characterChange;
|
||||||
private string _lastMessage;
|
private string _lastMessage;
|
||||||
// Using sticky values on these since they can cause flickering
|
// Using sticky values on these since they can cause flickering
|
||||||
@ -24,10 +23,9 @@ namespace Artemis.Modules.Games.Overwatch
|
|||||||
private DateTime _ultimateReady;
|
private DateTime _ultimateReady;
|
||||||
private DateTime _ultimateUsed;
|
private DateTime _ultimateUsed;
|
||||||
|
|
||||||
public OverwatchModel(IEventAggregator events, MainManager mainManager, OverwatchSettings settings)
|
public OverwatchModel(MainManager mainManager)
|
||||||
: base(mainManager, settings, new OverwatchDataModel())
|
: base(mainManager, SettingsProvider.Load<OverwatchSettings>(), new OverwatchDataModel())
|
||||||
{
|
{
|
||||||
_events = events;
|
|
||||||
Name = "Overwatch";
|
Name = "Overwatch";
|
||||||
ProcessName = "Overwatch";
|
ProcessName = "Overwatch";
|
||||||
Scale = 4;
|
Scale = 4;
|
||||||
@ -126,7 +124,8 @@ namespace Artemis.Modules.Games.Overwatch
|
|||||||
if (colors == null)
|
if (colors == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_events.PublishOnUIThread(new RazerColorArrayChanged(colors));
|
// TODO: Get the debug viewmodel and update the color array
|
||||||
|
//_events.PublishOnUIThread(new RazerColorArrayChanged(colors));
|
||||||
|
|
||||||
// Determine general game state
|
// Determine general game state
|
||||||
ParseGameSate(gameDataModel, colors);
|
ParseGameSate(gameDataModel, colors);
|
||||||
@ -137,10 +136,10 @@ namespace Artemis.Modules.Games.Overwatch
|
|||||||
// Ult can't possibly be ready within 2 seconds of changing, this avoids false positives.
|
// Ult can't possibly be ready within 2 seconds of changing, this avoids false positives.
|
||||||
// Filtering on ultReady and ultUsed removes false positives from the native ultimate effects
|
// Filtering on ultReady and ultUsed removes false positives from the native ultimate effects
|
||||||
// The control keys don't show during character select, so don't continue on those either.
|
// The control keys don't show during character select, so don't continue on those either.
|
||||||
if (_characterChange.AddSeconds(2) >= DateTime.Now ||
|
if ((_characterChange.AddSeconds(2) >= DateTime.Now) ||
|
||||||
_ultimateUsed.AddSeconds(2) >= DateTime.Now ||
|
(_ultimateUsed.AddSeconds(2) >= DateTime.Now) ||
|
||||||
_ultimateReady.AddSeconds(2) >= DateTime.Now ||
|
(_ultimateReady.AddSeconds(2) >= DateTime.Now) ||
|
||||||
_stickyStatus.Value == OverwatchStatus.InCharacterSelect)
|
(_stickyStatus.Value == OverwatchStatus.InCharacterSelect))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ParseSpecialKeys(gameDataModel, characterMatch, colors);
|
ParseSpecialKeys(gameDataModel, characterMatch, colors);
|
||||||
@ -152,7 +151,7 @@ namespace Artemis.Modules.Games.Overwatch
|
|||||||
if (string.IsNullOrEmpty(arrayString))
|
if (string.IsNullOrEmpty(arrayString))
|
||||||
return null;
|
return null;
|
||||||
var intermediateArray = arrayString.Split('|');
|
var intermediateArray = arrayString.Split('|');
|
||||||
if (intermediateArray[0] == "1" || intermediateArray.Length < 2)
|
if ((intermediateArray[0] == "1") || (intermediateArray.Length < 2))
|
||||||
return null;
|
return null;
|
||||||
var array = intermediateArray[1].Substring(1).Split(' ');
|
var array = intermediateArray[1].Substring(1).Split(' ');
|
||||||
if (!array.Any())
|
if (!array.Any())
|
||||||
@ -168,7 +167,7 @@ namespace Artemis.Modules.Games.Overwatch
|
|||||||
|
|
||||||
// Can't parse to a byte directly since it may contain values >254
|
// Can't parse to a byte directly since it may contain values >254
|
||||||
var parts = intermediate.Split(',').Select(int.Parse).ToArray();
|
var parts = intermediate.Split(',').Select(int.Parse).ToArray();
|
||||||
if (parts[0] >= 5 && parts[1] >= 21)
|
if ((parts[0] >= 5) && (parts[1] >= 21))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
colors[parts[0], parts[1]] = Color.FromRgb((byte) parts[2], (byte) parts[3], (byte) parts[4]);
|
colors[parts[0], parts[1]] = Color.FromRgb((byte) parts[2], (byte) parts[3], (byte) parts[4]);
|
||||||
@ -222,13 +221,13 @@ namespace Artemis.Modules.Games.Overwatch
|
|||||||
private bool ControlsShown(Color[,] colors)
|
private bool ControlsShown(Color[,] colors)
|
||||||
{
|
{
|
||||||
var keyColor = Color.FromRgb(222, 153, 0);
|
var keyColor = Color.FromRgb(222, 153, 0);
|
||||||
return colors[2, 3] == keyColor || colors[3, 2] == keyColor ||
|
return (colors[2, 3] == keyColor) || (colors[3, 2] == keyColor) ||
|
||||||
colors[3, 3] == keyColor || colors[3, 4] == keyColor;
|
(colors[3, 3] == keyColor) || (colors[3, 4] == keyColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ParseSpecialKeys(OverwatchDataModel gameDataModel, CharacterColor? characterMatch, Color[,] colors)
|
private void ParseSpecialKeys(OverwatchDataModel gameDataModel, CharacterColor? characterMatch, Color[,] colors)
|
||||||
{
|
{
|
||||||
if (characterMatch == null || characterMatch.Value.Character == OverwatchCharacter.None)
|
if ((characterMatch == null) || (characterMatch.Value.Character == OverwatchCharacter.None))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Ultimate is ready when Q is blinking
|
// Ultimate is ready when Q is blinking
|
||||||
|
|||||||
@ -1,36 +1,9 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Settings;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.Overwatch
|
namespace Artemis.Modules.Games.Overwatch
|
||||||
{
|
{
|
||||||
public class OverwatchSettings : GameSettings
|
public class OverwatchSettings : GameSettings
|
||||||
{
|
{
|
||||||
public OverwatchSettings()
|
|
||||||
{
|
|
||||||
Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GameDirectory { get; set; }
|
public string GameDirectory { get; set; }
|
||||||
|
|
||||||
public sealed override void Load()
|
|
||||||
{
|
|
||||||
Enabled = Overwatch.Default.Enabled;
|
|
||||||
LastProfile = Overwatch.Default.LastProfile;
|
|
||||||
GameDirectory = Overwatch.Default.GameDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void Save()
|
|
||||||
{
|
|
||||||
Overwatch.Default.Enabled = Enabled;
|
|
||||||
Overwatch.Default.LastProfile = LastProfile;
|
|
||||||
Overwatch.Default.GameDirectory = GameDirectory;
|
|
||||||
|
|
||||||
Overwatch.Default.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void ToDefault()
|
|
||||||
{
|
|
||||||
Enabled = true;
|
|
||||||
GameDirectory = string.Empty;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -4,18 +4,16 @@ using Artemis.InjectionFactories;
|
|||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Utilities.DataReaders;
|
using Artemis.Utilities.DataReaders;
|
||||||
using Artemis.ViewModels.Abstract;
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.Overwatch
|
namespace Artemis.Modules.Games.Overwatch
|
||||||
{
|
{
|
||||||
public sealed class OverwatchViewModel : GameViewModel
|
public sealed class OverwatchViewModel : GameViewModel
|
||||||
{
|
{
|
||||||
public OverwatchViewModel(MainManager main, IEventAggregator events, IProfileEditorVmFactory pFactory)
|
public OverwatchViewModel(MainManager main, IProfileEditorVmFactory pFactory, OverwatchModel model)
|
||||||
: base(main, new OverwatchModel(events, main, new OverwatchSettings()), events, pFactory)
|
: base(main, model, pFactory)
|
||||||
{
|
{
|
||||||
DisplayName = "Overwatch";
|
DisplayName = "Overwatch";
|
||||||
MainManager.EffectManager.EffectModels.Add(GameModel);
|
|
||||||
|
|
||||||
FindOverwatch();
|
FindOverwatch();
|
||||||
}
|
}
|
||||||
@ -24,7 +22,7 @@ namespace Artemis.Modules.Games.Overwatch
|
|||||||
{
|
{
|
||||||
var gameSettings = (OverwatchSettings) GameSettings;
|
var gameSettings = (OverwatchSettings) GameSettings;
|
||||||
// If already propertly set up, don't do anything
|
// If already propertly set up, don't do anything
|
||||||
if (gameSettings.GameDirectory != null && File.Exists(gameSettings.GameDirectory + "Overwatch.exe") &&
|
if ((gameSettings.GameDirectory != null) && File.Exists(gameSettings.GameDirectory + "Overwatch.exe") &&
|
||||||
File.Exists(gameSettings.GameDirectory + "RzChromaSDK64.dll"))
|
File.Exists(gameSettings.GameDirectory + "RzChromaSDK64.dll"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@ -1,50 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <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.Games.RocketLeague {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
|
||||||
internal sealed partial class RocketLeague : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static RocketLeague defaultInstance = ((RocketLeague)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new RocketLeague())));
|
|
||||||
|
|
||||||
public static RocketLeague Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
|
||||||
public bool Enabled {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["Enabled"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["Enabled"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Default")]
|
|
||||||
public string LastProfile {
|
|
||||||
get {
|
|
||||||
return ((string)(this["LastProfile"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["LastProfile"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
<?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">
|
|
||||||
<Profiles />
|
|
||||||
<Settings>
|
|
||||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="LastProfile" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)">Default</Value>
|
|
||||||
</Setting>
|
|
||||||
</Settings>
|
|
||||||
</SettingsFile>
|
|
||||||
@ -1,12 +1,12 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Artemis.DAL;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Profiles.Layers.Models;
|
using Artemis.Profiles.Layers.Models;
|
||||||
using Artemis.Settings;
|
using Artemis.Settings;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Artemis.Utilities.Memory;
|
using Artemis.Utilities.Memory;
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.RocketLeague
|
namespace Artemis.Modules.Games.RocketLeague
|
||||||
{
|
{
|
||||||
@ -15,8 +15,8 @@ namespace Artemis.Modules.Games.RocketLeague
|
|||||||
private Memory _memory;
|
private Memory _memory;
|
||||||
private GamePointersCollection _pointer;
|
private GamePointersCollection _pointer;
|
||||||
|
|
||||||
public RocketLeagueModel(MainManager mainManager, RocketLeagueSettings settings)
|
public RocketLeagueModel(MainManager mainManager)
|
||||||
: base(mainManager, settings, new RocketLeagueDataModel())
|
: base(mainManager, SettingsProvider.Load<RocketLeagueSettings>(), new RocketLeagueDataModel())
|
||||||
{
|
{
|
||||||
Name = "RocketLeague";
|
Name = "RocketLeague";
|
||||||
ProcessName = "RocketLeague";
|
ProcessName = "RocketLeague";
|
||||||
@ -25,20 +25,20 @@ namespace Artemis.Modules.Games.RocketLeague
|
|||||||
Initialized = false;
|
Initialized = false;
|
||||||
|
|
||||||
// Generate a new offset when the game is updated
|
// Generate a new offset when the game is updated
|
||||||
//var offset = new GamePointersCollection
|
// var offset = new GamePointersCollection
|
||||||
//{
|
// {
|
||||||
// Game = "RocketLeague",
|
// Game = "RocketLeague",
|
||||||
// GameVersion = "1.21",
|
// GameVersion = "1.21",
|
||||||
// GameAddresses = new List<GamePointer>
|
// GameAddresses = new List<GamePointer>
|
||||||
// {
|
// {
|
||||||
// new GamePointer
|
// new GamePointer
|
||||||
// {
|
// {
|
||||||
// Description = "Boost",
|
// Description = "Boost",
|
||||||
// BasePointer = new IntPtr(0x016AD528),
|
// BasePointer = new IntPtr(0x016AD528),
|
||||||
// Offsets = new[] {0x304, 0x8, 0x50, 0x720, 0x224}
|
// Offsets = new[] {0x304, 0x8, 0x50, 0x720, 0x224}
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
//};
|
// };
|
||||||
//var res = JsonConvert.SerializeObject(offset, Formatting.Indented);
|
//var res = JsonConvert.SerializeObject(offset, Formatting.Indented);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -55,7 +55,7 @@ namespace Artemis.Modules.Games.RocketLeague
|
|||||||
Initialized = false;
|
Initialized = false;
|
||||||
|
|
||||||
Updater.GetPointers();
|
Updater.GetPointers();
|
||||||
_pointer = JsonConvert.DeserializeObject<GamePointersCollection>(Offsets.Default.RocketLeague);
|
_pointer = SettingsProvider.Load<OffsetSettings>().RocketLeague;
|
||||||
|
|
||||||
var tempProcess = MemoryHelpers.GetProcessIfRunning(ProcessName);
|
var tempProcess = MemoryHelpers.GetProcessIfRunning(ProcessName);
|
||||||
if (tempProcess == null)
|
if (tempProcess == null)
|
||||||
@ -68,7 +68,7 @@ namespace Artemis.Modules.Games.RocketLeague
|
|||||||
|
|
||||||
public override void Update()
|
public override void Update()
|
||||||
{
|
{
|
||||||
if (Profile == null || DataModel == null || _memory == null)
|
if ((Profile == null) || (DataModel == null) || (_memory == null))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var offsets = _pointer.GameAddresses.First(ga => ga.Description == "Boost").ToString();
|
var offsets = _pointer.GameAddresses.First(ga => ga.Description == "Boost").ToString();
|
||||||
|
|||||||
@ -1,31 +1,8 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Settings;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.RocketLeague
|
namespace Artemis.Modules.Games.RocketLeague
|
||||||
{
|
{
|
||||||
public class RocketLeagueSettings : GameSettings
|
public class RocketLeagueSettings : GameSettings
|
||||||
{
|
{
|
||||||
public RocketLeagueSettings()
|
|
||||||
{
|
|
||||||
Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void Load()
|
|
||||||
{
|
|
||||||
Enabled = RocketLeague.Default.Enabled;
|
|
||||||
LastProfile = RocketLeague.Default.LastProfile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void Save()
|
|
||||||
{
|
|
||||||
RocketLeague.Default.Enabled = Enabled;
|
|
||||||
RocketLeague.Default.LastProfile = LastProfile;
|
|
||||||
|
|
||||||
RocketLeague.Default.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void ToDefault()
|
|
||||||
{
|
|
||||||
Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -28,7 +28,7 @@
|
|||||||
<Label FontSize="20" HorizontalAlignment="Left">
|
<Label FontSize="20" HorizontalAlignment="Left">
|
||||||
<Label.Content>
|
<Label.Content>
|
||||||
<AccessText TextWrapping="Wrap"
|
<AccessText TextWrapping="Wrap"
|
||||||
Text="By default fills up the keyboard according to the amount of boost. Also colors mouse and headset according to boost." />
|
Text="By default fills up the keyboard and colors all devices according to the amount boost." />
|
||||||
</Label.Content>
|
</Label.Content>
|
||||||
</Label>
|
</Label>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||||
|
|||||||
@ -1,11 +1,9 @@
|
|||||||
using Artemis.InjectionFactories;
|
using Artemis.DAL;
|
||||||
|
using Artemis.InjectionFactories;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Settings;
|
using Artemis.Settings;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Artemis.Utilities.Memory;
|
|
||||||
using Artemis.ViewModels.Abstract;
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.RocketLeague
|
namespace Artemis.Modules.Games.RocketLeague
|
||||||
{
|
{
|
||||||
@ -13,12 +11,10 @@ namespace Artemis.Modules.Games.RocketLeague
|
|||||||
{
|
{
|
||||||
private string _versionText;
|
private string _versionText;
|
||||||
|
|
||||||
public RocketLeagueViewModel(MainManager main, IEventAggregator events, IProfileEditorVmFactory pFactory)
|
public RocketLeagueViewModel(MainManager main, IProfileEditorVmFactory pFactory, RocketLeagueModel model)
|
||||||
: base(main, new RocketLeagueModel(main, new RocketLeagueSettings()), events, pFactory)
|
: base(main, model, pFactory)
|
||||||
{
|
{
|
||||||
DisplayName = "Rocket League";
|
DisplayName = "Rocket League";
|
||||||
|
|
||||||
MainManager.EffectManager.EffectModels.Add(GameModel);
|
|
||||||
SetVersionText();
|
SetVersionText();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +33,7 @@ namespace Artemis.Modules.Games.RocketLeague
|
|||||||
|
|
||||||
private void SetVersionText()
|
private void SetVersionText()
|
||||||
{
|
{
|
||||||
if (!General.Default.EnablePointersUpdate)
|
if (!SettingsProvider.Load<GeneralSettings>().EnablePointersUpdate)
|
||||||
{
|
{
|
||||||
VersionText = "Note: You disabled pointer updates, this could result in the " +
|
VersionText = "Note: You disabled pointer updates, this could result in the " +
|
||||||
"Rocket League effect not working after a game update.";
|
"Rocket League effect not working after a game update.";
|
||||||
@ -45,9 +41,7 @@ namespace Artemis.Modules.Games.RocketLeague
|
|||||||
}
|
}
|
||||||
|
|
||||||
Updater.GetPointers();
|
Updater.GetPointers();
|
||||||
var version = JsonConvert
|
var version = SettingsProvider.Load<OffsetSettings>().RocketLeague.GameVersion;
|
||||||
.DeserializeObject<GamePointersCollection>(Offsets.Default.RocketLeague)
|
|
||||||
.GameVersion;
|
|
||||||
VersionText = $"Note: Requires patch {version}. When a new patch is released Artemis downloads " +
|
VersionText = $"Note: Requires patch {version}. When a new patch is released Artemis downloads " +
|
||||||
"new pointers for the latest version (unless disabled in settings).";
|
"new pointers for the latest version (unless disabled in settings).";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,50 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <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.Games.TheDivision {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
|
||||||
internal sealed partial class TheDivision : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static TheDivision defaultInstance = ((TheDivision)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new TheDivision())));
|
|
||||||
|
|
||||||
public static TheDivision Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
|
||||||
public bool Enabled {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["Enabled"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["Enabled"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Default")]
|
|
||||||
public string LastProfile {
|
|
||||||
get {
|
|
||||||
return ((string)(this["LastProfile"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["LastProfile"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
<?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">
|
|
||||||
<Profiles />
|
|
||||||
<Settings>
|
|
||||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="LastProfile" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)">Default</Value>
|
|
||||||
</Setting>
|
|
||||||
</Settings>
|
|
||||||
</SettingsFile>
|
|
||||||
@ -1,6 +1,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Artemis.DAL;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Profiles.Layers.Models;
|
using Artemis.Profiles.Layers.Models;
|
||||||
@ -14,8 +15,8 @@ namespace Artemis.Modules.Games.TheDivision
|
|||||||
private StickyValue<bool> _stickyAmmo;
|
private StickyValue<bool> _stickyAmmo;
|
||||||
private StickyValue<bool> _stickyHp;
|
private StickyValue<bool> _stickyHp;
|
||||||
|
|
||||||
public TheDivisionModel(MainManager mainManager, TheDivisionSettings settings)
|
public TheDivisionModel(MainManager mainManager)
|
||||||
: base(mainManager, settings, new TheDivisionDataModel())
|
: base(mainManager, SettingsProvider.Load<TheDivisionSettings>(), new TheDivisionDataModel())
|
||||||
{
|
{
|
||||||
Name = "TheDivision";
|
Name = "TheDivision";
|
||||||
ProcessName = "TheDivision";
|
ProcessName = "TheDivision";
|
||||||
@ -81,7 +82,7 @@ namespace Artemis.Modules.Games.TheDivision
|
|||||||
var bPer = parts[4];
|
var bPer = parts[4];
|
||||||
|
|
||||||
// F1 to F4 indicate the player and his party. Blinks red on damage taken
|
// F1 to F4 indicate the player and his party. Blinks red on damage taken
|
||||||
if (keyCode >= 59 && keyCode <= 62)
|
if ((keyCode >= 59) && (keyCode <= 62))
|
||||||
{
|
{
|
||||||
var playerId = keyCode - 58;
|
var playerId = keyCode - 58;
|
||||||
|
|
||||||
@ -105,15 +106,15 @@ namespace Artemis.Modules.Games.TheDivision
|
|||||||
// R blinks white when low on ammo
|
// R blinks white when low on ammo
|
||||||
else if (keyCode == 19)
|
else if (keyCode == 19)
|
||||||
{
|
{
|
||||||
_stickyAmmo.Value = rPer == 100 && gPer > 1 && bPer > 1;
|
_stickyAmmo.Value = (rPer == 100) && (gPer > 1) && (bPer > 1);
|
||||||
gameDataModel.LowAmmo = _stickyAmmo.Value;
|
gameDataModel.LowAmmo = _stickyAmmo.Value;
|
||||||
}
|
}
|
||||||
// G turns white when holding a grenade, turns off when out of grenades
|
// G turns white when holding a grenade, turns off when out of grenades
|
||||||
else if (keyCode == 34)
|
else if (keyCode == 34)
|
||||||
{
|
{
|
||||||
if (rPer == 100 && gPer < 10 && bPer < 10)
|
if ((rPer == 100) && (gPer < 10) && (bPer < 10))
|
||||||
gameDataModel.GrenadeState = GrenadeState.HasGrenade;
|
gameDataModel.GrenadeState = GrenadeState.HasGrenade;
|
||||||
else if (rPer == 100 && gPer > 10 && bPer > 10)
|
else if ((rPer == 100) && (gPer > 10) && (bPer > 10))
|
||||||
gameDataModel.GrenadeState = GrenadeState.GrenadeEquipped;
|
gameDataModel.GrenadeState = GrenadeState.GrenadeEquipped;
|
||||||
else
|
else
|
||||||
gameDataModel.GrenadeState = GrenadeState.HasNoGrenade;
|
gameDataModel.GrenadeState = GrenadeState.HasNoGrenade;
|
||||||
@ -121,7 +122,7 @@ namespace Artemis.Modules.Games.TheDivision
|
|||||||
// V blinks on low HP
|
// V blinks on low HP
|
||||||
else if (keyCode == 47)
|
else if (keyCode == 47)
|
||||||
{
|
{
|
||||||
_stickyHp.Value = rPer == 100 && gPer > 1 && bPer > 1;
|
_stickyHp.Value = (rPer == 100) && (gPer > 1) && (bPer > 1);
|
||||||
gameDataModel.LowHp = _stickyHp.Value;
|
gameDataModel.LowHp = _stickyHp.Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,31 +1,8 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Settings;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.TheDivision
|
namespace Artemis.Modules.Games.TheDivision
|
||||||
{
|
{
|
||||||
public class TheDivisionSettings : GameSettings
|
public class TheDivisionSettings : GameSettings
|
||||||
{
|
{
|
||||||
public TheDivisionSettings()
|
|
||||||
{
|
|
||||||
Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void Load()
|
|
||||||
{
|
|
||||||
Enabled = TheDivision.Default.Enabled;
|
|
||||||
LastProfile = TheDivision.Default.LastProfile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void Save()
|
|
||||||
{
|
|
||||||
TheDivision.Default.Enabled = Enabled;
|
|
||||||
TheDivision.Default.LastProfile = LastProfile;
|
|
||||||
|
|
||||||
TheDivision.Default.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void ToDefault()
|
|
||||||
{
|
|
||||||
Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,17 +1,15 @@
|
|||||||
using Artemis.InjectionFactories;
|
using Artemis.InjectionFactories;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.ViewModels.Abstract;
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.TheDivision
|
namespace Artemis.Modules.Games.TheDivision
|
||||||
{
|
{
|
||||||
public sealed class TheDivisionViewModel : GameViewModel
|
public sealed class TheDivisionViewModel : GameViewModel
|
||||||
{
|
{
|
||||||
public TheDivisionViewModel(MainManager main, IEventAggregator events, IProfileEditorVmFactory pFactory)
|
public TheDivisionViewModel(MainManager main, IProfileEditorVmFactory pFactory, TheDivisionModel model)
|
||||||
: base(main, new TheDivisionModel(main, new TheDivisionSettings()), events, pFactory)
|
: base(main, model, pFactory)
|
||||||
{
|
{
|
||||||
DisplayName = "The Division";
|
DisplayName = "The Division";
|
||||||
MainManager.EffectManager.EffectModels.Add(GameModel);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,62 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <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.Games.UnrealTournament {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
|
||||||
internal sealed partial class UnrealTournament : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static UnrealTournament defaultInstance = ((UnrealTournament)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new UnrealTournament())));
|
|
||||||
|
|
||||||
public static UnrealTournament Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
|
||||||
public bool Enabled {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["Enabled"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["Enabled"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Default")]
|
|
||||||
public string LastProfile {
|
|
||||||
get {
|
|
||||||
return ((string)(this["LastProfile"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["LastProfile"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("")]
|
|
||||||
public string GameDirectory {
|
|
||||||
get {
|
|
||||||
return ((string)(this["GameDirectory"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["GameDirectory"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,17 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
|
||||||
|
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
|
||||||
GeneratedClassNamespace="Artemis.Modules.Games.UnrealTournament" GeneratedClassName="UnrealTournament">
|
|
||||||
<Profiles />
|
|
||||||
<Settings>
|
|
||||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="LastProfile" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)">Default</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="GameDirectory" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)" />
|
|
||||||
</Setting>
|
|
||||||
</Settings>
|
|
||||||
</SettingsFile>
|
|
||||||
@ -32,17 +32,25 @@ namespace Artemis.Modules.Games.UnrealTournament
|
|||||||
public string PlayerName { get; set; }
|
public string PlayerName { get; set; }
|
||||||
public string UniqueId { get; set; }
|
public string UniqueId { get; set; }
|
||||||
public int Score { get; set; }
|
public int Score { get; set; }
|
||||||
|
|
||||||
[JsonProperty("Team Num")]
|
[JsonProperty("Team Num")]
|
||||||
public int TeamNum { get; set; }
|
public int TeamNum { get; set; }
|
||||||
|
|
||||||
public int RankCheck { get; set; }
|
public int RankCheck { get; set; }
|
||||||
|
|
||||||
[JsonProperty("Duel Rank")]
|
[JsonProperty("Duel Rank")]
|
||||||
public int DuelRank { get; set; }
|
public int DuelRank { get; set; }
|
||||||
|
|
||||||
public int No_of_Duel_Played { get; set; }
|
public int No_of_Duel_Played { get; set; }
|
||||||
|
|
||||||
[JsonProperty("CTF Rank")]
|
[JsonProperty("CTF Rank")]
|
||||||
public int CTFRank { get; set; }
|
public int CTFRank { get; set; }
|
||||||
|
|
||||||
public int No_CTF_MatchesPlayed { get; set; }
|
public int No_CTF_MatchesPlayed { get; set; }
|
||||||
|
|
||||||
[JsonProperty("TDM Rank")]
|
[JsonProperty("TDM Rank")]
|
||||||
public int TDMRank { get; set; }
|
public int TDMRank { get; set; }
|
||||||
|
|
||||||
public int No_TDM_MatchesPlayed { get; set; }
|
public int No_TDM_MatchesPlayed { get; set; }
|
||||||
public int DMRank { get; set; }
|
public int DMRank { get; set; }
|
||||||
public int No_DM_Matches_Played { get; set; }
|
public int No_DM_Matches_Played { get; set; }
|
||||||
@ -100,5 +108,4 @@ namespace Artemis.Modules.Games.UnrealTournament
|
|||||||
public int RespawnWaitTime { get; set; }
|
public int RespawnWaitTime { get; set; }
|
||||||
public int ForceRespawnTime { get; set; }
|
public int ForceRespawnTime { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using Artemis.DAL;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Profiles.Layers.Models;
|
using Artemis.Profiles.Layers.Models;
|
||||||
@ -9,8 +10,8 @@ namespace Artemis.Modules.Games.UnrealTournament
|
|||||||
{
|
{
|
||||||
public class UnrealTournamentModel : GameModel
|
public class UnrealTournamentModel : GameModel
|
||||||
{
|
{
|
||||||
public UnrealTournamentModel(MainManager mainManager, UnrealTournamentSettings settings)
|
public UnrealTournamentModel(MainManager mainManager)
|
||||||
: base(mainManager, settings, new UnrealTournamentDataModel())
|
: base(mainManager, SettingsProvider.Load<UnrealTournamentSettings>(), new UnrealTournamentDataModel())
|
||||||
{
|
{
|
||||||
Name = "UnrealTournament";
|
Name = "UnrealTournament";
|
||||||
ProcessName = "UE4-Win64-Shipping";
|
ProcessName = "UE4-Win64-Shipping";
|
||||||
|
|||||||
@ -1,36 +1,9 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Settings;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.UnrealTournament
|
namespace Artemis.Modules.Games.UnrealTournament
|
||||||
{
|
{
|
||||||
public class UnrealTournamentSettings : GameSettings
|
public class UnrealTournamentSettings : GameSettings
|
||||||
{
|
{
|
||||||
public UnrealTournamentSettings()
|
|
||||||
{
|
|
||||||
Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public string GameDirectory { get; set; }
|
public string GameDirectory { get; set; }
|
||||||
|
|
||||||
public sealed override void Load()
|
|
||||||
{
|
|
||||||
Enabled = UnrealTournament.Default.Enabled;
|
|
||||||
LastProfile = UnrealTournament.Default.LastProfile;
|
|
||||||
GameDirectory = UnrealTournament.Default.GameDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void Save()
|
|
||||||
{
|
|
||||||
UnrealTournament.Default.Enabled = Enabled;
|
|
||||||
UnrealTournament.Default.LastProfile = LastProfile;
|
|
||||||
UnrealTournament.Default.GameDirectory = GameDirectory;
|
|
||||||
|
|
||||||
UnrealTournament.Default.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void ToDefault()
|
|
||||||
{
|
|
||||||
Enabled = true;
|
|
||||||
GameDirectory = string.Empty;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -10,7 +10,6 @@ using Artemis.Managers;
|
|||||||
using Artemis.Properties;
|
using Artemis.Properties;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Artemis.ViewModels.Abstract;
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json.Linq;
|
using Newtonsoft.Json.Linq;
|
||||||
|
|
||||||
@ -18,8 +17,8 @@ namespace Artemis.Modules.Games.UnrealTournament
|
|||||||
{
|
{
|
||||||
public sealed class UnrealTournamentViewModel : GameViewModel
|
public sealed class UnrealTournamentViewModel : GameViewModel
|
||||||
{
|
{
|
||||||
public UnrealTournamentViewModel(MainManager main, IEventAggregator events, IProfileEditorVmFactory pFactory)
|
public UnrealTournamentViewModel(MainManager main, IProfileEditorVmFactory pFactory, UnrealTournamentModel model)
|
||||||
: base(main, new UnrealTournamentModel(main, new UnrealTournamentSettings()), events, pFactory)
|
: base(main, model, pFactory)
|
||||||
{
|
{
|
||||||
DisplayName = "Unreal Tournament";
|
DisplayName = "Unreal Tournament";
|
||||||
MainManager.EffectManager.EffectModels.Add(GameModel);
|
MainManager.EffectManager.EffectModels.Add(GameModel);
|
||||||
@ -33,7 +32,8 @@ namespace Artemis.Modules.Games.UnrealTournament
|
|||||||
{
|
{
|
||||||
var gameSettings = (UnrealTournamentSettings) GameSettings;
|
var gameSettings = (UnrealTournamentSettings) GameSettings;
|
||||||
// If already propertly set up, don't do anything
|
// If already propertly set up, don't do anything
|
||||||
if (gameSettings.GameDirectory != null && File.Exists(gameSettings.GameDirectory + "UE4-Win64-Shipping.exe"))
|
if ((gameSettings.GameDirectory != null) &&
|
||||||
|
File.Exists(gameSettings.GameDirectory + "UE4-Win64-Shipping.exe"))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Attempt to read the file
|
// Attempt to read the file
|
||||||
@ -120,7 +120,8 @@ namespace Artemis.Modules.Games.UnrealTournament
|
|||||||
{
|
{
|
||||||
var gif = Resources.redeemer;
|
var gif = Resources.redeemer;
|
||||||
ProfileProvider.InsertGif(ProfileProvider.GetAll()
|
ProfileProvider.InsertGif(ProfileProvider.GetAll()
|
||||||
.Where(p => p.GameName == "UnrealTournament" && p.Name == "Default"), "Redeemer GIF", gif, "redeemer");
|
.Where(p => (p.GameName == "UnrealTournament") && (p.Name == "Default")), "Redeemer GIF", gif,
|
||||||
|
"redeemer");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,50 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <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.Games.Witcher3 {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
|
||||||
internal sealed partial class Witcher3 : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static Witcher3 defaultInstance = ((Witcher3)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Witcher3())));
|
|
||||||
|
|
||||||
public static Witcher3 Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
|
||||||
public bool Enabled {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["Enabled"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["Enabled"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Default")]
|
|
||||||
public string LastProfile {
|
|
||||||
get {
|
|
||||||
return ((string)(this["LastProfile"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["LastProfile"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
|
||||||
|
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
|
||||||
GeneratedClassNamespace="Artemis.Modules.Games.Witcher3" GeneratedClassName="Witcher3">
|
|
||||||
<Profiles />
|
|
||||||
<Settings>
|
|
||||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="LastProfile" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)">Default</Value>
|
|
||||||
</Setting>
|
|
||||||
</Settings>
|
|
||||||
</SettingsFile>
|
|
||||||
@ -4,6 +4,7 @@ using System.Diagnostics;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
using Artemis.DAL;
|
||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Models;
|
using Artemis.Models;
|
||||||
using Artemis.Profiles.Layers.Models;
|
using Artemis.Profiles.Layers.Models;
|
||||||
@ -16,8 +17,8 @@ namespace Artemis.Modules.Games.Witcher3
|
|||||||
private readonly Stopwatch _updateSw;
|
private readonly Stopwatch _updateSw;
|
||||||
private string _witcherSettings;
|
private string _witcherSettings;
|
||||||
|
|
||||||
public Witcher3Model(MainManager mainManager, Witcher3Settings settings)
|
public Witcher3Model(MainManager mainManager)
|
||||||
: base(mainManager, settings, new Witcher3DataModel())
|
: base(mainManager, SettingsProvider.Load<Witcher3Settings>(), new Witcher3DataModel())
|
||||||
{
|
{
|
||||||
Name = "Witcher3";
|
Name = "Witcher3";
|
||||||
ProcessName = "witcher3";
|
ProcessName = "witcher3";
|
||||||
|
|||||||
@ -1,31 +1,10 @@
|
|||||||
using Artemis.Models;
|
using Artemis.Settings;
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.Witcher3
|
namespace Artemis.Modules.Games.Witcher3
|
||||||
{
|
{
|
||||||
public class Witcher3Settings : GameSettings
|
public class Witcher3Settings : GameSettings
|
||||||
{
|
{
|
||||||
public Witcher3Settings()
|
// TODO: Change this to work the same as UT
|
||||||
{
|
public string GameDirectory { get; set; }
|
||||||
Load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void Load()
|
|
||||||
{
|
|
||||||
Enabled = Witcher3.Default.Enabled;
|
|
||||||
LastProfile = Witcher3.Default.LastProfile;
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void Save()
|
|
||||||
{
|
|
||||||
Witcher3.Default.Enabled = Enabled;
|
|
||||||
Witcher3.Default.LastProfile = LastProfile;
|
|
||||||
|
|
||||||
Witcher3.Default.Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public sealed override void ToDefault()
|
|
||||||
{
|
|
||||||
Enabled = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -9,17 +9,15 @@ using Artemis.InjectionFactories;
|
|||||||
using Artemis.Managers;
|
using Artemis.Managers;
|
||||||
using Artemis.Utilities;
|
using Artemis.Utilities;
|
||||||
using Artemis.ViewModels.Abstract;
|
using Artemis.ViewModels.Abstract;
|
||||||
using Caliburn.Micro;
|
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.Witcher3
|
namespace Artemis.Modules.Games.Witcher3
|
||||||
{
|
{
|
||||||
public sealed class Witcher3ViewModel : GameViewModel
|
public sealed class Witcher3ViewModel : GameViewModel
|
||||||
{
|
{
|
||||||
public Witcher3ViewModel(MainManager main, IEventAggregator events, IProfileEditorVmFactory pFactory)
|
public Witcher3ViewModel(MainManager main, IProfileEditorVmFactory pFactory, Witcher3Model model)
|
||||||
: base(main, new Witcher3Model(main, new Witcher3Settings()), events, pFactory)
|
: base(main, model, pFactory)
|
||||||
{
|
{
|
||||||
DisplayName = "The Witcher 3";
|
DisplayName = "The Witcher 3";
|
||||||
MainManager.EffectManager.EffectModels.Add(GameModel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async void AutoInstall()
|
public async void AutoInstall()
|
||||||
@ -62,8 +60,6 @@ namespace Artemis.Modules.Games.Witcher3
|
|||||||
Directory.GetFiles(dialog.SelectedPath + @"\mods", "playerWitcher.ws", SearchOption.AllDirectories)
|
Directory.GetFiles(dialog.SelectedPath + @"\mods", "playerWitcher.ws", SearchOption.AllDirectories)
|
||||||
.FirstOrDefault();
|
.FirstOrDefault();
|
||||||
if (file != null)
|
if (file != null)
|
||||||
{
|
|
||||||
// Don't trip over our own mod
|
|
||||||
if (!file.Contains("modArtemis"))
|
if (!file.Contains("modArtemis"))
|
||||||
{
|
{
|
||||||
var viewHelp = await
|
var viewHelp = await
|
||||||
@ -80,11 +76,10 @@ namespace Artemis.Modules.Games.Witcher3
|
|||||||
|
|
||||||
archive.ExtractToDirectory(folder + @"witcher3-mod", true);
|
archive.ExtractToDirectory(folder + @"witcher3-mod", true);
|
||||||
|
|
||||||
System.Diagnostics.Process.Start(
|
Process.Start(
|
||||||
new ProcessStartInfo("https://github.com/SpoinkyNL/Artemis/wiki/The-Witcher-3"));
|
new ProcessStartInfo("https://github.com/SpoinkyNL/Artemis/wiki/The-Witcher-3"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
archive.ExtractToDirectory(dialog.SelectedPath, true);
|
archive.ExtractToDirectory(dialog.SelectedPath, true);
|
||||||
|
|||||||
@ -1,50 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <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.Games.WorldofWarcraft {
|
|
||||||
|
|
||||||
|
|
||||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")]
|
|
||||||
internal sealed partial class WoW : global::System.Configuration.ApplicationSettingsBase {
|
|
||||||
|
|
||||||
private static WoW defaultInstance = ((WoW)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new WoW())));
|
|
||||||
|
|
||||||
public static WoW Default {
|
|
||||||
get {
|
|
||||||
return defaultInstance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("True")]
|
|
||||||
public bool Enabled {
|
|
||||||
get {
|
|
||||||
return ((bool)(this["Enabled"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["Enabled"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
|
||||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
|
||||||
[global::System.Configuration.DefaultSettingValueAttribute("Default")]
|
|
||||||
public string LastProfile {
|
|
||||||
get {
|
|
||||||
return ((string)(this["LastProfile"]));
|
|
||||||
}
|
|
||||||
set {
|
|
||||||
this["LastProfile"] = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,14 +0,0 @@
|
|||||||
<?xml version='1.0' encoding='utf-8'?>
|
|
||||||
|
|
||||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)"
|
|
||||||
GeneratedClassNamespace="Artemis.Modules.Games.WoW" GeneratedClassName="WoW">
|
|
||||||
<Profiles />
|
|
||||||
<Settings>
|
|
||||||
<Setting Name="Enabled" Type="System.Boolean" Scope="User">
|
|
||||||
<Value Profile="(Default)">True</Value>
|
|
||||||
</Setting>
|
|
||||||
<Setting Name="LastProfile" Type="System.String" Scope="User">
|
|
||||||
<Value Profile="(Default)">Default</Value>
|
|
||||||
</Setting>
|
|
||||||
</Settings>
|
|
||||||
</SettingsFile>
|
|
||||||
@ -1,54 +1,54 @@
|
|||||||
using System.Collections.Generic;
|
//using System.Collections.Generic;
|
||||||
using Artemis.Managers;
|
//using Artemis.Managers;
|
||||||
using Artemis.Models;
|
//using Artemis.Models;
|
||||||
using Artemis.Profiles.Layers.Models;
|
//using Artemis.Profiles.Layers.Models;
|
||||||
using Artemis.Utilities.Memory;
|
//using Artemis.Utilities.Memory;
|
||||||
|
//
|
||||||
|
//namespace Artemis.Modules.Games.WorldofWarcraft
|
||||||
|
//{
|
||||||
|
// public class WoWModel : GameModel
|
||||||
|
// {
|
||||||
|
// private Memory _memory;
|
||||||
|
//
|
||||||
|
// public WoWModel(MainManager mainManager): base(mainManager, SettingsProvider.Load<WoWSettings>(), new WoWDataModel())
|
||||||
|
// {
|
||||||
|
// Name = "WoW";
|
||||||
|
// ProcessName = "Wow-64";
|
||||||
|
// Scale = 4;
|
||||||
|
// Enabled = Settings.Enabled;
|
||||||
|
// Initialized = false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public int Scale { get; set; }
|
||||||
|
//
|
||||||
|
// public override void Dispose()
|
||||||
|
// {
|
||||||
|
// Initialized = false;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public override void Enable()
|
||||||
|
// {
|
||||||
|
// var tempProcess = MemoryHelpers.GetProcessIfRunning(ProcessName);
|
||||||
|
// if (tempProcess == null)
|
||||||
|
// return;
|
||||||
|
//
|
||||||
|
// _memory = new Memory(tempProcess);
|
||||||
|
//
|
||||||
|
// Initialized = true;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public override void Update()
|
||||||
|
// {
|
||||||
|
// if (Profile == null || DataModel == null || _memory == null)
|
||||||
|
// return;
|
||||||
|
//
|
||||||
|
//// _memory.ReadMemory();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// public override List<LayerModel> GetRenderLayers(bool keyboardOnly)
|
||||||
|
// {
|
||||||
|
// return Profile.GetRenderLayers(DataModel, keyboardOnly);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
namespace Artemis.Modules.Games.WorldofWarcraft
|
|
||||||
{
|
|
||||||
public class WoWModel : GameModel
|
|
||||||
{
|
|
||||||
private Memory _memory;
|
|
||||||
|
|
||||||
public WoWModel(MainManager mainManager, WoWSettings settings)
|
|
||||||
: base(mainManager, settings, new WoWDataModel())
|
|
||||||
{
|
|
||||||
Name = "WoW";
|
|
||||||
ProcessName = "Wow-64";
|
|
||||||
Scale = 4;
|
|
||||||
Enabled = Settings.Enabled;
|
|
||||||
Initialized = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int Scale { get; set; }
|
|
||||||
|
|
||||||
public override void Dispose()
|
|
||||||
{
|
|
||||||
Initialized = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Enable()
|
|
||||||
{
|
|
||||||
var tempProcess = MemoryHelpers.GetProcessIfRunning(ProcessName);
|
|
||||||
if (tempProcess == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
_memory = new Memory(tempProcess);
|
|
||||||
|
|
||||||
Initialized = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public override void Update()
|
|
||||||
{
|
|
||||||
if (Profile == null || DataModel == null || _memory == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// _memory.ReadMemory();
|
|
||||||
}
|
|
||||||
|
|
||||||
public override List<LayerModel> GetRenderLayers(bool keyboardOnly)
|
|
||||||
{
|
|
||||||
return Profile.GetRenderLayers(DataModel, keyboardOnly);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user