Browse Source

Various changes.

tags/3.0d
Eusth 7 years ago
parent
commit
e8873c191e
5 changed files with 18 additions and 14 deletions
  1. +1
    -1
      IPA/IPA.csproj
  2. +8
    -7
      IPA/Program.cs
  3. +8
    -0
      IllusionInjector/Bootstrapper.cs
  4. +1
    -1
      IllusionInjector/Injector.cs
  5. +0
    -5
      IllusionInjector/PluginComponent.cs

+ 1
- 1
IPA/IPA.csproj View File

@@ -89,7 +89,7 @@
<Launcher Include="$(SolutionDir)Launcher\$(OutDir)Launcher.exe" />
<Dlls Include="$(SolutionDir)IllusionInjector\$(OutDir)**\*" />
</ItemGroup>
<Copy SourceFiles="@(Dlls)" DestinationFolder="$(OutputPath)IPA\Managed" />
<Copy SourceFiles="@(Dlls)" DestinationFolder="$(OutputPath)IPA\Data\Managed" />
<Copy SourceFiles="@(Launcher)" DestinationFolder="$(OutputPath)IPA" />
</Target>
</Project>

+ 8
- 7
IPA/Program.cs View File

@@ -17,26 +17,27 @@ namespace IPA
}

string launcherSrc = Path.Combine("IPA", "Launcher.exe");
string managedFolder = Path.Combine("IPA", "Managed");
string dataSrcPath = Path.Combine("IPA", "Data");
string pluginsFolder = "Plugins";
string projectName = Path.GetFileNameWithoutExtension(args[0]);
string dataPath = Path.Combine(Path.Combine(Path.GetDirectoryName(args[0]), projectName + "_Data"), "Managed");
string engineFile = Path.Combine(dataPath, "UnityEngine.dll");
string assemblyFile = Path.Combine(dataPath, "Assembly-Csharp.dll");
string dataDstPath = Path.Combine(Path.GetDirectoryName(args[0]), projectName + "_Data");
string managedPath = Path.Combine(dataDstPath, "Managed");
string engineFile = Path.Combine(managedPath, "UnityEngine.dll");
string assemblyFile = Path.Combine(managedPath, "Assembly-Csharp.dll");


// Sanitizing
if (!File.Exists(launcherSrc)) Fail("Couldn't find DLLs! Make sure you extracted all contents of the release archive.");
if(!Directory.Exists(dataPath) || !File.Exists(engineFile) || !File.Exists(assemblyFile))
if(!Directory.Exists(dataDstPath) || !File.Exists(engineFile) || !File.Exists(assemblyFile))
{
Fail("Game does not seem to be a Unity project. Could not find the libraries to patch.");
Fail("Game does not seem to be a Unity project. Could not find the libraries to patch. ");
}

try
{
// Copying
Console.Write("Updating files... ");
CopyAll(new DirectoryInfo(managedFolder), new DirectoryInfo(dataPath));
CopyAll(new DirectoryInfo(dataSrcPath), new DirectoryInfo(dataDstPath));
Console.WriteLine("Successfully updated files!");

if (!Directory.Exists(pluginsFolder))


+ 8
- 0
IllusionInjector/Bootstrapper.cs View File

@@ -9,6 +9,14 @@ namespace IllusionInjector
class Bootstrapper : MonoBehaviour
{
public event Action Destroyed = delegate {};
void Awake()
{
if (Environment.CommandLine.Contains("--verbose") && !Screen.fullScreen)
{
Windows.GuiConsole.CreateConsole();
}
}

void Start()
{


+ 1
- 1
IllusionInjector/Injector.cs View File

@@ -1,4 +1,5 @@
using System;
using System.IO;
using UnityEngine;

namespace IllusionInjector
@@ -11,7 +12,6 @@ namespace IllusionInjector
if (!injected)
{
injected = true;

var bootstrapper = new GameObject("Bootstrapper").AddComponent<Bootstrapper>();
bootstrapper.Destroyed += Bootstrapper_Destroyed;
}


+ 0
- 5
IllusionInjector/PluginComponent.cs View File

@@ -14,11 +14,6 @@ namespace IllusionInjector
{
DontDestroyOnLoad(gameObject);

if (Environment.CommandLine.Contains("--verbose") && !Screen.fullScreen)
{
Windows.GuiConsole.CreateConsole();
}

plugins = new CompositePlugin(PluginManager.Plugins);
plugins.OnApplicationStart();
}


Loading…
Cancel
Save