Skip to content

Commit

Permalink
Fixed Tales of Arise setup
Browse files Browse the repository at this point in the history
  • Loading branch information
TekkaGB committed Sep 10, 2021
1 parent 3b1a67e commit e270dcb
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 24 deletions.
85 changes: 62 additions & 23 deletions Unverum/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public static bool Generic(string exe, string projectName, string defaultPath)
}
public static bool MHOJ2()
{
var defaultPath = @"C:\Program Files (x86)\Steam\steamapps\common\My Hero One's Justice 2\MHOJ2.exe";
var defaultPath = @"C:\Program Files (x86)\Steam\steamapps\common\My Hero One's Justice 2\HeroGame\Binaries\Win64\MHOJ2.exe";
if (!File.Exists(defaultPath))
{
OpenFileDialog dialog = new OpenFileDialog();
Expand Down Expand Up @@ -152,6 +152,39 @@ public static bool MHOJ2()
Global.logger.WriteLine($"Setup completed for {Global.config.CurrentGame}!", LoggerType.Info);
return true;
}
public static bool ToA()
{
var defaultPath = @"C:\Program Files (x86)\Steam\steamapps\common\Tales of Arise\Arise\Binaries\Win64\Tales of Arise.exe";
if (!File.Exists(defaultPath))
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.DefaultExt = ".exe";
dialog.Filter = $"Executable Files (Tales of Arise.exe)|Tales of Arise.exe";
dialog.Title = $"Select Tales of Arise.exe from your Steam Install folder";
dialog.Multiselect = false;
dialog.InitialDirectory = Global.assemblyLocation;
dialog.ShowDialog();
if (!String.IsNullOrEmpty(dialog.FileName)
&& Path.GetFileName(dialog.FileName).Equals("Tales of Arise.exe", StringComparison.InvariantCultureIgnoreCase))
defaultPath = dialog.FileName;
else if (!String.IsNullOrEmpty(dialog.FileName))
{
Global.logger.WriteLine($"Invalid .exe chosen", LoggerType.Error);
return false;
}
else
return false;
}
var parent = defaultPath.Replace($"{Global.s}Arise{Global.s}Binaries{Global.s}Win64{Global.s}Tales of Arise.exe", String.Empty);
var paks = $"{parent}{Global.s}Arise{Global.s}Content{Global.s}Paks";
var ModsFolder = $"{paks}{Global.s}~mods";
Directory.CreateDirectory(ModsFolder);
Global.config.Configs[Global.config.CurrentGame].ModsFolder = ModsFolder;
Global.config.Configs[Global.config.CurrentGame].Launcher = defaultPath;
Global.UpdateConfig();
Global.logger.WriteLine($"Setup completed for {Global.config.CurrentGame}!", LoggerType.Info);
return true;
}
public static bool KHIII()
{
OpenFileDialog dialog = new OpenFileDialog();
Expand Down Expand Up @@ -197,31 +230,37 @@ public static void CheckJFPatch(string exe)
public static bool JF()
{
var defaultPath = @"C:\Program Files (x86)\Steam\steamapps\common\JUMP FORCE\JUMP_FORCE.exe";
OpenFileDialog dialog = new OpenFileDialog();
dialog.DefaultExt = ".exe";
dialog.Filter = "Executable Files (JUMP_FORCE.exe)|JUMP_FORCE.exe";
dialog.Title = "Select JUMP_FORCE.exe from your Steam Install folder";
dialog.Multiselect = false;
dialog.InitialDirectory = Global.assemblyLocation;
dialog.ShowDialog();
if (!String.IsNullOrEmpty(dialog.FileName)
&& Path.GetFileName(dialog.FileName).Equals("JUMP_FORCE.exe", StringComparison.InvariantCultureIgnoreCase))
if (!File.Exists(defaultPath))
{
var parent = Path.GetDirectoryName(dialog.FileName);
var ModsFolder = $"{parent}{Global.s}JUMP_FORCE{Global.s}Content{Global.s}Paks{Global.s}~mods";
OpenFileDialog dialog = new OpenFileDialog();
dialog.DefaultExt = ".exe";
dialog.Filter = "Executable Files (JUMP_FORCE.exe)|JUMP_FORCE.exe";
dialog.Title = "Select JUMP_FORCE.exe from your Steam Install folder";
dialog.Multiselect = false;
dialog.InitialDirectory = Global.assemblyLocation;
dialog.ShowDialog();
if (!String.IsNullOrEmpty(dialog.FileName)
&& Path.GetFileName(dialog.FileName).Equals("JUMP_FORCE.exe", StringComparison.InvariantCultureIgnoreCase))
defaultPath = dialog.FileName;
else if (!String.IsNullOrEmpty(dialog.FileName))
{
Global.logger.WriteLine($"Invalid .exe chosen", LoggerType.Error);
return false;
}
else
return false;
}
var parent = Path.GetDirectoryName(defaultPath);
var ModsFolder = $"{parent}{Global.s}JUMP_FORCE{Global.s}Content{Global.s}Paks{Global.s}~mods";

CheckJFPatch(dialog.FileName);
CheckJFPatch(defaultPath);

Directory.CreateDirectory(ModsFolder);
Global.config.Configs[Global.config.CurrentGame].ModsFolder = ModsFolder;
Global.config.Configs[Global.config.CurrentGame].Launcher = dialog.FileName;
Global.UpdateConfig();
Global.logger.WriteLine($"Setup completed!", LoggerType.Info);
return true;
}
else if (!String.IsNullOrEmpty(dialog.FileName))
Global.logger.WriteLine($"Invalid .exe chosen", LoggerType.Error);
return false;
Directory.CreateDirectory(ModsFolder);
Global.config.Configs[Global.config.CurrentGame].ModsFolder = ModsFolder;
Global.config.Configs[Global.config.CurrentGame].Launcher = defaultPath;
Global.UpdateConfig();
Global.logger.WriteLine($"Setup completed!", LoggerType.Info);
return true;
}
public static bool DBFZ()
{
Expand Down
2 changes: 1 addition & 1 deletion Unverum/UI/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ private bool SetupGame()
case GameFilter.SN:
return Setup.Generic("ScarletNexus.exe", "ScarletNexus", @"C:\Program Files (x86)\Steam\steamapps\common\ScarletNexus\ScarletNexus.exe");
case GameFilter.ToA:
return Setup.Generic("Tales of Arise.exe", "Arise", @"C:\Program Files (x86)\Steam\steamapps\common\Tales of Arise\Tales of Arise.exe");
return Setup.ToA();
}
return false;
}
Expand Down

0 comments on commit e270dcb

Please sign in to comment.