From dbbb0ba32cb655875d7918740512fba5fa44c6a3 Mon Sep 17 00:00:00 2001 From: Rikko Date: Sun, 30 Apr 2023 22:24:56 +0530 Subject: [PATCH 1/6] Fix double sounds --- plugin_manager.py | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/plugin_manager.py b/plugin_manager.py index 2c4664d..dcd74fc 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -104,10 +104,6 @@ async def async_stream_network_response_to_file(request, file, md5sum=None, retr return content -def play_sound(): - ba.playsound(ba.getsound('swish')) - - def partial_format(string_template, **kwargs): for key, value in kwargs.items(): string_template = string_template.replace("{" + key + "}", value) @@ -814,7 +810,7 @@ class PluginWindow(popup.PopupWindow): async def draw_ui(self): # print(ba.app.plugins.active_plugins) - play_sound() + ba.playsound(ba.getsound('swish')) b_text_color = (0.75, 0.7, 0.8) s = 1.25 if _uiscale is ba.UIScale.SMALL else 1.39 if ba.UIScale.MEDIUM else 1.67 width = 400 * s @@ -827,7 +823,7 @@ class PluginWindow(popup.PopupWindow): self._root_widget = ba.containerwidget(size=(width, height), # parent=_ba.get_special_widget( # 'overlay_stack'), - on_outside_click_call=self._ok, + on_outside_click_call=self._cancel, transition=transition, scale=(2.1 if _uiscale is ba.UIScale.SMALL else 1.5 if _uiscale is ba.UIScale.MEDIUM else 1.0), @@ -931,7 +927,7 @@ class PluginWindow(popup.PopupWindow): text_scale=1, label=button3_label) ba.containerwidget(edit=self._root_widget, - on_cancel_call=self._ok) + on_cancel_call=self._cancel) open_pos_x = (390 if _uiscale is ba.UIScale.SMALL else 450 if _uiscale is ba.UIScale.MEDIUM else 440) @@ -1026,7 +1022,10 @@ class PluginWindow(popup.PopupWindow): # ba.containerwidget(edit=self._root_widget, start_button=button3) def _ok(self) -> None: - play_sound() + ba.containerwidget(edit=self._root_widget, transition='out_scale') + + def _cancel(self) -> None: + ba.playsound(ba.getsound('swish')) ba.containerwidget(edit=self._root_widget, transition='out_scale') def button(fn): @@ -1193,7 +1192,6 @@ class PluginManager: class PluginSourcesWindow(popup.PopupWindow): def __init__(self, origin_widget): - play_sound() self.selected_source = None self.scale_origin = origin_widget.get_screen_space_center() @@ -1364,7 +1362,7 @@ class PluginSourcesWindow(popup.PopupWindow): self.draw_sources() def _ok(self) -> None: - play_sound() + ba.playsound(ba.getsound('swish')) ba.containerwidget(edit=self._root_widget, transition='out_scale') @@ -1399,7 +1397,7 @@ class PluginCategoryWindow(popup.PopupMenuWindow): PluginSourcesWindow(origin_widget=self.root_widget) def _ok(self) -> None: - play_sound() + ba.playsound(ba.getsound('swish')) ba.containerwidget(edit=self.root_widget, transition='out_scale') @@ -1773,7 +1771,6 @@ class PluginManagerWindow(ba.Window): PluginWindow(plugin, self._root_widget, lambda: self.draw_plugin_name(plugin)) def show_categories_window(self): - play_sound() PluginCategoryWindow( self.plugin_manager.categories.keys(), self.selected_category, @@ -1813,7 +1810,6 @@ class PluginManagerWindow(ba.Window): class PluginManagerSettingsWindow(popup.PopupWindow): def __init__(self, plugin_manager, origin_widget): - play_sound() self._plugin_manager = plugin_manager self.scale_origin = origin_widget.get_screen_space_center() self.settings = ba.app.config["Community Plugin Manager"]["Settings"].copy() @@ -2020,7 +2016,7 @@ class PluginManagerSettingsWindow(popup.PopupWindow): self._update_button.delete() def _ok(self) -> None: - play_sound() + ba.playsound(ba.getsound('swish')) ba.containerwidget(edit=self._root_widget, transition='out_scale') From c902cebd6e5fc5fae6813aed4e104fa04495fb61 Mon Sep 17 00:00:00 2001 From: rikkolovescats Date: Sun, 30 Apr 2023 16:56:47 +0000 Subject: [PATCH 2/6] [ci] apply-version-metadata --- plugins/utilities.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/utilities.json b/plugins/utilities.json index 33fab5d..b10844f 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -672,4 +672,4 @@ } } } -} +} \ No newline at end of file From c81e3a6af76995ef6d1fbf717d2ae6d12fcaf912 Mon Sep 17 00:00:00 2001 From: Rikko Date: Sun, 30 Apr 2023 22:33:01 +0530 Subject: [PATCH 3/6] Set current tag dynamically --- plugin_manager.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugin_manager.py b/plugin_manager.py index dcd74fc..e62b967 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -26,6 +26,8 @@ _uiscale = ba.app.ui.uiscale PLUGIN_MANAGER_VERSION = "0.3.1" REPOSITORY_URL = "https://github.com/bombsquad-community/plugin-manager" +# Current tag can be changed to "staging" or any other branch in +# plugin manager repo for testing purpose. CURRENT_TAG = "main" INDEX_META = "{repository_url}/{content_type}/{tag}/index.json" HEADERS = { @@ -308,8 +310,11 @@ class Category: async def fetch_metadata(self): if self._metadata is None: + # Let's keep depending on the "main" branch for 3rd party sources + # even if we're using a different branch of plugin manager's repository. + tag = "main" if self.is_3rd_party else CURRENT_TAG request = urllib.request.Request( - self.meta_url.format(content_type="raw", tag=CURRENT_TAG), + self.meta_url.format(content_type="raw", tag=tag), headers=self.request_headers, ) response = await async_send_network_request(request) From 7cf7f7b6d1b66aa7b83c3631c88856a6db0e644c Mon Sep 17 00:00:00 2001 From: Rikko Date: Sun, 30 Apr 2023 22:45:54 +0530 Subject: [PATCH 4/6] Resolve spaces to underscores when searching for plugins --- plugin_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugin_manager.py b/plugin_manager.py index e62b967..fec10c8 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -1680,6 +1680,8 @@ class PluginManagerWindow(ba.Window): draw_controller=controller_button) def search_term_filterer(self, plugin, search_term): + # This helps resolve "plugin name" to "plugin_name". + search_term = search_term.replace(" ", "_") if search_term in plugin.name: return True if search_term in plugin.info["description"].lower(): From 789f95f6b1e8713e2511c138a3df853a414d63dd Mon Sep 17 00:00:00 2001 From: Rikko Date: Sun, 30 Apr 2023 22:46:21 +0530 Subject: [PATCH 5/6] Bump to v0.3.2 --- index.json | 3 ++- plugin_manager.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.json b/index.json index 8805e0f..db12a23 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.3.2": null, "0.3.1": { "api_version": 7, "commit_sha": "0b856ba", @@ -80,4 +81,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 +} diff --git a/plugin_manager.py b/plugin_manager.py index fec10c8..dda2d68 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -24,7 +24,7 @@ _env = _ba.env() _uiscale = ba.app.ui.uiscale -PLUGIN_MANAGER_VERSION = "0.3.1" +PLUGIN_MANAGER_VERSION = "0.3.2" REPOSITORY_URL = "https://github.com/bombsquad-community/plugin-manager" # Current tag can be changed to "staging" or any other branch in # plugin manager repo for testing purpose. From c8a6eb7eac61c7002560e6750f41fd416ddcc755 Mon Sep 17 00:00:00 2001 From: rikkolovescats Date: Sun, 30 Apr 2023 17:16:59 +0000 Subject: [PATCH 6/6] [ci] apply-version-metadata --- index.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.json b/index.json index db12a23..3a1b001 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.3.2": null, + "0.3.2": { + "api_version": 7, + "commit_sha": "789f95f", + "released_on": "30-04-2023", + "md5sum": "ff679f8411e426e5e4e92a2f958eec02" + }, "0.3.1": { "api_version": 7, "commit_sha": "0b856ba", @@ -81,4 +86,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