Browse Source

Fixed bare manifests

4.0.0-beta
Anairkoen Schno 4 years ago
parent
commit
9eee5d8793
3 changed files with 15 additions and 5 deletions
  1. +9
    -2
      IPA.Loader/Loader/PluginExecutor.cs
  2. +5
    -2
      IPA.Loader/Loader/PluginLoader.cs
  3. +1
    -1
      IPA.Loader/Loader/manifest.json

+ 9
- 2
IPA.Loader/Loader/PluginExecutor.cs View File

@ -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 // NOTE: TaskEx.WhenAll() (Task.WhenAll() in .NET 4) returns CompletedTask if it has no arguments, which we need for .NET 3
internal class PluginExecutor internal class PluginExecutor
{ {
public enum Special
{
None, Self, Bare
}
public PluginMetadata Metadata { get; } public PluginMetadata Metadata { get; }
public PluginExecutor(PluginMetadata meta, bool isSelf)
public Special SpecialType { get; }
public PluginExecutor(PluginMetadata meta, Special specialType = Special.None)
{ {
Metadata = meta; Metadata = meta;
if (isSelf)
SpecialType = specialType;
if (specialType != Special.None)
{ {
CreatePlugin = m => null; CreatePlugin = m => null;
LifecycleEnable = o => { }; LifecycleEnable = o => { };


+ 5
- 2
IPA.Loader/Loader/PluginLoader.cs View File

@ -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."); Logger.loader.Warn($"Mod {meta.Name} developed for game version {meta.Manifest.GameVersion}, so it may not work properly.");
if (meta.IsSelf) if (meta.IsSelf)
return new PluginExecutor(meta, true);
return new PluginExecutor(meta, PluginExecutor.Special.Self);
foreach (var dep in meta.Dependencies) foreach (var dep in meta.Dependencies)
{ {
@ -632,6 +632,9 @@ namespace IPA.Loader
return null; return null;
} }
if (meta.IsBare)
return new PluginExecutor(meta, PluginExecutor.Special.Bare);
Load(meta); Load(meta);
foreach (var feature in meta.Features) foreach (var feature in meta.Features)
@ -651,7 +654,7 @@ namespace IPA.Loader
PluginExecutor exec; PluginExecutor exec;
try try
{ {
exec = new PluginExecutor(meta, false);
exec = new PluginExecutor(meta);
} }
catch (Exception e) catch (Exception e)
{ {


+ 1
- 1
IPA.Loader/Loader/manifest.json View File

@ -5,7 +5,7 @@
"#![IPA.Loader.description.md]", "#![IPA.Loader.description.md]",
"A mod loader specifically for Beat Saber." "A mod loader specifically for Beat Saber."
], ],
"gameVersion": "1.6.1",
"gameVersion": "1.6.2",
"id": "BSIPA", "id": "BSIPA",
"name": "Beat Saber IPA", "name": "Beat Saber IPA",
"version": "4.0.0-beta.3", "version": "4.0.0-beta.3",


Loading…
Cancel
Save