1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-12 21:38:38 +00:00

Added skeleton code for profiles

This commit is contained in:
SpoinkyNL 2016-03-20 01:28:19 +01:00
parent 0029a1b99e
commit c28783b461
7 changed files with 63 additions and 6 deletions

View File

@ -256,6 +256,7 @@
<Compile Include="Components\Abstract\LayerComponent.cs" />
<Compile Include="Components\Layer.cs" />
<Compile Include="Components\LayerComposite.cs" />
<Compile Include="DAL\ProfileProvider.cs" />
<Compile Include="Events\ToggleEnabled.cs" />
<Compile Include="Events\ActiveEffectChanged.cs" />
<Compile Include="Events\ChangeBitmap.cs" />
@ -278,6 +279,7 @@
<Compile Include="Models\GameSettings.cs" />
<Compile Include="Models\Interfaces\IGameDataModel.cs" />
<Compile Include="Models\LayerConditionModel.cs" />
<Compile Include="Models\ProfileModel.cs" />
<Compile Include="Modules\Effects\AmbientLightning\AmbientLightningEffectModel.cs" />
<Compile Include="Modules\Effects\AmbientLightning\AmbientLightningEffectSettings.cs" />
<Compile Include="Modules\Effects\AmbientLightning\AmbientLightningEffectView.xaml.cs">

View File

@ -0,0 +1,37 @@
using System.Collections.Generic;
using System.Linq;
using Artemis.Models;
namespace Artemis.DAL
{
internal class ProfileProvider
{
/// <summary>
/// Get all profiles
/// </summary>
/// <returns>All profiles</returns>
public List<ProfileModel> GetAll()
{
return new List<ProfileModel>();
}
/// <summary>
/// Get all profiles matching the provided game
/// </summary>
/// <param name="game">The game to match</param>
/// <returns>All profiles matching the provided game</returns>
public List<ProfileModel> GetAll(GameModel game)
{
return GetAll().Where(g => g.GameName.Equals(game.Name)).ToList();
}
/// <summary>
/// Adds or update the given profile.
/// Updates occur when a profile with the same name and game exist.
/// </summary>
/// <param name="profile">The profile to add or update</param>
public void AddOrUpdate(ProfileModel profile)
{
}
}
}

View File

@ -11,12 +11,14 @@ namespace Artemis.KeyboardProviders.Logitech
{
internal class Orion : KeyboardProvider
{
private string _versionString;
public Orion()
{
Name = "Logitech G910 RGB";
CantEnableText = "Couldn't connect to your Logitech G910.\n" +
"Please check your cables and updating the Logitech Gaming Software\n" +
"A minimum version of 8.81.15 is required).\n\n" +
$"A minimum version of 8.81.15 is required. (Detected {_versionString})\n\n" +
"If needed, you can select a different keyboard in Artemis under settings.";
Height = 6;
Width = 21;
@ -30,7 +32,6 @@ namespace Artemis.KeyboardProviders.Logitech
public override bool CanEnable()
{
return true;
if (DllManager.RestoreDll())
RestoreDll();
int majorNum = 0, minorNum = 0, buildNum = 0;
@ -41,6 +42,7 @@ namespace Artemis.KeyboardProviders.Logitech
// Turn it into one long number...
var version = int.Parse($"{majorNum}{minorNum}{buildNum}");
_versionString = $"{majorNum}.{minorNum}.{buildNum}";
return version >= 88115;
}

View File

@ -13,8 +13,8 @@ namespace Artemis.KeyboardProviders.Razer
public BlackWidow()
{
Name = "Razer BlackWidow Chroma";
CantEnableText = "Couldn't connect to your Razer BlackWidow Chroma.\n " +
"Please check your cables and try updating Razer Synapse.\n\n " +
CantEnableText = "Couldn't connect to your Razer BlackWidow Chroma.\n" +
"Please check your cables and try updating Razer Synapse.\n\n" +
"If needed, you can select a different keyboard in Artemis under settings.";
}

View File

@ -0,0 +1,14 @@
using Artemis.Components;
namespace Artemis.Models
{
public class ProfileModel
{
public string Name { get; set; }
public string KeyboardName { get; set; }
public string GameName { get; set; }
public LayerComposite Layers { get; set; }
}
}

View File

@ -1,4 +1,4 @@
using System.Collections.Generic;
 using System.Collections.Generic;
using Artemis.Models.Interfaces;
namespace Artemis.Modules.Games.TheDivision

View File

@ -1,4 +1,6 @@
using System.Windows.Media;
using System.Collections.Generic;
using System.Windows.Media;
using Artemis.Components;
using Artemis.KeyboardProviders;
using Caliburn.Micro;