mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
Added confirmation window
This commit is contained in:
parent
d07794a05d
commit
fe4d41177a
1 changed files with 39 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
# ba_meta require api 7
|
# ba_meta require api 7
|
||||||
import ba
|
import ba
|
||||||
import _ba
|
import _ba
|
||||||
from bastd.ui import popup
|
from bastd.ui import popup, confirm
|
||||||
|
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import http.client
|
import http.client
|
||||||
|
|
@ -813,7 +813,6 @@ class PluginWindow(popup.PopupWindow):
|
||||||
|
|
||||||
async def draw_ui(self):
|
async def draw_ui(self):
|
||||||
# print(ba.app.plugins.active_plugins)
|
# print(ba.app.plugins.active_plugins)
|
||||||
|
|
||||||
play_sound()
|
play_sound()
|
||||||
b_text_color = (0.75, 0.7, 0.8)
|
b_text_color = (0.75, 0.7, 0.8)
|
||||||
s = 1.1 if _uiscale is ba.UIScale.SMALL else 1.27 if ba.UIScale.MEDIUM else 1.57
|
s = 1.1 if _uiscale is ba.UIScale.SMALL else 1.27 if ba.UIScale.MEDIUM else 1.57
|
||||||
|
|
@ -961,6 +960,43 @@ class PluginWindow(popup.PopupWindow):
|
||||||
rotate=25,
|
rotate=25,
|
||||||
scale=0.45)
|
scale=0.45)
|
||||||
|
|
||||||
|
# Below snippet handles the tutorial button in the plugin window
|
||||||
|
tutorial_url = self.plugin.info["external_url"]
|
||||||
|
if tutorial_url:
|
||||||
|
def tutorial_confirm_window():
|
||||||
|
text="This will take you to \n\""+self.plugin.info["external_url"] + "\""
|
||||||
|
tutorial_confirm_window = confirm.ConfirmWindow(
|
||||||
|
text=text,
|
||||||
|
action=lambda: ba.open_url(self.plugin.info["external_url"]),
|
||||||
|
)
|
||||||
|
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,
|
||||||
|
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=tutorial_confirm_window)
|
||||||
|
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:
|
if to_draw_button4:
|
||||||
settings_pos_x = (60 if _uiscale is ba.UIScale.SMALL else
|
settings_pos_x = (60 if _uiscale is ba.UIScale.SMALL else
|
||||||
60 if _uiscale is ba.UIScale.MEDIUM else 60)
|
60 if _uiscale is ba.UIScale.MEDIUM else 60)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue