mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-26 17:03:14 +08:00
Edit manualtab.py
This commit is contained in:
parent
eae497b1bc
commit
08b1656ad5
@ -456,6 +456,24 @@ class ManualGatherTab(GatherTab):
|
||||
claims_left_right=True,
|
||||
)
|
||||
|
||||
self._no_parties_added_text = bui.textwidget(
|
||||
parent=self._container,
|
||||
size=(0, 0),
|
||||
h_align='center',
|
||||
v_align='center',
|
||||
text='',
|
||||
color=(0.6, 0.6, 0.6),
|
||||
scale=1.2,
|
||||
position=(
|
||||
(
|
||||
(190 if uiscale is bui.UIScale.SMALL else 225)
|
||||
+ sub_scroll_width * 0.5
|
||||
),
|
||||
v + sub_scroll_height * 0.5
|
||||
),
|
||||
glow_type='uniform',
|
||||
)
|
||||
|
||||
self._favorite_selected = None
|
||||
self._refresh_favorites()
|
||||
|
||||
@ -698,6 +716,12 @@ class ManualGatherTab(GatherTab):
|
||||
|
||||
assert self._favorites_scroll_width is not None
|
||||
assert self._favorites_connect_button is not None
|
||||
|
||||
bui.textwidget(
|
||||
edit=self._no_parties_added_text,
|
||||
text='',
|
||||
)
|
||||
num_of_fav = 0
|
||||
for i, server in enumerate(servers):
|
||||
txt = bui.textwidget(
|
||||
parent=self._columnwidget,
|
||||
@ -726,6 +750,7 @@ class ManualGatherTab(GatherTab):
|
||||
left_widget=self._favorites_connect_button,
|
||||
right_widget=txt,
|
||||
)
|
||||
num_of_fav = num_of_fav + 1
|
||||
|
||||
# If there's no servers, allow selecting out of the scroll area
|
||||
bui.containerwidget(
|
||||
@ -738,6 +763,11 @@ class ManualGatherTab(GatherTab):
|
||||
up_widget=self._favorites_text,
|
||||
left_widget=self._favorites_connect_button,
|
||||
)
|
||||
if num_of_fav == 0:
|
||||
bui.textwidget(
|
||||
edit=self._no_parties_added_text,
|
||||
text='No Parties Added',
|
||||
)
|
||||
|
||||
def on_deactivate(self) -> None:
|
||||
self._access_check_timer = None
|
||||
@ -804,10 +834,7 @@ class ManualGatherTab(GatherTab):
|
||||
config.commit()
|
||||
bui.getsound('gunCocking').play()
|
||||
else:
|
||||
bui.screenmessage(
|
||||
bui.Lstr(resource='internal.invalidAddressErrorText'),
|
||||
color=(1, 0, 0),
|
||||
)
|
||||
bui.screenmessage('Invalid Address', color=(1, 0, 0))
|
||||
bui.getsound('error').play()
|
||||
|
||||
def _host_lookup_result(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user