mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
Removed an Error and Added a few Colors
This commit is contained in:
parent
4703b0f978
commit
6cc514813f
1 changed files with 16 additions and 13 deletions
|
|
@ -119,7 +119,7 @@ class StartupTasks:
|
||||||
to_version, commit_sha = update_details
|
to_version, commit_sha = update_details
|
||||||
ba.screenmessage(f"Plugin Manager is being updated to version v{to_version}.")
|
ba.screenmessage(f"Plugin Manager is being updated to version v{to_version}.")
|
||||||
await self.plugin_manager.update(to_version, commit_sha)
|
await self.plugin_manager.update(to_version, commit_sha)
|
||||||
ba.screenmessage("Update successful. Restart game to reload changes.")
|
ba.screenmessage("Update successful. Restart game to reload changes.", color = (0,1,0))
|
||||||
|
|
||||||
async def update_plugins(self):
|
async def update_plugins(self):
|
||||||
pass
|
pass
|
||||||
|
|
@ -385,7 +385,7 @@ class PluginLocal:
|
||||||
self.load_minigames()
|
self.load_minigames()
|
||||||
# await self._set_status(to_enable=True)
|
# await self._set_status(to_enable=True)
|
||||||
self.save()
|
self.save()
|
||||||
ba.screenmessage("Plugin Enabled")
|
ba.screenmessage("Plugin Enabled", color = (0,1,0))
|
||||||
|
|
||||||
def load_plugin(self, entry_point):
|
def load_plugin(self, entry_point):
|
||||||
plugin_class = ba._general.getclass(entry_point, ba.Plugin)
|
plugin_class = ba._general.getclass(entry_point, ba.Plugin)
|
||||||
|
|
@ -401,7 +401,7 @@ class PluginLocal:
|
||||||
# reads the local plugin file and parses entry points from it.
|
# reads the local plugin file and parses entry points from it.
|
||||||
# await self._set_status(to_enable=False)
|
# await self._set_status(to_enable=False)
|
||||||
self.save()
|
self.save()
|
||||||
ba.screenmessage("Plugin Disabled")
|
ba.screenmessage("Plugin Disabled", color = (0,1,0))
|
||||||
|
|
||||||
def set_version(self, version):
|
def set_version(self, version):
|
||||||
ba.app.config["Community Plugin Manager"]["Installed Plugins"][self.name]["version"] = version
|
ba.app.config["Community Plugin Manager"]["Installed Plugins"][self.name]["version"] = version
|
||||||
|
|
@ -485,15 +485,15 @@ class Plugin:
|
||||||
async def install(self):
|
async def install(self):
|
||||||
local_plugin = await self._download()
|
local_plugin = await self._download()
|
||||||
await local_plugin.enable()
|
await local_plugin.enable()
|
||||||
ba.screenmessage("Plugin Installed")
|
ba.screenmessage("Plugin Installed", color = (0,1,0))
|
||||||
|
|
||||||
async def uninstall(self):
|
async def uninstall(self):
|
||||||
await self.get_local().uninstall()
|
await self.get_local().uninstall()
|
||||||
ba.screenmessage("Plugin Uninstalled")
|
ba.screenmessage("Plugin Uninstalled", color = (0,1,0))
|
||||||
|
|
||||||
async def update(self):
|
async def update(self):
|
||||||
await self._download()
|
await self._download()
|
||||||
ba.screenmessage("Plugin Updated")
|
ba.screenmessage("Plugin Updated", color = (0,1,0))
|
||||||
|
|
||||||
|
|
||||||
class PluginWindow(popup.PopupWindow):
|
class PluginWindow(popup.PopupWindow):
|
||||||
|
|
@ -953,21 +953,24 @@ 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")
|
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")
|
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):
|
||||||
ba.app.config["Community Plugin Manager"]["Custom Sources"].remove(self.selected_source)
|
try:
|
||||||
ba.app.config.commit()
|
ba.app.config["Community Plugin Manager"]["Custom Sources"].remove(self.selected_source)
|
||||||
ba.screenmessage("Plugin source deleted, refresh plugin list to see changes")
|
ba.app.config.commit()
|
||||||
self.draw_sources()
|
ba.screenmessage("Plugin source deleted, refresh plugin list to see changes", color = (0,1,0))
|
||||||
|
self.draw_sources()
|
||||||
|
except:
|
||||||
|
ba.screenmessage("No Plugin Selected to Delete", color = (1,0,0))
|
||||||
|
|
||||||
def _ok(self) -> None:
|
def _ok(self) -> None:
|
||||||
play_sound()
|
play_sound()
|
||||||
|
|
@ -1464,7 +1467,7 @@ class PluginManagerSettingsWindow(popup.PopupWindow):
|
||||||
|
|
||||||
async def update(self, to_version=None, commit_sha=None):
|
async def update(self, to_version=None, commit_sha=None):
|
||||||
await self._plugin_manager.update(to_version, commit_sha)
|
await self._plugin_manager.update(to_version, commit_sha)
|
||||||
ba.screenmessage("Update successful.")
|
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