mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
Build Fixing Part 1
This commit is contained in:
parent
f4721502d9
commit
8ad43be72f
1 changed files with 52 additions and 41 deletions
|
|
@ -1052,24 +1052,26 @@ class PluginSourcesWindow(popup.PopupWindow):
|
||||||
)
|
)
|
||||||
category = Category(meta_url, is_3rd_party=True)
|
category = Category(meta_url, is_3rd_party=True)
|
||||||
if not await category.is_valid():
|
if not await category.is_valid():
|
||||||
ba.screenmessage("Enter a valid plugin source", color = (1,0,0))
|
ba.screenmessage("Enter a valid plugin source", color=(1, 0, 0))
|
||||||
return
|
return
|
||||||
if source in ba.app.config["Community Plugin Manager"]["Custom Sources"]:
|
if source in ba.app.config["Community Plugin Manager"]["Custom Sources"]:
|
||||||
ba.screenmessage("Plugin source already exists")
|
ba.screenmessage("Plugin source already exists")
|
||||||
return
|
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, refresh plugin list to see changes", color = (0,1,0))
|
ba.screenmessage("Plugin source added, refresh plugin list to see changes",
|
||||||
|
color=(0, 1, 0))
|
||||||
self.draw_sources()
|
self.draw_sources()
|
||||||
|
|
||||||
def delete_selected_source(self):
|
def delete_selected_source(self):
|
||||||
try:
|
try:
|
||||||
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, refresh plugin list to see changes", color = (0,1,0))
|
ba.screenmessage("Plugin source deleted, refresh plugin list to see changes",
|
||||||
|
color=(0, 1, 0))
|
||||||
self.draw_sources()
|
self.draw_sources()
|
||||||
except:
|
except Exception:
|
||||||
ba.screenmessage("No Plugin Selected to Delete", color = (1,0,0))
|
ba.screenmessage("No Plugin Selected to Delete", color=(1, 0, 0))
|
||||||
|
|
||||||
def _ok(self) -> None:
|
def _ok(self) -> None:
|
||||||
play_sound()
|
play_sound()
|
||||||
|
|
@ -1235,7 +1237,6 @@ class PluginManagerWindow(ba.Window):
|
||||||
border=2,
|
border=2,
|
||||||
margin=0)
|
margin=0)
|
||||||
|
|
||||||
|
|
||||||
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)
|
||||||
|
|
@ -1252,7 +1253,8 @@ class PluginManagerWindow(ba.Window):
|
||||||
position=(category_pos_x,
|
position=(category_pos_x,
|
||||||
category_pos_y),
|
category_pos_y),
|
||||||
size=b_size,
|
size=b_size,
|
||||||
on_activate_call=self.show_categories_window,
|
on_activate_call=(
|
||||||
|
self.show_categories_window),
|
||||||
label=label,
|
label=label,
|
||||||
button_type="square",
|
button_type="square",
|
||||||
color=b_color,
|
color=b_color,
|
||||||
|
|
@ -1371,7 +1373,8 @@ class PluginManagerWindow(ba.Window):
|
||||||
size=(30, 30),
|
size=(30, 30),
|
||||||
button_type="square",
|
button_type="square",
|
||||||
label="",
|
label="",
|
||||||
on_activate_call=lambda: loop.create_task(self.refresh()))
|
on_activate_call=lambda:
|
||||||
|
loop.create_task(self.refresh()))
|
||||||
ba.imagewidget(parent=self._root_widget,
|
ba.imagewidget(parent=self._root_widget,
|
||||||
position=(settings_pos_x, settings_pos_y),
|
position=(settings_pos_x, settings_pos_y),
|
||||||
size=(30, 30),
|
size=(30, 30),
|
||||||
|
|
@ -1389,7 +1392,8 @@ class PluginManagerWindow(ba.Window):
|
||||||
|
|
||||||
# XXX: Not sure if this is the best way to handle search filters.
|
# XXX: Not sure if this is the best way to handle search filters.
|
||||||
async def draw_plugin_names(self, category, search_filter=""):
|
async def draw_plugin_names(self, category, search_filter=""):
|
||||||
to_draw_plugin_names = (search_filter, category) != (self._last_filter_text, self.selected_category)
|
to_draw_plugin_names = (search_filter, category) != (self._last_filter_text,
|
||||||
|
self.selected_category)
|
||||||
if not to_draw_plugin_names:
|
if not to_draw_plugin_names:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
@ -1591,15 +1595,22 @@ class PluginManagerSettingsWindow(popup.PopupWindow):
|
||||||
text_color = (0.75, 0.2, 0.2)
|
text_color = (0.75, 0.2, 0.2)
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
button_size = (95 * s, 32 * s)
|
button_size = (95 * s, 32 * s)
|
||||||
|
update_button_label = f'Update to v{plugin_manager_update_available[0]}'
|
||||||
self._update_button = ba.buttonwidget(parent=self._root_widget,
|
self._update_button = ba.buttonwidget(parent=self._root_widget,
|
||||||
position=((width * 0.77) - button_size[0] / 2, pos),
|
position=((width * 0.77) - button_size[0] / 2,
|
||||||
|
pos),
|
||||||
size=button_size,
|
size=button_size,
|
||||||
on_activate_call=lambda: loop.create_task(self.update(*plugin_manager_update_available)),
|
on_activate_call=lambda:
|
||||||
|
loop.create_task(
|
||||||
|
self.update(
|
||||||
|
*plugin_manager_update_available
|
||||||
|
)
|
||||||
|
),
|
||||||
textcolor=b_text_color,
|
textcolor=b_text_color,
|
||||||
button_type='square',
|
button_type='square',
|
||||||
text_scale=1,
|
text_scale=1,
|
||||||
color=(0, 0.7, 0),
|
color=(0, 0.7, 0),
|
||||||
label=f'Update to v{plugin_manager_update_available[0]}')
|
label=update_button_label)
|
||||||
self._restart_to_reload_changes_text = ba.textwidget(parent=self._root_widget,
|
self._restart_to_reload_changes_text = ba.textwidget(parent=self._root_widget,
|
||||||
position=(width * 0.79, pos + 20),
|
position=(width * 0.79, pos + 20),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
|
|
@ -1645,9 +1656,9 @@ class PluginManagerSettingsWindow(popup.PopupWindow):
|
||||||
await self._plugin_manager.update(to_version, commit_sha)
|
await self._plugin_manager.update(to_version, commit_sha)
|
||||||
except TypeError:
|
except TypeError:
|
||||||
# TODO: Catch a more fitting exception here.
|
# TODO: Catch a more fitting exception here.
|
||||||
ba.screenmessage(f"md5sum check failed", color=(1, 0, 0))
|
ba.screenmessage("md5sum check failed", color=(1, 0, 0))
|
||||||
else:
|
else:
|
||||||
ba.screenmessage("Update successful.", color = (0,1,0))
|
ba.screenmessage("Update successful.", color=(0, 1, 0))
|
||||||
ba.textwidget(edit=self._restart_to_reload_changes_text,
|
ba.textwidget(edit=self._restart_to_reload_changes_text,
|
||||||
text='Update Applied!\nRestart game to reload changes.')
|
text='Update Applied!\nRestart game to reload changes.')
|
||||||
self._update_button.delete()
|
self._update_button.delete()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue