mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
Add files via upload
This commit is contained in:
parent
e7d612d0bf
commit
ef99b13364
1 changed files with 78 additions and 84 deletions
|
|
@ -14,7 +14,6 @@ from bastd.ui.popup import PopupWindow
|
||||||
#mod by ʟօʊքɢǟʀօʊ
|
#mod by ʟօʊքɢǟʀօʊ
|
||||||
#export replays to mods folder and share with your friends or have a backup
|
#export replays to mods folder and share with your friends or have a backup
|
||||||
|
|
||||||
|
|
||||||
def Print(*args,color=None,top=None):
|
def Print(*args,color=None,top=None):
|
||||||
out=""
|
out=""
|
||||||
for arg in args:
|
for arg in args:
|
||||||
|
|
@ -22,7 +21,6 @@ def Print(*args, color=None, top=None):
|
||||||
out += a
|
out += a
|
||||||
ba.screenmessage(out,color=color,top=top)
|
ba.screenmessage(out,color=color,top=top)
|
||||||
|
|
||||||
|
|
||||||
def cprint(*args):
|
def cprint(*args):
|
||||||
out=""
|
out=""
|
||||||
for arg in args:
|
for arg in args:
|
||||||
|
|
@ -30,7 +28,6 @@ def cprint(*args):
|
||||||
out += a
|
out += a
|
||||||
_ba.chatmessage(out)
|
_ba.chatmessage(out)
|
||||||
|
|
||||||
|
|
||||||
internal_dir="/data/data/net.froemling.bombsquad/files/bombsquad_config/replays"
|
internal_dir="/data/data/net.froemling.bombsquad/files/bombsquad_config/replays"
|
||||||
external_dir="/storage/emulated/0/Android/data/net.froemling.bombsquad/files/mods/replays"
|
external_dir="/storage/emulated/0/Android/data/net.froemling.bombsquad/files/mods/replays"
|
||||||
#colors
|
#colors
|
||||||
|
|
@ -44,7 +41,6 @@ try:
|
||||||
except FileExistsError:
|
except FileExistsError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class Help(PopupWindow):
|
class Help(PopupWindow):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
uiscale = ba.app.ui.uiscale
|
uiscale = ba.app.ui.uiscale
|
||||||
|
|
@ -57,8 +53,7 @@ class Help(PopupWindow):
|
||||||
scale=1.2,)
|
scale=1.2,)
|
||||||
|
|
||||||
ba.containerwidget(edit=self.root_widget,on_outside_click_call=self.close)
|
ba.containerwidget(edit=self.root_widget,on_outside_click_call=self.close)
|
||||||
ba.textwidget(parent=self.root_widget, position=(0, self.height * 0.6),
|
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")
|
||||||
text=f"•Replays are exported to\n {external_dir}\n•Importing replay and other features comming in v1.2")
|
|
||||||
|
|
||||||
def close(self):
|
def close(self):
|
||||||
ba.playsound(ba.getsound('swish'))
|
ba.playsound(ba.getsound('swish'))
|
||||||
|
|
@ -80,8 +75,7 @@ class SettingWindow():
|
||||||
|
|
||||||
def draw_ui(self):
|
def draw_ui(self):
|
||||||
self.uiscale = ba.app.ui.uiscale
|
self.uiscale = ba.app.ui.uiscale
|
||||||
self.root = ba.Window(ba.containerwidget(
|
self.root=ba.Window(ba.containerwidget(size=(900, 670),on_outside_click_call=self.close,transition="in_right")).get_root_widget()
|
||||||
size=(900, 670), on_outside_click_call=self.close, transition="in_right")).get_root_widget()
|
|
||||||
|
|
||||||
ba.textwidget(
|
ba.textwidget(
|
||||||
parent=self.root,
|
parent=self.root,
|
||||||
|
|
@ -113,8 +107,8 @@ class SettingWindow():
|
||||||
parent=self.root,
|
parent=self.root,
|
||||||
position=(820, 590),
|
position=(820, 590),
|
||||||
size=(35, 35),
|
size=(35, 35),
|
||||||
icon=ba.gettexture("crossOut"),
|
texture=ba.gettexture("crossOut"),
|
||||||
icon_color=(1, 0.2, 0.2),
|
label="",
|
||||||
scale=2,
|
scale=2,
|
||||||
color=(1, 0.2, 0.2),
|
color=(1, 0.2, 0.2),
|
||||||
extra_touch_border_scale=3,
|
extra_touch_border_scale=3,
|
||||||
|
|
@ -124,8 +118,7 @@ class SettingWindow():
|
||||||
parent=self.root,
|
parent=self.root,
|
||||||
size=(500,400),
|
size=(500,400),
|
||||||
position=(200,150))
|
position=(200,150))
|
||||||
self.scroll = ba.columnwidget(parent=scroll, size=(
|
self.scroll=ba.columnwidget(parent=scroll,size=(500,900),selection_loops_to_parent=True,single_depth=True)
|
||||||
500, 900), selection_loops_to_parent=True, single_depth=True)
|
|
||||||
|
|
||||||
height=900
|
height=900
|
||||||
for i in listdir(internal_dir):
|
for i in listdir(internal_dir):
|
||||||
|
|
@ -142,13 +135,13 @@ class SettingWindow():
|
||||||
|
|
||||||
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):
|
def export(self):
|
||||||
if self.selected_name is None:
|
if self.selected_name is None:
|
||||||
Print("Select a replay",color=red)
|
Print("Select a replay",color=red)
|
||||||
return
|
return
|
||||||
copy(internal_dir+"/"+self.selected_name,external_dir+"/"+self.selected_name)
|
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)#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):
|
def close(self):
|
||||||
ba.playsound(ba.getsound('swish'))
|
ba.playsound(ba.getsound('swish'))
|
||||||
|
|
@ -163,7 +156,6 @@ class SettingWindow():
|
||||||
|
|
||||||
ww.__old_init__=ww.__init__
|
ww.__old_init__=ww.__init__
|
||||||
|
|
||||||
|
|
||||||
def new_init(self,transition="in_right",origin_widget=None):
|
def new_init(self,transition="in_right",origin_widget=None):
|
||||||
self.__old_init__(transition,origin_widget)
|
self.__old_init__(transition,origin_widget)
|
||||||
self._share_button = ba.buttonwidget(
|
self._share_button = ba.buttonwidget(
|
||||||
|
|
@ -190,3 +182,5 @@ class main(ba.Plugin):
|
||||||
|
|
||||||
def show_settings_ui(self,button):
|
def show_settings_ui(self,button):
|
||||||
SettingWindow()
|
SettingWindow()
|
||||||
|
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue