mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
1.2.3.0
Improved profile loading performance Updated packages Added default GIF for UT Added default profiles for UT Bumped version number
This commit is contained in:
parent
841979098c
commit
8a0fc47514
@ -2,65 +2,26 @@
|
||||
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings"
|
||||
type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<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.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.WindowsProfile.WindowsProfile"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.Overwatch.Overwatch"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.TheDivision.TheDivision"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.Dota2.Dota2"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.RocketLeague.RocketLeague"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.Offsets"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.Witcher3.Witcher3"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Effects.AudioVisualizer.AudioVisualization"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.CounterStrike.CounterStrike"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.CounterStrike"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.AudioVisualization"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.RocketLeague"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Properties.Settings"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.TypeWave"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.General"
|
||||
type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
|
||||
allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<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.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.WindowsProfile.WindowsProfile" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.Overwatch.Overwatch" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.TheDivision.TheDivision" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.Dota2.Dota2" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Overlays.VolumeDisplay.VolumeDisplay" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.RocketLeague.RocketLeague" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.Offsets" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.Witcher3.Witcher3" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Effects.AudioVisualizer.AudioVisualization" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Modules.Games.CounterStrike.CounterStrike" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.CounterStrike" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.AudioVisualization" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.RocketLeague" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.TypeWave" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
<section name="Artemis.Settings.General" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<connectionStrings />
|
||||
@ -330,7 +291,7 @@
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-8.0.0.0" newVersion="8.0.0.0" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="log4net" publicKeyToken="669e0ddf0bb1aa2a" culture="neutral" />
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
<ProductName>Artemis</ProductName>
|
||||
<PublisherName>Artemis</PublisherName>
|
||||
<ApplicationRevision>0</ApplicationRevision>
|
||||
<ApplicationVersion>1.2.2.0</ApplicationVersion>
|
||||
<ApplicationVersion>1.2.3.0</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||
<PublishWizardCompleted>true</PublishWizardCompleted>
|
||||
@ -141,8 +141,8 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>lib\ColorBox.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Corale.Colore, Version=4.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Colore.4.0.0\lib\net35\Corale.Colore.dll</HintPath>
|
||||
<Reference Include="Corale.Colore, Version=5.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Colore.5.0.0\lib\net35\Corale.Colore.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="CUE.NET, Version=1.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@ -176,8 +176,8 @@
|
||||
<HintPath>..\packages\NAudio.1.7.3\lib\net35\NAudio.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Reference Include="Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Ninject, Version=3.2.0.0, Culture=neutral, PublicKeyToken=c7192dc5380945e7, processorArchitecture=MSIL">
|
||||
@ -197,7 +197,7 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NLog.4.3.4\lib\net45\NLog.dll</HintPath>
|
||||
<HintPath>..\packages\NLog.4.3.7\lib\net45\NLog.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Process.NET, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
@ -205,7 +205,7 @@
|
||||
<HintPath>D:\Downloads\Chome Downloads\Process.NET-master\Process.NET-master\src\Process.NET\bin\Release\Process.NET.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="SpotifyAPI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SpotifyAPI-NET.2.9.0\lib\SpotifyAPI.dll</HintPath>
|
||||
<HintPath>..\packages\SpotifyAPI-NET.2.11.0\lib\SpotifyAPI.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
@ -639,6 +639,9 @@
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>WoW.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="NLog.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Resources\generic.png" />
|
||||
<None Include="Resources\Keyboards\g810.png" />
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
@ -686,9 +689,6 @@
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>VolumeDisplay.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="NLog.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
@ -878,6 +878,7 @@
|
||||
<Content Include="LogitechLedEnginesWrapper.dll">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="Modules\Games\UnrealTournament\Resources\redeemer.gif" />
|
||||
<Content Include="Resources\CounterStrike\csgoGamestateConfiguration.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Linq;
|
||||
@ -19,9 +20,10 @@ namespace Artemis.DAL
|
||||
{
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
private static readonly string ProfileFolder = Environment
|
||||
.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis\profiles";
|
||||
private static readonly string ProfileFolder =
|
||||
Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis\profiles";
|
||||
|
||||
private static readonly List<ProfileModel> Profiles = new List<ProfileModel>();
|
||||
private static bool _installedDefaults;
|
||||
|
||||
/// <summary>
|
||||
@ -30,7 +32,15 @@ namespace Artemis.DAL
|
||||
/// <returns>All profiles</returns>
|
||||
public static List<ProfileModel> GetAll()
|
||||
{
|
||||
return ReadProfiles();
|
||||
lock (Profiles)
|
||||
{
|
||||
if (!Profiles.Any())
|
||||
ReadProfiles();
|
||||
|
||||
// Return a new list, this'll make sure removing/updating the retrieved list doesn't
|
||||
// affect the datastore
|
||||
return Profiles.ToList();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -59,8 +69,15 @@ namespace Artemis.DAL
|
||||
if (prof == null)
|
||||
throw new ArgumentNullException(nameof(prof));
|
||||
|
||||
lock (Profiles)
|
||||
{
|
||||
if (!Profiles.Contains(prof))
|
||||
Profiles.Add(prof);
|
||||
}
|
||||
|
||||
lock (prof)
|
||||
{
|
||||
// Store the file
|
||||
if (!(prof.GameName?.Length > 1) || !(prof.KeyboardSlug?.Length > 1) || !(prof.Name?.Length > 1))
|
||||
throw new ArgumentException("Profile is invalid. Name, GameName and KeyboardSlug are required");
|
||||
|
||||
@ -86,31 +103,43 @@ namespace Artemis.DAL
|
||||
}
|
||||
}
|
||||
|
||||
private static List<ProfileModel> ReadProfiles()
|
||||
private static void ReadProfiles()
|
||||
{
|
||||
CheckProfiles();
|
||||
InstallDefaults();
|
||||
var profiles = new List<ProfileModel>();
|
||||
|
||||
// Create the directory structure
|
||||
var profilePaths = Directory.GetFiles(ProfileFolder, "*.json", SearchOption.AllDirectories);
|
||||
|
||||
// Parse the JSON files into objects and add them if they are valid
|
||||
foreach (var path in profilePaths)
|
||||
lock (Profiles)
|
||||
{
|
||||
try
|
||||
Profiles.Clear();
|
||||
|
||||
// Create the directory structure
|
||||
var profilePaths = Directory.GetFiles(ProfileFolder, "*.json", SearchOption.AllDirectories);
|
||||
|
||||
// Parse the JSON files into objects and add them if they are valid
|
||||
foreach (var path in profilePaths)
|
||||
{
|
||||
var prof = LoadProfileIfValid(path);
|
||||
if (prof != null)
|
||||
profiles.Add(prof);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Error("Failed to load profile: {0} - {1}", path, e.InnerException.Message);
|
||||
try
|
||||
{
|
||||
var prof = LoadProfileIfValid(path);
|
||||
if (prof == null)
|
||||
continue;
|
||||
|
||||
// Only add unique profiles
|
||||
if (Profiles.Any(p => p.GameName == prof.GameName && p.Name == prof.Name &&
|
||||
p.KeyboardSlug == prof.KeyboardSlug))
|
||||
{
|
||||
Logger.Error("Didn't load duplicate profile: {0}", path);
|
||||
}
|
||||
else
|
||||
{
|
||||
Profiles.Add(prof);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Error("Failed to load profile: {0} - {1}", path, e.InnerException.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return profiles;
|
||||
InstallDefaults();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -133,23 +162,27 @@ namespace Artemis.DAL
|
||||
var archive = new ZipArchive(stream);
|
||||
archive.ExtractToDirectory(ProfileFolder, true);
|
||||
|
||||
// Extract the demo GIF file
|
||||
var gifPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis\demo-gif.gif";
|
||||
Resources.demo_gif.Save(gifPath);
|
||||
var demoProfiles = Profiles.Where(d => d.Name == "Demo (duplicate to keep changes)");
|
||||
InsertGif(demoProfiles, "GIF", Resources.demo_gif, "demo-gif");
|
||||
}
|
||||
|
||||
// Set the GIF path on each demo profile
|
||||
var demoProfiles = GetAll().Where(d => d.Name == "Demo (Duplicate to keep changes)");
|
||||
foreach (var demoProfile in demoProfiles)
|
||||
public static void InsertGif(IEnumerable<ProfileModel> profileModels, string layerName, Bitmap gifFile,
|
||||
string fileName)
|
||||
{
|
||||
// Extract the GIF file
|
||||
var gifDir = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + @"\Artemis\gifs";
|
||||
Directory.CreateDirectory(gifDir);
|
||||
var gifPath = gifDir + $"\\{fileName}.gif";
|
||||
gifFile.Save(gifPath);
|
||||
|
||||
foreach (var profile in profileModels)
|
||||
{
|
||||
var gifLayer = demoProfile
|
||||
.Layers.FirstOrDefault(l => l.Name == "Demo - GIFs")?
|
||||
.Children.FirstOrDefault(c => c.Name == "GIF");
|
||||
|
||||
var gifLayer = profile.GetLayers().FirstOrDefault(l => l.Name == layerName);
|
||||
if (gifLayer == null)
|
||||
continue;
|
||||
|
||||
((KeyboardPropertiesModel) gifLayer.Properties).GifFile = gifPath;
|
||||
AddOrUpdate(demoProfile);
|
||||
AddOrUpdate(profile);
|
||||
}
|
||||
}
|
||||
|
||||
@ -208,20 +241,29 @@ namespace Artemis.DAL
|
||||
if (string.IsNullOrEmpty(name))
|
||||
return;
|
||||
|
||||
// Remove the old file
|
||||
var path = ProfileFolder + $@"\{profile.KeyboardSlug}\{profile.GameName}\{profile.Name}.json";
|
||||
if (File.Exists(path))
|
||||
File.Delete(path);
|
||||
// Remove the old profile
|
||||
DeleteProfile(profile);
|
||||
|
||||
// Update the profile, creating a new file
|
||||
profile.Name = name;
|
||||
AddOrUpdate(profile);
|
||||
}
|
||||
|
||||
public static void DeleteProfile(ProfileModel profile)
|
||||
public static void DeleteProfile(ProfileModel prof)
|
||||
{
|
||||
// Remove from datastore
|
||||
lock (Profiles)
|
||||
{
|
||||
// Get the profile from the datastore instead of just the provided value, to be certain it is removed
|
||||
var dsProfile = Profiles.FirstOrDefault(p => p.GameName == prof.GameName &&
|
||||
p.Name == prof.Name &&
|
||||
p.KeyboardSlug == prof.KeyboardSlug);
|
||||
if (dsProfile != null)
|
||||
Profiles.Remove(dsProfile);
|
||||
}
|
||||
|
||||
// Remove the file
|
||||
var path = ProfileFolder + $@"\{profile.KeyboardSlug}\{profile.GameName}\{profile.Name}.json";
|
||||
var path = ProfileFolder + $@"\{prof.KeyboardSlug}\{prof.GameName}\{prof.Name}.json";
|
||||
if (File.Exists(path))
|
||||
File.Delete(path);
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ namespace Artemis.DeviceProviders.Razer
|
||||
|
||||
public override bool CanEnable()
|
||||
{
|
||||
if (!Chroma.IsSdkAvailable())
|
||||
if (!Chroma.SdkAvailable)
|
||||
return false;
|
||||
|
||||
// Some people have Synapse installed, but not a Chroma keyboard, deal with this
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
using System.Drawing;
|
||||
using Artemis.Utilities;
|
||||
using Corale.Colore.Razer.Keyboard.Effects;
|
||||
using Color = Corale.Colore.Core.Color;
|
||||
|
||||
namespace Artemis.DeviceProviders.Razer.Utilities
|
||||
{
|
||||
@ -13,8 +14,13 @@ namespace Artemis.DeviceProviders.Razer.Utilities
|
||||
b = ImageUtilities.ResizeImage(b, width, height);
|
||||
|
||||
for (var y = 0; y < b.Height; y++)
|
||||
{
|
||||
for (var x = 0; x < b.Width; x++)
|
||||
keyboardGrid[y, x] = b.GetPixel(x, y);
|
||||
{
|
||||
var pixel = b.GetPixel(x, y);
|
||||
keyboardGrid[y, x] = new Color(pixel.R, pixel.G, pixel.B);
|
||||
}
|
||||
}
|
||||
|
||||
return keyboardGrid;
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
@ -76,8 +76,8 @@ namespace Artemis.Modules.Games.UnrealTournament
|
||||
{
|
||||
Unzoomed = 0,
|
||||
Zoomed = 3,
|
||||
ZoomingIn = 2,
|
||||
ZoomingOut = 1
|
||||
ZoomingIn = 1,
|
||||
ZoomingOut = 2
|
||||
}
|
||||
|
||||
public class Environment
|
||||
|
||||
@ -3,16 +3,12 @@ using System.Collections.Generic;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Models;
|
||||
using Artemis.Profiles.Layers.Models;
|
||||
using Artemis.Utilities.Memory;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace Artemis.Modules.Games.UnrealTournament
|
||||
{
|
||||
public class UnrealTournamentModel : GameModel
|
||||
{
|
||||
private Memory _memory;
|
||||
private GamePointersCollection _pointer;
|
||||
|
||||
public UnrealTournamentModel(MainManager mainManager, UnrealTournamentSettings settings)
|
||||
: base(mainManager, settings, new UnrealTournamentDataModel())
|
||||
{
|
||||
|
||||
@ -4,8 +4,10 @@ using System.IO.Compression;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Windows.Forms;
|
||||
using Artemis.DAL;
|
||||
using Artemis.InjectionFactories;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Properties;
|
||||
using Artemis.Utilities;
|
||||
using Artemis.ViewModels.Abstract;
|
||||
using Caliburn.Micro;
|
||||
@ -22,6 +24,7 @@ namespace Artemis.Modules.Games.UnrealTournament
|
||||
DisplayName = "Unreal Tournament";
|
||||
MainManager.EffectManager.EffectModels.Add(GameModel);
|
||||
FindGame();
|
||||
InstallGif();
|
||||
}
|
||||
|
||||
public UnrealTournamentModel UnrealTournamentModel { get; set; }
|
||||
@ -112,5 +115,12 @@ namespace Artemis.Modules.Games.UnrealTournament
|
||||
|
||||
MainManager.Logger.Info("Installed Unreal Tournament plugin in '{0}'", path);
|
||||
}
|
||||
|
||||
private void InstallGif()
|
||||
{
|
||||
var gif = Resources.redeemer;
|
||||
ProfileProvider.InsertGif(ProfileProvider.GetAll()
|
||||
.Where(p => p.GameName == "UnrealTournament" && p.Name == "Default"), "Redeemer GIF", gif, "redeemer");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -232,7 +232,6 @@
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="Layout"></xs:complexType>
|
||||
<xs:complexType name="Filter" abstract="true"></xs:complexType>
|
||||
<xs:complexType name="TimeSource" abstract="true"></xs:complexType>
|
||||
<xs:simpleType name="SimpleLayoutAttribute">
|
||||
@ -1020,8 +1019,8 @@
|
||||
<xs:element name="archiveFileName" minOccurs="0" maxOccurs="1" type="Layout" />
|
||||
<xs:element name="archiveEvery" minOccurs="0" maxOccurs="1" type="NLog.Targets.FileArchivePeriod" />
|
||||
<xs:element name="archiveAboveSize" minOccurs="0" maxOccurs="1" type="xs:long" />
|
||||
<xs:element name="maxArchiveFiles" minOccurs="0" maxOccurs="1" type="xs:integer" />
|
||||
<xs:element name="enableArchiveFileCompression" minOccurs="0" maxOccurs="1" type="xs:boolean" />
|
||||
<xs:element name="maxArchiveFiles" minOccurs="0" maxOccurs="1" type="xs:integer" />
|
||||
<xs:element name="forceManaged" minOccurs="0" maxOccurs="1" type="xs:boolean" />
|
||||
<xs:element name="cleanupFileName" minOccurs="0" maxOccurs="1" type="xs:boolean" />
|
||||
<xs:element name="fileName" minOccurs="0" maxOccurs="1" type="Layout" />
|
||||
@ -1093,16 +1092,16 @@
|
||||
<xs:documentation>Size in bytes above which log files will be automatically archived. Warning: combining this with isn't supported. We cannot create multiple archive files, if they should have the same name. Choose: </xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="maxArchiveFiles" type="xs:integer">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Maximum number of archive files that should be kept.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="enableArchiveFileCompression" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Indicates whether to compress archive files into the zip archive format.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="maxArchiveFiles" type="xs:integer">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Maximum number of archive files that should be kept.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="forceManaged" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Gets or set a value indicating whether a managed file stream is forced, instead of used the native implementation.</xs:documentation>
|
||||
@ -2238,6 +2237,18 @@
|
||||
<xs:enumeration value="HttpGet" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
<xs:complexType name="CompoundLayout">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="Layout">
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="layout" minOccurs="0" maxOccurs="unbounded" type="Layout" />
|
||||
</xs:choice>
|
||||
</xs:extension>
|
||||
</xs:complexContent>
|
||||
</xs:complexType>
|
||||
<xs:complexType name="Layout">
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded" />
|
||||
</xs:complexType>
|
||||
<xs:complexType name="CsvLayout">
|
||||
<xs:complexContent>
|
||||
<xs:extension base="Layout">
|
||||
@ -2334,8 +2345,14 @@
|
||||
<xs:extension base="Layout">
|
||||
<xs:choice minOccurs="0" maxOccurs="unbounded">
|
||||
<xs:element name="attribute" minOccurs="0" maxOccurs="unbounded" type="NLog.Layouts.JsonAttribute" />
|
||||
<xs:element name="renderEmptyObject" minOccurs="0" maxOccurs="1" type="xs:boolean" />
|
||||
<xs:element name="suppressSpaces" minOccurs="0" maxOccurs="1" type="xs:boolean" />
|
||||
</xs:choice>
|
||||
<xs:attribute name="renderEmptyObject" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Option to render the empty object value {}</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:attribute>
|
||||
<xs:attribute name="suppressSpaces" type="xs:boolean">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Option to suppress the extra spaces in the output json</xs:documentation>
|
||||
|
||||
@ -22,16 +22,13 @@ namespace Artemis.Profiles.Layers.Types.Audio
|
||||
{
|
||||
private readonly List<LayerModel> _audioLayers = new List<LayerModel>();
|
||||
private readonly MMDevice _device;
|
||||
private readonly MainManager _mainManager;
|
||||
private readonly SampleAggregator _sampleAggregator = new SampleAggregator(2048);
|
||||
private readonly WasapiLoopbackCapture _waveIn;
|
||||
private int _lines;
|
||||
private AudioPropertiesModel _previousSettings;
|
||||
private AudioPropertiesModel _properties;
|
||||
|
||||
public AudioType(MainManager mainManager)
|
||||
{
|
||||
_mainManager = mainManager;
|
||||
_device =
|
||||
new MMDeviceEnumerator().EnumerateAudioEndPoints(DataFlow.All, DeviceState.Active).FirstOrDefault();
|
||||
|
||||
|
||||
10
Artemis/Artemis/Properties/Resources.Designer.cs
generated
10
Artemis/Artemis/Properties/Resources.Designer.cs
generated
@ -288,6 +288,16 @@ namespace Artemis.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap redeemer {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("redeemer", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
|
||||
@ -190,4 +190,7 @@
|
||||
<data name="witcher3_mod" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Modules\Games\Witcher3\Resources\witcher3-mod.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name="redeemer" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Modules\Games\UnrealTournament\Resources\redeemer.gif;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
||||
Binary file not shown.
@ -15,12 +15,12 @@ namespace Artemis.Utilities
|
||||
{
|
||||
public static class Updater
|
||||
{
|
||||
public static int CurrentVersion = 1220;
|
||||
public static int CurrentVersion = 1230;
|
||||
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
|
||||
|
||||
public static async Task<Action> CheckForUpdate(MetroDialogService dialogService)
|
||||
{
|
||||
Logger.Info("Checking for updates - Current version: 1.2.2.0");
|
||||
Logger.Info("Checking for updates - Current version: 1.2.3.0");
|
||||
if (!General.Default.CheckForUpdates)
|
||||
return null;
|
||||
|
||||
|
||||
@ -518,38 +518,30 @@ namespace Artemis.ViewModels.Profiles
|
||||
{
|
||||
if (SelectedProfile == null)
|
||||
return;
|
||||
|
||||
var oldName = SelectedProfile.Name;
|
||||
SelectedProfile.Name = await DialogService
|
||||
.ShowInputDialog("Rename profile", "Please enter a unique new profile name");
|
||||
|
||||
var name = await DialogService.ShowInputDialog("Rename profile", "Please enter a unique new profile name");
|
||||
|
||||
// Null when the user cancelled
|
||||
if (string.IsNullOrEmpty(SelectedProfile.Name) || SelectedProfile.Name.Length < 2)
|
||||
{
|
||||
SelectedProfile.Name = oldName;
|
||||
if (string.IsNullOrEmpty(name) || name.Length < 2)
|
||||
return;
|
||||
}
|
||||
|
||||
// Verify the name
|
||||
while (ProfileProvider.GetAll().Contains(SelectedProfile))
|
||||
while (ProfileProvider.GetAll().Any(p => p.Name == name && p.GameName == SelectedProfile.GameName &&
|
||||
p.KeyboardSlug == SelectedProfile.KeyboardSlug))
|
||||
{
|
||||
SelectedProfile.Name = await DialogService.
|
||||
ShowInputDialog("Name already in use", "Please enter a unique new profile name");
|
||||
name = await DialogService.ShowInputDialog("Name already in use", "Please enter a unique new profile name");
|
||||
|
||||
// Null when the user cancelled
|
||||
if (string.IsNullOrEmpty(SelectedProfile.Name) || SelectedProfile.Name.Length < 2)
|
||||
{
|
||||
SelectedProfile.Name = oldName;
|
||||
if (string.IsNullOrEmpty(name) || name.Length < 2)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var newName = SelectedProfile.Name;
|
||||
SelectedProfile.Name = oldName;
|
||||
ProfileProvider.RenameProfile(SelectedProfile, newName);
|
||||
|
||||
var profile = SelectedProfile;
|
||||
SelectedProfile = null;
|
||||
ProfileProvider.RenameProfile(profile, name);
|
||||
|
||||
LastProfile = name;
|
||||
LoadProfiles();
|
||||
SelectedProfile = Profiles.FirstOrDefault(p => p.Name == newName);
|
||||
}
|
||||
|
||||
public async void DuplicateProfile()
|
||||
|
||||
@ -113,7 +113,7 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock Grid.Row="0" Grid.ColumnSpan="2" x:Name="ActiveEffectName" />
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="Artemis 1.2.2.0" VerticalAlignment="Center"
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="Artemis 1.2.3.0" VerticalAlignment="Center"
|
||||
HorizontalAlignment="Left" />
|
||||
<Button Grid.Row="1" Grid.Column="1" Focusable="False"
|
||||
Style="{StaticResource AccentedSquareButtonStyle}"
|
||||
|
||||
@ -151,10 +151,12 @@
|
||||
<!-- Layer list -->
|
||||
<StackPanel Grid.Column="1" Grid.Row="0" Orientation="Horizontal">
|
||||
<Label FontSize="20" HorizontalAlignment="Left" Content="Layers" Margin="10,0,0,0" />
|
||||
<Label HorizontalAlignment="Right" Content="Show all" Margin="88,0,0,0" VerticalAlignment="Center" />
|
||||
<ToggleButton x:Name="ShowAll" Margin="0 3 0 0" Width="25" Height="25"
|
||||
IsChecked="{Binding Path=ProfileViewModel.ShowAll, Mode=TwoWay}"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}" HorizontalAlignment="Right" />
|
||||
<Label HorizontalAlignment="Right" ToolTip="Show all layers instead of just the one you have selected"
|
||||
Content="Show all" Margin="88,0,0,0" VerticalAlignment="Center" />
|
||||
<ToggleButton x:Name="ShowAll" ToolTip="Show all layers instead of just the one you have selected"
|
||||
Margin="0 3 0 0" Width="25" Height="25"
|
||||
IsChecked="{Binding Path=ProfileViewModel.ShowAll, Mode=TwoWay}"
|
||||
Style="{DynamicResource MetroCircleToggleButtonStyle}" HorizontalAlignment="Right" />
|
||||
</StackPanel>
|
||||
|
||||
<Border Grid.Column="1" Grid.Row="1" Background="#FF232323" BorderBrush="{DynamicResource HighlightBrush}"
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<packages>
|
||||
<package id="Caliburn.Micro" version="3.0.1" targetFramework="net452" />
|
||||
<package id="Caliburn.Micro.Core" version="3.0.1" targetFramework="net452" />
|
||||
<package id="Castle.Core" version="3.3.3" targetFramework="net452" />
|
||||
<package id="Colore" version="4.0.0" targetFramework="net452" />
|
||||
<package id="Colore" version="5.0.0" targetFramework="net461" />
|
||||
<package id="CUE.NET" version="1.0.3" targetFramework="net452" />
|
||||
<package id="DynamicExpresso.Core" version="1.3.1.0" targetFramework="net452" />
|
||||
<package id="Extended.Wpf.Toolkit" version="2.7" targetFramework="net452" />
|
||||
@ -14,14 +13,14 @@
|
||||
<package id="MahApps.Metro" version="1.2.4.0" targetFramework="net452" />
|
||||
<package id="MahApps.Metro.Resources" version="0.6.1.0" targetFramework="net452" />
|
||||
<package id="NAudio" version="1.7.3" targetFramework="net452" />
|
||||
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net452" />
|
||||
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net461" />
|
||||
<package id="Ninject" version="3.2.2.0" targetFramework="net452" />
|
||||
<package id="Ninject.Extensions.Factory" version="3.2.1.0" targetFramework="net452" />
|
||||
<package id="Ninject.Extensions.Logging" version="3.2.3.0" targetFramework="net452" />
|
||||
<package id="Ninject.Extensions.Logging.nlog4" version="3.2.3.0" targetFramework="net452" />
|
||||
<package id="NLog" version="4.3.4" targetFramework="net452" />
|
||||
<package id="NLog.Schema" version="4.3.4" targetFramework="net452" />
|
||||
<package id="SpotifyAPI-NET" version="2.9.0" targetFramework="net452" />
|
||||
<package id="NLog" version="4.3.7" targetFramework="net461" />
|
||||
<package id="NLog.Schema" version="4.3.7" targetFramework="net461" />
|
||||
<package id="SpotifyAPI-NET" version="2.11.0" targetFramework="net461" />
|
||||
<package id="VirtualInput" version="1.0.1" targetFramework="net452" />
|
||||
<package id="WpfExceptionViewer" version="1.0.0.0" targetFramework="net452" />
|
||||
</packages>
|
||||
Loading…
x
Reference in New Issue
Block a user