From 9eee5d87936c935ed5518fb7afbfb516d0b41962 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Sat, 11 Jan 2020 16:13:45 -0600 Subject: [PATCH] Fixed bare manifests --- IPA.Loader/Loader/PluginExecutor.cs | 11 +++++++++-- IPA.Loader/Loader/PluginLoader.cs | 7 +++++-- IPA.Loader/Loader/manifest.json | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/IPA.Loader/Loader/PluginExecutor.cs b/IPA.Loader/Loader/PluginExecutor.cs index ae946914..90b54582 100644 --- a/IPA.Loader/Loader/PluginExecutor.cs +++ b/IPA.Loader/Loader/PluginExecutor.cs @@ -24,11 +24,18 @@ namespace IPA.Loader // NOTE: TaskEx.WhenAll() (Task.WhenAll() in .NET 4) returns CompletedTask if it has no arguments, which we need for .NET 3 internal class PluginExecutor { + public enum Special + { + None, Self, Bare + } + public PluginMetadata Metadata { get; } - public PluginExecutor(PluginMetadata meta, bool isSelf) + public Special SpecialType { get; } + public PluginExecutor(PluginMetadata meta, Special specialType = Special.None) { Metadata = meta; - if (isSelf) + SpecialType = specialType; + if (specialType != Special.None) { CreatePlugin = m => null; LifecycleEnable = o => { }; diff --git a/IPA.Loader/Loader/PluginLoader.cs b/IPA.Loader/Loader/PluginLoader.cs index a8b267d5..32fa0b53 100644 --- a/IPA.Loader/Loader/PluginLoader.cs +++ b/IPA.Loader/Loader/PluginLoader.cs @@ -604,7 +604,7 @@ namespace IPA.Loader Logger.loader.Warn($"Mod {meta.Name} developed for game version {meta.Manifest.GameVersion}, so it may not work properly."); if (meta.IsSelf) - return new PluginExecutor(meta, true); + return new PluginExecutor(meta, PluginExecutor.Special.Self); foreach (var dep in meta.Dependencies) { @@ -632,6 +632,9 @@ namespace IPA.Loader return null; } + if (meta.IsBare) + return new PluginExecutor(meta, PluginExecutor.Special.Bare); + Load(meta); foreach (var feature in meta.Features) @@ -651,7 +654,7 @@ namespace IPA.Loader PluginExecutor exec; try { - exec = new PluginExecutor(meta, false); + exec = new PluginExecutor(meta); } catch (Exception e) { diff --git a/IPA.Loader/Loader/manifest.json b/IPA.Loader/Loader/manifest.json index b7f9254e..3df51671 100644 --- a/IPA.Loader/Loader/manifest.json +++ b/IPA.Loader/Loader/manifest.json @@ -5,7 +5,7 @@ "#![IPA.Loader.description.md]", "A mod loader specifically for Beat Saber." ], - "gameVersion": "1.6.1", + "gameVersion": "1.6.2", "id": "BSIPA", "name": "Beat Saber IPA", "version": "4.0.0-beta.3",