From 355ee66b86b5a37089906976fe24e130f5cfdc93 Mon Sep 17 00:00:00 2001 From: Vishal Date: Tue, 9 Aug 2022 02:02:29 +0530 Subject: [PATCH] Button for the Respective Plugin Pages. --- plugin_manager.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plugin_manager.py b/plugin_manager.py index db83364..4722a65 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -464,6 +464,24 @@ class PluginWindow(popup.PopupWindow): label=button3_label) ba.containerwidget(edit=self._root_widget, on_cancel_call=self._ok) + + open_pos_x = (500 if _uiscale is ba.UIScale.SMALL else + 440 if _uiscale is ba.UIScale.MEDIUM else 350) + open_pos_y = (130 if _uiscale is ba.UIScale.SMALL else + 60 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="", + on_activate_call=self.open_plugin_page) + 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("upButton"), + draw_controller=open_button) # ba.containerwidget(edit=self._root_widget, selected_child=button3) # ba.containerwidget(edit=self._root_widget, start_button=button3) @@ -471,6 +489,9 @@ class PluginWindow(popup.PopupWindow): play_sound() ba.containerwidget(edit=self._root_widget, transition='out_scale') + def open_plugin_page(self) -> None: + ba.open_url(f"https://github.com/bombsquad-community/plugin-manager/tree/main/plugins/utilities/{self.plugin.name}.py") + def button(fn): async def asyncio_handler(fn, self, *args, **kwargs): await fn(self, *args, **kwargs)