2025-01-21 23:24:35 +05:30
|
|
|
# ba_meta require api 9
|
2024-05-16 18:44:57 +03:00
|
|
|
import bascenev1 as bs
|
|
|
|
|
from babase import Plugin as v
|
2024-05-16 16:07:23 +00:00
|
|
|
from bauiv1 import buttonwidget as z, gettexture as x
|
2025-01-21 23:24:35 +05:30
|
|
|
from bauiv1lib.ingamemenu import InGameMenuWindow as m
|
2024-05-16 18:44:57 +03:00
|
|
|
|
2024-05-16 16:07:23 +00:00
|
|
|
m.i = m.p = 0
|
|
|
|
|
k = bs.connect_to_party
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def j(address, port=43210, print_progress=False):
|
|
|
|
|
try:
|
2025-01-25 20:50:52 +05:30
|
|
|
if bool(bs.get_connection_to_host_info_2()):
|
2025-01-21 23:24:35 +05:30
|
|
|
bs.disconnect_from_host()
|
2024-05-16 16:07:23 +00:00
|
|
|
except:
|
|
|
|
|
pass
|
2025-01-25 20:50:52 +05:30
|
|
|
m.i = address
|
|
|
|
|
m.p = port
|
|
|
|
|
k(m.i, m.p, print_progress)
|
2024-05-16 16:07:23 +00:00
|
|
|
|
|
|
|
|
|
2024-05-16 18:44:57 +03:00
|
|
|
def R(s):
|
2024-05-16 16:07:23 +00:00
|
|
|
def w(t, *f, **g):
|
|
|
|
|
z(parent=t._root_widget, size=(23, 26), icon=x('replayIcon'),
|
|
|
|
|
on_activate_call=bs.Call(j, m.i, m.p))
|
|
|
|
|
return s(t, *f, **g)
|
2024-05-16 18:44:57 +03:00
|
|
|
return w
|
|
|
|
|
|
2025-06-24 00:55:09 +05:30
|
|
|
# ba_meta export babase.Plugin
|
2024-05-16 18:44:57 +03:00
|
|
|
class byBordd(v):
|
|
|
|
|
def __init__(s):
|
2024-05-16 16:07:23 +00:00
|
|
|
m._refresh_in_game = R(m._refresh_in_game)
|
2025-01-25 20:51:53 +05:30
|
|
|
bs.connect_to_party = j
|