Browse Source

Added MarkDown description for BSIPA

pull/46/head
Anairkoen Schno 5 years ago
parent
commit
ac4f75aea2
5 changed files with 49 additions and 10 deletions
  1. +3
    -0
      IPA.Loader/IPA.Loader.csproj
  2. +26
    -8
      IPA.Loader/Loader/PluginLoader.cs
  3. +16
    -0
      IPA.Loader/Loader/description.md
  4. +4
    -1
      IPA.Loader/Loader/manifest.json
  5. +0
    -1
      IPA/IPA.csproj

+ 3
- 0
IPA.Loader/IPA.Loader.csproj View File

@ -130,5 +130,8 @@
<ItemGroup> <ItemGroup>
<EmbeddedResource Include="icon.png" /> <EmbeddedResource Include="icon.png" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Loader\description.md" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

+ 26
- 8
IPA.Loader/Loader/PluginLoader.cs View File

@ -223,20 +223,38 @@ namespace IPA.Loader
var m = embeddedTextDescriptionPattern.Match(lines[0]); var m = embeddedTextDescriptionPattern.Match(lines[0]);
if (m.Success) if (m.Success)
{ {
var name = m.Groups[1].Value;
var resc = meta.PluginType.Module.Resources.Select(r => r as EmbeddedResource)
.Where(r => r != null)
.FirstOrDefault(r => r.Name == name);
if (resc == null)
if (meta.IsBare)
{ {
Logger.loader.Warn($"Could not find description file for plugin {meta.Name} ({name}); ignoring include");
Logger.loader.Warn($"Bare manifest cannot specify description file");
meta.Manifest.Description = string.Join("\n", lines.Skip(1)); // ignore first line meta.Manifest.Description = string.Join("\n", lines.Skip(1)); // ignore first line
continue; continue;
} }
var name = m.Groups[1].Value;
string description; string description;
using (var reader = new StreamReader(resc.GetResourceStream()))
description = reader.ReadToEnd();
if (!meta.IsSelf)
{
var resc = meta.PluginType.Module.Resources.Select(r => r as EmbeddedResource)
.Where(r => r != null)
.FirstOrDefault(r => r.Name == name);
if (resc == null)
{
Logger.loader.Warn($"Could not find description file for plugin {meta.Name} ({name}); ignoring include");
meta.Manifest.Description = string.Join("\n", lines.Skip(1)); // ignore first line
continue;
}
using (var reader = new StreamReader(resc.GetResourceStream()))
description = reader.ReadToEnd();
}
else
{
using (var descriptionReader =
new StreamReader(
meta.Assembly.GetManifestResourceStream(name) ??
throw new InvalidOperationException()))
description = descriptionReader.ReadToEnd();
}
meta.Manifest.Description = description; meta.Manifest.Description = description;
} }


+ 16
- 0
IPA.Loader/Loader/description.md View File

@ -0,0 +1,16 @@
BSIPA
=====
BSIPA is a mod loader based off of [Illusion Plugin Architecture](https://github.com/russianGecko/IPA-Reloaded), designed for Beat Saber.
While it retains backwards compatability, the recommended interface has been completely redesigned for a more consistent and stable installation.
Taking some inspiration from mod injectors like [BepInEx](https://github.com/BepInEx/BepInEx), it uses a fork of [Unity Doorstop](https://github.com/NeighTools/UnityDoorstop)
to actually inject itself into the game.
***
The particular method of injection that BSIPA uses lets its user experience be far nicer than most others, not requiring a repatch for every game update.
With updating the game being seamless, it also makes sense to make updating the mods themselves seamless. BSIPA's internal updater will automatically ask [BeatMods](https://beatmods.com/)
for newer versions of your installed mods. Of course, this is configurable either in the config at `UserData\Beat Saber IPA.json` or with the Mod List, which lets you control the process
to a greater extend than even the configs.

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

@ -1,7 +1,10 @@
{ {
"$schema": "https://raw.githubusercontent.com/beat-saber-modding-group/BSIPA-MetadataFileSchema/master/Schema.json", "$schema": "https://raw.githubusercontent.com/beat-saber-modding-group/BSIPA-MetadataFileSchema/master/Schema.json",
"author": "DaNike", "author": "DaNike",
"description": "A mod loader specifically for Beat Saber.",
"description": [
"#![IPA.Loader.description.md]",
"A mod loader specifically for Beat Saber."
],
"gameVersion": "0.13.2", "gameVersion": "0.13.2",
"id": "BSIPA", "id": "BSIPA",
"name": "Beat Saber IPA", "name": "Beat Saber IPA",


+ 0
- 1
IPA/IPA.csproj View File

@ -111,7 +111,6 @@
<ItemGroup> <ItemGroup>
<Content Include="favicon.ico" /> <Content Include="favicon.ico" />
</ItemGroup> </ItemGroup>
<ItemGroup />
<ItemGroup> <ItemGroup>
<PackageReference Include="Mono.Cecil"> <PackageReference Include="Mono.Cecil">
<Version>0.10.3</Version> <Version>0.10.3</Version>


Loading…
Cancel
Save