From 59dc4465dd52a634447d9722a2a947158f7440a0 Mon Sep 17 00:00:00 2001 From: Anairkoen Schno Date: Tue, 19 Feb 2019 20:25:06 -0600 Subject: [PATCH] Removed no-longer-needed members of IBeatSaberPlugin --- IPA.Injector/Properties/AssemblyInfo.cs | 4 ++-- IPA.Loader/Config/SelfConfig.cs | 6 ++--- .../Loader/Composite/CompositeBSPlugin.cs | 24 +++++++++---------- IPA.Loader/Loader/PluginComponent.cs | 3 +-- IPA.Loader/Loader/manifest.json | 2 +- .../BeatSaber/IBeatSaberPlugin.cs | 16 ------------- IPA.Loader/Updating/SelfPlugin.cs | 6 ++--- IPA/Properties/AssemblyInfo.cs | 4 ++-- appveyor.yml | 2 +- 9 files changed, 25 insertions(+), 42 deletions(-) diff --git a/IPA.Injector/Properties/AssemblyInfo.cs b/IPA.Injector/Properties/AssemblyInfo.cs index 00648990..3ac8cb85 100644 --- a/IPA.Injector/Properties/AssemblyInfo.cs +++ b/IPA.Injector/Properties/AssemblyInfo.cs @@ -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")] \ No newline at end of file +[assembly: AssemblyVersion("3.12.2")] +[assembly: AssemblyFileVersion("3.12.2")] \ No newline at end of file diff --git a/IPA.Loader/Config/SelfConfig.cs b/IPA.Loader/Config/SelfConfig.cs index f5c2d7f1..cfe1471d 100644 --- a/IPA.Loader/Config/SelfConfig.cs +++ b/IPA.Loader/Config/SelfConfig.cs @@ -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; diff --git a/IPA.Loader/Loader/Composite/CompositeBSPlugin.cs b/IPA.Loader/Loader/Composite/CompositeBSPlugin.cs index 2efa8158..ed4b0b7c 100644 --- a/IPA.Loader/Loader/Composite/CompositeBSPlugin.cs +++ b/IPA.Loader/Loader/Composite/CompositeBSPlugin.cs @@ -7,32 +7,32 @@ namespace IPA.Loader.Composite { internal class CompositeBSPlugin : IBeatSaberPlugin { - private readonly IEnumerable plugins; + private readonly IEnumerable plugins; - private delegate void CompositeCall(IBeatSaberPlugin plugin); + private delegate void CompositeCall(PluginLoader.PluginInfo plugin); - public CompositeBSPlugin(IEnumerable plugins) { + public CompositeBSPlugin(IEnumerable 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(); }); } diff --git a/IPA.Loader/Loader/PluginComponent.cs b/IPA.Loader/Loader/PluginComponent.cs index 60f45c71..ec02f6de 100644 --- a/IPA.Loader/Loader/PluginComponent.cs +++ b/IPA.Loader/Loader/PluginComponent.cs @@ -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 diff --git a/IPA.Loader/Loader/manifest.json b/IPA.Loader/Loader/manifest.json index 04d31d68..71cabcc9 100644 --- a/IPA.Loader/Loader/manifest.json +++ b/IPA.Loader/Loader/manifest.json @@ -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)", diff --git a/IPA.Loader/PluginInterfaces/BeatSaber/IBeatSaberPlugin.cs b/IPA.Loader/PluginInterfaces/BeatSaber/IBeatSaberPlugin.cs index cbf40917..6b613ee0 100644 --- a/IPA.Loader/PluginInterfaces/BeatSaber/IBeatSaberPlugin.cs +++ b/IPA.Loader/PluginInterfaces/BeatSaber/IBeatSaberPlugin.cs @@ -9,22 +9,6 @@ namespace IPA /// public interface IBeatSaberPlugin { - - /// - /// Gets the name of the plugin. - /// - string Name { get; } - - /// - /// Gets the version of the plugin. - /// - string Version { get; } - - /// - /// Gets the info for the ModSaber release of this plugin. Return null if there is no ModSaber release. - /// - ModsaberModInfo ModInfo { get; } - /// /// Gets invoked when the application is started. /// diff --git a/IPA.Loader/Updating/SelfPlugin.cs b/IPA.Loader/Updating/SelfPlugin.cs index 52074ee5..750f1400 100644 --- a/IPA.Loader/Updating/SelfPlugin.cs +++ b/IPA.Loader/Updating/SelfPlugin.cs @@ -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" }; diff --git a/IPA/Properties/AssemblyInfo.cs b/IPA/Properties/AssemblyInfo.cs index e2c7b1e3..05d2f742 100644 --- a/IPA/Properties/AssemblyInfo.cs +++ b/IPA/Properties/AssemblyInfo.cs @@ -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")] \ No newline at end of file +[assembly: AssemblyVersion("3.12.2")] +[assembly: AssemblyFileVersion("3.12.2")] \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 9439b05c..db0be9de 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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: