mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-12 21:38:38 +00:00
Merge branch 'master' of https://github.com/SpoinkyNL/Artemis.git
This commit is contained in:
commit
06c8a70e42
@ -232,6 +232,7 @@
|
||||
<Compile Include="Events\ChangeBitmap.cs" />
|
||||
<Compile Include="KeyboardProviders\Corsair\CorsairRGB.cs" />
|
||||
<Compile Include="KeyboardProviders\KeyboardProvider.cs" />
|
||||
<Compile Include="KeyboardProviders\KeyboardRegion.cs" />
|
||||
<Compile Include="KeyboardProviders\Logitech\Orion.cs" />
|
||||
<Compile Include="KeyboardProviders\Logitech\Utilities\KeyboardNames.cs" />
|
||||
<Compile Include="KeyboardProviders\Logitech\Utilities\KeyMap.cs" />
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System.Drawing;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using Artemis.Utilities;
|
||||
using CUE.NET;
|
||||
@ -18,6 +19,7 @@ namespace Artemis.KeyboardProviders.Corsair
|
||||
CantEnableText = "Couldn't connect to your Corsair keyboard.\n " +
|
||||
"Please check your cables and/or drivers (could be outdated) and that Corsair Utility Engine is running.\n\n " +
|
||||
"If needed, you can select a different keyboard in Artemis under settings.";
|
||||
KeyboardRegions = new List<KeyboardRegion>();
|
||||
}
|
||||
|
||||
public override bool CanEnable()
|
||||
@ -71,10 +73,12 @@ namespace Artemis.KeyboardProviders.Corsair
|
||||
case "K95 RGB":
|
||||
Height = 7;
|
||||
Width = 24;
|
||||
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(1, 0), new Point(1, 20)));
|
||||
break;
|
||||
case "K70 RGB":
|
||||
Height = 7;
|
||||
Width = 21;
|
||||
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(1, 0), new Point(1, 16)));
|
||||
break;
|
||||
case "K65 RGB":
|
||||
Height = 7;
|
||||
@ -82,6 +86,7 @@ namespace Artemis.KeyboardProviders.Corsair
|
||||
break;
|
||||
case "STRAFE RGB":
|
||||
Height = 7;
|
||||
KeyboardRegions.Add(new KeyboardRegion("TopRow", new Point(1, 0), new Point(1, 16)));
|
||||
Width = 22;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using System.Drawing;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
namespace Artemis.KeyboardProviders
|
||||
{
|
||||
@ -9,6 +10,8 @@ namespace Artemis.KeyboardProviders
|
||||
public int Width { get; set; }
|
||||
public string CantEnableText { get; set; }
|
||||
|
||||
public List<KeyboardRegion> KeyboardRegions { get; set; }
|
||||
|
||||
public abstract bool CanEnable();
|
||||
public abstract void Enable();
|
||||
public abstract void Disable();
|
||||
|
||||
18
Artemis/Artemis/KeyboardProviders/KeyboardRegion.cs
Normal file
18
Artemis/Artemis/KeyboardProviders/KeyboardRegion.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System.Drawing;
|
||||
|
||||
namespace Artemis.KeyboardProviders
|
||||
{
|
||||
public class KeyboardRegion
|
||||
{
|
||||
public string RegionName { get; set; }
|
||||
public Point TopLeft { get; set; }
|
||||
public Point BottomRight { get; set; }
|
||||
|
||||
public KeyboardRegion(string regionName, Point topLeft, Point bottomRight)
|
||||
{
|
||||
RegionName = regionName;
|
||||
TopLeft = topLeft;
|
||||
BottomRight = bottomRight;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,5 @@
|
||||
using System.Drawing;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Threading;
|
||||
using Artemis.KeyboardProviders.Logitech.Utilities;
|
||||
|
||||
@ -14,6 +15,7 @@ namespace Artemis.KeyboardProviders.Logitech
|
||||
"If needed, you can select a different keyboard in Artemis under settings.";
|
||||
Height = 6;
|
||||
Width = 21;
|
||||
KeyboardRegions = new List<KeyboardRegion> {new KeyboardRegion("TopRow", new Point(0, 0), new Point(0, 16))};
|
||||
}
|
||||
|
||||
public override bool CanEnable()
|
||||
|
||||
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Linq;
|
||||
using Artemis.KeyboardProviders;
|
||||
using Artemis.KeyboardProviders.Corsair;
|
||||
using Artemis.KeyboardProviders.Logitech;
|
||||
using Artemis.Models;
|
||||
@ -16,7 +17,7 @@ namespace Artemis.Modules.Games.CounterStrike
|
||||
{
|
||||
public class CounterStrikeModel : GameModel
|
||||
{
|
||||
private int _ammoWidth;
|
||||
private KeyboardRegion _topRow;
|
||||
|
||||
public CounterStrikeModel(MainModel mainModel, CounterStrikeSettings settings) : base(mainModel)
|
||||
{
|
||||
@ -47,23 +48,12 @@ namespace Artemis.Modules.Games.CounterStrike
|
||||
public override void Enable()
|
||||
{
|
||||
// Some keyboards have a different baseline, Corsair F-keys start at row 1
|
||||
int baseLine;
|
||||
if (MainModel.ActiveKeyboard is CorsairRGB)
|
||||
{
|
||||
baseLine = 1;
|
||||
_ammoWidth = 19;
|
||||
}
|
||||
else
|
||||
{
|
||||
baseLine = 0;
|
||||
_ammoWidth = 16;
|
||||
}
|
||||
|
||||
AmmoRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, baseLine, new List<Color>(),
|
||||
_topRow = MainModel.ActiveKeyboard.KeyboardRegions.First(r => r.RegionName == "TopRow");
|
||||
AmmoRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, _topRow.TopLeft.X, new List<Color>(),
|
||||
LinearGradientMode.Horizontal) {Height = Scale, ContainedBrush = false};
|
||||
TeamRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, baseLine + 1, new List<Color>(),
|
||||
TeamRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, _topRow.TopLeft.X + 1, new List<Color>(),
|
||||
LinearGradientMode.Horizontal) {Height = MainModel.ActiveKeyboard.Height*Scale - Scale};
|
||||
EventRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, baseLine + 1, new List<Color>(),
|
||||
EventRect = new KeyboardRectangle(MainModel.ActiveKeyboard, 0, _topRow.TopLeft.X + 1, new List<Color>(),
|
||||
LinearGradientMode.Horizontal) {Height = MainModel.ActiveKeyboard.Height*Scale - Scale};
|
||||
MainModel.GameStateWebServer.GameDataReceived += HandleGameData;
|
||||
}
|
||||
@ -162,7 +152,7 @@ namespace Artemis.Modules.Games.CounterStrike
|
||||
return;
|
||||
|
||||
var ammoPercentage = (int) Math.Ceiling(100.00/maxAmmo)*ammo;
|
||||
AmmoRect.Width = (int) Math.Floor(_ammoWidth / 100.00*ammoPercentage)*Scale;
|
||||
AmmoRect.Width = (int) Math.Floor(_topRow.BottomRight.Y / 100.00*ammoPercentage)*Scale;
|
||||
AmmoRect.Colors = new List<Color>
|
||||
{
|
||||
ColorHelpers.ToDrawingColor(Settings.AmmoMainColor),
|
||||
|
||||
@ -3,6 +3,10 @@ Artemis adds support for several games to a range of RGB keyboards.
|
||||
|
||||
Besides game-support there are also a few effects for when you're not gaming.
|
||||
|
||||
**Download**: https://github.com/SpoinkyNL/Artemis/releases
|
||||
|
||||
**FAQ**: https://github.com/SpoinkyNL/Artemis/wiki/Frequently-Asked-Questions-(FAQ)
|
||||
|
||||
Some of it's basic features:
|
||||
|
||||
* Support for multiple keyboards planned.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user