Build Fixing Part 3

This commit is contained in:
Vishal 2022-08-24 16:18:12 +05:30 committed by GitHub
parent 3907df6871
commit f8595db387
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 14 deletions

View file

@ -1,7 +1,6 @@
# ba_meta require api 7 # ba_meta require api 7
import ba import ba
import _ba import _ba
import bastd
from bastd.ui import popup from bastd.ui import popup
import urllib.request import urllib.request
@ -24,9 +23,9 @@ _uiscale = ba.app.ui.uiscale
PLUGIN_MANAGER_VERSION = "0.1.1" PLUGIN_MANAGER_VERSION = "0.1.1"
REPOSITORY_URL = "http://github.com/bombsquad-community/plugin-manager" REPOSITORY_URL = "http://github.com/bombsquad-community/plugin-manager"
CURRENT_TAG = "main" CURRENT_TAG = "main"
# XXX: Using https with `ba.open_url` seems to trigger a pop-up dialog box on Android currently (v1.7.6) # XXX: Using https with `ba.open_url` seems to trigger a pop-up dialog box on
# and won't open the actual URL in a web-browser. Let's fallback to http for now until this # Android currently (v1.7.6) and won't open the actual URL in a web-browser.
# gets resolved. # Let's fallback to http for now until this gets resolved.
INDEX_META = "{repository_url}/{content_type}/{tag}/index.json" INDEX_META = "{repository_url}/{content_type}/{tag}/index.json"
HEADERS = { HEADERS = {
"User-Agent": _env["user_agent_string"], "User-Agent": _env["user_agent_string"],
@ -34,8 +33,8 @@ HEADERS = {
PLUGIN_DIRECTORY = _env["python_directory_user"] PLUGIN_DIRECTORY = _env["python_directory_user"]
REGEXP = { REGEXP = {
"plugin_api_version": re.compile(b"(?<=ba_meta require api )(.*)"), "plugin_api_version": re.compile(b"(?<=ba_meta require api )(.*)"),
"plugin_entry_points": re.compile(b"(ba_meta export plugin\n+class )(.*)\("), "plugin_entry_points": re.compile(b"(ba_meta export plugin\n+class )(.*)\\("),
"minigames": re.compile(b"(ba_meta export game\n+class )(.*)\("), "minigames": re.compile(b"(ba_meta export game\n+class )(.*)\\("),
} }
_CACHE = {} _CACHE = {}
@ -96,8 +95,9 @@ class StartupTasks:
self.plugin_manager = PluginManager() self.plugin_manager = PluginManager()
def setup_config(self): def setup_config(self):
is_config_updated = False # is_config_updated = False
existing_plugin_manager_config = copy.deepcopy(ba.app.config.get("Community Plugin Manager")) existing_plugin_manager_config = copy.deepcopy(
ba.app.config.get("Community Plugin Manager"))
plugin_manager_config = ba.app.config.setdefault("Community Plugin Manager", {}) plugin_manager_config = ba.app.config.setdefault("Community Plugin Manager", {})
plugin_manager_config.setdefault("Custom Sources", []) plugin_manager_config.setdefault("Custom Sources", [])
@ -133,7 +133,8 @@ 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.", color = (0,1,0)) ba.screenmessage("Update successful. Restart game to reload changes.",
color=(0, 1, 0))
async def update_plugins(self): async def update_plugins(self):
if not ba.app.config["Community Plugin Manager"]["Settings"]["Auto Update Plugins"]: if not ba.app.config["Community Plugin Manager"]["Settings"]["Auto Update Plugins"]:
@ -925,7 +926,7 @@ class PluginSourcesWindow(popup.PopupWindow):
self.scale_origin = origin_widget.get_screen_space_center() self.scale_origin = origin_widget.get_screen_space_center()
b_textcolor = (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'
transition = 'in_scale' transition = 'in_scale'

View file

@ -14,7 +14,7 @@ from bastd.actor.spazfactory import SpazFactory
from bastd.actor.scoreboard import Scoreboard from bastd.actor.scoreboard import Scoreboard
if TYPE_CHECKING: if TYPE_CHECKING:
from typing import (Any, Tuple, Dict, Type, List, Sequence, Optional, from typing import (Any, Tuple, Type, List, Sequence, Optional,
Union) Union)