[ci] auto-format

This commit is contained in:
Loup-Garou911XD 2022-11-07 19:58:27 +00:00 committed by github-actions[bot]
parent a47c5e7d1f
commit 7f155a07d7

View file

@ -15,6 +15,7 @@ from bastd.ui.popup import PopupWindow
# mod by ʟօʊքɢǟʀօʊ
# export replays to mods folder and share with your friends or have a backup
def Print(*args, color=None, top=None):
out = ""
for arg in args:
@ -22,6 +23,7 @@ def Print(*args,color=None,top=None):
out += a
ba.screenmessage(out, color=color, top=top)
def cprint(*args):
out = ""
for arg in args:
@ -29,6 +31,7 @@ def cprint(*args):
out += a
_ba.chatmessage(out)
internal_dir = path.join("ba_data", "..", "..", "..", "files", "bombsquad_config", "replays" + sep)
external_dir = path.join(_ba.env()["python_directory_user"], "replays"+sep)
@ -41,6 +44,7 @@ if not path.exists(external_dir):
mkdir(external_dir)
Print("You are ready to share replays", color=pink)
class Help(PopupWindow):
def __init__(self):
uiscale = ba.app.ui.uiscale
@ -53,7 +57,8 @@ class Help(PopupWindow):
scale=1.2,)
ba.containerwidget(edit=self.root_widget, on_outside_click_call=self.close)
ba.textwidget(parent=self.root_widget,position=(0 , self.height * 0.6), text=f"•Replays are exported to\n {external_dir}\n•Importing replay and other features comming in v1.2")
ba.textwidget(parent=self.root_widget, position=(0, self.height * 0.6),
text=f"•Replays are exported to\n {external_dir}\n•Importing replay and other features comming in v1.2")
def close(self):
ba.playsound(ba.getsound('swish'))
@ -75,7 +80,8 @@ class SettingWindow():
def draw_ui(self):
self.uiscale = ba.app.ui.uiscale
self.root=ba.Window(ba.containerwidget(size=(900, 670),on_outside_click_call=self.close,transition="in_right")).get_root_widget()
self.root = ba.Window(ba.containerwidget(
size=(900, 670), on_outside_click_call=self.close, transition="in_right")).get_root_widget()
ba.textwidget(
parent=self.root,
@ -119,7 +125,8 @@ class SettingWindow():
parent=self.root,
size=(500, 400),
position=(200, 150))
self.scroll=ba.columnwidget(parent=scroll,size=(500,900),selection_loops_to_parent=True,single_depth=True)
self.scroll = ba.columnwidget(parent=scroll, size=(
500, 900), selection_loops_to_parent=True, single_depth=True)
height = 900
for i in listdir(internal_dir):
@ -136,13 +143,13 @@ class SettingWindow():
ba.textwidget(edit=i, on_activate_call=ba.Call(self.on_select_text, i, a))
def export(self):
if self.selected_name is None:
Print("Select a replay", color=red)
return
copy(internal_dir+"/"+self.selected_name, external_dir+"/"+self.selected_name)
Print(self.selected_name[0:-4]+" exported", top=True,color=pink)#image={"texture":ba.gettexture("bombColor"),"tint_texture":None,"tint_color":None,"tint2_color":None})
# image={"texture":ba.gettexture("bombColor"),"tint_texture":None,"tint_color":None,"tint2_color":None})
Print(self.selected_name[0:-4]+" exported", top=True, color=pink)
def close(self):
ba.playsound(ba.getsound('swish'))
@ -157,6 +164,7 @@ class SettingWindow():
ww.__old_init__ = ww.__init__
def new_init(self, transition="in_right", origin_widget=None):
self.__old_init__(transition, origin_widget)
self._share_button = ba.buttonwidget(
@ -182,5 +190,3 @@ class Loup(ba.Plugin):
def show_settings_ui(self, button):
SettingWindow()