diff --git a/BSIPA-ModList/UI/ViewControllers/ModCells.cs b/BSIPA-ModList/UI/ViewControllers/ModCells.cs index dbe2efed..49113319 100644 --- a/BSIPA-ModList/UI/ViewControllers/ModCells.cs +++ b/BSIPA-ModList/UI/ViewControllers/ModCells.cs @@ -18,7 +18,7 @@ namespace BSIPA_ModList.UI.ViewControllers void Update(); } - internal class BSIPAModCell : CustomCellInfo, IClickableCell + internal class BSIPAModCell : CustomCellInfo, IClickableCell, IDisposable { internal PluginLoader.PluginMetadata Plugin; private ModListController list; @@ -59,7 +59,10 @@ namespace BSIPA_ModList.UI.ViewControllers private static void PluginManager_PluginDisabled(PluginLoader.PluginMetadata plugin, bool needsRestart, WeakReference _self, PluginManager.PluginDisableDelegate ownDel) { if (!_self.TryGetTarget(out var self)) + { PluginManager.PluginDisabled -= ownDel; + return; + } if (plugin != self.Plugin) return; @@ -112,6 +115,28 @@ namespace BSIPA_ModList.UI.ViewControllers if (propogate) list.Reload(); } + + #region IDisposable Support + private bool disposedValue = false; // To detect redundant calls + + protected virtual void Dispose(bool disposing) + { + if (!disposedValue) + { + if (disposing) + { + PluginManager.PluginDisabled -= disableDel; + PluginManager.PluginEnabled -= enableDel; + } + + disposedValue = true; + } + } + public void Dispose() + { + Dispose(true); + } + #endregion } internal class BSIPAIgnoredModCell : CustomCellInfo, IClickableCell diff --git a/BSIPA-ModList/UI/ViewControllers/ModInfoViewController.cs b/BSIPA-ModList/UI/ViewControllers/ModInfoViewController.cs index 295d7a91..1127022f 100644 --- a/BSIPA-ModList/UI/ViewControllers/ModInfoViewController.cs +++ b/BSIPA-ModList/UI/ViewControllers/ModInfoViewController.cs @@ -94,6 +94,20 @@ namespace BSIPA_ModList.UI SetupLinks(links); } + protected override void DidDeactivate(DeactivationType deactivationType) + { + base.DidDeactivate(deactivationType); + + if (deactivationType == DeactivationType.RemovedFromHierarchy) + Plugin.OnConfigChaned -= OptHideButton; + } + + protected override void OnDestroy() + { + Plugin.OnConfigChaned -= OptHideButton; + base.OnDestroy(); + } + ~ModInfoViewController() { Plugin.OnConfigChaned -= OptHideButton; @@ -101,7 +115,7 @@ namespace BSIPA_ModList.UI private void OptHideButton(SelfConfig cfg) { - enableDisableButton?.gameObject.SetActive(cfg.ShowEnableDisable); + enableDisableButton?.gameObject?.SetActive(cfg.ShowEnableDisable); } private Action setAction = () => { }; diff --git a/BSIPA-ModList/UI/ViewControllers/ModListController.cs b/BSIPA-ModList/UI/ViewControllers/ModListController.cs index 907122a5..cd61a9a2 100644 --- a/BSIPA-ModList/UI/ViewControllers/ModListController.cs +++ b/BSIPA-ModList/UI/ViewControllers/ModListController.cs @@ -64,7 +64,8 @@ namespace BSIPA_ModList.UI var cells = _customListTableView.GetPrivateField>("_visibleCells"); foreach (var c in cells) { - c.gameObject.SetActive(false); + if (c == null) continue; + c.gameObject?.SetActive(false); _customListTableView.AddCellToReusableCells(c); } cells.Clear(); @@ -85,5 +86,16 @@ namespace BSIPA_ModList.UI _customListTableView.gameObject.GetComponent().scrollSensitivity = 0f; } + + protected override void OnDestroy() + { + base.OnDestroy(); + + foreach (var cell in Data) + { + if (cell is IDisposable disp) + disp.Dispose(); + } + } } } diff --git a/BSIPA-ModList/manifest.json b/BSIPA-ModList/manifest.json index 72dbdef2..47ae215c 100644 --- a/BSIPA-ModList/manifest.json +++ b/BSIPA-ModList/manifest.json @@ -11,7 +11,7 @@ "gameVersion": "1.1.0", "id": "BSIPA Mod List", "name": "BSIPA Mod List", - "version": "1.2.5", + "version": "1.2.6", "icon": "BSIPA_ModList.Icons.self.png", "dependsOn": { "BSIPA": "^3.12.22", diff --git a/IPA.Loader/Config/SelfConfig.cs b/IPA.Loader/Config/SelfConfig.cs index 34a6c76c..b69c4033 100644 --- a/IPA.Loader/Config/SelfConfig.cs +++ b/IPA.Loader/Config/SelfConfig.cs @@ -37,7 +37,7 @@ namespace IPA.Config } internal const string IPAName = "Beat Saber IPA"; - internal const string IPAVersion = "3.12.22"; + internal const string IPAVersion = "3.12.23"; public bool Regenerate = true; diff --git a/IPA.Loader/Loader/PluginManager.cs b/IPA.Loader/Loader/PluginManager.cs index e89870d0..2fae7a29 100644 --- a/IPA.Loader/Loader/PluginManager.cs +++ b/IPA.Loader/Loader/PluginManager.cs @@ -120,7 +120,6 @@ namespace IPA.Loader runtimeDisabled.Add(plugin); _bsPlugins.Remove(plugin); - PluginLoader.DisabledPlugins.Add(plugin.Metadata); try { diff --git a/IPA.Loader/Loader/manifest.json b/IPA.Loader/Loader/manifest.json index be6b461f..1393dfce 100644 --- a/IPA.Loader/Loader/manifest.json +++ b/IPA.Loader/Loader/manifest.json @@ -8,7 +8,7 @@ "gameVersion": "1.1.0", "id": "BSIPA", "name": "Beat Saber IPA", - "version": "3.12.22", + "version": "3.12.23", "icon": "IPA.icon.png", "features": [ "define-feature(print, IPA.Loader.Features.PrintFeature)", diff --git a/IPA/Program.cs b/IPA/Program.cs index 59f4fdb5..86fc39d2 100644 --- a/IPA/Program.cs +++ b/IPA/Program.cs @@ -23,7 +23,7 @@ namespace IPA Unknown } - public const string FileVersion = "3.12.22"; + public const string FileVersion = "3.12.23"; public static Version Version => Assembly.GetEntryAssembly().GetName().Version; diff --git a/Refs/BeatSaberCustomUI.dll b/Refs/BeatSaberCustomUI.dll index 5456be86..455b2a7f 100644 Binary files a/Refs/BeatSaberCustomUI.dll and b/Refs/BeatSaberCustomUI.dll differ diff --git a/Refs/BeatSaberCustomUI.xml b/Refs/BeatSaberCustomUI.xml deleted file mode 100644 index 5fbaa627..00000000 --- a/Refs/BeatSaberCustomUI.xml +++ /dev/null @@ -1,359 +0,0 @@ - - - - BeatSaberCustomUI - - - - - Display a keyboard interface to accept user input. - - The title to be displayed above the keyboard. - The starting value of the keyboard. - Callback when the text is modified by the user (when any key is pressed basically). - Callback when the user successfully submits the changed text. - Callback when the user presses the cancel button. - - - - - Creates a copy of a template button and returns it. - - The transform to parent the button to. - The name of the button to make a copy of. Example: "QuitButton", "PlayButton", etc. - The position the button should be anchored to. - The size of the buttons RectTransform. - Callback for when the button is pressed. - The text that should be shown on the button. - The icon that should be shown on the button. - The newly created button. - - - - Creates a copy of a template button and returns it. - - The transform to parent the button to. - The name of the button to make a copy of. Example: "QuitButton", "PlayButton", etc. - The position the button should be anchored to. - Callback for when the button is pressed. - The text that should be shown on the button. - The icon that should be shown on the button. - The newly created button. - - - - Creates a copy of a template button and returns it. - - The transform to parent the button to. - The name of the button to make a copy of. Example: "QuitButton", "PlayButton", etc. - Callback for when the button is pressed. - The text that should be shown on the button. - The icon that should be shown on the button. - The newly created button. - - - - Creates a copy of a back button. - - The transform to parent the new button to. - Callback for when the button is pressed. - The newly created back button. - - - - Creates a VRUIViewController of type T, and marks it to not be destroyed. - - The variation of VRUIViewController you want to create. - The newly created VRUIViewController of type T. - - - - Creates a CustomMenu, which is basically a custom panel that handles UI transitions for you automatically. - - The type of CustomMenu to instantiate. - The title of the new CustomMenu. - The newly created CustomMenu of type T. - - - - Creates a loading spinner. - - The transform to parent the new loading spinner to. - The newly created loading spinner. - - - - Creates a TextMeshProUGUI component. - - Thet ransform to parent the new TextMeshProUGUI component to. - The text to be displayed. - The position the button should be anchored to. - The newly created TextMeshProUGUI component. - - - - Creates a TextMeshProUGUI component. - - Thet transform to parent the new TextMeshProUGUI component to. - The text to be displayed. - The position the text component should be anchored to. - The size of the text components RectTransform. - The newly created TextMeshProUGUI component. - - - - Adds hint text to any component that handles pointer events. - - Thet transform to parent the new HoverHint component to. - The text to be displayed on the HoverHint panel. - The newly created HoverHint component. - - - - Creates a custom slider. - - Thet transform to parent the new slider component to. - The minimum value of the slider. - The maximum value of the slider. - The amount to increment the slider by. - True if the value represented by the slider is an int, false if it's a float. - Callback when the sliders value changes. - - - - - Creates a color picker. - - Thet transform to parent the new color picker to. - The position the color picker should be anchored to. - The size of the color picker's RectTransform. - - - - - The FlowCoordinator that presented this FlowCoordinator - - - - - The CustomMenu this FlowCoordinator is representing. - - - - - Back out to the previous flow coordinator. - - If set to true, no animation will be shown and the transition will be instant. - - - - Back out to the previous flow coordinator with an animation. - - - - - Whether or not to include a back button when the ViewController is activated. - - - - - A reference to the page up button, if it exists. - - - - - A reference to the page down button, if it exists. - - - - - The TableView associated with the current CustomListViewController. - - - - - The data to be displayed in the table. - - - - - An event fired when the user selects a cell in the TableView. - - - - - The reuse identifier, which is used to recycle cells instead of instantiating new instances of them. - - - - - The prefab used to instantiate new table cells. - - - - - Instantiates a new LevelListTableCell (or recycles an old one). - - This param does nothing, and was left in by mistake. - If set to false, the BeatmapCharacteristicImages will be destroyed. - - - - - Instantiates a new LevelListTableCell (or recycles an old one). - - If set to false, the BeatmapCharacteristicImages will be destroyed. - - - - - The CustomFlowCoordinator associated with this CustomMenu. This will not be populated if you have no main CustomViewController. - - - - - The main CustomViewController associated with this menu. - - - - - The left CustomViewController associated with this menu. - - - - - The right CustomViewController associated with this menu. - - - - - The bottom CustomViewController associated with this menu. - - - - - Sets up the main CustomViewController. - - The viewcontroller to set. - Whether or not to generate a back button. - Optional, a callback when the ViewController becomes active (when you open it). - Optional, a callback when the ViewController becomes inactive (when you close it). - - - - Sets up the left CustomViewController. - - The viewcontroller to set. - Whether or not to generate a back button. - Optional, a callback when the ViewController becomes active (when you open it). - Optional, a callback when the ViewController becomes inactive (when you close it). - - - - Sets up the right CustomViewController. - - The viewcontroller to set. - Whether or not to generate a back button. - Optional, a callback when the ViewController becomes active (when you open it). - Optional, a callback when the ViewController becomes inactive (when you close it). - - - - Sets up the bottom CustomViewController. - - The viewcontroller to set. - Whether or not to generate a back button. - Optional, a callback when the ViewController becomes active (when you open it). - Optional, a callback when the ViewController becomes inactive (when you close it). - - - - Opens the menu. - - If set to true, no animation will be shown and the transition will be instant. - - - - - Opens the menu with an animation. - - - - - Closes the menu. - - If set to true, no animation will be shown and the transition will be instant. - - - - Closes the menu with an animation. - - - - - The event that's fired when the back button is pressed. - - - - - A reference to the current back button, if it exists. - - - - - When set to true, a back button will be automatically generated. - - - - - The event that's fired when the CustomViewController is activated (when you open it). - - - - - The event that's fired when the CustomViewController is deactivated (when you close it). - - - - - Clears any back button callbacks. - - - - - Sets the color while also updating all associated components. - - The to set the preview image - - - - Get the color of a sprite contained in an on pointer click - - The given by OnPointerDown - The instance - - - - Initialize the (should be called after assigning the variable) - - - - - Method called when the pointer is clicked inside the - - Some informations about the pointer - - - - Method called when the pointer is released inside the - - Some informations about the pointer - - - - Method called when the pointer is exiting the - - Some informations about the pointer - - - diff --git a/Refs/UnityEngine.CoreModule.dll b/Refs/UnityEngine.CoreModule.dll index b90fbc70..09b46aec 100644 Binary files a/Refs/UnityEngine.CoreModule.dll and b/Refs/UnityEngine.CoreModule.dll differ diff --git a/Refs/refs.txt b/Refs/refs.txt index 3c9fd3aa..32320c83 100644 --- a/Refs/refs.txt +++ b/Refs/refs.txt @@ -25,5 +25,4 @@ """"""xml "Plugins/ ""BeatSaberCustomUI. -"""dll -"""xml \ No newline at end of file +"""dll \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index f68ba254..69eb1dfc 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,6 @@ version: 'BSIPA-{branch}-{build}' environment: - bsipa_version: '3.12.22' + bsipa_version: '3.12.23' gh_token: secure: E42gl/yepETuoLSwbJZ1GmEIPK6cCJu6zkd59NA21XiICtEV6COOLW7aehi1tcVU pull_requests: