Browse Source

Fixed backups to bacup files that will be patched, even if they aren't initially

pull/46/head
Anairkoen Schno 6 years ago
parent
commit
2bd4c0b327
4 changed files with 11 additions and 3 deletions
  1. +1
    -1
      Doorstop
  2. +3
    -1
      IPA.Injector/Injector.cs
  3. +4
    -1
      IPA.Injector/Virtualizer.cs
  4. +3
    -0
      IPA/Program.cs

+ 1
- 1
Doorstop

@ -1 +1 @@
Subproject commit 04d2989813eaec3d98859333d0ad563ac292c714
Subproject commit b45c8415cd3cfe59c6e79f90955bfc7a07204e13

+ 3
- 1
IPA.Injector/Injector.cs View File

@ -109,13 +109,15 @@ namespace IPA.Injector
} }
if (modified) if (modified)
{
unityAsmDef.Write(unityPath); unityAsmDef.Write(unityPath);
}
#endregion #endregion
loader.Debug("Ensuring Assembly-CSharp is virtualized"); loader.Debug("Ensuring Assembly-CSharp is virtualized");
#region Virtualize Assembly-CSharp.dll #region Virtualize Assembly-CSharp.dll
var ascPath = Path.Combine(Environment.CurrentDirectory, "Beat Saber_Data", "Managed", "Assembly-CSharp.dll"); var ascPath = Path.Combine(Environment.CurrentDirectory, "Beat Saber_Data", "Managed", "Assembly-CSharp.dll");
var ascModule = VirtualizedModule.Load(ascPath); var ascModule = VirtualizedModule.Load(ascPath);
ascModule.Virtualize(cAsmName); ascModule.Virtualize(cAsmName);
#endregion #endregion


+ 4
- 1
IPA.Injector/Virtualizer.cs View File

@ -36,7 +36,7 @@ namespace IPA.Injector
/// ///
/// </summary> /// </summary>
/// <param name="module"></param> /// <param name="module"></param>
public void Virtualize(AssemblyName selfName)
public void Virtualize(AssemblyName selfName, Action beforeChangeCallback = null)
{ {
bool changed = false; bool changed = false;
bool virtualize = true; bool virtualize = true;
@ -65,7 +65,10 @@ namespace IPA.Injector
} }
if (changed) if (changed)
{
beforeChangeCallback?.Invoke();
module.Write(file.FullName); module.Write(file.FullName);
}
} }
private void VirtualizeType(TypeDefinition type) private void VirtualizeType(TypeDefinition type)


+ 3
- 0
IPA/Program.cs View File

@ -254,6 +254,9 @@ namespace IPA
CopyAll(new DirectoryInfo(context.IPARoot), new DirectoryInfo(context.ProjectRoot), force, CopyAll(new DirectoryInfo(context.IPARoot), new DirectoryInfo(context.ProjectRoot), force,
backup, backup,
null, false); null, false);
backup.Add(context.AssemblyFile);
backup.Add(context.EngineFile);
} }
#region Create Plugin Folder #region Create Plugin Folder


Loading…
Cancel
Save