This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move marsyfier into own class, remove references to Marsey.Serializer
- Loading branch information
Showing
5 changed files
with
39 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Marsey.Game; | ||
using Marsey.Misc; | ||
using Marsey.PatchAssembly; | ||
|
||
namespace Marsey.Patches; | ||
|
||
/// <summary> | ||
/// Manages MarseyPatch instances | ||
/// </summary> | ||
public static class Marsyfier | ||
{ | ||
public static List<MarseyPatch> GetMarseyPatches() => PatchListManager.GetPatchList<MarseyPatch>(); | ||
|
||
/// <summary> | ||
/// Start preload of marseypatches that are flagged as such | ||
/// </summary> | ||
public static void Preload(string[]? path = null) | ||
{ | ||
List<string> preloads = FileHandler.GetFilesFromPipe("PreloadMarseyPatchesPipe"); | ||
|
||
if (preloads.Count == 0) return; | ||
|
||
MarseyLogger.Log(MarseyLogger.LogType.INFO, "Preloader", $"Preloading {preloads.Count} patches."); | ||
|
||
foreach (string patch in preloads) | ||
{ | ||
MarseyLogger.Log(MarseyLogger.LogType.DEBG, "Preloader", $"Preloading {patch}"); | ||
FileHandler.LoadExactAssembly(patch); | ||
} | ||
|
||
List<MarseyPatch> preloadedPatches = GetMarseyPatches(); | ||
|
||
AssemblyFieldHandler.InitHelpers(preloadedPatches); | ||
|
||
if (preloadedPatches.Count != 0) Patcher.Patch(preloadedPatches); | ||
|
||
PatchListManager.ResetList(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters