From 23eb66093cfa8e00a1a6509af2c1d08bfa15a942 Mon Sep 17 00:00:00 2001 From: Loup <90267658+Loup-Garou911XD@users.noreply.github.com> Date: Mon, 7 Nov 2022 01:18:24 +0530 Subject: [PATCH 1/4] Update utilities.json --- plugins/utilities.json | 57 ++++++------------------------------------ 1 file changed, 8 insertions(+), 49 deletions(-) diff --git a/plugins/utilities.json b/plugins/utilities.json index 3643231..5336f99 100644 --- a/plugins/utilities.json +++ b/plugins/utilities.json @@ -14,12 +14,7 @@ } ], "versions": { - "1.0.0": { - "api_version": 7, - "commit_sha": "32c6b83", - "released_on": "06-11-2022", - "md5sum": "b652c675e61332a9e7714342ee83bfce" - } + "1.0.0":null } }, "custom_death": { @@ -33,12 +28,7 @@ } ], "versions": { - "1.0.0": { - "api_version": 7, - "commit_sha": "7d3d117", - "released_on": "03-11-2022", - "md5sum": "7b1941512532321eec18140087569215" - } + "1.0.0":null } }, "max_players": { @@ -52,12 +42,7 @@ } ], "versions": { - "1.0.0": { - "api_version": 7, - "commit_sha": "7d3d117", - "released_on": "03-11-2022", - "md5sum": "f5e129f009e9732b3179c7edaf75478e" - } + "1.0.0":null } }, "quick_custom_game": { @@ -71,12 +56,7 @@ } ], "versions": { - "1.0.0": { - "api_version": 7, - "commit_sha": "7d3d117", - "released_on": "03-11-2022", - "md5sum": "b691e35afb17cd3b5f6fe21c0194567d" - } + "1.0.0":null } }, "random_colors": { @@ -90,12 +70,7 @@ } ], "versions": { - "1.0.0": { - "api_version": 7, - "commit_sha": "7d3d117", - "released_on": "03-11-2022", - "md5sum": "0c351a0aebed77c3771053cde0c18d7b" - } + "1.0.0":null } }, "chat_cmd": { @@ -114,12 +89,7 @@ } ], "versions": { - "1.0.0": { - "api_version": 7, - "commit_sha": "7d3d117", - "released_on": "03-11-2022", - "md5sum": "c84d9a1c9e63e77949134020e1f11834" - } + "1.0.0":null } }, "mood_light": { @@ -133,18 +103,7 @@ } ], "versions": { - "1.2.2": { - "api_version": 7, - "commit_sha": "490b857", - "released_on": "04-11-2022", - "md5sum": "cb367f877d6360a0e41941b1d0396a9b" - }, - "1.2.1": { - "api_version": 7, - "commit_sha": "1a56b57", - "released_on": "28-10-2022", - "md5sum": "81414a2b497da3d2340a4d7eb004336c" - }, + "1.2.1":null "1.2.0": { "api_version": 7, "commit_sha": "d838115", @@ -429,4 +388,4 @@ } } } -} \ No newline at end of file +} From e7d612d0bf72ff57e91fdc1b5fd1e7798b8f0b2c Mon Sep 17 00:00:00 2001 From: Loup <90267658+Loup-Garou911XD@users.noreply.github.com> Date: Mon, 7 Nov 2022 01:21:10 +0530 Subject: [PATCH 2/4] Update minigames.json --- plugins/minigames.json | 44 +++++++----------------------------------- 1 file changed, 7 insertions(+), 37 deletions(-) diff --git a/plugins/minigames.json b/plugins/minigames.json index 3dc129e..3fd3023 100644 --- a/plugins/minigames.json +++ b/plugins/minigames.json @@ -33,12 +33,7 @@ } ], "versions": { - "1.0.0": { - "api_version": 7, - "commit_sha": "7d3d117", - "released_on": "03-11-2022", - "md5sum": "def39482b339095a7affb574af829ea0" - } + "1.0.0":null } }, "squid_race": { @@ -52,12 +47,7 @@ } ], "versions": { - "1.0.0": { - "api_version": 7, - "commit_sha": "7d3d117", - "released_on": "03-11-2022", - "md5sum": "7ec43481e6b35b4da4f6425977ee0004" - } + "1.0.0":null } }, "zombie_horde": { @@ -71,12 +61,7 @@ } ], "versions": { - "1.0.0": { - "api_version": 7, - "commit_sha": "7d3d117", - "released_on": "03-11-2022", - "md5sum": "671e7b98a9d3eb0aeb7e47448db25af9" - } + "1.0.0":null } }, "meteor_shower": { @@ -90,12 +75,7 @@ } ], "versions": { - "1.0.0": { - "api_version": 7, - "commit_sha": "7d3d117", - "released_on": "03-11-2022", - "md5sum": "1ce8c1a3f3ec240af39b7a73375e7891" - } + "1.0.0":null } }, "boxing": { @@ -109,12 +89,7 @@ } ], "versions": { - "1.0.0": { - "api_version": 7, - "commit_sha": "7d3d117", - "released_on": "03-11-2022", - "md5sum": "c1b615df09886ba05622c4e8b4f6be40" - } + "1.0.0":null } }, "basket_bomb": { @@ -128,12 +103,7 @@ } ], "versions": { - "1.0.0": { - "api_version": 7, - "commit_sha": "7d3d117", - "released_on": "03-11-2022", - "md5sum": "7ec87edbdd5183ec4b2daffad0019820" - } + "1.0.0":null } }, "ultimate_last_stand": { @@ -232,4 +202,4 @@ } } } -} \ No newline at end of file +} From ef99b13364f6bf8f353694e16a96f6390c020d2c Mon Sep 17 00:00:00 2001 From: Loup <90267658+Loup-Garou911XD@users.noreply.github.com> Date: Mon, 7 Nov 2022 02:53:57 +0530 Subject: [PATCH 3/4] Add files via upload --- plugins/utilities/share_replay.py | 162 ++++++++++++++---------------- 1 file changed, 78 insertions(+), 84 deletions(-) diff --git a/plugins/utilities/share_replay.py b/plugins/utilities/share_replay.py index 61a0029..fb49c40 100644 --- a/plugins/utilities/share_replay.py +++ b/plugins/utilities/share_replay.py @@ -3,63 +3,58 @@ from __future__ import annotations from typing import TYPE_CHECKING, cast if TYPE_CHECKING: from typing import Any, Sequence, Callable, List, Dict, Tuple, Optional, Union - -from os import listdir, mkdir -from shutil import copy, copytree + +from os import listdir,mkdir +from shutil import copy,copytree import ba import _ba from bastd.ui.watch import WatchWindow as ww from bastd.ui.popup import PopupWindow -# mod by ʟօʊքɢǟʀօʊ -# export replays to mods folder and share with your friends or have a backup +#mod by ʟօʊքɢǟʀօʊ +#export replays to mods folder and share with your friends or have a backup - -def Print(*args, color=None, top=None): - out = "" +def Print(*args,color=None,top=None): + out="" for arg in args: - a = str(arg) + a=str(arg) out += a - ba.screenmessage(out, color=color, top=top) - + ba.screenmessage(out,color=color,top=top) def cprint(*args): - out = "" + out="" for arg in args: - a = str(arg) + a=str(arg) out += a _ba.chatmessage(out) - - -internal_dir = "/data/data/net.froemling.bombsquad/files/bombsquad_config/replays" -external_dir = "/storage/emulated/0/Android/data/net.froemling.bombsquad/files/mods/replays" -# colors -pink = (1, 0.2, 0.8) -green = (0.4, 1, 0.4) -red = (1, 0, 0) + +internal_dir="/data/data/net.froemling.bombsquad/files/bombsquad_config/replays" +external_dir="/storage/emulated/0/Android/data/net.froemling.bombsquad/files/mods/replays" +#colors +pink=(1,0.2,0.8) +green=(0.4,1,0.4) +red=(1,0,0) try: mkdir(external_dir) - Print("You are ready to share replays", color=pink) + Print("You are ready to share replays",color=pink) except FileExistsError: pass - - + class Help(PopupWindow): def __init__(self): uiscale = ba.app.ui.uiscale self.width = 800 self.height = 300 - + PopupWindow.__init__(self, position=(0.0, 0.0), size=(self.width, self.height), 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.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") + def close(self): ba.playsound(ba.getsound('swish')) ba.containerwidget(edit=self.root_widget, transition="out_right",) @@ -69,19 +64,18 @@ class SettingWindow(): def __init__(self): self.draw_ui() self.selected_widget = None - self.selected_name = None - - def on_select_text(self, widget, name): - if self.selected_widget is not None: - ba.textwidget(edit=self.selected_widget, color=(1, 1, 1)) - ba.textwidget(edit=widget, color=(1, 1, 0)) + self.selected_name= None + + def on_select_text(self,widget,name): + if self.selected_widget is not None: + ba.textwidget(edit=self.selected_widget,color=(1,1,1)) + ba.textwidget(edit=widget,color=(1,1,0)) self.selected_name = name self.selected_widget = widget - + 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, @@ -93,14 +87,14 @@ class SettingWindow(): v_align="center", text="ShareReplay", color=green) - + ba.buttonwidget( parent=self.root, - position=(400, 580), - size=(35, 35), + position=(400,580), + size=(35,35), label="Help", on_activate_call=Help) - + ba.buttonwidget( parent=self.root, position=(770, 460), @@ -108,64 +102,62 @@ class SettingWindow(): scale=1.5, label="EXPORT", on_activate_call=self.export) - + self.close_button = ba.buttonwidget( parent=self.root, position=(820, 590), size=(35, 35), - icon=ba.gettexture("crossOut"), - icon_color=(1, 0.2, 0.2), + texture=ba.gettexture("crossOut"), + label="", scale=2, color=(1, 0.2, 0.2), extra_touch_border_scale=3, on_activate_call=self.close) - - scroll = ba.scrollwidget( + + scroll=ba.scrollwidget( 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) - - height = 900 + size=(500,400), + position=(200,150)) + 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): - height -= 40 - a = i + height-=40 + a=i i = ba.textwidget( - parent=self.scroll, - size=(500, 50), - text=i.split(".")[0], - position=(10, height), + parent=self.scroll, + size=(500,50), + text= i.split(".")[0], + position=(10,height), selectable=True, max_chars=40, click_activate=True,) - - ba.textwidget(edit=i, on_activate_call=ba.Call(self.on_select_text, i, a)) - + + 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) - # 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) - + 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}) + def close(self): ba.playsound(ba.getsound('swish')) - ba.containerwidget(edit=self.root, transition="out_right",) - + ba.containerwidget(edit=self.root, transition="out_right",) + # ++++++++++++++++for keyboard navigation++++++++++++++++ - #ba.widget(edit=self.enable_button, up_widget=decrease_button, down_widget=self.lower_text,left_widget=save_button, right_widget=save_button) + #ba.widget(edit=self.enable_button, up_widget=decrease_button, down_widget=self.lower_text,left_widget=save_button, right_widget=save_button) # -------------------------------------------------------------------------------------------------- -ww.__old_init__ = ww.__init__ +ww.__old_init__=ww.__init__ - -def new_init(self, transition="in_right", origin_widget=None): - self.__old_init__(transition, origin_widget) +def new_init(self,transition="in_right",origin_widget=None): + self.__old_init__(transition,origin_widget) self._share_button = ba.buttonwidget( parent=self._root_widget, position=(self._width*0.70, self._height*0.80), @@ -176,17 +168,19 @@ def new_init(self, transition="in_right", origin_widget=None): iconscale=1.5, label="SHARE REPLAY", on_activate_call=SettingWindow) - - + + # ba_meta export plugin class main(ba.Plugin): def on_app_running(self): - - ww.__init__ = new_init - + + ww.__init__=new_init + def has_settings_ui(self): return True - - def show_settings_ui(self, button): + + def show_settings_ui(self,button): SettingWindow() + + \ No newline at end of file From e788b41b740d6fce4eb403c6e81271ee65de05b7 Mon Sep 17 00:00:00 2001 From: Loup-Garou911XD Date: Sun, 6 Nov 2022 21:24:27 +0000 Subject: [PATCH 4/4] [ci] auto-format --- plugins/utilities/share_replay.py | 160 ++++++++++++++++-------------- 1 file changed, 83 insertions(+), 77 deletions(-) diff --git a/plugins/utilities/share_replay.py b/plugins/utilities/share_replay.py index fb49c40..fe66569 100644 --- a/plugins/utilities/share_replay.py +++ b/plugins/utilities/share_replay.py @@ -3,58 +3,63 @@ from __future__ import annotations from typing import TYPE_CHECKING, cast if TYPE_CHECKING: from typing import Any, Sequence, Callable, List, Dict, Tuple, Optional, Union - -from os import listdir,mkdir -from shutil import copy,copytree + +from os import listdir, mkdir +from shutil import copy, copytree import ba import _ba from bastd.ui.watch import WatchWindow as ww from bastd.ui.popup import PopupWindow -#mod by ʟօʊքɢǟʀօʊ -#export replays to mods folder and share with your friends or have a backup +# mod by ʟօʊքɢǟʀօʊ +# export replays to mods folder and share with your friends or have a backup -def Print(*args,color=None,top=None): - out="" + +def Print(*args, color=None, top=None): + out = "" for arg in args: - a=str(arg) + a = str(arg) out += a - ba.screenmessage(out,color=color,top=top) + ba.screenmessage(out, color=color, top=top) + def cprint(*args): - out="" + out = "" for arg in args: - a=str(arg) + a = str(arg) out += a _ba.chatmessage(out) - -internal_dir="/data/data/net.froemling.bombsquad/files/bombsquad_config/replays" -external_dir="/storage/emulated/0/Android/data/net.froemling.bombsquad/files/mods/replays" -#colors -pink=(1,0.2,0.8) -green=(0.4,1,0.4) -red=(1,0,0) + + +internal_dir = "/data/data/net.froemling.bombsquad/files/bombsquad_config/replays" +external_dir = "/storage/emulated/0/Android/data/net.froemling.bombsquad/files/mods/replays" +# colors +pink = (1, 0.2, 0.8) +green = (0.4, 1, 0.4) +red = (1, 0, 0) try: mkdir(external_dir) - Print("You are ready to share replays",color=pink) + Print("You are ready to share replays", color=pink) except FileExistsError: pass - + + class Help(PopupWindow): def __init__(self): uiscale = ba.app.ui.uiscale self.width = 800 self.height = 300 - + PopupWindow.__init__(self, position=(0.0, 0.0), size=(self.width, self.height), 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.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") + def close(self): ba.playsound(ba.getsound('swish')) ba.containerwidget(edit=self.root_widget, transition="out_right",) @@ -64,18 +69,19 @@ class SettingWindow(): def __init__(self): self.draw_ui() self.selected_widget = None - self.selected_name= None - - def on_select_text(self,widget,name): - if self.selected_widget is not None: - ba.textwidget(edit=self.selected_widget,color=(1,1,1)) - ba.textwidget(edit=widget,color=(1,1,0)) + self.selected_name = None + + def on_select_text(self, widget, name): + if self.selected_widget is not None: + ba.textwidget(edit=self.selected_widget, color=(1, 1, 1)) + ba.textwidget(edit=widget, color=(1, 1, 0)) self.selected_name = name self.selected_widget = widget - + 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, @@ -87,14 +93,14 @@ class SettingWindow(): v_align="center", text="ShareReplay", color=green) - + ba.buttonwidget( parent=self.root, - position=(400,580), - size=(35,35), + position=(400, 580), + size=(35, 35), label="Help", on_activate_call=Help) - + ba.buttonwidget( parent=self.root, position=(770, 460), @@ -102,62 +108,64 @@ class SettingWindow(): scale=1.5, label="EXPORT", on_activate_call=self.export) - + self.close_button = ba.buttonwidget( parent=self.root, position=(820, 590), size=(35, 35), texture=ba.gettexture("crossOut"), - label="", + label="", scale=2, color=(1, 0.2, 0.2), extra_touch_border_scale=3, on_activate_call=self.close) - - scroll=ba.scrollwidget( + + scroll = ba.scrollwidget( 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) - - height=900 + size=(500, 400), + position=(200, 150)) + 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): - height-=40 - a=i + height -= 40 + a = i i = ba.textwidget( - parent=self.scroll, - size=(500,50), - text= i.split(".")[0], - position=(10,height), + parent=self.scroll, + size=(500, 50), + text=i.split(".")[0], + position=(10, height), selectable=True, max_chars=40, click_activate=True,) - - ba.textwidget(edit=i,on_activate_call=ba.Call(self.on_select_text,i,a)) - - + + 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}) - + if self.selected_name is None: + Print("Select a replay", color=red) + return + copy(internal_dir+"/"+self.selected_name, external_dir+"/"+self.selected_name) + # 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')) - ba.containerwidget(edit=self.root, transition="out_right",) - + ba.containerwidget(edit=self.root, transition="out_right",) + # ++++++++++++++++for keyboard navigation++++++++++++++++ - #ba.widget(edit=self.enable_button, up_widget=decrease_button, down_widget=self.lower_text,left_widget=save_button, right_widget=save_button) + #ba.widget(edit=self.enable_button, up_widget=decrease_button, down_widget=self.lower_text,left_widget=save_button, right_widget=save_button) # -------------------------------------------------------------------------------------------------- -ww.__old_init__=ww.__init__ +ww.__old_init__ = ww.__init__ -def new_init(self,transition="in_right",origin_widget=None): - self.__old_init__(transition,origin_widget) + +def new_init(self, transition="in_right", origin_widget=None): + self.__old_init__(transition, origin_widget) self._share_button = ba.buttonwidget( parent=self._root_widget, position=(self._width*0.70, self._height*0.80), @@ -168,19 +176,17 @@ def new_init(self,transition="in_right",origin_widget=None): iconscale=1.5, label="SHARE REPLAY", on_activate_call=SettingWindow) - - + + # ba_meta export plugin class main(ba.Plugin): def on_app_running(self): - - ww.__init__=new_init - + + ww.__init__ = new_init + def has_settings_ui(self): return True - - def show_settings_ui(self,button): + + def show_settings_ui(self, button): SettingWindow() - - \ No newline at end of file