mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-11 19:36:28 +00:00
Added WoW addon management code
Updated Nuget packages
This commit is contained in:
1 parent
b71adf5462
commit
747cb9a71d
26 files changed
+153
-30
No files matched your search
@@ -152,8 +152,8 @@
|
||||
<HintPath>..\packages\Colore.5.1.0\lib\net35\Corale.Colore.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="CSCore, Version=1.2.1.1, Culture=neutral, PublicKeyToken=5a08f2b6f4415dea, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CSCore.1.2.1.1\lib\net35-client\CSCore.dll</HintPath>
|
||||
<Reference Include="CSCore, Version=1.2.1.2, Culture=neutral, PublicKeyToken=5a08f2b6f4415dea, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CSCore.1.2.1.2\lib\net35-client\CSCore.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="CUE.NET, Version=1.1.3.1, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CUE.NET.1.1.3.1\lib\net45\CUE.NET.dll</HintPath>
|
||||
@@ -170,8 +170,8 @@
|
||||
<HintPath>..\packages\DeltaCompressionDotNet.1.1.0\lib\net20\DeltaCompressionDotNet.PatchApi.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="DynamicExpresso.Core, Version=1.3.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DynamicExpresso.Core.1.3.3.6\lib\net40\DynamicExpresso.Core.dll</HintPath>
|
||||
<Reference Include="DynamicExpresso.Core, Version=1.3.4.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\DynamicExpresso.Core.1.3.4.7\lib\net40\DynamicExpresso.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Gma.System.MouseKeyHook, Version=5.4.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MouseKeyHook.5.4.0\lib\net40\Gma.System.MouseKeyHook.dll</HintPath>
|
||||
@@ -267,7 +267,7 @@
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="SpotifyAPI, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SpotifyAPI-NET.2.16.0\lib\SpotifyAPI.dll</HintPath>
|
||||
<HintPath>..\packages\SpotifyAPI-NET.2.16.1\lib\SpotifyAPI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Squirrel, Version=1.4.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\squirrel.windows.1.4.4\lib\Net45\Squirrel.dll</HintPath>
|
||||
@@ -799,16 +799,17 @@
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<None Include="Modules\Games\WoW\Resources\Addon\Artemis.toc" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon\Core.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon\Libs\AceAddon-3.0\AceAddon-3.0.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon\Libs\AceComm-3.0\AceComm-3.0.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon\Libs\AceComm-3.0\ChatThrottleLib.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon\Libs\AceConsole-3.0\AceConsole-3.0.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon\Libs\AceEvent-3.0\AceEvent-3.0.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon\Libs\AceTimer-3.0\AceTimer-3.0.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon\Libs\json.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon\Libs\LibStub\LibStub.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Artemis.toc" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Core.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceAddon-3.0\AceAddon-3.0.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceComm-3.0\AceComm-3.0.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceComm-3.0\ChatThrottleLib.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceConsole-3.0\AceConsole-3.0.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceEvent-3.0\AceEvent-3.0.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceTimer-3.0\AceTimer-3.0.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\json.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\LibStub\LibStub.lua" />
|
||||
<None Include="Modules\Games\WoW\Resources\wow-addon.zip" />
|
||||
<None Include="NLog.xsd">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
@@ -1087,12 +1088,12 @@
|
||||
<None Include="Modules\Games\EurotruckSimulator2\Resources\Win64\ets2-telemetry-server.dll" />
|
||||
<None Include="Resources\audio.png" />
|
||||
<None Include="Resources\ambilight.png" />
|
||||
<Resource Include="Modules\Games\WoW\Resources\Addon\embeds.xml" />
|
||||
<Resource Include="Modules\Games\WoW\Resources\Addon\Libs\AceAddon-3.0\AceAddon-3.0.xml" />
|
||||
<Resource Include="Modules\Games\WoW\Resources\Addon\Libs\AceComm-3.0\AceComm-3.0.xml" />
|
||||
<Resource Include="Modules\Games\WoW\Resources\Addon\Libs\AceConsole-3.0\AceConsole-3.0.xml" />
|
||||
<Resource Include="Modules\Games\WoW\Resources\Addon\Libs\AceEvent-3.0\AceEvent-3.0.xml" />
|
||||
<Resource Include="Modules\Games\WoW\Resources\Addon\Libs\AceTimer-3.0\AceTimer-3.0.xml" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\embeds.xml" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceAddon-3.0\AceAddon-3.0.xml" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceComm-3.0\AceComm-3.0.xml" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceConsole-3.0\AceConsole-3.0.xml" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceEvent-3.0\AceEvent-3.0.xml" />
|
||||
<None Include="Modules\Games\WoW\Resources\Addon source\Libs\AceTimer-3.0\AceTimer-3.0.xml" />
|
||||
<Content Include="Resources\CounterStrike\csgoGamestateConfiguration.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
|
||||
<!-- Game directory -->
|
||||
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left" Content="Overwatch Directory" />
|
||||
<Label FontSize="20" HorizontalAlignment="Left" Content="Overwatch directory" />
|
||||
<Grid>
|
||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="0,0,30,0" Text="{Binding Path=Settings.GameDirectory, Mode=TwoWay}" cal:Message.Attach="[Event LostFocus] = [Action PlaceDll]" />
|
||||
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944" HorizontalAlignment="Right" Width="25" Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
@@ -2,22 +2,37 @@
|
||||
using Artemis.Managers;
|
||||
using Artemis.Modules.Abstract;
|
||||
using Artemis.Modules.Games.WoW.Models;
|
||||
using Artemis.Properties;
|
||||
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
|
||||
{
|
||||
public class WoWModel : ModuleModel
|
||||
{
|
||||
private readonly MetroDialogService _dialogService;
|
||||
private readonly WowPacketScanner _packetScanner;
|
||||
|
||||
public WoWModel(DeviceManager deviceManager, LuaManager luaManager, WowPacketScanner packetScanner) : base(deviceManager, luaManager)
|
||||
public WoWModel(DeviceManager deviceManager, LuaManager luaManager, WowPacketScanner packetScanner, MetroDialogService dialogService) : base(deviceManager, luaManager)
|
||||
{
|
||||
Settings = SettingsProvider.Load<WoWSettings>();
|
||||
DataModel = new WoWDataModel();
|
||||
ProcessNames.Add("Wow-64");
|
||||
|
||||
_packetScanner = packetScanner;
|
||||
_dialogService = dialogService;
|
||||
_packetScanner.RaiseDataReceived += (sender, args) => HandleGameData(args.Command, args.Data);
|
||||
|
||||
FindWoW();
|
||||
|
||||
// I simply cannot be sure wether this addon will bring people's accounts in trouble so
|
||||
// lets remove it whenever Artemis isn't running the WoW module.
|
||||
// (This also means the addon isnt left behind should the user uninstall Artemis.)
|
||||
RemoveAddon();
|
||||
}
|
||||
|
||||
public override string Name => "WoW";
|
||||
@@ -26,12 +41,14 @@ namespace Artemis.Modules.Games.WoW
|
||||
|
||||
public override void Enable()
|
||||
{
|
||||
PlaceAddon();
|
||||
_packetScanner.Start();
|
||||
base.Enable();
|
||||
}
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
RemoveAddon();
|
||||
_packetScanner.Stop();
|
||||
base.Dispose();
|
||||
}
|
||||
@@ -44,6 +61,67 @@ namespace Artemis.Modules.Games.WoW
|
||||
dataModel.Target.Update();
|
||||
}
|
||||
|
||||
public void FindWoW()
|
||||
{
|
||||
var gameSettings = Settings as WoWSettings;
|
||||
if (gameSettings == null)
|
||||
return;
|
||||
|
||||
// If already propertly set up, don't do anything
|
||||
if (gameSettings.GameDirectory != null && File.Exists(gameSettings.GameDirectory + @"\Wow.exe"))
|
||||
return;
|
||||
|
||||
var key = Registry.LocalMachine.OpenSubKey(
|
||||
@"SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\World of Warcraft");
|
||||
var path = key?.GetValue("DisplayIcon")?.ToString();
|
||||
if (string.IsNullOrEmpty(path) || !File.Exists(path))
|
||||
return;
|
||||
|
||||
gameSettings.GameDirectory = path.Substring(0, path.Length - 8);
|
||||
gameSettings.Save();
|
||||
}
|
||||
|
||||
public void ChangeDirectory(string directory, bool checkExe)
|
||||
{
|
||||
var settings = (WoWSettings) Settings;
|
||||
if (checkExe && !File.Exists(directory + @"\Wow.exe"))
|
||||
{
|
||||
_dialogService.ShowErrorMessageBox("Please select a valid WoW directory\n\n" +
|
||||
@"By default WoW is in C:\Program Files (x86)\World of Warcraft");
|
||||
|
||||
settings.GameDirectory = string.Empty;
|
||||
settings.Save();
|
||||
return;
|
||||
}
|
||||
settings.GameDirectory = directory;
|
||||
settings.Save();
|
||||
}
|
||||
|
||||
public void PlaceAddon()
|
||||
{
|
||||
var settings = (WoWSettings) Settings;
|
||||
var path = settings.GameDirectory;
|
||||
|
||||
if (!File.Exists(path + @"\Wow.exe"))
|
||||
return;
|
||||
|
||||
// Load the ZIP from resources
|
||||
using (var stream = new MemoryStream(Resources.wow_addon))
|
||||
{
|
||||
using (var archive = new ZipArchive(stream))
|
||||
{
|
||||
archive.ExtractToDirectory(settings.GameDirectory + @"\Interface\Addons\Artemis", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveAddon()
|
||||
{
|
||||
var settings = (WoWSettings) Settings;
|
||||
if (Directory.Exists(settings.GameDirectory + @"\Interface\Addons\Artemis"))
|
||||
Directory.Delete(settings.GameDirectory + @"\Interface\Addons\Artemis", true);
|
||||
}
|
||||
|
||||
private void HandleGameData(string command, string data)
|
||||
{
|
||||
JToken json = null;
|
||||
|
||||
@@ -4,5 +4,6 @@ namespace Artemis.Modules.Games.WoW
|
||||
{
|
||||
public class WoWSettings : ModuleSettings
|
||||
{
|
||||
public string GameDirectory { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
@@ -32,11 +33,20 @@
|
||||
Style="{StaticResource MahApps.Metro.Styles.ToggleSwitchButton.Win10}" ToolTip="Note: You can't enable an module when Artemis is disabled" />
|
||||
</StackPanel>
|
||||
|
||||
<!-- Game directory -->
|
||||
<StackPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" Margin="0,0,1,0">
|
||||
<Label FontSize="20" HorizontalAlignment="Left" Content="World of Warcraft directory" />
|
||||
<Grid>
|
||||
<TextBox x:Name="GameDirectory" Height="23" TextWrapping="Wrap" Margin="0,0,30,0" Text="{Binding Path=Settings.GameDirectory, Mode=TwoWay}" cal:Message.Attach="[Event LostFocus] = [Action PlaceAddon]" />
|
||||
<Button x:Name="BrowseDirectory" Content="..." RenderTransformOrigin="-0.039,-0.944" HorizontalAlignment="Right" Width="25" Style="{DynamicResource SquareButtonStyle}" Height="26" />
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<!-- Profile editor -->
|
||||
<ContentControl Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
<ContentControl Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2" x:Name="ProfileEditor" />
|
||||
|
||||
<!-- Buttons -->
|
||||
<StackPanel Grid.Column="0" Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<StackPanel Grid.Row="4" Grid.Column="0" Orientation="Horizontal" VerticalAlignment="Bottom">
|
||||
<Button x:Name="ResetSettings" Content="Reset effect" VerticalAlignment="Top" Width="100" Style="{DynamicResource SquareButtonStyle}" />
|
||||
<Button x:Name="SaveSettings" Content="Save changes" VerticalAlignment="Top" Width="100" Margin="10,0,0,0" Style="{DynamicResource SquareButtonStyle}" />
|
||||
</StackPanel>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Artemis.Managers;
|
||||
using System.Windows.Forms;
|
||||
using Artemis.Managers;
|
||||
using Artemis.Modules.Abstract;
|
||||
using Ninject;
|
||||
|
||||
@@ -13,5 +14,23 @@ namespace Artemis.Modules.Games.WoW
|
||||
}
|
||||
|
||||
public override bool UsesProfileEditor => true;
|
||||
|
||||
public void PlaceAddon()
|
||||
{
|
||||
((WoWModel) ModuleModel).PlaceAddon();
|
||||
}
|
||||
|
||||
public void BrowseDirectory()
|
||||
{
|
||||
var dialog = new FolderBrowserDialog {SelectedPath = ((WoWSettings) Settings).GameDirectory};
|
||||
var result = dialog.ShowDialog();
|
||||
if (result != DialogResult.OK)
|
||||
return;
|
||||
|
||||
((WoWSettings) Settings).GameDirectory = dialog.SelectedPath;
|
||||
((WoWModel) ModuleModel).PlaceAddon();
|
||||
Settings.Save();
|
||||
NotifyOfPropertyChange(() => Settings);
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-1
@@ -19,7 +19,7 @@ namespace Artemis.Properties {
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
@@ -105,6 +105,7 @@ namespace Artemis.Properties {
|
||||
///{
|
||||
/// "uri" "http://localhost:{{port}}/csgo_game_event"
|
||||
/// "timeout" "0.1"
|
||||
/// "heartbeat" "0.1"
|
||||
/// "data"
|
||||
/// {
|
||||
/// "provider" "1"
|
||||
@@ -437,5 +438,15 @@ namespace Artemis.Properties {
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Byte[].
|
||||
/// </summary>
|
||||
internal static byte[] wow_addon {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("wow_addon", resourceCulture);
|
||||
return ((byte[])(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -223,4 +223,7 @@
|
||||
<data name="k95_platinum" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Keyboards\k95-platinum.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="wow_addon" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Modules\Games\WoW\Resources\wow-addon.zip;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -4,10 +4,10 @@
|
||||
<package id="Caliburn.Micro" version="3.1.0" targetFramework="net461" />
|
||||
<package id="Caliburn.Micro.Core" version="3.1.0" targetFramework="net461" />
|
||||
<package id="Colore" version="5.1.0" targetFramework="net461" />
|
||||
<package id="CSCore" version="1.2.1.1" targetFramework="net461" />
|
||||
<package id="CSCore" version="1.2.1.2" targetFramework="net461" />
|
||||
<package id="CUE.NET" version="1.1.3.1" targetFramework="net461" />
|
||||
<package id="DeltaCompressionDotNet" version="1.1.0" targetFramework="net461" />
|
||||
<package id="DynamicExpresso.Core" version="1.3.3.6" targetFramework="net461" />
|
||||
<package id="DynamicExpresso.Core" version="1.3.4.7" targetFramework="net461" />
|
||||
<package id="gong-wpf-dragdrop" version="0.1.4.3" targetFramework="net461" />
|
||||
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.8" targetFramework="net452" />
|
||||
<package id="log4net" version="2.0.8" targetFramework="net461" />
|
||||
@@ -28,7 +28,7 @@
|
||||
<package id="SharpDX" version="4.0.1" targetFramework="net461" />
|
||||
<package id="SharpDX.Direct3D9" version="4.0.1" targetFramework="net461" />
|
||||
<package id="Splat" version="2.0.0" targetFramework="net461" />
|
||||
<package id="SpotifyAPI-NET" version="2.16.0" targetFramework="net461" />
|
||||
<package id="SpotifyAPI-NET" version="2.16.1" targetFramework="net461" />
|
||||
<package id="squirrel.windows" version="1.4.4" targetFramework="net461" />
|
||||
<package id="WpfExceptionViewer" version="1.0.0.0" targetFramework="net452" />
|
||||
</packages>
|
||||
Reference in new issue
Block a user