1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2026-01-01 10:13:30 +00:00

Added smoothing to default Windows profile

Added default easing values
Fixed Logitech DLL restore on startup
Bumped version number
This commit is contained in:
SpoinkyNL 2016-12-13 19:27:00 +01:00
parent 118d4b2df2
commit 1ee6678448
12 changed files with 44 additions and 38 deletions

View File

@ -324,9 +324,9 @@
<Compile Include="DeviceProviders\CoolerMaster\MasterkeysProL.cs" /> <Compile Include="DeviceProviders\CoolerMaster\MasterkeysProL.cs" />
<Compile Include="DeviceProviders\CoolerMaster\MasterkeysProS.cs" /> <Compile Include="DeviceProviders\CoolerMaster\MasterkeysProS.cs" />
<Compile Include="DeviceProviders\CoolerMaster\Utilities\CmSdk.cs" /> <Compile Include="DeviceProviders\CoolerMaster\Utilities\CmSdk.cs" />
<Compile Include="DeviceProviders\Corsair\CorsairMice.cs" /> <Compile Include="DeviceProviders\Corsair\CorsairMouse.cs" />
<Compile Include="DeviceProviders\Corsair\CorsairHeadsets.cs" /> <Compile Include="DeviceProviders\Corsair\CorsairHeadset.cs" />
<Compile Include="DeviceProviders\Corsair\CorsairMousemats.cs" /> <Compile Include="DeviceProviders\Corsair\CorsairMousemat.cs" />
<Compile Include="DeviceProviders\Corsair\Utilities\KeyMap.cs" /> <Compile Include="DeviceProviders\Corsair\Utilities\KeyMap.cs" />
<Compile Include="DeviceProviders\DeviceProvider.cs" /> <Compile Include="DeviceProviders\DeviceProvider.cs" />
<Compile Include="DeviceProviders\Logitech\G810.cs" /> <Compile Include="DeviceProviders\Logitech\G810.cs" />
@ -344,7 +344,7 @@
<Compile Include="InjectionModules\EffectModules.cs" /> <Compile Include="InjectionModules\EffectModules.cs" />
<Compile Include="InjectionModules\ProfileModules.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\CorsairKeyboard.cs" />
<Compile Include="DeviceProviders\KeyboardProvider.cs" /> <Compile Include="DeviceProviders\KeyboardProvider.cs" />
<Compile Include="DeviceProviders\Logitech\G910.cs" /> <Compile Include="DeviceProviders\Logitech\G910.cs" />
<Compile Include="DeviceProviders\Logitech\Utilities\KeyboardNames.cs" /> <Compile Include="DeviceProviders\Logitech\Utilities\KeyboardNames.cs" />

View File

@ -8,6 +8,7 @@ using Artemis.InjectionModules;
using Artemis.Settings; using Artemis.Settings;
using Artemis.Utilities; using Artemis.Utilities;
using Artemis.Utilities.Converters; using Artemis.Utilities.Converters;
using Artemis.Utilities.DataReaders;
using Artemis.ViewModels; using Artemis.ViewModels;
using Caliburn.Micro; using Caliburn.Micro;
using Newtonsoft.Json; using Newtonsoft.Json;
@ -23,6 +24,8 @@ namespace Artemis
{ {
// Start logging before anything else // Start logging before anything else
Logging.SetupLogging(SettingsProvider.Load<GeneralSettings>().LogLevel); Logging.SetupLogging(SettingsProvider.Load<GeneralSettings>().LogLevel);
// Restore DDLs before interacting with any SDKs
DllManager.RestoreLogitechDll();
Initialize(); Initialize();
BindSpecialValues(); BindSpecialValues();

View File

@ -8,9 +8,9 @@ using Ninject.Extensions.Logging;
namespace Artemis.DeviceProviders.Corsair namespace Artemis.DeviceProviders.Corsair
{ {
internal class CorsairHeadsets : DeviceProvider internal class CorsairHeadset : DeviceProvider
{ {
public CorsairHeadsets(ILogger logger) public CorsairHeadset(ILogger logger)
{ {
Logger = logger; Logger = logger;
Type = DeviceType.Headset; Type = DeviceType.Headset;

View File

@ -10,19 +10,18 @@ using CUE.NET;
using CUE.NET.Brushes; using CUE.NET.Brushes;
using CUE.NET.Devices.Generic; using CUE.NET.Devices.Generic;
using CUE.NET.Devices.Generic.Enums; using CUE.NET.Devices.Generic.Enums;
using CUE.NET.Devices.Keyboard;
using CUE.NET.Helper; using CUE.NET.Helper;
using Ninject.Extensions.Logging; using Ninject.Extensions.Logging;
using Point = System.Drawing.Point; using Point = System.Drawing.Point;
namespace Artemis.DeviceProviders.Corsair namespace Artemis.DeviceProviders.Corsair
{ {
public class CorsairKeyboards : KeyboardProvider public class CorsairKeyboard : KeyboardProvider
{ {
private CorsairKeyboard _keyboard; private CUE.NET.Devices.Keyboard.CorsairKeyboard _keyboard;
private ImageBrush _keyboardBrush; private ImageBrush _keyboardBrush;
public CorsairKeyboards(ILogger logger) public CorsairKeyboard(ILogger logger)
{ {
Logger = logger; Logger = logger;
Name = "Corsair RGB Keyboards"; Name = "Corsair RGB Keyboards";
@ -83,7 +82,6 @@ namespace Artemis.DeviceProviders.Corsair
} }
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());
} }

View File

@ -8,9 +8,9 @@ using Ninject.Extensions.Logging;
namespace Artemis.DeviceProviders.Corsair namespace Artemis.DeviceProviders.Corsair
{ {
internal class CorsairMice : DeviceProvider internal class CorsairMouse : DeviceProvider
{ {
public CorsairMice(ILogger logger) public CorsairMouse(ILogger logger)
{ {
Logger = logger; Logger = logger;
Type = DeviceType.Mouse; Type = DeviceType.Mouse;

View File

@ -4,14 +4,13 @@ using System.Linq;
using System.Threading; using System.Threading;
using CUE.NET; using CUE.NET;
using CUE.NET.Devices.Generic.Enums; using CUE.NET.Devices.Generic.Enums;
using CUE.NET.Devices.Mousemat.Enums;
using Ninject.Extensions.Logging; using Ninject.Extensions.Logging;
namespace Artemis.DeviceProviders.Corsair namespace Artemis.DeviceProviders.Corsair
{ {
internal class CorsairMousemats : DeviceProvider internal class CorsairMousemat : DeviceProvider
{ {
public CorsairMousemats(ILogger logger) public CorsairMousemat(ILogger logger)
{ {
Logger = logger; Logger = logger;
Type = DeviceType.Mousemat; Type = DeviceType.Mousemat;
@ -40,7 +39,7 @@ namespace Artemis.DeviceProviders.Corsair
public override void UpdateDevice(Bitmap bitmap) public override void UpdateDevice(Bitmap bitmap)
{ {
if (!CanUse || bitmap == null) if (!CanUse || (bitmap == null))
return; return;
if (bitmap.Width != bitmap.Height) if (bitmap.Width != bitmap.Height)
throw new ArgumentException("Bitmap must be a perfect square"); throw new ArgumentException("Bitmap must be a perfect square");

View File

@ -1,6 +1,5 @@
using System.Drawing; using System.Drawing;
using System.Threading; using System.Threading;
using System.Windows;
using Artemis.DeviceProviders.Logitech.Utilities; using Artemis.DeviceProviders.Logitech.Utilities;
using Artemis.Utilities.DataReaders; using Artemis.Utilities.DataReaders;
using Microsoft.Win32; using Microsoft.Win32;
@ -23,8 +22,17 @@ namespace Artemis.DeviceProviders.Logitech
return false; return false;
} }
if (DllManager.RestoreLogitechDll()) if (DllManager.DllPlaced())
RestoreDll(); {
CantEnableText =
"Artemis couldn't enable your Logitech keyboard, because the required files are not in place.\n\n" +
"This happens when you run The Division or GTA and shut down Artemis before shutting down The Division\n" +
"Artemis tries to fix this automatically on startup but because the files may have been in use it failed.\n\n" +
"To try again, restart Artemis or check out the FAQ.";
return false;
}
int majorNum = 0, minorNum = 0, buildNum = 0; int majorNum = 0, minorNum = 0, buildNum = 0;
LogitechGSDK.LogiLedInit(); LogitechGSDK.LogiLedInit();
@ -42,15 +50,6 @@ namespace Artemis.DeviceProviders.Logitech
return version >= 88115; return version >= 88115;
} }
private void RestoreDll()
{
MessageBox.Show(
"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" +
"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.");
}
public override void Enable() public override void Enable()
{ {
// Initialize the SDK // Initialize the SDK

View File

@ -12,7 +12,7 @@ namespace Artemis.InjectionModules
public override void Load() public override void Load()
{ {
// Keyboards // Keyboards
Bind<DeviceProvider>().To<CorsairKeyboards>().InSingletonScope(); Bind<DeviceProvider>().To<CorsairKeyboard>().InSingletonScope();
Bind<DeviceProvider>().To<G910>().InSingletonScope(); Bind<DeviceProvider>().To<G910>().InSingletonScope();
Bind<DeviceProvider>().To<G810>().InSingletonScope(); Bind<DeviceProvider>().To<G810>().InSingletonScope();
Bind<DeviceProvider>().To<BlackWidow>().InSingletonScope(); Bind<DeviceProvider>().To<BlackWidow>().InSingletonScope();
@ -20,13 +20,13 @@ namespace Artemis.InjectionModules
Bind<DeviceProvider>().To<MasterkeysProS>().InSingletonScope(); Bind<DeviceProvider>().To<MasterkeysProS>().InSingletonScope();
// Mice // Mice
Bind<DeviceProvider>().To<CorsairMice>().InSingletonScope(); Bind<DeviceProvider>().To<CorsairMouse>().InSingletonScope();
// Headsets // Headsets
Bind<DeviceProvider>().To<CorsairHeadsets>().InSingletonScope(); Bind<DeviceProvider>().To<CorsairHeadset>().InSingletonScope();
// Mousemats // Mousemats
Bind<DeviceProvider>().To<CorsairMousemats>().InSingletonScope(); Bind<DeviceProvider>().To<CorsairMousemat>().InSingletonScope();
// Other // Other
Bind<DeviceProvider>().To<LogitechGeneric>().InSingletonScope(); Bind<DeviceProvider>().To<LogitechGeneric>().InSingletonScope();

View File

@ -28,6 +28,7 @@ namespace Artemis.Profiles.Layers.Models
[JsonIgnore] [JsonIgnore]
public ImageSource LayerImage => LayerType.DrawThumbnail(this); public ImageSource LayerImage => LayerType.DrawThumbnail(this);
[JsonIgnore] [JsonIgnore]
public TweenModel TweenModel { get; set; } public TweenModel TweenModel { get; set; }
@ -176,7 +177,13 @@ namespace Artemis.Profiles.Layers.Models
Width = 1, Width = 1,
X = 0, X = 0,
Y = 0, Y = 0,
Opacity = 1 Opacity = 1,
HeightEaseTime = 0,
HeightEase = "Linear",
WidthEaseTime = 0,
WidthEase = "Linear",
OpacityEaseTime = 0,
OpacityEase = "Linear"
} }
}; };
} }
@ -236,7 +243,7 @@ namespace Artemis.Profiles.Layers.Models
if (height < 0) if (height < 0)
height = 0; height = 0;
return new Rect(X * scale, Y * scale, width * scale, height * scale); return new Rect(X*scale, Y*scale, width*scale, height*scale);
} }
/// <summary> /// <summary>

View File

@ -53,7 +53,7 @@ using System.Windows;
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.5.0.4")] [assembly: AssemblyVersion("1.6.0.0")]
[assembly: AssemblyFileVersion("1.5.0.4")] [assembly: AssemblyFileVersion("1.6.0.0")]
[assembly: InternalsVisibleTo("Artemis.Explorables")] [assembly: InternalsVisibleTo("Artemis.Explorables")]

View File

@ -33,7 +33,7 @@ namespace Artemis.Utilities.DataReaders
public static bool RestoreLogitechDll() public static bool RestoreLogitechDll()
{ {
if (!File.Exists(LogitechPath + @"\LogitechLed.dll") || !File.Exists(LogitechPath + @"\artemis.txt")) if (!DllPlaced())
return false; return false;
try try