Update edit.py

This commit is contained in:
Vishal 2023-11-23 17:53:29 +05:30 committed by GitHub
parent 3703b406e2
commit 426798a9d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(