Browse Source

Removed no-longer-needed members of IBeatSaberPlugin

pull/11/head
Anairkoen Schno 5 years ago
parent
commit
59dc4465dd
9 changed files with 25 additions and 42 deletions
  1. +2
    -2
      IPA.Injector/Properties/AssemblyInfo.cs
  2. +3
    -3
      IPA.Loader/Config/SelfConfig.cs
  3. +12
    -12
      IPA.Loader/Loader/Composite/CompositeBSPlugin.cs
  4. +1
    -2
      IPA.Loader/Loader/PluginComponent.cs
  5. +1
    -1
      IPA.Loader/Loader/manifest.json
  6. +0
    -16
      IPA.Loader/PluginInterfaces/BeatSaber/IBeatSaberPlugin.cs
  7. +3
    -3
      IPA.Loader/Updating/SelfPlugin.cs
  8. +2
    -2
      IPA/Properties/AssemblyInfo.cs
  9. +1
    -1
      appveyor.yml

+ 2
- 2
IPA.Injector/Properties/AssemblyInfo.cs View File

@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.12.1")]
[assembly: AssemblyFileVersion("3.12.1")]
[assembly: AssemblyVersion("3.12.2")]
[assembly: AssemblyFileVersion("3.12.2")]

+ 3
- 3
IPA.Loader/Config/SelfConfig.cs View File

@ -29,11 +29,11 @@ namespace IPA.Config
public static void Set()
{
LoaderConfig = Config.GetProviderFor(IPA_Name, "json");
LoaderConfig = Config.GetProviderFor(IPAName, "json");
}
internal const string IPA_Name = "Beat Saber IPA";
internal const string IPA_Version = "3.12.0";
internal const string IPAName = "Beat Saber IPA";
internal const string IPAVersion = "3.12.2";
public bool Regenerate = true;


+ 12
- 12
IPA.Loader/Loader/Composite/CompositeBSPlugin.cs View File

@ -7,32 +7,32 @@ namespace IPA.Loader.Composite
{
internal class CompositeBSPlugin : IBeatSaberPlugin
{
private readonly IEnumerable<IBeatSaberPlugin> plugins;
private readonly IEnumerable<PluginLoader.PluginInfo> plugins;
private delegate void CompositeCall(IBeatSaberPlugin plugin);
private delegate void CompositeCall(PluginLoader.PluginInfo plugin);
public CompositeBSPlugin(IEnumerable<IBeatSaberPlugin> plugins) {
public CompositeBSPlugin(IEnumerable<PluginLoader.PluginInfo> plugins) {
this.plugins = plugins;
}
public void OnApplicationStart() {
Invoke(plugin => plugin.OnApplicationStart());
Invoke(plugin => plugin.Plugin.OnApplicationStart());
}
public void OnApplicationQuit() {
Invoke(plugin => plugin.OnApplicationQuit());
Invoke(plugin => plugin.Plugin.OnApplicationQuit());
}
public void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode) {
Invoke(plugin => plugin.OnSceneLoaded(scene, sceneMode));
Invoke(plugin => plugin.Plugin.OnSceneLoaded(scene, sceneMode));
}
public void OnSceneUnloaded(Scene scene) {
Invoke(plugin => plugin.OnSceneUnloaded(scene));
Invoke(plugin => plugin.Plugin.OnSceneUnloaded(scene));
}
public void OnActiveSceneChanged(Scene prevScene, Scene nextScene) {
Invoke(plugin => plugin.OnActiveSceneChanged(prevScene, nextScene));
Invoke(plugin => plugin.Plugin.OnActiveSceneChanged(prevScene, nextScene));
}
private void Invoke(CompositeCall callback) {
@ -41,17 +41,17 @@ namespace IPA.Loader.Composite
callback(plugin);
}
catch (Exception ex) {
Logger.log.Error($"{plugin.Name}: {ex}");
Logger.log.Error($"{plugin.Metadata.Name}: {ex}");
}
}
}
public void OnUpdate() {
Invoke(plugin => plugin.OnUpdate());
Invoke(plugin => plugin.Plugin.OnUpdate());
}
public void OnFixedUpdate() {
Invoke(plugin => plugin.OnFixedUpdate());
Invoke(plugin => plugin.Plugin.OnFixedUpdate());
}
public string Name => throw new InvalidOperationException();
@ -62,7 +62,7 @@ namespace IPA.Loader.Composite
public void OnLateUpdate() {
Invoke(plugin => {
if (plugin is IEnhancedBeatSaberPlugin saberPlugin)
if (plugin.Plugin is IEnhancedBeatSaberPlugin saberPlugin)
saberPlugin.OnLateUpdate();
});
}


+ 1
- 2
IPA.Loader/Loader/PluginComponent.cs View File

@ -1,6 +1,5 @@
using IPA.Loader.Composite;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using UnityEngine;
using UnityEngine.SceneManagement;
// ReSharper disable UnusedMember.Local
@ -23,7 +22,7 @@ namespace IPA.Loader
{
DontDestroyOnLoad(gameObject);
bsPlugins = new CompositeBSPlugin(PluginManager.BSPlugins.Where(p => p != null));
bsPlugins = new CompositeBSPlugin(PluginManager.BSMetas);
#pragma warning disable 618
ipaPlugins = new CompositeIPAPlugin(PluginManager.Plugins);
#pragma warning restore 618


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

@ -5,7 +5,7 @@
"gameVersion": "0.12.2",
"id": "beatsaber-ipa-reloaded",
"name": "BSIPA",
"version": "3.12.1",
"version": "3.12.2",
"features": [
"define-feature(print, IPA.Loader.Features.PrintFeature)",
"define-feature(debug, IPA.Loader.Features.DebugFeature)",


+ 0
- 16
IPA.Loader/PluginInterfaces/BeatSaber/IBeatSaberPlugin.cs View File

@ -9,22 +9,6 @@ namespace IPA
/// </summary>
public interface IBeatSaberPlugin
{
/// <summary>
/// Gets the name of the plugin.
/// </summary>
string Name { get; }
/// <summary>
/// Gets the version of the plugin.
/// </summary>
string Version { get; }
/// <summary>
/// Gets the info for the ModSaber release of this plugin. Return null if there is no ModSaber release.
/// </summary>
ModsaberModInfo ModInfo { get; }
/// <summary>
/// Gets invoked when the application is started.
/// </summary>


+ 3
- 3
IPA.Loader/Updating/SelfPlugin.cs View File

@ -9,13 +9,13 @@ namespace IPA.Updating
{
public static SelfPlugin Instance { get; set; } = new SelfPlugin();
public string Name => SelfConfig.IPA_Name;
public string Name => SelfConfig.IPAName;
public string Version => SelfConfig.IPA_Version;
public string Version => SelfConfig.IPAVersion;
public ModsaberModInfo ModInfo => new ModsaberModInfo
{
CurrentVersion = SelfConfig.IPA_Version,
CurrentVersion = SelfConfig.IPAVersion,
InternalName = "beatsaber-ipa-reloaded"
};


+ 2
- 2
IPA/Properties/AssemblyInfo.cs View File

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.12.1")]
[assembly: AssemblyFileVersion("3.12.1")]
[assembly: AssemblyVersion("3.12.2")]
[assembly: AssemblyFileVersion("3.12.2")]

+ 1
- 1
appveyor.yml View File

@ -1,6 +1,6 @@
version: 'BSIPA-{branch}-{build}'
environment:
bsipa_version: '3.12.1'
bsipa_version: '3.12.2'
pull_requests:
do_not_increment_build_number: true
install:


Loading…
Cancel
Save