mirror of
https://github.com/Artemis-RGB/Artemis
synced 2025-12-13 05:48:35 +00:00
Strafe fixes
GTA V fixes
This commit is contained in:
parent
96eadfecbb
commit
b9ebdeefa1
@ -1,4 +1,5 @@
|
||||
using System.Drawing;
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Windows;
|
||||
@ -67,6 +68,8 @@ namespace Artemis.DeviceProviders.CoolerMaster
|
||||
for (var y = 0; y < Height; y++)
|
||||
{
|
||||
var c = b.GetPixel(x, y);
|
||||
if (c.R != 0)
|
||||
Console.WriteLine();
|
||||
matrix.KeyColor[y, x] = new KEY_COLOR(c.R, c.G, c.B);
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,13 +81,18 @@ namespace Artemis.DeviceProviders.Corsair
|
||||
PreviewSettings = new PreviewSettings(new Rect(15, 30, 751, 284), Resources.k65);
|
||||
break;
|
||||
case "STRAFE RGB":
|
||||
Height = 7;
|
||||
Height = 8;
|
||||
Width = 22;
|
||||
Slug = "corsair-strafe-rgb";
|
||||
PreviewSettings = new PreviewSettings(new Rect(23, 30, 940, 303), Resources.strafe);
|
||||
PreviewSettings = new PreviewSettings(new Rect(23, 12, 937, 324), Resources.strafe);
|
||||
break;
|
||||
}
|
||||
|
||||
Height = 8;
|
||||
Width = 22;
|
||||
Slug = "corsair-strafe-rgb";
|
||||
PreviewSettings = new PreviewSettings(new Rect(23, 12, 937, 324), Resources.strafe);
|
||||
|
||||
Logger.Debug("Corsair SDK reported device as: {0}", _keyboard.DeviceInfo.Model);
|
||||
_keyboard.Brush = _keyboardBrush ?? (_keyboardBrush = new ImageBrush());
|
||||
}
|
||||
@ -114,29 +119,8 @@ namespace Artemis.DeviceProviders.Corsair
|
||||
/// <param name="bitmap"></param>
|
||||
public override void DrawBitmap(Bitmap bitmap)
|
||||
{
|
||||
|
||||
// For STRAFE, stretch the image on row 2.
|
||||
if (_keyboard.DeviceInfo.Model == "STRAFE RGB")
|
||||
{
|
||||
using (var strafeBitmap = new Bitmap(22, 8))
|
||||
{
|
||||
using (var g = Graphics.FromImage(strafeBitmap))
|
||||
{
|
||||
g.DrawImage(bitmap, new Point(0, 0));
|
||||
g.DrawImage(bitmap, new Rectangle(0, 3, 22, 7), new Rectangle(0, 2, 22, 7),
|
||||
GraphicsUnit.Pixel);
|
||||
|
||||
_keyboardBrush.Image = strafeBitmap;
|
||||
_keyboard.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_keyboardBrush.Image = bitmap;
|
||||
_keyboard.Update();
|
||||
}
|
||||
|
||||
_keyboardBrush.Image = bitmap;
|
||||
_keyboard.Update();
|
||||
}
|
||||
|
||||
public override KeyMatch? GetKeyPosition(Keys keyCode)
|
||||
|
||||
@ -29,7 +29,6 @@ namespace Artemis.Modules.Games.GtaV
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
var process = System.Diagnostics.Process.GetProcessesByName("GTA5").First();
|
||||
DllManager.PlaceLogitechDll();
|
||||
_pipeServer.PipeMessage += PipeServerOnPipeMessage;
|
||||
base.Enable();
|
||||
|
||||
@ -53,7 +53,7 @@ using System.Windows;
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
|
||||
[assembly: AssemblyVersion("1.9.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.9.0.0")]
|
||||
[assembly: AssemblyVersion("1.9.0.1")]
|
||||
[assembly: AssemblyFileVersion("1.9.0.1")]
|
||||
[assembly: InternalsVisibleTo("Artemis.Explorables")]
|
||||
|
||||
|
||||
Binary file not shown.
@ -37,8 +37,11 @@ namespace Artemis.Utilities.DataReaders
|
||||
try
|
||||
{
|
||||
// Change the registry key to point to the fake DLL
|
||||
var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Classes\CLSID\{a6519e67-7632-4375-afdf-caa889744403}\ServerBinary", true);
|
||||
key?.SetValue(null, DllPath + @"\LogitechLed.dll");
|
||||
// Key doesn't exist yet on systems without LGS installed
|
||||
var key = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Classes\CLSID\{a6519e67-7632-4375-afdf-caa889744403}\ServerBinary", true) ??
|
||||
Registry.LocalMachine.CreateSubKey(@"SOFTWARE\Classes\CLSID\{a6519e67-7632-4375-afdf-caa889744403}\ServerBinary", true);
|
||||
|
||||
key.SetValue(null, DllPath + @"\LogitechLed.dll");
|
||||
|
||||
// Make sure the fake DLL is in place
|
||||
if (!Directory.Exists(DllPath))
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@ -12,7 +11,6 @@ using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using Artemis.DAL;
|
||||
using Artemis.DeviceProviders;
|
||||
using Artemis.Events;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Models;
|
||||
@ -46,14 +44,14 @@ namespace Artemis.ViewModels
|
||||
{
|
||||
public sealed class ProfileEditorViewModel : Screen, IDropTarget
|
||||
{
|
||||
private readonly KeybindModel _copyKeybind;
|
||||
private readonly DeviceManager _deviceManager;
|
||||
private readonly MetroDialogService _dialogService;
|
||||
private readonly LoopManager _loopManager;
|
||||
private readonly ModuleModel _moduleModel;
|
||||
private readonly KeybindModel _copyKeybind;
|
||||
private readonly KeybindModel _pasteKeybind;
|
||||
private ImageSource _keyboardPreview;
|
||||
private ObservableCollection<LayerModel> _layers;
|
||||
private readonly KeybindModel _pasteKeybind;
|
||||
private ObservableCollection<string> _profileNames;
|
||||
private bool _saving;
|
||||
private LayerModel _selectedLayer;
|
||||
@ -198,7 +196,7 @@ namespace Artemis.ViewModels
|
||||
NotifyOfPropertyChange(() => LayerSelected);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ProfileModel SelectedProfile => _moduleModel?.ProfileModel;
|
||||
public bool ProfileSelected => SelectedProfile != null;
|
||||
public bool LayerSelected => SelectedProfile != null && SelectedLayer != null;
|
||||
@ -348,9 +346,7 @@ namespace Artemis.ViewModels
|
||||
return;
|
||||
|
||||
if (SelectedLayer != null)
|
||||
{
|
||||
SelectedLayer.InsertAfter(layerModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedProfile.Layers.Add(layerModel);
|
||||
@ -405,6 +401,9 @@ namespace Artemis.ViewModels
|
||||
if (_saving || SelectedProfile == null || _deviceManager.ChangingKeyboard)
|
||||
return;
|
||||
|
||||
SelectedProfile.Width = _deviceManager.ActiveKeyboard.Width;
|
||||
SelectedProfile.Height = _deviceManager.ActiveKeyboard.Height;
|
||||
|
||||
_saving = true;
|
||||
try
|
||||
{
|
||||
@ -421,8 +420,7 @@ namespace Artemis.ViewModels
|
||||
{
|
||||
if (_deviceManager.ActiveKeyboard == null)
|
||||
{
|
||||
_dialogService.ShowMessageBox("Cannot add profile.",
|
||||
"To add a profile, please select a keyboard in the options menu first.");
|
||||
_dialogService.ShowMessageBox("Cannot add profile.", "To add a profile, please select a keyboard in the options menu first.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -701,9 +699,7 @@ namespace Artemis.ViewModels
|
||||
: Cursors.SizeAll;
|
||||
}
|
||||
else
|
||||
{
|
||||
KeyboardPreviewCursor = Cursors.Hand;
|
||||
}
|
||||
}
|
||||
|
||||
private Point GetScaledPosition(MouseEventArgs e)
|
||||
@ -716,13 +712,13 @@ namespace Artemis.ViewModels
|
||||
var heightScale = sourceImage.ActualHeight / _deviceManager.ActiveKeyboard.PreviewSettings.BackgroundRectangle.Height;
|
||||
|
||||
// Remove the preview settings' offset from the cursor postion
|
||||
pos.X = pos.X - (previewSettings.OverlayRectangle.X * widthScale);
|
||||
pos.Y = pos.Y - (previewSettings.OverlayRectangle.Y * heightScale);
|
||||
pos.X = pos.X - previewSettings.OverlayRectangle.X * widthScale;
|
||||
pos.Y = pos.Y - previewSettings.OverlayRectangle.Y * heightScale;
|
||||
|
||||
// Scale the X and Y position down to match the keyboard's physical size and thus the layer positions
|
||||
pos.X = pos.X * (SelectedProfile.Width / (previewSettings.OverlayRectangle.Width*widthScale));
|
||||
pos.X = pos.X * (SelectedProfile.Width / (previewSettings.OverlayRectangle.Width * widthScale));
|
||||
pos.Y = pos.Y * (SelectedProfile.Height / (previewSettings.OverlayRectangle.Height * heightScale));
|
||||
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user