mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
[ci] auto-format
This commit is contained in:
parent
c2832136aa
commit
b9b4944285
4 changed files with 233 additions and 226 deletions
|
|
@ -55,7 +55,6 @@ from bascenev1 import _lobby
|
||||||
from bascenev1lib.actor.spazappearance import *
|
from bascenev1lib.actor.spazappearance import *
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, vpos: float, sessionplayer: bs.SessionPlayer,
|
def __init__(self, vpos: float, sessionplayer: bs.SessionPlayer,
|
||||||
lobby: 'Lobby') -> None:
|
lobby: 'Lobby') -> None:
|
||||||
self._deek_sound = bs.getsound('deek')
|
self._deek_sound = bs.getsound('deek')
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,6 @@ def is_game_version_lower_than(version):
|
||||||
return game_version < version
|
return game_version < version
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def updateBannedServersCache():
|
def updateBannedServersCache():
|
||||||
response = None
|
response = None
|
||||||
config = babase.app.config
|
config = babase.app.config
|
||||||
|
|
@ -327,7 +326,6 @@ def _clear(self) -> None:
|
||||||
widget.delete()
|
widget.delete()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def update(self, index: int, party: PartyEntry, sub_scroll_width: float,
|
def update(self, index: int, party: PartyEntry, sub_scroll_width: float,
|
||||||
sub_scroll_height: float, lineheight: float,
|
sub_scroll_height: float, lineheight: float,
|
||||||
columnwidget: bui.Widget, join_text: bui.Widget,
|
columnwidget: bui.Widget, join_text: bui.Widget,
|
||||||
|
|
@ -455,6 +453,7 @@ def update(self, index: int, party: PartyEntry, sub_scroll_width: float,
|
||||||
|
|
||||||
party.clean_display_index = index
|
party.clean_display_index = index
|
||||||
|
|
||||||
|
|
||||||
def _get_popup_window_scale() -> float:
|
def _get_popup_window_scale() -> float:
|
||||||
uiscale = bui.app.ui_v1.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
return (2.3 if uiscale is babase.UIScale.SMALL else
|
return (2.3 if uiscale is babase.UIScale.SMALL else
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ import _baplus
|
||||||
import babase
|
import babase
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
original_get_purchased = _baplus.get_purchased
|
original_get_purchased = _baplus.get_purchased
|
||||||
|
|
||||||
|
|
||||||
def get_purchased(item):
|
def get_purchased(item):
|
||||||
if item.startswith('characters.') or item.startswith('icons.'):
|
if item.startswith('characters.') or item.startswith('icons.'):
|
||||||
return original_get_purchased(item)
|
return original_get_purchased(item)
|
||||||
|
|
@ -18,4 +18,3 @@ class Unlock(babase.Plugin):
|
||||||
def on_app_running(self):
|
def on_app_running(self):
|
||||||
babase.app.classic.accounts.have_pro = lambda: True
|
babase.app.classic.accounts.have_pro = lambda: True
|
||||||
_baplus.get_purchased = get_purchased
|
_baplus.get_purchased = get_purchased
|
||||||
|
|
||||||
|
|
@ -18,6 +18,8 @@ import bascenev1 as bs
|
||||||
current_server_ip = "127.0.0.1"
|
current_server_ip = "127.0.0.1"
|
||||||
current_server_port = 43210
|
current_server_port = 43210
|
||||||
servers = []
|
servers = []
|
||||||
|
|
||||||
|
|
||||||
def _refresh_in_game(func):
|
def _refresh_in_game(func):
|
||||||
def wrapper(self, *args, **kwargs):
|
def wrapper(self, *args, **kwargs):
|
||||||
returnValue = func(self, *args, **kwargs)
|
returnValue = func(self, *args, **kwargs)
|
||||||
|
|
@ -39,7 +41,7 @@ def _refresh_in_game(func):
|
||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
draw_controller=None,
|
draw_controller=None,
|
||||||
text="IP: "+current_server_ip+" PORT: "+str(current_server_port),
|
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',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
size=(20, 60),
|
size=(20, 60),
|
||||||
|
|
@ -57,7 +59,7 @@ def _refresh_in_game(func):
|
||||||
self._server_button = bui.buttonwidget(
|
self._server_button = bui.buttonwidget(
|
||||||
color=(0.8, 0, 1),
|
color=(0.8, 0, 1),
|
||||||
parent=self._root_widget,
|
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),
|
size=(self._button_width, self._button_height),
|
||||||
scale=1.0,
|
scale=1.0,
|
||||||
autoselect=self._use_autoselect,
|
autoselect=self._use_autoselect,
|
||||||
|
|
@ -69,7 +71,10 @@ def _refresh_in_game(func):
|
||||||
return returnValue
|
return returnValue
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
connect = bs.connect_to_party
|
connect = bs.connect_to_party
|
||||||
|
|
||||||
|
|
||||||
def connect_to_party(address, port=43210, print_progress=False):
|
def connect_to_party(address, port=43210, print_progress=False):
|
||||||
global current_server_ip
|
global current_server_ip
|
||||||
global current_server_port
|
global current_server_port
|
||||||
|
|
@ -80,6 +85,7 @@ def connect_to_party(address, port=43210, print_progress=False):
|
||||||
connect(address, port, print_progress)
|
connect(address, port, print_progress)
|
||||||
babase.apptimer(1, check_connect_status)
|
babase.apptimer(1, check_connect_status)
|
||||||
|
|
||||||
|
|
||||||
def check_connect_status():
|
def check_connect_status():
|
||||||
global servers
|
global servers
|
||||||
global current_server_ip
|
global current_server_ip
|
||||||
|
|
@ -88,7 +94,8 @@ def check_connect_status():
|
||||||
if (not bs.get_connection_to_host_info()['name']):
|
if (not bs.get_connection_to_host_info()['name']):
|
||||||
babase.apptimer(1, check_connect_status)
|
babase.apptimer(1, check_connect_status)
|
||||||
return
|
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:
|
if new_server not in servers:
|
||||||
servers.append(new_server)
|
servers.append(new_server)
|
||||||
servers = servers[-3:]
|
servers = servers[-3:]
|
||||||
|
|
@ -96,13 +103,16 @@ def check_connect_status():
|
||||||
print("connection failed falling back to gather window")
|
print("connection failed falling back to gather window")
|
||||||
public_servers()
|
public_servers()
|
||||||
|
|
||||||
def public_servers(origin = None):
|
|
||||||
|
def public_servers(origin=None):
|
||||||
from bauiv1lib.gather import GatherWindow
|
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
|
# ba_meta export plugin
|
||||||
|
|
||||||
|
|
||||||
class bySmoothy(babase.Plugin):
|
class bySmoothy(babase.Plugin):
|
||||||
def __init__(self):
|
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
|
bs.connect_to_party = connect_to_party
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue