[ci] auto-format

This commit is contained in:
imayushsaini 2023-07-08 10:24:14 +00:00 committed by github-actions[bot]
parent 7666f31a63
commit ed88413c43

View file

@ -18,6 +18,8 @@ import bascenev1 as bs
current_server_ip = "127.0.0.1"
current_server_port = 43210
servers = []
def _refresh_in_game(func):
def wrapper(self, *args, **kwargs):
returnValue = func(self, *args, **kwargs)
@ -39,7 +41,7 @@ def _refresh_in_game(func):
parent=self._root_widget,
draw_controller=None,
text="IP: "+current_server_ip+" PORT: "+str(current_server_port),
position=(h-self._button_width/2 + 130 , v+60),
position=(h-self._button_width/2 + 130, v+60),
h_align='center',
v_align='center',
size=(20, 60),
@ -57,7 +59,7 @@ def _refresh_in_game(func):
self._server_button = bui.buttonwidget(
color=(0.8, 0, 1),
parent=self._root_widget,
position=( (h- self._button_width / 2 ) + self._button_width + 20, v),
position=((h - self._button_width / 2) + self._button_width + 20, v),
size=(self._button_width, self._button_height),
scale=1.0,
autoselect=self._use_autoselect,
@ -69,7 +71,10 @@ def _refresh_in_game(func):
return returnValue
return wrapper
connect = bs.connect_to_party
def connect_to_party(address, port=43210, print_progress=False):
global current_server_ip
global current_server_port
@ -80,6 +85,7 @@ def connect_to_party(address, port=43210, print_progress=False):
connect(address, port, print_progress)
babase.apptimer(1, check_connect_status)
def check_connect_status():
global servers
global current_server_ip
@ -88,7 +94,8 @@ def check_connect_status():
if (not bs.get_connection_to_host_info()['name']):
babase.apptimer(1, check_connect_status)
return
new_server = {"name": bs.get_connection_to_host_info()['name'], "ip": current_server_ip, "port": current_server_port}
new_server = {"name": bs.get_connection_to_host_info(
)['name'], "ip": current_server_ip, "port": current_server_port}
if new_server not in servers:
servers.append(new_server)
servers = servers[-3:]
@ -96,13 +103,16 @@ def check_connect_status():
print("connection failed falling back to gather window")
public_servers()
def public_servers(origin = None):
def public_servers(origin=None):
from bauiv1lib.gather import GatherWindow
bui.app.ui_v1.set_main_menu_window( GatherWindow(origin_widget=origin).get_root_widget())
bui.app.ui_v1.set_main_menu_window(GatherWindow(origin_widget=origin).get_root_widget())
# ba_meta export plugin
class bySmoothy(babase.Plugin):
def __init__(self):
bastd_ui_mainmenu.MainMenuWindow._refresh_in_game = _refresh_in_game(bastd_ui_mainmenu.MainMenuWindow._refresh_in_game)
bastd_ui_mainmenu.MainMenuWindow._refresh_in_game = _refresh_in_game(
bastd_ui_mainmenu.MainMenuWindow._refresh_in_game)
bs.connect_to_party = connect_to_party