mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-07 16:13:23 +08:00
Update edit.py
This commit is contained in:
parent
3703b406e2
commit
426798a9d9
@ -516,6 +516,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
self._update_character()
|
self._update_character()
|
||||||
|
|
||||||
def assign_random_name(self) -> None:
|
def assign_random_name(self) -> None:
|
||||||
|
"""Assigning a random name to the player."""
|
||||||
names = bs.get_random_names()
|
names = bs.get_random_names()
|
||||||
name = names[random.randrange(len(names))]
|
name = names[random.randrange(len(names))]
|
||||||
bui.textwidget(
|
bui.textwidget(
|
||||||
@ -524,7 +525,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def upgrade_profile(self) -> None:
|
def upgrade_profile(self) -> None:
|
||||||
"""Attempt to ugrade the profile to global."""
|
"""Attempt to upgrade the profile to global."""
|
||||||
from bauiv1lib import account
|
from bauiv1lib import account
|
||||||
from bauiv1lib.profile import upgrade as pupgrade
|
from bauiv1lib.profile import upgrade as pupgrade
|
||||||
|
|
||||||
@ -744,10 +745,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if len(name) > 10 and not (self._global or self._is_account_profile):
|
if len(name) > 10 and not (self._global or self._is_account_profile):
|
||||||
name = name.strip()
|
name = name.strip()
|
||||||
display_name = ((name[:10] + '...')
|
display_name = (name[:10] + '...') if len(name) > 10 else name
|
||||||
if len(name) > 10
|
|
||||||
else name
|
|
||||||
)
|
|
||||||
bui.textwidget(
|
bui.textwidget(
|
||||||
edit=self._clipped_name_text,
|
edit=self._clipped_name_text,
|
||||||
text=bui.Lstr(
|
text=bui.Lstr(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user