diff --git a/Artemis/Artemis/Artemis.csproj b/Artemis/Artemis/Artemis.csproj
index 246fecf0c..2d029036a 100644
--- a/Artemis/Artemis/Artemis.csproj
+++ b/Artemis/Artemis/Artemis.csproj
@@ -360,7 +360,9 @@
-
+
+
+
SettingsSingleFileGenerator
Offsets.Designer.cs
@@ -441,7 +443,7 @@
PreserveNewest
-
+
PreserveNewest
diff --git a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3View.xaml b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3View.xaml
index d0d6f53b7..cdc90c8a4 100644
--- a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3View.xaml
+++ b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3View.xaml
@@ -9,11 +9,13 @@
-
+
+
+
-
- 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.
+
+ If you do use conflicting mods, we'll let you know what to do.
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3ViewModel.cs b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3ViewModel.cs
index 3c5cf7ddc..0da201790 100644
--- a/Artemis/Artemis/Modules/Games/Witcher3/Witcher3ViewModel.cs
+++ b/Artemis/Artemis/Modules/Games/Witcher3/Witcher3ViewModel.cs
@@ -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");
+ }
}
}
\ No newline at end of file
diff --git a/Artemis/Artemis/Properties/Resources.Designer.cs b/Artemis/Artemis/Properties/Resources.Designer.cs
index c9ce2b8ae..3d9fec521 100644
--- a/Artemis/Artemis/Properties/Resources.Designer.cs
+++ b/Artemis/Artemis/Properties/Resources.Designer.cs
@@ -104,12 +104,26 @@ namespace Artemis.Properties {
}
///
- /// 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<name>;
+ ///
+ ///
+ /// private saved var alchemyRecipes : array<name>; [rest of string was truncated]";.
///
- internal static byte[] playerWitcher {
+ internal static string playerWitcher {
get {
- object obj = ResourceManager.GetObject("playerWitcher", resourceCulture);
- return ((byte[])(obj));
+ return ResourceManager.GetString("playerWitcher", resourceCulture);
}
}
}
diff --git a/Artemis/Artemis/Properties/Resources.resx b/Artemis/Artemis/Properties/Resources.resx
index 782795640..ffe099e90 100644
--- a/Artemis/Artemis/Properties/Resources.resx
+++ b/Artemis/Artemis/Properties/Resources.resx
@@ -119,12 +119,12 @@
- ..\Resources\artemis.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
+ ..\Resources\artemis.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
..\Resources\gamestateConfigFileCsGo.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252
- ..\Resources\playerWitcher.ws;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+ ..\Resources\playerWitcher.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16
\ No newline at end of file
diff --git a/Artemis/Artemis/Resources/artemis.txt b/Artemis/Artemis/Resources/artemis.txt
new file mode 100644
index 000000000..4bb757ee4
--- /dev/null
+++ b/Artemis/Artemis/Resources/artemis.txt
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Artemis/Artemis/Resources/playerWitcher.txt b/Artemis/Artemis/Resources/playerWitcher.txt
new file mode 100644
index 000000000..2fead1e77
Binary files /dev/null and b/Artemis/Artemis/Resources/playerWitcher.txt differ