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

Completely reimplemented Witcher 3 support, this resolves #6

This commit is contained in:
SpoinkyNL 2016-02-15 17:22:30 +01:00
parent abc2cdbe3b
commit f02c7b6f2c
7 changed files with 107 additions and 13 deletions

View File

@ -360,7 +360,9 @@
</None>
<None Include="packages.config" />
<AppDesigner Include="Properties\" />
<None Include="Resources\playerWitcher.ws" />
<None Include="Resources\playerWitcher.txt" />
<None Include="Resources\artemis.txt" />
<Content Include="Resources\playerWitcher.ws" />
<None Include="Settings\Offsets.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Offsets.Designer.cs</LastGenOutput>
@ -441,7 +443,7 @@
<Content Include="LogitechLedEnginesWrapper.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="Resources\artemis.xml" />
<Content Include="Resources\artemis.xml" />
<Content Include="RzChromaSDK64.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

View File

@ -9,11 +9,13 @@
<Grid Margin="15, 5, 15, 5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2">
<Label FontSize="20" HorizontalAlignment="Left">
@ -28,12 +30,19 @@
Style="{DynamicResource MetroCircleToggleButtonStyle}" />
</StackPanel>
</StackPanel>
<TextBlock Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
Foreground="#535353" MaxWidth="510" TextAlignment="Justify">
Note: Requires patch x.x. When a new patch is released Artemis downloads new pointers for the latest version (unless disabled in settings).
Artemis requires the latest Witcher 3 version and mod to be installed in order to work. If you don't use any (conflicting) Witcher 3 mods, the mod can automatically be installed.
</TextBlock>
<TextBlock Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Center" Margin="0,8"
TextWrapping="Wrap" HorizontalAlignment="Left" FontFamily="Segoe UI Semibold"
Foreground="#535353" MaxWidth="510" TextAlignment="Justify">
If you do use conflicting mods, we'll let you know what to do.
</TextBlock>
<Button Grid.Row="3" Grid.Column="0" x:Name="AutoInstall" Content="Try automatic mod install" Width="160"
Style="{DynamicResource SquareButtonStyle}" HorizontalAlignment="Left" Margin="0,20,0,0" />
</Grid>
</ScrollViewer>
</UserControl>

View File

@ -1,6 +1,9 @@
using Artemis.Models;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using Artemis.Models;
using Artemis.Modules.Games.RocketLeague;
using Caliburn.Micro;
using Screen = Caliburn.Micro.Screen;
namespace Artemis.Modules.Games.Witcher3
{
@ -52,5 +55,62 @@ namespace Artemis.Modules.Games.Witcher3
SaveSettings();
}
public void AutoInstall()
{
// Request The Witcher 3 folder
var dialog = new FolderBrowserDialog
{
Description = "Please select your Witcher 3 install path (root directory)."
};
var result = dialog.ShowDialog();
if (result != DialogResult.OK)
return;
// If the subfolder doesn't contain witcher3.exe, it's the wrong folder.
if (!File.Exists(dialog.SelectedPath + @"\bin\x64\witcher3.exe"))
{
var error = MessageBox.Show("That's not a valid Witcher 3 directory\n\n" +
"Default directories:\n" +
"Steam: C:\\Program Files (x86)\\Steam\\steamapps\\common\\The Witcher 3\n" +
"GOG: C:\\GOG Games\\The Witcher 3 Wild Hunt", "Installation error",
MessageBoxButtons.RetryCancel);
if (error == DialogResult.Retry)
AutoInstall();
else
return;
}
// Look for any conflicting mods
if (Directory.Exists(dialog.SelectedPath + @"\mods"))
{
var file =
Directory.GetFiles(dialog.SelectedPath + @"\mods", "playerWitcher.ws", SearchOption.AllDirectories)
.FirstOrDefault();
if (file != null)
{
// Don't trip over our own mod
if (!file.Contains("modArtemis"))
{
MessageBox.Show("Oh no, you have a conflicting mod!\n\n" +
"Conflicting file: " + file.Remove(0, dialog.SelectedPath.Length) +
"\n\nOnce you press OK you will be taken to an instructions page.", "Conflicting mod found");
return;
}
}
}
// Create the directory structure
if (!Directory.Exists(dialog.SelectedPath + @"\mods\modArtemis\content\scripts\game\player"))
Directory.CreateDirectory(dialog.SelectedPath + @"\mods\modArtemis\content\scripts\game\player");
if (!Directory.Exists(dialog.SelectedPath + @"\bin\config\r4game\user_config_matrix\pc"))
Directory.CreateDirectory(dialog.SelectedPath + @"\bin\config\r4game\user_config_matrix\pc");
// Install the mod files
File.WriteAllText(dialog.SelectedPath + @"\bin\config\r4game\user_config_matrix\pc\artemis.xml", Properties.Resources.artemis);
File.WriteAllText(dialog.SelectedPath + @"\mods\modArtemis\content\scripts\game\player\playerWitcher.ws", Properties.Resources.playerWitcher);
MessageBox.Show("The mod was successfully installed!", "Success");
}
}
}

View File

@ -104,12 +104,26 @@ namespace Artemis.Properties {
}
/// <summary>
/// Looks up a localized resource of type System.Byte[].
/// Looks up a localized string similar to /***********************************************************************/
////** © 2015 CD PROJEKT S.A. All rights reserved.
////** THE WITCHER® is a trademark of CD PROJEKT S. A.
////** The Witcher game is based on the prose of Andrzej Sapkowski.
////***********************************************************************/
///
///
///
///
///statemachine class W3PlayerWitcher extends CR4Player
///{
///
/// private saved var craftingSchematics : array&lt;name&gt;;
///
///
/// private saved var alchemyRecipes : array&lt;name&gt;; [rest of string was truncated]&quot;;.
/// </summary>
internal static byte[] playerWitcher {
internal static string playerWitcher {
get {
object obj = ResourceManager.GetObject("playerWitcher", resourceCulture);
return ((byte[])(obj));
return ResourceManager.GetString("playerWitcher", resourceCulture);
}
}
}

View File

@ -119,12 +119,12 @@
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="artemis" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\artemis.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
<value>..\Resources\artemis.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="gamestateConfigFileCsGo" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\gamestateConfigFileCsGo.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
</data>
<data name="playerWitcher" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\playerWitcher.ws;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>..\Resources\playerWitcher.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
</data>
</root>

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-16"?>
<!-- Used by Artemis to get the active Sign -->
<UserConfig>
<Group id="Artemis" displayName="Artemis">
<VisibleVars>
<Var id="ActiveSign" displayName="ActiveSign" displayType="SLIDER:0:1:1000000"/>
</VisibleVars>
</Group>
</UserConfig>

Binary file not shown.