From 6aa0f6f677bc13a7b378cd60e1076f4febeb74c9 Mon Sep 17 00:00:00 2001 From: ! Freaku <92618708+Freaku17@users.noreply.github.com> Date: Mon, 5 Dec 2022 21:39:08 +0530 Subject: [PATCH 01/11] Replace `on_plugin_manager_prompt` to default plugin setting ui --- plugin_manager.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/plugin_manager.py b/plugin_manager.py index 1ee0277..adc48a2 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -20,7 +20,7 @@ _env = _ba.env() _uiscale = ba.app.ui.uiscale -PLUGIN_MANAGER_VERSION = "0.1.10" +PLUGIN_MANAGER_VERSION = "0.2.0" REPOSITORY_URL = "https://github.com/bombsquad-community/plugin-manager" CURRENT_TAG = "main" INDEX_META = "{repository_url}/{content_type}/{tag}/index.json" @@ -364,13 +364,13 @@ class PluginLocal: def has_settings(self): for plugin_entry_point, plugin_class in ba.app.plugins.active_plugins.items(): if plugin_entry_point.startswith(self._entry_point_initials): - return hasattr(plugin_class, "on_plugin_manager_prompt") + return hasattr(plugin_class, "has_settings_ui") return False - def launch_settings(self): + def launch_settings(self, source_widget): for plugin_entry_point, plugin_class in ba.app.plugins.active_plugins.items(): if plugin_entry_point.startswith(self._entry_point_initials): - return plugin_class.on_plugin_manager_prompt() + return plugin_class.show_settings_ui(source_widget) async def get_content(self): if self._content is None: @@ -851,8 +851,10 @@ class PluginWindow(popup.PopupWindow): size=(40, 40), button_type="square", label="", - color=(0, 0.75, 0.75), - on_activate_call=self.settings) + color=(0, 0.75, 0.75),) + ba.buttonwidget( + edit=settings_button, + on_activate_call=ba.Call(self.settings, settings_button),) ba.imagewidget(parent=self._root_widget, position=(settings_pos_x, settings_pos_y), size=(40, 40), @@ -883,8 +885,8 @@ class PluginWindow(popup.PopupWindow): return wrapper - def settings(self): - self.local_plugin.launch_settings() + def settings(self, source_widget): + self.local_plugin.launch_settings(source_widget) @button def disable(self) -> None: From 51614b7fa1fa4e280d8f1c31a2a6dacf77c6ebae Mon Sep 17 00:00:00 2001 From: ! Freaku <92618708+Freaku17@users.noreply.github.com> Date: Mon, 5 Dec 2022 21:41:03 +0530 Subject: [PATCH 02/11] Remove old functions used in plugins --- plugins/utilities/colorscheme.py | 5 ++++- plugins/utilities/mood_light.py | 2 +- plugins/utilities/share_replay.py | 3 --- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/utilities/colorscheme.py b/plugins/utilities/colorscheme.py index 6e42717..bd4e4c5 100644 --- a/plugins/utilities/colorscheme.py +++ b/plugins/utilities/colorscheme.py @@ -445,5 +445,8 @@ class Main(ba.Plugin): def on_app_running(self): load_plugin() - def on_plugin_manager_prompt(self): + def has_settings_ui(self): + return True + + def show_settings_ui(self, source_widget): launch_colorscheme_selection_window() diff --git a/plugins/utilities/mood_light.py b/plugins/utilities/mood_light.py index 225df54..cb94021 100644 --- a/plugins/utilities/mood_light.py +++ b/plugins/utilities/mood_light.py @@ -287,7 +287,7 @@ class moodlight(ba.Plugin): def on_app_running(self): _ba.show_progress_bar() - def on_plugin_manager_prompt(self): + def show_settings_ui(self, source_widget): SettingWindow() def has_settings_ui(self): diff --git a/plugins/utilities/share_replay.py b/plugins/utilities/share_replay.py index 1a39493..9909816 100644 --- a/plugins/utilities/share_replay.py +++ b/plugins/utilities/share_replay.py @@ -262,6 +262,3 @@ class Loup(ba.Plugin): def show_settings_ui(self, button): SettingWindow() - - def on_plugin_manager_prompt(self): - SettingWindow() From 536ed382ad301a0249ccddd9d0f116fb5b1d9e05 Mon Sep 17 00:00:00 2001 From: ! Freaku <92618708+Freaku17@users.noreply.github.com> Date: Mon, 5 Dec 2022 21:41:45 +0530 Subject: [PATCH 03/11] Update utilities.json --- plugins/utilities.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/utilities.json b/plugins/utilities.json index 840222b..f29e12d 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -14,6 +14,7 @@ } ], "versions": { + "1.2.1": null, "1.2.0": { "api_version": 7, "commit_sha": "f07d2f8", @@ -145,6 +146,7 @@ } ], "versions": { + "1.2.2": null, "1.2.1": { "api_version": 7, "commit_sha": "2fda676", @@ -181,6 +183,7 @@ } ], "versions": { + "1.2.3": null, "1.2.2": { "api_version": 7, "commit_sha": "a6d1a43", From 1d5f0a742223bf8c3e647c09e7d7d4b171487cad Mon Sep 17 00:00:00 2001 From: ! Freaku <92618708+Freaku17@users.noreply.github.com> Date: Mon, 5 Dec 2022 21:42:01 +0530 Subject: [PATCH 04/11] Update index.json --- index.json | 1 + 1 file changed, 1 insertion(+) diff --git a/index.json b/index.json index 319c43a..e864e58 100644 --- a/index.json +++ b/index.json @@ -1,6 +1,7 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { + "0.2.0": null, "0.1.10": { "api_version": 7, "commit_sha": "e122d0f", From 7753b87d7fcb8df726e4268992094e7b4c3fcb59 Mon Sep 17 00:00:00 2001 From: ! Freaku <92618708+Freaku17@users.noreply.github.com> Date: Mon, 5 Dec 2022 21:43:11 +0530 Subject: [PATCH 05/11] Update CHANGELOG.md --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c43cf27..63fb9e3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ ## Plugin Manager (dd-mm-yyyy) +### 0.2.0 (05-12-2022) + +- Removed `on_plugin_manager_prompt` and replaced it with the in-game's plugin settings ui + +### 0.1.10 (05-12-2022) + +- Added Discord and Github textures on buttons + ### 0.1.9 (03-12-2022) - Search now filters on author names and plugin description. From 38c79385b3d1b77ae3ae89afdf1f72024838599c Mon Sep 17 00:00:00 2001 From: Freaku17 Date: Mon, 5 Dec 2022 16:14:33 +0000 Subject: [PATCH 06/11] [ci] apply-version-metadata --- index.json | 7 ++++++- plugins/utilities.json | 21 ++++++++++++++++++--- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/index.json b/index.json index e864e58..c9f331b 100644 --- a/index.json +++ b/index.json @@ -1,7 +1,12 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "0.2.0": null, + "0.2.0": { + "api_version": 7, + "commit_sha": "7753b87", + "released_on": "05-12-2022", + "md5sum": "ee88d457a66ac0689624f6dc72d27c1c" + }, "0.1.10": { "api_version": 7, "commit_sha": "e122d0f", diff --git a/plugins/utilities.json b/plugins/utilities.json index f29e12d..d58ff2d 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -14,7 +14,12 @@ } ], "versions": { - "1.2.1": null, + "1.2.1": { + "api_version": 7, + "commit_sha": "7753b87", + "released_on": "05-12-2022", + "md5sum": "7ab5c7ebd43ebd929866fccb82cd5a45" + }, "1.2.0": { "api_version": 7, "commit_sha": "f07d2f8", @@ -146,7 +151,12 @@ } ], "versions": { - "1.2.2": null, + "1.2.2": { + "api_version": 7, + "commit_sha": "7753b87", + "released_on": "05-12-2022", + "md5sum": "c6e5366b446e265c623e34010d5c40c7" + }, "1.2.1": { "api_version": 7, "commit_sha": "2fda676", @@ -183,7 +193,12 @@ } ], "versions": { - "1.2.3": null, + "1.2.3": { + "api_version": 7, + "commit_sha": "7753b87", + "released_on": "05-12-2022", + "md5sum": "659794e1fa1e87cf9768899519994eac" + }, "1.2.2": { "api_version": 7, "commit_sha": "a6d1a43", From df9a29f5c220eab56d8cdddcc950fd3864a24b8c Mon Sep 17 00:00:00 2001 From: ! Freaku <92618708+Freaku17@users.noreply.github.com> Date: Mon, 5 Dec 2022 22:03:13 +0530 Subject: [PATCH 07/11] Fixing a bug --- plugin_manager.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin_manager.py b/plugin_manager.py index adc48a2..921983d 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -364,8 +364,7 @@ class PluginLocal: def has_settings(self): for plugin_entry_point, plugin_class in ba.app.plugins.active_plugins.items(): if plugin_entry_point.startswith(self._entry_point_initials): - return hasattr(plugin_class, "has_settings_ui") - return False + return plugin_class.has_settings_ui() def launch_settings(self, source_widget): for plugin_entry_point, plugin_class in ba.app.plugins.active_plugins.items(): From d321df7dafc3a58b79cb0d49d945bef4640254c7 Mon Sep 17 00:00:00 2001 From: ! Freaku <92618708+Freaku17@users.noreply.github.com> Date: Mon, 5 Dec 2022 22:04:12 +0530 Subject: [PATCH 08/11] Update index.json --- index.json | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/index.json b/index.json index c9f331b..9579cd0 100644 --- a/index.json +++ b/index.json @@ -1,12 +1,7 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "0.2.0": { - "api_version": 7, - "commit_sha": "7753b87", - "released_on": "05-12-2022", - "md5sum": "ee88d457a66ac0689624f6dc72d27c1c" - }, + "0.2.0": null}, "0.1.10": { "api_version": 7, "commit_sha": "e122d0f", @@ -56,4 +51,4 @@ "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugins/maps.json" ], "external_source_url": "https://github.com/{repository}/{content_type}/{tag}/category.json" -} \ No newline at end of file +} From bd9dc14a8ac57c8a495d9702ef1fc2a64b63fcce Mon Sep 17 00:00:00 2001 From: ! Freaku <92618708+Freaku17@users.noreply.github.com> Date: Mon, 5 Dec 2022 22:04:34 +0530 Subject: [PATCH 09/11] Update index.json --- index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.json b/index.json index 9579cd0..4ad42bc 100644 --- a/index.json +++ b/index.json @@ -1,7 +1,7 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "0.2.0": null}, + "0.2.0": null, "0.1.10": { "api_version": 7, "commit_sha": "e122d0f", From bde4df0e4cf05ece4d37c35e58fb93bebad2c983 Mon Sep 17 00:00:00 2001 From: Freaku17 Date: Mon, 5 Dec 2022 16:34:59 +0000 Subject: [PATCH 10/11] [ci] apply-version-metadata --- index.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.json b/index.json index 4ad42bc..15e8096 100644 --- a/index.json +++ b/index.json @@ -1,7 +1,12 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "0.2.0": null, + "0.2.0": { + "api_version": 7, + "commit_sha": "bd9dc14", + "released_on": "05-12-2022", + "md5sum": "3633c9c58037cbad7d2942858270c4ae" + }, "0.1.10": { "api_version": 7, "commit_sha": "e122d0f", @@ -51,4 +56,4 @@ "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugins/maps.json" ], "external_source_url": "https://github.com/{repository}/{content_type}/{tag}/category.json" -} +} \ No newline at end of file From 4f545393be9311dbbe65caccbdfb89691c659f5d Mon Sep 17 00:00:00 2001 From: ! Freaku <92618708+Freaku17@users.noreply.github.com> Date: Mon, 5 Dec 2022 22:16:21 +0530 Subject: [PATCH 11/11] Update README.md --- README.md | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/README.md b/README.md index bae5dfd..bedb672 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,7 @@ There are two different ways the plugin manager can be installed: - New plugins are accepted through a [pull request](../../compare). Add your plugin in the minigames, utilities, or the category directory you feel is the most relevant to the type of plugin you're submitting, [here](plugins). Then add an entry to the category's JSON metadata file. -- Plugin manager will also show and execute the settings icon if your `ba.Plugin` export class has a method named - `on_plugin_manager_prompt`; check out the - [colorscheme](https://github.com/bombsquad-community/plugin-manager/blob/f24f0ca5ded427f6041795021f1af2e6a08b6ce9/plugins/utilities/colorscheme.py#L419-L420) - plugin as an example and its behaviour when the settings icon is tapped via the plugin manager in-game. +- Plugin manager will also show and execute the settings icon if your `ba.Plugin` class has methods `has_settings_ui` and `show_settings_ui`. #### Example: @@ -73,9 +70,6 @@ import ba class Main(ba.Plugin): def on_app_running(self): ba.screenmessage("Hi! I am a sample plugin!") - - def on_plugin_manager_prompt(self): - ba.screenmessage("You tapped my settings from the Plugin Manager Window!") ``` You'll have to fork this repository and add your `sample_plugin.py` plugin file into the appropriate directory, which for @@ -137,9 +131,6 @@ index ebb7dcc..da2b312 100644 def on_app_running(self): ba.screenmessage("Hi! I am a sample plugin!") + ba.screenmessage("Hey! This is my new screenmessage!") - - def on_plugin_manager_prompt(self): - ba.screenmessage("You tapped my settings from the Plugin Manager Window!") ``` To name this new version as `1.1.0`, add `"1.1.0": null,` just above the previous plugin version in `utilities.json`: