mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
Compliment Plugin.on_plugin_manager_prompt
This commit is contained in:
parent
fd2d301d27
commit
004a563ffd
1 changed files with 111 additions and 48 deletions
|
|
@ -7,6 +7,7 @@ from bastd.ui import popup
|
||||||
import urllib.request
|
import urllib.request
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
import asyncio
|
import asyncio
|
||||||
import re
|
import re
|
||||||
import string
|
import string
|
||||||
|
|
@ -193,6 +194,7 @@ class PluginLocal:
|
||||||
"""
|
"""
|
||||||
self.name = name
|
self.name = name
|
||||||
self.install_path = os.path.join(PLUGIN_DIRECTORY, f"{name}.py")
|
self.install_path = os.path.join(PLUGIN_DIRECTORY, f"{name}.py")
|
||||||
|
self._entry_point_initials = f"{self.name}."
|
||||||
self.cleanup()
|
self.cleanup()
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
|
|
@ -243,6 +245,17 @@ class PluginLocal:
|
||||||
with open(self.install_path, "wb") as fout:
|
with open(self.install_path, "wb") as fout:
|
||||||
fout.write(content)
|
fout.write(content)
|
||||||
|
|
||||||
|
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 False
|
||||||
|
|
||||||
|
def launch_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 plugin_class.on_plugin_manager_prompt()
|
||||||
|
|
||||||
async def get_content(self):
|
async def get_content(self):
|
||||||
if self._content is None:
|
if self._content is None:
|
||||||
if not self.is_installed:
|
if not self.is_installed:
|
||||||
|
|
@ -277,9 +290,8 @@ class PluginLocal:
|
||||||
"""
|
"""
|
||||||
Return True even if a single entry point is enabled or contains minigames.
|
Return True even if a single entry point is enabled or contains minigames.
|
||||||
"""
|
"""
|
||||||
entry_point_initials = f"{self.name}."
|
|
||||||
for entry_point, plugin_info in ba.app.config["Plugins"].items():
|
for entry_point, plugin_info in ba.app.config["Plugins"].items():
|
||||||
if entry_point.startswith(entry_point_initials) and plugin_info["enabled"]:
|
if entry_point.startswith(self._entry_point_initials) and plugin_info["enabled"]:
|
||||||
return True
|
return True
|
||||||
# XXX: The below logic is more accurate but less efficient, since it actually
|
# XXX: The below logic is more accurate but less efficient, since it actually
|
||||||
# reads the local plugin file and parses entry points from it.
|
# reads the local plugin file and parses entry points from it.
|
||||||
|
|
@ -305,10 +317,9 @@ class PluginLocal:
|
||||||
self.save()
|
self.save()
|
||||||
ba.screenmessage("Plugin Enabled")
|
ba.screenmessage("Plugin Enabled")
|
||||||
|
|
||||||
async def disable(self):
|
def disable(self):
|
||||||
entry_point_initials = f"{self.name}."
|
|
||||||
for entry_point, plugin_info in ba.app.config["Plugins"].items():
|
for entry_point, plugin_info in ba.app.config["Plugins"].items():
|
||||||
if entry_point.startswith(entry_point_initials):
|
if entry_point.startswith(self._entry_point_initials):
|
||||||
plugin_info["enabled"] = False
|
plugin_info["enabled"] = False
|
||||||
# XXX: The below logic is more accurate but less efficient, since it actually
|
# XXX: The below logic is more accurate but less efficient, since it actually
|
||||||
# reads the local plugin file and parses entry points from it.
|
# reads the local plugin file and parses entry points from it.
|
||||||
|
|
@ -395,7 +406,7 @@ class Plugin:
|
||||||
await local_plugin.enable()
|
await local_plugin.enable()
|
||||||
ba.screenmessage("Plugin Installed")
|
ba.screenmessage("Plugin Installed")
|
||||||
|
|
||||||
async def uninstall(self):
|
def uninstall(self):
|
||||||
self.get_local().uninstall()
|
self.get_local().uninstall()
|
||||||
ba.screenmessage("Plugin Uninstalled")
|
ba.screenmessage("Plugin Uninstalled")
|
||||||
|
|
||||||
|
|
@ -413,6 +424,7 @@ class PluginWindow(popup.PopupWindow):
|
||||||
loop.create_task(self.draw_ui())
|
loop.create_task(self.draw_ui())
|
||||||
|
|
||||||
async def draw_ui(self):
|
async def draw_ui(self):
|
||||||
|
# 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
|
||||||
|
|
@ -470,6 +482,7 @@ class PluginWindow(popup.PopupWindow):
|
||||||
button_size = (80 * s, 40 * s)
|
button_size = (80 * s, 40 * s)
|
||||||
|
|
||||||
to_draw_button1 = True
|
to_draw_button1 = True
|
||||||
|
to_draw_button4 = False
|
||||||
if self.plugin.is_installed:
|
if self.plugin.is_installed:
|
||||||
self.local_plugin = self.plugin.get_local()
|
self.local_plugin = self.plugin.get_local()
|
||||||
if await self.local_plugin.has_minigames():
|
if await self.local_plugin.has_minigames():
|
||||||
|
|
@ -478,6 +491,8 @@ class PluginWindow(popup.PopupWindow):
|
||||||
if await self.local_plugin.is_enabled():
|
if await self.local_plugin.is_enabled():
|
||||||
button1_label = "Disable"
|
button1_label = "Disable"
|
||||||
button1_action = self.disable
|
button1_action = self.disable
|
||||||
|
if self.local_plugin.has_settings():
|
||||||
|
to_draw_button4 = True
|
||||||
else:
|
else:
|
||||||
button1_label = "Enable"
|
button1_label = "Enable"
|
||||||
button1_action = self.enable
|
button1_action = self.enable
|
||||||
|
|
@ -545,6 +560,26 @@ class PluginWindow(popup.PopupWindow):
|
||||||
color=(0.8, 0.95, 1),
|
color=(0.8, 0.95, 1),
|
||||||
texture=ba.gettexture("upButton"),
|
texture=ba.gettexture("upButton"),
|
||||||
draw_controller=open_button)
|
draw_controller=open_button)
|
||||||
|
|
||||||
|
if to_draw_button4:
|
||||||
|
settings_pos_x = (0 if _uiscale is ba.UIScale.SMALL else
|
||||||
|
60 if _uiscale is ba.UIScale.MEDIUM else 60)
|
||||||
|
settings_pos_y = (100 if _uiscale is ba.UIScale.SMALL else
|
||||||
|
110 if _uiscale is ba.UIScale.MEDIUM else 120)
|
||||||
|
settings_button = ba.buttonwidget(parent=self._root_widget,
|
||||||
|
autoselect=True,
|
||||||
|
position=(settings_pos_x, settings_pos_y),
|
||||||
|
size=(40, 40),
|
||||||
|
button_type="square",
|
||||||
|
label="",
|
||||||
|
on_activate_call=self.settings)
|
||||||
|
ba.imagewidget(parent=self._root_widget,
|
||||||
|
position=(settings_pos_x, settings_pos_y),
|
||||||
|
size=(40, 40),
|
||||||
|
color=(0.8, 0.95, 1),
|
||||||
|
texture=ba.gettexture("settingsIcon"),
|
||||||
|
draw_controller=settings_button)
|
||||||
|
|
||||||
# ba.containerwidget(edit=self._root_widget, selected_child=button3)
|
# ba.containerwidget(edit=self._root_widget, selected_child=button3)
|
||||||
# ba.containerwidget(edit=self._root_widget, start_button=button3)
|
# ba.containerwidget(edit=self._root_widget, start_button=button3)
|
||||||
|
|
||||||
|
|
@ -569,9 +604,14 @@ class PluginWindow(popup.PopupWindow):
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
@button
|
@button
|
||||||
async def disable(self) -> None:
|
def settings(self):
|
||||||
|
play_sound
|
||||||
|
self.local_plugin.launch_settings()
|
||||||
|
|
||||||
|
@button
|
||||||
|
def disable(self) -> None:
|
||||||
play_sound()
|
play_sound()
|
||||||
await self.local_plugin.disable()
|
self.local_plugin.disable()
|
||||||
|
|
||||||
@button
|
@button
|
||||||
async def enable(self) -> None:
|
async def enable(self) -> None:
|
||||||
|
|
@ -584,9 +624,9 @@ class PluginWindow(popup.PopupWindow):
|
||||||
await self.plugin.install()
|
await self.plugin.install()
|
||||||
|
|
||||||
@button
|
@button
|
||||||
async def uninstall(self):
|
def uninstall(self):
|
||||||
play_sound()
|
play_sound()
|
||||||
await self.plugin.uninstall()
|
self.plugin.uninstall()
|
||||||
|
|
||||||
@button
|
@button
|
||||||
async def update(self):
|
async def update(self):
|
||||||
|
|
@ -667,7 +707,7 @@ class PluginSourcesWindow(popup.PopupWindow):
|
||||||
|
|
||||||
self.scale_origin = origin_widget.get_screen_space_center()
|
self.scale_origin = origin_widget.get_screen_space_center()
|
||||||
|
|
||||||
b_text_color = (0.75, 0.7, 0.8)
|
b_textcolor = (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
|
||||||
text_scale = 0.7 * s
|
text_scale = 0.7 * s
|
||||||
self._transition_out = 'out_scale'
|
self._transition_out = 'out_scale'
|
||||||
|
|
@ -682,6 +722,18 @@ class PluginSourcesWindow(popup.PopupWindow):
|
||||||
scale_origin_stack_offset=self.scale_origin,
|
scale_origin_stack_offset=self.scale_origin,
|
||||||
on_cancel_call=self._ok)
|
on_cancel_call=self._ok)
|
||||||
|
|
||||||
|
ba.textwidget(
|
||||||
|
parent=self._root_widget,
|
||||||
|
position=(155, 300),
|
||||||
|
size=(100, 25),
|
||||||
|
text="Custom Plugin Sources",
|
||||||
|
color=ba.app.ui.title_color,
|
||||||
|
scale=0.8,
|
||||||
|
h_align="center",
|
||||||
|
v_align="center",
|
||||||
|
maxwidth=270,
|
||||||
|
)
|
||||||
|
|
||||||
scroll_size_x = (400 if _uiscale is ba.UIScale.SMALL else
|
scroll_size_x = (400 if _uiscale is ba.UIScale.SMALL else
|
||||||
380 if _uiscale is ba.UIScale.MEDIUM else 290)
|
380 if _uiscale is ba.UIScale.MEDIUM else 290)
|
||||||
scroll_size_y = (225 if _uiscale is ba.UIScale.SMALL else
|
scroll_size_y = (225 if _uiscale is ba.UIScale.SMALL else
|
||||||
|
|
@ -697,34 +749,55 @@ class PluginSourcesWindow(popup.PopupWindow):
|
||||||
border=1,
|
border=1,
|
||||||
margin=0)
|
margin=0)
|
||||||
|
|
||||||
|
delete_source_button_position_pos_x = 360
|
||||||
|
delete_source_button_position_pos_y = 110
|
||||||
|
delete_source_button = ba.buttonwidget(parent=self._root_widget,
|
||||||
|
position=(delete_source_button_position_pos_x, delete_source_button_position_pos_y),
|
||||||
|
size=(25, 25),
|
||||||
|
on_activate_call=self.delete_selected_source,
|
||||||
|
label="",
|
||||||
|
# texture=ba.gettexture("crossOut"),
|
||||||
|
button_type="square",
|
||||||
|
color=(0.6, 0, 0),
|
||||||
|
textcolor=b_textcolor,
|
||||||
|
# autoselect=True,
|
||||||
|
text_scale=1)
|
||||||
|
|
||||||
|
ba.imagewidget(parent=self._root_widget,
|
||||||
|
position=(delete_source_button_position_pos_x + 2, delete_source_button_position_pos_y),
|
||||||
|
size=(25, 25),
|
||||||
|
color=(5, 2, 2),
|
||||||
|
texture=ba.gettexture("crossOut"),
|
||||||
|
draw_controller=delete_source_button)
|
||||||
ba.textwidget(
|
ba.textwidget(
|
||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(155, 300),
|
position=(48, 74),
|
||||||
size=(100, 25),
|
size=(50, 22),
|
||||||
text="Plugin Sources",
|
text=("Warning: 3rd party plugin sources are not moderated\n"
|
||||||
color=ba.app.ui.title_color,
|
" by the community and may be dangerous!"),
|
||||||
scale=0.8,
|
color=(1, 0.23, 0.23),
|
||||||
h_align="center",
|
scale=0.5,
|
||||||
|
h_align="left",
|
||||||
v_align="center",
|
v_align="center",
|
||||||
maxwidth=270,
|
maxwidth=400,
|
||||||
)
|
)
|
||||||
|
|
||||||
self._add_source_widget = ba.textwidget(parent=self._root_widget,
|
self._add_source_widget = ba.textwidget(parent=self._root_widget,
|
||||||
text="rikkolovescats/sahilp-plugins",
|
text="rikkolovescats/sahilp-plugins",
|
||||||
size=(335, 50),
|
size=(335, 50),
|
||||||
position=(21, 30),
|
position=(21, 22),
|
||||||
h_align='left',
|
h_align='left',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
editable=True,
|
editable=True,
|
||||||
scale=0.75,
|
scale=0.75,
|
||||||
maxwidth=215,
|
maxwidth=215,
|
||||||
|
# autoselect=True,
|
||||||
description="Add Source")
|
description="Add Source")
|
||||||
|
|
||||||
b_textcolor = (0.75, 0.7, 0.8)
|
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
|
|
||||||
ba.buttonwidget(parent=self._root_widget,
|
ba.buttonwidget(parent=self._root_widget,
|
||||||
position=(330, 36),
|
position=(330, 28),
|
||||||
size=(37, 37),
|
size=(37, 37),
|
||||||
on_activate_call=lambda: loop.create_task(self.add_source()),
|
on_activate_call=lambda: loop.create_task(self.add_source()),
|
||||||
label="",
|
label="",
|
||||||
|
|
@ -733,20 +806,9 @@ class PluginSourcesWindow(popup.PopupWindow):
|
||||||
button_type="square",
|
button_type="square",
|
||||||
color=(0, 0.9, 0),
|
color=(0, 0.9, 0),
|
||||||
textcolor=b_textcolor,
|
textcolor=b_textcolor,
|
||||||
autoselect=True,
|
# autoselect=True,
|
||||||
text_scale=1)
|
text_scale=1)
|
||||||
|
|
||||||
ba.buttonwidget(parent=self._root_widget,
|
|
||||||
position=(360, 110),
|
|
||||||
size=(30, 30),
|
|
||||||
on_activate_call=self.delete_selected_source,
|
|
||||||
label="",
|
|
||||||
texture=ba.gettexture("crossOut"),
|
|
||||||
button_type="square",
|
|
||||||
color=(5, 0.8, 0.8),
|
|
||||||
textcolor=b_textcolor,
|
|
||||||
autoselect=True,
|
|
||||||
text_scale=1)
|
|
||||||
self.draw_sources()
|
self.draw_sources()
|
||||||
|
|
||||||
def draw_sources(self):
|
def draw_sources(self):
|
||||||
|
|
@ -758,7 +820,7 @@ class PluginSourcesWindow(popup.PopupWindow):
|
||||||
ba.textwidget(parent=self._columnwidget,
|
ba.textwidget(parent=self._columnwidget,
|
||||||
# size=(410, 30),
|
# size=(410, 30),
|
||||||
selectable=True,
|
selectable=True,
|
||||||
always_highlight=True,
|
# always_highlight=True,
|
||||||
color=color,
|
color=color,
|
||||||
text=custom_source,
|
text=custom_source,
|
||||||
# click_activate=True,
|
# click_activate=True,
|
||||||
|
|
@ -776,12 +838,12 @@ class PluginSourcesWindow(popup.PopupWindow):
|
||||||
source = ba.textwidget(query=self._add_source_widget)
|
source = ba.textwidget(query=self._add_source_widget)
|
||||||
meta_url = THIRD_PARTY_CATEGORY_URL.format(repository=source, content_type="raw")
|
meta_url = THIRD_PARTY_CATEGORY_URL.format(repository=source, content_type="raw")
|
||||||
category = Category(meta_url, is_3rd_party=True)
|
category = Category(meta_url, is_3rd_party=True)
|
||||||
if source in ba.app.config["Community Plugin Manager"]["Custom Sources"]:
|
|
||||||
ba.screenmessage("Plugin source already exists")
|
|
||||||
return
|
|
||||||
if not await category.is_valid():
|
if not await category.is_valid():
|
||||||
ba.screenmessage("Enter a valid plugin source")
|
ba.screenmessage("Enter a valid plugin source")
|
||||||
return
|
return
|
||||||
|
if source in ba.app.config["Community Plugin Manager"]["Custom Sources"]:
|
||||||
|
ba.screenmessage("Plugin source already exists")
|
||||||
|
return
|
||||||
ba.app.config["Community Plugin Manager"]["Custom Sources"].append(source)
|
ba.app.config["Community Plugin Manager"]["Custom Sources"].append(source)
|
||||||
ba.app.config.commit()
|
ba.app.config.commit()
|
||||||
ba.screenmessage("Plugin source added")
|
ba.screenmessage("Plugin source added")
|
||||||
|
|
@ -790,6 +852,7 @@ class PluginSourcesWindow(popup.PopupWindow):
|
||||||
def delete_selected_source(self):
|
def delete_selected_source(self):
|
||||||
ba.app.config["Community Plugin Manager"]["Custom Sources"].remove(self.selected_source)
|
ba.app.config["Community Plugin Manager"]["Custom Sources"].remove(self.selected_source)
|
||||||
ba.app.config.commit()
|
ba.app.config.commit()
|
||||||
|
ba.screenmessage("Plugin source deleted")
|
||||||
self.draw_sources()
|
self.draw_sources()
|
||||||
|
|
||||||
def _ok(self) -> None:
|
def _ok(self) -> None:
|
||||||
|
|
@ -800,7 +863,7 @@ class PluginSourcesWindow(popup.PopupWindow):
|
||||||
return ba.app.config["Community Plugin Manager"]["Custom Sources"]
|
return ba.app.config["Community Plugin Manager"]["Custom Sources"]
|
||||||
|
|
||||||
|
|
||||||
class CategoryWindow(popup.PopupMenuWindow):
|
class PluginCategoryWindow(popup.PopupMenuWindow):
|
||||||
def __init__(self, choices, current_choice, origin_widget, asyncio_callback):
|
def __init__(self, choices, current_choice, origin_widget, asyncio_callback):
|
||||||
choices = (*choices, "Custom Sources")
|
choices = (*choices, "Custom Sources")
|
||||||
self._asyncio_callback = asyncio_callback
|
self._asyncio_callback = asyncio_callback
|
||||||
|
|
@ -937,10 +1000,10 @@ class PluginManagerWindow(ba.Window):
|
||||||
|
|
||||||
async def draw_index(self):
|
async def draw_index(self):
|
||||||
try:
|
try:
|
||||||
await self.draw_search_bar()
|
self.draw_search_bar()
|
||||||
await self.draw_category_selection_button(post_label="All")
|
self.draw_category_selection_button(post_label="All")
|
||||||
await self.draw_refresh_icon()
|
self.draw_refresh_icon()
|
||||||
await self.draw_settings_icon()
|
self.draw_settings_icon()
|
||||||
await self.plugin_manager.setup_index()
|
await self.plugin_manager.setup_index()
|
||||||
ba.textwidget(edit=self._plugin_manager_status_text,
|
ba.textwidget(edit=self._plugin_manager_status_text,
|
||||||
text="")
|
text="")
|
||||||
|
|
@ -952,7 +1015,7 @@ class PluginManagerWindow(ba.Window):
|
||||||
ba.textwidget(edit=self._plugin_manager_status_text,
|
ba.textwidget(edit=self._plugin_manager_status_text,
|
||||||
text="Make sure you are connected\n to the Internet and try again.")
|
text="Make sure you are connected\n to the Internet and try again.")
|
||||||
|
|
||||||
async def draw_category_selection_button(self, post_label):
|
def draw_category_selection_button(self, post_label):
|
||||||
category_pos_x = (330 if _uiscale is ba.UIScale.SMALL else
|
category_pos_x = (330 if _uiscale is ba.UIScale.SMALL else
|
||||||
285 if _uiscale is ba.UIScale.MEDIUM else 350)
|
285 if _uiscale is ba.UIScale.MEDIUM else 350)
|
||||||
category_pos_y = self._height - (145 if _uiscale is ba.UIScale.SMALL else
|
category_pos_y = self._height - (145 if _uiscale is ba.UIScale.SMALL else
|
||||||
|
|
@ -979,7 +1042,7 @@ class PluginManagerWindow(ba.Window):
|
||||||
self.category_selection_button = ba.buttonwidget(edit=self.category_selection_button,
|
self.category_selection_button = ba.buttonwidget(edit=self.category_selection_button,
|
||||||
label=label)
|
label=label)
|
||||||
|
|
||||||
async def draw_search_bar(self):
|
def draw_search_bar(self):
|
||||||
search_bar_pos_x = (80 if _uiscale is ba.UIScale.SMALL else
|
search_bar_pos_x = (80 if _uiscale is ba.UIScale.SMALL else
|
||||||
55 if _uiscale is ba.UIScale.MEDIUM else 90)
|
55 if _uiscale is ba.UIScale.MEDIUM else 90)
|
||||||
search_bar_pos_y = self._height - (
|
search_bar_pos_y = self._height - (
|
||||||
|
|
@ -1012,7 +1075,7 @@ class PluginManagerWindow(ba.Window):
|
||||||
scale=0.8,
|
scale=0.8,
|
||||||
description=filter_txt)
|
description=filter_txt)
|
||||||
|
|
||||||
async def draw_settings_icon(self):
|
def draw_settings_icon(self):
|
||||||
settings_pos_x = (500 if _uiscale is ba.UIScale.SMALL else
|
settings_pos_x = (500 if _uiscale is ba.UIScale.SMALL else
|
||||||
440 if _uiscale is ba.UIScale.MEDIUM else 510)
|
440 if _uiscale is ba.UIScale.MEDIUM else 510)
|
||||||
settings_pos_y = (130 if _uiscale is ba.UIScale.SMALL else
|
settings_pos_y = (130 if _uiscale is ba.UIScale.SMALL else
|
||||||
|
|
@ -1032,7 +1095,7 @@ class PluginManagerWindow(ba.Window):
|
||||||
texture=ba.gettexture("settingsIcon"),
|
texture=ba.gettexture("settingsIcon"),
|
||||||
draw_controller=controller_button)
|
draw_controller=controller_button)
|
||||||
|
|
||||||
async def draw_refresh_icon(self):
|
def draw_refresh_icon(self):
|
||||||
settings_pos_x = (500 if _uiscale is ba.UIScale.SMALL else
|
settings_pos_x = (500 if _uiscale is ba.UIScale.SMALL else
|
||||||
440 if _uiscale is ba.UIScale.MEDIUM else 510)
|
440 if _uiscale is ba.UIScale.MEDIUM else 510)
|
||||||
settings_pos_y = (180 if _uiscale is ba.UIScale.SMALL else
|
settings_pos_y = (180 if _uiscale is ba.UIScale.SMALL else
|
||||||
|
|
@ -1098,7 +1161,7 @@ class PluginManagerWindow(ba.Window):
|
||||||
|
|
||||||
def show_categories_window(self):
|
def show_categories_window(self):
|
||||||
play_sound()
|
play_sound()
|
||||||
CategoryWindow(
|
PluginCategoryWindow(
|
||||||
self.plugin_manager.categories.keys(),
|
self.plugin_manager.categories.keys(),
|
||||||
self.selected_category,
|
self.selected_category,
|
||||||
self._root_widget,
|
self._root_widget,
|
||||||
|
|
@ -1108,7 +1171,7 @@ class PluginManagerWindow(ba.Window):
|
||||||
async def select_category(self, category):
|
async def select_category(self, category):
|
||||||
self.selected_category = category
|
self.selected_category = category
|
||||||
self.plugins_in_current_view.clear()
|
self.plugins_in_current_view.clear()
|
||||||
await self.draw_category_selection_button(post_label=category)
|
self.draw_category_selection_button(post_label=category)
|
||||||
await self.draw_plugin_names(category)
|
await self.draw_plugin_names(category)
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue