From ac26f010aa32834f58e4b35a6b75e14daa3f9eda Mon Sep 17 00:00:00 2001 From: Sravan Kumar <42110198+kingsamurai123@users.noreply.github.com> Date: Mon, 30 Jan 2023 22:51:39 +0530 Subject: [PATCH 1/8] UI changes for tutorial button UI has been added for the tutorial button along with the URL reference. Still need to update for non-existent URL logic and texture. --- plugin_manager.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/plugin_manager.py b/plugin_manager.py index 1650138..ccd35f6 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -960,6 +960,35 @@ class PluginWindow(popup.PopupWindow): color=(1, 1, 1, 1), rotate=25, scale=0.45) + + ## Below snippet handles the tutorial button in the plugin window + open_pos_x = (10 if _uiscale is ba.UIScale.SMALL else + 50 if _uiscale is ba.UIScale.MEDIUM else 50) + open_pos_y = (100 if _uiscale is ba.UIScale.SMALL else + 110 if _uiscale is ba.UIScale.MEDIUM else 120) + open_button = ba.buttonwidget(parent=self._root_widget, + autoselect=True, + position=(open_pos_x, open_pos_y), + size=(40, 40), + button_type="square", + label="", + # color=ba.app.ui.title_color, + color=(0.6, 0.53, 0.63), + on_activate_call=lambda: ba.open_url(self.plugin.info["external_url"])) + ba.imagewidget(parent=self._root_widget, + position=(open_pos_x, open_pos_y), + size=(40, 40), + color=(0.8, 0.95, 1), + texture=ba.gettexture("file"), + draw_controller=open_button) + ba.textwidget(parent=self._root_widget, + position=(open_pos_x - 3, open_pos_y + 12), + text="Tutorial", + size=(10, 10), + draw_controller=open_button, + color=(1, 1, 1, 1), + rotate=25, + scale=0.45) if to_draw_button4: settings_pos_x = (60 if _uiscale is ba.UIScale.SMALL else From faf2b8a0b8ccd1b81d3cae03c30d4aadbf19f1ba Mon Sep 17 00:00:00 2001 From: Sravan Kumar <42110198+kingsamurai123@users.noreply.github.com> Date: Tue, 31 Jan 2023 15:39:13 +0530 Subject: [PATCH 2/8] Final tutorial button Changed the texture to "frameInset" and the button will only appear only if the external_url is not empty. --- plugin_manager.py | 56 ++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/plugin_manager.py b/plugin_manager.py index ccd35f6..67fe530 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -962,33 +962,35 @@ class PluginWindow(popup.PopupWindow): scale=0.45) ## Below snippet handles the tutorial button in the plugin window - open_pos_x = (10 if _uiscale is ba.UIScale.SMALL else - 50 if _uiscale is ba.UIScale.MEDIUM else 50) - open_pos_y = (100 if _uiscale is ba.UIScale.SMALL else - 110 if _uiscale is ba.UIScale.MEDIUM else 120) - open_button = ba.buttonwidget(parent=self._root_widget, - autoselect=True, - position=(open_pos_x, open_pos_y), - size=(40, 40), - button_type="square", - label="", - # color=ba.app.ui.title_color, - color=(0.6, 0.53, 0.63), - on_activate_call=lambda: ba.open_url(self.plugin.info["external_url"])) - ba.imagewidget(parent=self._root_widget, - position=(open_pos_x, open_pos_y), - size=(40, 40), - color=(0.8, 0.95, 1), - texture=ba.gettexture("file"), - draw_controller=open_button) - ba.textwidget(parent=self._root_widget, - position=(open_pos_x - 3, open_pos_y + 12), - text="Tutorial", - size=(10, 10), - draw_controller=open_button, - color=(1, 1, 1, 1), - rotate=25, - scale=0.45) + tutorial_url = self.plugin.info["external_url"] + if tutorial_url: + open_pos_x = (10 if _uiscale is ba.UIScale.SMALL else + 70 if _uiscale is ba.UIScale.MEDIUM else 60) + open_pos_y = (100 if _uiscale is ba.UIScale.SMALL else + 110 if _uiscale is ba.UIScale.MEDIUM else 120) + open_button = ba.buttonwidget(parent=self._root_widget, + autoselect=True, + position=(open_pos_x, open_pos_y), + size=(40, 40), + button_type="square", + label="", + # color=ba.app.ui.title_color, + color=(0.6, 0.53, 0.63), + on_activate_call=lambda: ba.open_url(self.plugin.info["external_url"])) + ba.imagewidget(parent=self._root_widget, + position=(open_pos_x, open_pos_y), + size=(40, 40), + color=(0.8, 0.95, 1), + texture=ba.gettexture("frameInset"), + draw_controller=open_button) + ba.textwidget(parent=self._root_widget, + position=(open_pos_x - 3, open_pos_y + 12), + text="Tutorial", + size=(10, 10), + draw_controller=open_button, + color=(1, 1, 1, 1), + rotate=25, + scale=0.45) if to_draw_button4: settings_pos_x = (60 if _uiscale is ba.UIScale.SMALL else From ee2715d3ecac9fd033f82651258f2caa1367f0ac Mon Sep 17 00:00:00 2001 From: Sravan Kumar <42110198+kingsamurai123@users.noreply.github.com> Date: Tue, 31 Jan 2023 15:41:31 +0530 Subject: [PATCH 3/8] Bump the plugin manager version Changed the plugin manager minor version to reflect in the existing consoles as an updated version. --- plugin_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin_manager.py b/plugin_manager.py index 67fe530..e789d07 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.2.2" +PLUGIN_MANAGER_VERSION = "0.2.3" REPOSITORY_URL = "https://github.com/bombsquad-community/plugin-manager" CURRENT_TAG = "main" INDEX_META = "{repository_url}/{content_type}/{tag}/index.json" From 5d773946bb17ce0eb82b0a320436b386cb7645b3 Mon Sep 17 00:00:00 2001 From: kingsamurai123 Date: Tue, 31 Jan 2023 10:16:15 +0000 Subject: [PATCH 4/8] [ci] auto-format --- plugin_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin_manager.py b/plugin_manager.py index e789d07..412575c 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -960,8 +960,8 @@ class PluginWindow(popup.PopupWindow): color=(1, 1, 1, 1), rotate=25, scale=0.45) - - ## Below snippet handles the tutorial button in the plugin window + + # Below snippet handles the tutorial button in the plugin window tutorial_url = self.plugin.info["external_url"] if tutorial_url: open_pos_x = (10 if _uiscale is ba.UIScale.SMALL else From 2e78a54c682fb163fd5e3e516985bf9160eede0c Mon Sep 17 00:00:00 2001 From: Sravan Kumar <42110198+kingsamurai123@users.noreply.github.com> Date: Tue, 31 Jan 2023 19:32:46 +0530 Subject: [PATCH 5/8] Update Changelog.md Edited the changelog to display the 0.2.3 description. --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a46809..26bf651 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Plugin Manager (dd-mm-yyyy) +### 0.2.3 (31-01-2023) + +- Displays a tutorial button, whenever there is a external_url is present in the plugin data. + ### 0.2.2 (18-01-2023) - Auto add new line breaks in long plugin descriptions. From 8f61bce3a5030fac5a900f324c0b1ecd1f042b3c Mon Sep 17 00:00:00 2001 From: Sravan Kumar <42110198+kingsamurai123@users.noreply.github.com> Date: Tue, 31 Jan 2023 19:33:59 +0530 Subject: [PATCH 6/8] typo in the changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 26bf651..6088c33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ### 0.2.3 (31-01-2023) -- Displays a tutorial button, whenever there is a external_url is present in the plugin data. +- Displays a tutorial button, whenever there is a "external_url" present in the plugin data. ### 0.2.2 (18-01-2023) From 3d13058adba6af60153472f596c57499593cd2ec Mon Sep 17 00:00:00 2001 From: Sravan Date: Tue, 31 Jan 2023 20:58:30 +0530 Subject: [PATCH 7/8] Changed the tutorial button position As the previous UI button was replacing the settings button in some plugins. Changed the UI position. --- plugin_manager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugin_manager.py b/plugin_manager.py index e789d07..5fdcbe7 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -960,12 +960,12 @@ class PluginWindow(popup.PopupWindow): color=(1, 1, 1, 1), rotate=25, scale=0.45) - - ## Below snippet handles the tutorial button in the plugin window + + # Below snippet handles the tutorial button in the plugin window tutorial_url = self.plugin.info["external_url"] if tutorial_url: - open_pos_x = (10 if _uiscale is ba.UIScale.SMALL else - 70 if _uiscale is ba.UIScale.MEDIUM else 60) + open_pos_x = (350 if _uiscale is ba.UIScale.SMALL else + 410 if _uiscale is ba.UIScale.MEDIUM else 400) open_pos_y = (100 if _uiscale is ba.UIScale.SMALL else 110 if _uiscale is ba.UIScale.MEDIUM else 120) open_button = ba.buttonwidget(parent=self._root_widget, From 2720ce82120092dc76de83284ad88d0ff8814246 Mon Sep 17 00:00:00 2001 From: Sravan Date: Tue, 31 Jan 2023 21:00:19 +0530 Subject: [PATCH 8/8] changelog updated Updated the changelog to 0.2.3 change about the tutorial button --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a46809..d809d66 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## Plugin Manager (dd-mm-yyyy) +### 0.2.3 (31-01-2023) + +- Displays a tutorial button in the plugin window, whenever there is a supported url present in the plugin data. + ### 0.2.2 (18-01-2023) - Auto add new line breaks in long plugin descriptions.