Minor WoW & Overwatch fixes

Added Moira to Overwatch
Fixed Overwatch update logic to carry on if no char match was found
WoW module now uses the first active network adapter by default
This commit is contained in:
SpoinkyNL committed 2017-12-08 20:56:00 +01:00
1 parent 6a815a14d7
commit 215d5cb4c5
5 files changed
+22 -13

No files matched your search

@@ -51,6 +51,7 @@ namespace Artemis.Modules.Games.Overwatch
Ana,
Sombra,
Orisa,
Doomfist
Doomfist,
Moira
}
}
@@ -78,7 +78,8 @@ namespace Artemis.Modules.Games.Overwatch
new CharacterColor {Character = OverwatchCharacter.Ana, Color = Color.FromRgb(16, 36, 87)},
new CharacterColor {Character = OverwatchCharacter.Sombra, Color = Color.FromRgb(20, 5, 101)},
new CharacterColor {Character = OverwatchCharacter.Orisa, Color = Color.FromRgb(1,40,0)},
new CharacterColor {Character = OverwatchCharacter.Doomfist, Color = Color.FromRgb(33, 3, 1)}
new CharacterColor {Character = OverwatchCharacter.Doomfist, Color = Color.FromRgb(33, 3, 1)},
new CharacterColor {Character = OverwatchCharacter.Moira, Color = Color.FromRgb(28, 0, 2)}, // Same as Reaper
};
}
@@ -214,16 +215,16 @@ namespace Artemis.Modules.Games.Overwatch
if (characterMatch.Character != gameDataModel.Character)
_characterChange = DateTime.Now;
// Update the datamodel
gameDataModel.Character = characterMatch.Character;
gameDataModel.CharacterColor = colors[0, 20].ToHex();
// If no character was found, this method shouldn't continue
if (characterMatch.Character == OverwatchCharacter.None)
return characterMatch;
// If WASD isn't orange (any of them will do), player is in character select
_stickyStatus.Value = ControlsShown(colors) ? OverwatchStatus.InGame : OverwatchStatus.InCharacterSelect;
// Update the datamodel
gameDataModel.Character = characterMatch.Character;
gameDataModel.CharacterColor = colors[0, 20].ToHex();
return characterMatch;
}
@@ -1,4 +1,6 @@
using Artemis.DAL;
using System.IO;
using System.IO.Compression;
using Artemis.DAL;
using Artemis.Managers;
using Artemis.Modules.Abstract;
using Artemis.Modules.Games.WoW.Models;
@@ -7,8 +9,6 @@ using Artemis.Services;
using Artemis.Utilities;
using Microsoft.Win32;
using Newtonsoft.Json.Linq;
using System.IO;
using System.IO.Compression;
namespace Artemis.Modules.Games.WoW
{
@@ -42,7 +42,7 @@ namespace Artemis.Modules.Games.WoW
public override void Enable()
{
PlaceAddon();
_packetScanner.Start();
_packetScanner.Start(((WoWSettings) Settings).NetworkAdapter);
base.Enable();
}
@@ -29,7 +29,7 @@ namespace Artemis.Modules.Games.WoW
public event EventHandler<WowDataReceivedEventArgs> RaiseDataReceived;
public void Start()
public void Start(string networkAdapter)
{
// Start scanning WoW packets
// Retrieve the device list from the local machine
@@ -41,8 +41,14 @@ namespace Artemis.Modules.Games.WoW
return;
}
// Take the selected adapter
PacketDevice selectedDevice = allDevices.First();
// Take the configured network adapter
// TODO: Create UI with available network adapters dropdown
PacketDevice selectedDevice = null;
if (!string.IsNullOrEmpty(networkAdapter))
selectedDevice = allDevices.FirstOrDefault(d => d.Name.Contains(networkAdapter));
// If not found take the first active network adapter
if (selectedDevice == null)
selectedDevice = allDevices.First(d => d.Addresses.Any());
// Open the device
try
@@ -5,5 +5,6 @@ namespace Artemis.Modules.Games.WoW
public class WoWSettings : ModuleSettings
{
public string GameDirectory { get; set; }
public string NetworkAdapter { get; set; }
}
}