mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-10-08 14:54:36 +00:00
[ci] auto-format
This commit is contained in:
parent
7666f31a63
commit
ed88413c43
1 changed files with 37 additions and 27 deletions
|
|
@ -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)
|
||||
|
|
@ -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):
|
||||
from bauiv1lib.gather import GatherWindow
|
||||
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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue