Skip to content

Commit

Permalink
Merge pull request #1 from mouzedrift/game-launch-fix
Browse files Browse the repository at this point in the history
Add AE and AO check for quick game launch
  • Loading branch information
Paul authored Jul 20, 2020
2 parents 9934f78 + 3ac7f09 commit 64242cd
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
4 changes: 2 additions & 2 deletions AliveHookManager/LinkerMapParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void Parse(string linkMapText)
int firstAtIndex = funcName.IndexOf('@');
funcName = funcName.Substring(0, (firstAtIndex != -1) ? firstAtIndex : funcName.Length);

string[] nameSplit = funcName.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries);
string[] nameSplit = funcName.Split(new char[] { '_' }, StringSplitOptions.RemoveEmptyEntries);
int address = 0;
if (int.TryParse(nameSplit.Last(), System.Globalization.NumberStyles.HexNumber, null, out address) && address > 0x400000)
{
Expand All @@ -55,7 +55,7 @@ public void Parse(string linkMapText)

var lowerFunc = funcName.ToLower();
var sym = funcObjectSplit.First().ToLower();
if (!lowerFunc.StartsWith("_") && !lowerFunc.StartsWith("?"))
if (!lowerFunc.StartsWith("_") && !lowerFunc.StartsWith("?"))
{
Functions.Add(new LinkerMapFunction() { Name = funcName, Object = functionObject, Address = address });
}
Expand Down
29 changes: 23 additions & 6 deletions AliveHookManager/ManagerV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,29 @@ void SaveDisabledFunctions()
}
}

void LaunchGame(string args)
{
Process p = Process.Start("Exoddus_NoStubs.exe", args);
Hide();
p.WaitForExit();
Show();
void LaunchGame(string args)
{
Process p;

if (File.Exists("Exoddus_AliveDllAE.exe"))
{
p = Process.Start("Exoddus_AliveDllAE.exe", args);
}

else if (File.Exists("AbeWin_AliveDllAO.exe"))
{
p = Process.Start("AbeWin_AliveDllAO.exe", args);
}

else
{
MessageBox.Show($"Exoddus_AliveDllAE.exe nor AbeWin_AliveDllAO.exe was found. Make sure to put this app into the game directory.", $"No executable found", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}

Hide();
p.WaitForExit();
Show();
}

bool LoadLinkerMap(string fileName)
Expand Down

0 comments on commit 64242cd

Please sign in to comment.