Browse Source

Improve shutdown handling and disable virtualizing when no Assembly is available.

tags/3,2
Eusth 7 years ago
parent
commit
0df8b1ecb8
2 changed files with 20 additions and 8 deletions
  1. +10
    -7
      IPA/Program.cs
  2. +10
    -1
      IllusionInjector/PluginComponent.cs

+ 10
- 7
IPA/Program.cs View File

@@ -48,7 +48,7 @@ namespace IPA
private static void Validate(PatchContext c)
{
if (!File.Exists(c.LauncherPathSrc)) Fail("Couldn't find DLLs! Make sure you extracted all contents of the release archive.");
if (!Directory.Exists(c.DataPathDst) || !File.Exists(c.EngineFile) || !File.Exists(c.AssemblyFile))
if (!Directory.Exists(c.DataPathDst) || !File.Exists(c.EngineFile))
{
Fail("Game does not seem to be a Unity project. Could not find the libraries to patch.");
}
@@ -86,13 +86,16 @@ namespace IPA
}

// Virtualizing
var virtualizedModule = VirtualizedModule.Load(context.AssemblyFile);
if (!virtualizedModule.IsVirtualized)
if (File.Exists(context.AssemblyFile))
{
Console.Write("Virtualizing Assembly-Csharp.dll... ");
backup.Add(context.AssemblyFile);
virtualizedModule.Virtualize();
Console.WriteLine("Done!");
var virtualizedModule = VirtualizedModule.Load(context.AssemblyFile);
if (!virtualizedModule.IsVirtualized)
{
Console.Write("Virtualizing Assembly-Csharp.dll... ");
backup.Add(context.AssemblyFile);
virtualizedModule.Virtualize();
Console.WriteLine("Done!");
}
}

// Creating shortcut


+ 10
- 1
IllusionInjector/PluginComponent.cs View File

@@ -9,6 +9,7 @@ namespace IllusionInjector
{
private CompositePlugin plugins;
private bool freshlyLoaded = false;
private bool quitting = false;

public static PluginComponent Create()
{
@@ -49,10 +50,18 @@ namespace IllusionInjector
}

void OnDestroy()
{
if (!quitting)
{
Create();
}
}
void OnApplicationQuit()
{
plugins.OnApplicationQuit();

Create();
quitting = true;
}

void OnLevelWasLoaded(int level)


Loading…
Cancel
Save