From de698f607f15fece97ea71b66453c35c5620a315 Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 13 Nov 2023 13:09:50 +0530 Subject: [PATCH 01/32] Edit plugins.py --- .../python/bauiv1lib/settings/plugins.py | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/assets/ba_data/python/bauiv1lib/settings/plugins.py b/src/assets/ba_data/python/bauiv1lib/settings/plugins.py index 5f22847b3..abc645e20 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/plugins.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/plugins.py @@ -129,6 +129,15 @@ def __init__( settings_button_x = 670 if uiscale is bui.UIScale.SMALL else 570 + self._num_plugins_text = bui.textwidget( + parent=self._root_widget, + position=(settings_button_x - 130, self._height - 38), + size=(0, 0), + text='', + h_align='center', + v_align='center', + ) + self._category_button = bui.buttonwidget( parent=self._root_widget, scale=0.7, @@ -174,6 +183,17 @@ def __init__( ) bui.widget(edit=self._scrollwidget, right_widget=self._scrollwidget) + self._no_plugins_installed_text = bui.textwidget( + parent=self._root_widget, + position=(self._width * 0.5, self._height * 0.5), + size=(0, 0), + text='', + color=(0.6, 0.6, 0.6), + scale=0.8, + h_align='center', + v_align='center', + ) + if bui.app.meta.scanresults is None: bui.screenmessage( 'Still scanning plugins; please try again.', color=(1, 0, 0) @@ -274,6 +294,11 @@ def _show_plugins(self) -> None: plugspecs_sorted = sorted(plugspecs.items()) + bui.textwidget( + edit=self._no_plugins_installed_text, + text='', + ) + for _classpath, plugspec in plugspecs_sorted: # counting number of enabled and disabled plugins # plugstate = plugstates.setdefault(plugspec[0], {}) @@ -372,6 +397,17 @@ def _show_plugins(self) -> None: bui.widget(edit=check, show_buffer_top=40, show_buffer_bottom=40) num_shown += 1 + bui.textwidget( + edit=self._num_plugins_text, + text=str(num_shown), + ) + + if num_shown == 0: + bui.textwidget( + edit=self._no_plugins_installed_text, + text='No Plugins Installed', + ) + def _save_state(self) -> None: try: sel = self._root_widget.get_selected_child() From f1a80d2acab2d43c698b3172bee22374b108156d Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 13 Nov 2023 13:14:23 +0530 Subject: [PATCH 02/32] Update plugins.py --- src/assets/ba_data/python/bauiv1lib/settings/plugins.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/ba_data/python/bauiv1lib/settings/plugins.py b/src/assets/ba_data/python/bauiv1lib/settings/plugins.py index abc645e20..339e334c1 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/plugins.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/plugins.py @@ -405,7 +405,7 @@ def _show_plugins(self) -> None: if num_shown == 0: bui.textwidget( edit=self._no_plugins_installed_text, - text='No Plugins Installed', + text=bui.Lstr(resource='noPluginsInstalledText'), ) def _save_state(self) -> None: From c7500773bdeed3cda7eb54992ad88057d7f49bb3 Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 13 Nov 2023 13:27:57 +0530 Subject: [PATCH 03/32] Update plugins.py --- src/assets/ba_data/python/bauiv1lib/settings/plugins.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/assets/ba_data/python/bauiv1lib/settings/plugins.py b/src/assets/ba_data/python/bauiv1lib/settings/plugins.py index 339e334c1..d035f11b3 100644 --- a/src/assets/ba_data/python/bauiv1lib/settings/plugins.py +++ b/src/assets/ba_data/python/bauiv1lib/settings/plugins.py @@ -283,6 +283,7 @@ def _clear_scroll_widget(self) -> None: def _show_plugins(self) -> None: # pylint: disable=too-many-locals # pylint: disable=too-many-branches + # pylint: disable=too-many-statements plugspecs = bui.app.plugins.plugin_specs plugstates: dict[str, dict] = bui.app.config.setdefault('Plugins', {}) assert isinstance(plugstates, dict) @@ -401,7 +402,7 @@ def _show_plugins(self) -> None: edit=self._num_plugins_text, text=str(num_shown), ) - + if num_shown == 0: bui.textwidget( edit=self._no_plugins_installed_text, From 4f28bf0198e0af31b09cc5d56f16c844cb13d9b4 Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 13 Nov 2023 16:37:24 +0530 Subject: [PATCH 04/32] Update manualtab.py --- src/assets/ba_data/python/bauiv1lib/gather/manualtab.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py index 3202d812b..69baf8775 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py @@ -801,7 +801,10 @@ def _save_server( config.commit() bui.getsound('gunCocking').play() else: - bui.screenmessage('Invalid Address', color=(1, 0, 0)) + bui.screenmessage( + bui.Lstr(resource='internal.invalidAddressErrorText'), + color=(1, 0, 0), + ) bui.getsound('error').play() def _host_lookup_result( From 716d01487fada29c61088782f8495e95af394a53 Mon Sep 17 00:00:00 2001 From: Vishal Date: Wed, 15 Nov 2023 14:10:33 +0530 Subject: [PATCH 05/32] Update party.py --- src/assets/ba_data/python/bauiv1lib/party.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/party.py b/src/assets/ba_data/python/bauiv1lib/party.py index 5920c2d85..5fa2bddd9 100644 --- a/src/assets/ba_data/python/bauiv1lib/party.py +++ b/src/assets/ba_data/python/bauiv1lib/party.py @@ -40,6 +40,7 @@ def __init__(self, origin: Sequence[float] = (0, 0)): if uiscale is bui.UIScale.MEDIUM else 600 ) + self._display_old_msgs = True super().__init__( root_widget=bui.containerwidget( size=(self._width, self._height), @@ -142,12 +143,6 @@ def __init__(self, origin: Sequence[float] = (0, 0)): ) self._chat_texts: list[bui.Widget] = [] - # add all existing messages if chat is not muted - if not bui.app.config.resolve('Chat Muted'): - msgs = bs.get_chat_messages() - for msg in msgs: - self._add_msg(msg) - self._text_field = txt = bui.textwidget( parent=self._root_widget, editable=True, @@ -269,6 +264,12 @@ def _update(self) -> None: first.delete() else: bui.textwidget(edit=self._muted_text, color=(1, 1, 1, 0.0)) + # add all existing messages if chat is not muted + if self._display_old_msgs: + msgs = bs.get_chat_messages() + for msg in msgs: + self._add_msg(msg) + self._display_old_msgs = False # update roster section roster = bs.get_game_roster() @@ -466,6 +467,7 @@ def popup_menu_selected_choice( cfg = bui.app.config cfg['Chat Muted'] = choice == 'mute' cfg.apply_and_commit() + self._display_old_msgs = True self._update() else: print(f'unhandled popup type: {self._popup_type}') From abab49761f62235b474d2d90f1f75e4245845577 Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 16 Nov 2023 17:29:19 +0530 Subject: [PATCH 06/32] Edit party.py --- src/assets/ba_data/python/bauiv1lib/party.py | 91 +++++++++++++++++++- 1 file changed, 88 insertions(+), 3 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/party.py b/src/assets/ba_data/python/bauiv1lib/party.py index 5fa2bddd9..abb7702ea 100644 --- a/src/assets/ba_data/python/bauiv1lib/party.py +++ b/src/assets/ba_data/python/bauiv1lib/party.py @@ -237,11 +237,12 @@ def _on_menu_button_press(self) -> None: if uiscale is bui.UIScale.MEDIUM else 1.23 ), - choices=['unmute' if is_muted else 'mute'], + choices=['unmute' if is_muted else 'mute', 'add_to_favorites'], choices_display=[ bui.Lstr( resource='chatUnMuteText' if is_muted else 'chatMuteText' - ) + ), + bui.Lstr(value='Add to Favorites') ], current_choice='unmute' if is_muted else 'mute', delegate=self, @@ -469,9 +470,93 @@ def popup_menu_selected_choice( cfg.apply_and_commit() self._display_old_msgs = True self._update() + if choice == 'add_to_favorites': + plus = bui.app.plus + assert plus is not None + + if plus.get_v1_account_state() == 'signed_in': + plus.add_v1_account_transaction( + { + 'type': 'PUBLIC_PARTY_QUERY', + 'proto': bs.protocol_version(), + 'lang': bui.app.lang.language, + }, + callback=bui.WeakCall(self._add_to_favorites), + ) + plus.run_v1_account_transactions() + else: + self._add_to_favorites(None) + else: print(f'unhandled popup type: {self._popup_type}') + def _add_to_favorites(self, result: dict[str, Any] | None) -> None: + if result is None: + return + + parties_in = result['l'] + + assert isinstance(parties_in, list) + info = bs.get_connection_to_host_info() + + if info.get('name', '') != '': + title = info['name'] + else: + return + + for party_in in parties_in: + server_name = party_in['n'] + if server_name == title: + assert isinstance(party_in['a'], str) + assert isinstance(party_in['p'], int) + self._save_server(title, party_in['a'], party_in['p']) + return + + def _save_server( + self, + name_text: str, + address: str, + port_num: int + ) -> None: + addr = address + if addr == '': + bui.screenmessage( + bui.Lstr(resource='internal.invalidAddressErrorText'), + color=(1, 0, 0), + ) + bui.getsound('error').play() + return + try: + port = port_num + except ValueError: + port = -1 + if port > 65535 or port < 0: + bui.screenmessage( + bui.Lstr(resource='internal.invalidPortErrorText'), + color=(1, 0, 0), + ) + bui.getsound('error').play() + return + config = bui.app.config + + if addr: + if not isinstance(config.get('Saved Servers'), dict): + config['Saved Servers'] = {} + config['Saved Servers'][f'{addr}@{port}'] = { + 'addr': addr, + 'port': port, + 'name': name_text, + } + config.commit() + bui.getsound('gunCocking').play() + bui.screenmessage('Added to Favourites') + else: + bui.screenmessage( + bui.Lstr(resource='internal.invalidAddressErrorText'), + color=(1, 0, 0), + ) + bui.getsound('error').play() + def popup_menu_closing(self, popup_window: PopupWindow) -> None: """Called when the popup is closing.""" @@ -517,4 +602,4 @@ def close(self) -> None: def close_with_sound(self) -> None: """Close the window and make a lovely sound.""" bui.getsound('swish').play() - self.close() + self.close() \ No newline at end of file From 5f70cd864a4540d8cbbc5994b731dc73d5bc3005 Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 16 Nov 2023 17:31:33 +0530 Subject: [PATCH 07/32] Update party.py --- src/assets/ba_data/python/bauiv1lib/party.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/party.py b/src/assets/ba_data/python/bauiv1lib/party.py index abb7702ea..faa69fc56 100644 --- a/src/assets/ba_data/python/bauiv1lib/party.py +++ b/src/assets/ba_data/python/bauiv1lib/party.py @@ -242,7 +242,7 @@ def _on_menu_button_press(self) -> None: bui.Lstr( resource='chatUnMuteText' if is_muted else 'chatMuteText' ), - bui.Lstr(value='Add to Favorites') + bui.Lstr(resource='addToFavoritesText') ], current_choice='unmute' if is_muted else 'mute', delegate=self, @@ -602,4 +602,4 @@ def close(self) -> None: def close_with_sound(self) -> None: """Close the window and make a lovely sound.""" bui.getsound('swish').play() - self.close() \ No newline at end of file + self.close() From 34cd8ab5b8afbd8f91219d43f1c128073ce60ed3 Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 16 Nov 2023 18:09:01 +0530 Subject: [PATCH 08/32] Update party.py From eae497b1bc3b3bd297c58dc325a838fedda4d5a5 Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 16 Nov 2023 18:29:19 +0530 Subject: [PATCH 09/32] Update party.py --- src/assets/ba_data/python/bauiv1lib/party.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/assets/ba_data/python/bauiv1lib/party.py b/src/assets/ba_data/python/bauiv1lib/party.py index faa69fc56..81720f1a1 100644 --- a/src/assets/ba_data/python/bauiv1lib/party.py +++ b/src/assets/ba_data/python/bauiv1lib/party.py @@ -549,7 +549,10 @@ def _save_server( } config.commit() bui.getsound('gunCocking').play() - bui.screenmessage('Added to Favourites') + bui.screenmessage( + bui.Lstr(resource='addedToFavouritesText'), + color=(0, 1, 0), + ) else: bui.screenmessage( bui.Lstr(resource='internal.invalidAddressErrorText'), From 08b1656ad5553373ce980666f4e88446374bc779 Mon Sep 17 00:00:00 2001 From: Vishal Date: Sat, 18 Nov 2023 16:45:27 +0530 Subject: [PATCH 10/32] Edit manualtab.py --- .../python/bauiv1lib/gather/manualtab.py | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py index 6f91eeb79..00a913c60 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py @@ -456,6 +456,24 @@ def _build_favorites_tab(self, region_height: float) -> None: 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 @@ def _refresh_favorites(self) -> None: 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 @@ def _refresh_favorites(self) -> None: 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 @@ def _refresh_favorites(self) -> None: 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 @@ def _save_server( 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( From 30ee6ea7dc72fb8b8c92c1f4654a9eec1ba15004 Mon Sep 17 00:00:00 2001 From: Vishal Date: Sat, 18 Nov 2023 16:54:21 +0530 Subject: [PATCH 11/32] Update manualtab.py --- src/assets/ba_data/python/bauiv1lib/gather/manualtab.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py index 00a913c60..8adaba4fa 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py @@ -99,6 +99,7 @@ def __init__(self, window: GatherWindow) -> None: self._party_edit_name_text: bui.Widget | None = None self._party_edit_addr_text: bui.Widget | None = None self._party_edit_port_text: bui.Widget | None = None + self._no_parties_added_text: bui.Widget | None = None def on_activate( self, @@ -834,7 +835,10 @@ def _save_server( config.commit() bui.getsound('gunCocking').play() else: - bui.screenmessage('Invalid Address', color=(1, 0, 0)) + bui.screenmessage( + bui.Lstr(resource='internal.invalidAddressErrorText'), + color=(1, 0, 0), + ) bui.getsound('error').play() def _host_lookup_result( From 0349fa4dfdb2b6617c2d5da3fc9688cec034e312 Mon Sep 17 00:00:00 2001 From: Vishal Date: Sat, 18 Nov 2023 17:04:25 +0530 Subject: [PATCH 12/32] Update manualtab.py --- src/assets/ba_data/python/bauiv1lib/gather/manualtab.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py index 8adaba4fa..8774939b1 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py @@ -767,7 +767,7 @@ def _refresh_favorites(self) -> None: if num_of_fav == 0: bui.textwidget( edit=self._no_parties_added_text, - text='No Parties Added', + text=bui.Lstr(resource='noPartiesAddedText'), ) def on_deactivate(self) -> None: From 4a75399f3ed0f0e532a6b474911be958bc183fad Mon Sep 17 00:00:00 2001 From: Vishal Date: Tue, 21 Nov 2023 16:08:03 +0530 Subject: [PATCH 13/32] Edit browser.py --- .../python/bauiv1lib/profile/browser.py | 61 +++++++++++++++---- 1 file changed, 50 insertions(+), 11 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/profile/browser.py b/src/assets/ba_data/python/bauiv1lib/profile/browser.py index 0fc51e144..28111956e 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/browser.py @@ -197,9 +197,11 @@ def __init__( bui.containerwidget( edit=self._root_widget, selected_child=self._scrollwidget ) - self._columnwidget = bui.columnwidget( - parent=self._scrollwidget, border=2, margin=0 - ) + self._subcontainer = bui.containerwidget( + parent=self._scrollwidget, + size=(self._scroll_width, 32), + background=False, + ) v -= 255 self._profiles: dict[str, dict[str, Any]] | None = None self._selected_profile = selected_profile @@ -344,6 +346,7 @@ def _refresh(self) -> None: # pylint: disable=too-many-locals from efro.util import asserttype from bascenev1 import PlayerProfilesChangedMessage + from bascenev1lib.actor import spazappearance assert bui.app.classic is not None @@ -359,14 +362,27 @@ def _refresh(self) -> None: assert self._profiles is not None items = list(self._profiles.items()) items.sort(key=lambda x: asserttype(x[0], str).lower()) + spazzes = spazappearance.get_appearances() + spazzes.sort() + icon_textures = [ + bui.gettexture(bui.app.classic.spaz_appearances[s].icon_texture) + for s in spazzes + ] + icon_tint_textures = [ + bui.gettexture( + bui.app.classic.spaz_appearances[s].icon_mask_texture + ) + for s in spazzes + ] index = 0 + y_val = 35 * (len(self._profiles) - 1) account_name: str | None if plus.get_v1_account_state() == 'signed_in': account_name = plus.get_v1_account_display_string() else: account_name = None - widget_to_select = None - for p_name, _ in items: + + for p_name, p_info in items: if p_name == '__account__' and account_name is None: continue color, _highlight = bui.app.classic.get_player_profile_colors( @@ -379,15 +395,32 @@ def _refresh(self) -> None: else bui.app.classic.get_player_profile_icon(p_name) + p_name ) assert isinstance(tval, str) + character = bui.buttonwidget( + parent=self._subcontainer, + position=(0, y_val), + size=(28, 28), + label='', + color=(1, 1, 1), + mask_texture=bui.gettexture('characterIconMask'), + tint_color=color, + tint2_color=_highlight, + texture=icon_textures[ + spazzes.index(p_info['character']) + ], + tint_texture=icon_tint_textures[ + spazzes.index(p_info['character']) + ], + selectable=False, + ) txtw = bui.textwidget( - parent=self._columnwidget, - position=(0, 32), - size=((self._width - 210) / scl, 28), + parent=self._subcontainer, + position=(35, y_val), + size=((self._width - 40) / scl, 28), text=bui.Lstr(value=tval), h_align='left', v_align='center', on_select_call=bui.WeakCall(self._select, p_name, index), - maxwidth=self._scroll_width * 0.86, + maxwidth=self._scroll_width * 0.92, corner_scale=scl, color=bui.safecolor(color, 0.4), always_highlight=True, @@ -398,6 +431,7 @@ def _refresh(self) -> None: bui.widget(edit=txtw, up_widget=self._back_button) bui.widget(edit=txtw, show_buffer_top=40, show_buffer_bottom=40) self._profile_widgets.append(txtw) + self._profile_widgets.append(character) # Select/show this one if it was previously selected # (but defer till after this loop since our height is @@ -406,10 +440,15 @@ def _refresh(self) -> None: widget_to_select = txtw index += 1 + y_val -= 35 + bui.containerwidget( + edit=self._subcontainer, + size=(self._scroll_width, index * 35), + ) if widget_to_select is not None: - bui.columnwidget( - edit=self._columnwidget, + bui.containerwidget( + edit=self._subcontainer, selected_child=widget_to_select, visible_child=widget_to_select, ) From 1b595ad7b4dfc32696c4184302ecbb0a22e98b3c Mon Sep 17 00:00:00 2001 From: Vishal Date: Tue, 21 Nov 2023 16:20:20 +0530 Subject: [PATCH 14/32] Edit browser.py --- src/assets/ba_data/python/bauiv1lib/profile/browser.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/profile/browser.py b/src/assets/ba_data/python/bauiv1lib/profile/browser.py index 28111956e..6b69f35b9 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/browser.py @@ -381,7 +381,7 @@ def _refresh(self) -> None: account_name = plus.get_v1_account_display_string() else: account_name = None - + widget_to_select = None for p_name, p_info in items: if p_name == '__account__' and account_name is None: continue @@ -415,12 +415,12 @@ def _refresh(self) -> None: txtw = bui.textwidget( parent=self._subcontainer, position=(35, y_val), - size=((self._width - 40) / scl, 28), + size=((self._width - 210) / scl, 28), text=bui.Lstr(value=tval), h_align='left', v_align='center', on_select_call=bui.WeakCall(self._select, p_name, index), - maxwidth=self._scroll_width * 0.92, + maxwidth=self._scroll_width * 0.86, corner_scale=scl, color=bui.safecolor(color, 0.4), always_highlight=True, From 3703b406e28d3f59e76e01314bee58108e4bf60a Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 23 Nov 2023 17:44:47 +0530 Subject: [PATCH 15/32] Edit edit.py --- .../ba_data/python/bauiv1lib/profile/edit.py | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/profile/edit.py b/src/assets/ba_data/python/bauiv1lib/profile/edit.py index 5c9c899d6..779dd1e33 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/edit.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/edit.py @@ -184,7 +184,7 @@ def __init__( self._clipped_name_text = bui.textwidget( parent=self._root_widget, text='', - position=(540 + x_inset, v - 8), + position=(580 + x_inset, v - 8), flatness=1.0, shadow=0.0, scale=0.55, @@ -390,6 +390,23 @@ def __init__( autoselect=True, on_activate_call=self.upgrade_profile, ) + self._random_name_button = bui.buttonwidget( + parent=self._root_widget, + label='', + size=(20, 20), + position=(500 + x_inset, v - 20), + button_type='square', + color=(0.6, 0.5, 0.65), + autoselect=True, + on_activate_call=self.assign_random_name, + ) + bui.imagewidget( + parent=self._root_widget, + size=(20, 20), + draw_controller=self._random_name_button, + position=(501 + x_inset, v - 20), + texture=bui.gettexture('replayIcon'), + ) self._update_clipped_name() self._clipped_name_timer = bui.AppTimer( @@ -498,6 +515,14 @@ def __init__( ) self._update_character() + def assign_random_name(self) -> None: + names = bs.get_random_names() + name = names[random.randrange(len(names))] + bui.textwidget( + edit=self._text_field, + text=name, + ) + def upgrade_profile(self) -> None: """Attempt to ugrade the profile to global.""" from bauiv1lib import account @@ -719,7 +744,10 @@ def _update_clipped_name(self) -> None: ) if len(name) > 10 and not (self._global or self._is_account_profile): name = name.strip() - display_name = (name[:10] + '...') if len(name) > 10 else name + display_name = ((name[:10] + '...') + if len(name) > 10 + else name + ) bui.textwidget( edit=self._clipped_name_text, text=bui.Lstr( From 426798a9d98c84ef08ba6501c098122c2649eda7 Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 23 Nov 2023 17:53:29 +0530 Subject: [PATCH 16/32] Update edit.py --- src/assets/ba_data/python/bauiv1lib/profile/edit.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/profile/edit.py b/src/assets/ba_data/python/bauiv1lib/profile/edit.py index 779dd1e33..1ef3079a2 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/edit.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/edit.py @@ -516,6 +516,7 @@ def __init__( self._update_character() def assign_random_name(self) -> None: + """Assigning a random name to the player.""" names = bs.get_random_names() name = names[random.randrange(len(names))] bui.textwidget( @@ -524,7 +525,7 @@ def assign_random_name(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.profile import upgrade as pupgrade @@ -744,10 +745,7 @@ def _update_clipped_name(self) -> None: ) if len(name) > 10 and not (self._global or self._is_account_profile): name = name.strip() - display_name = ((name[:10] + '...') - if len(name) > 10 - else name - ) + display_name = (name[:10] + '...') if len(name) > 10 else name bui.textwidget( edit=self._clipped_name_text, text=bui.Lstr( From c646868a3f1ed8e8acda2ddeff9efe4366eba4dc Mon Sep 17 00:00:00 2001 From: Vishal Date: Fri, 24 Nov 2023 18:32:33 +0530 Subject: [PATCH 17/32] Update browser.py --- .../ba_data/python/bauiv1lib/profile/browser.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/profile/browser.py b/src/assets/ba_data/python/bauiv1lib/profile/browser.py index 6b69f35b9..a33cf750e 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/browser.py @@ -394,6 +394,12 @@ def _refresh(self) -> None: if p_name == '__account__' else bui.app.classic.get_player_profile_icon(p_name) + p_name ) + + try: + char_index = spazzes.index(p_info['character']) + except Exception: + char_index = spazzes.index('Spaz') + assert isinstance(tval, str) character = bui.buttonwidget( parent=self._subcontainer, @@ -404,12 +410,8 @@ def _refresh(self) -> None: mask_texture=bui.gettexture('characterIconMask'), tint_color=color, tint2_color=_highlight, - texture=icon_textures[ - spazzes.index(p_info['character']) - ], - tint_texture=icon_tint_textures[ - spazzes.index(p_info['character']) - ], + texture=icon_textures[char_index], + tint_texture=icon_tint_textures[char_index], selectable=False, ) txtw = bui.textwidget( From 545261147e7bed64ae95e230f73e5089fb7f65fb Mon Sep 17 00:00:00 2001 From: Vishal Date: Fri, 24 Nov 2023 18:36:46 +0530 Subject: [PATCH 18/32] Update browser.py --- src/assets/ba_data/python/bauiv1lib/profile/browser.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/assets/ba_data/python/bauiv1lib/profile/browser.py b/src/assets/ba_data/python/bauiv1lib/profile/browser.py index a33cf750e..694504a7c 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/browser.py @@ -344,6 +344,7 @@ def _back(self) -> None: def _refresh(self) -> None: # pylint: disable=too-many-locals + # pylint: disable=too-many-statements from efro.util import asserttype from bascenev1 import PlayerProfilesChangedMessage from bascenev1lib.actor import spazappearance From 7803caf1c25334882dd3d658c1d5a87f8bf5060c Mon Sep 17 00:00:00 2001 From: Vishal Date: Sun, 26 Nov 2023 13:40:47 +0530 Subject: [PATCH 19/32] Update party.py --- src/assets/ba_data/python/bauiv1lib/party.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/ba_data/python/bauiv1lib/party.py b/src/assets/ba_data/python/bauiv1lib/party.py index 81720f1a1..d49e6864c 100644 --- a/src/assets/ba_data/python/bauiv1lib/party.py +++ b/src/assets/ba_data/python/bauiv1lib/party.py @@ -550,7 +550,7 @@ def _save_server( config.commit() bui.getsound('gunCocking').play() bui.screenmessage( - bui.Lstr(resource='addedToFavouritesText'), + bui.Lstr(resource='addedToFavoritesText'), color=(0, 1, 0), ) else: From 81006ed8d6a282c7a47aed9c3b7b557ad6cd21d7 Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 27 Nov 2023 07:03:10 +0530 Subject: [PATCH 20/32] Update manualtab.py --- src/assets/ba_data/python/bauiv1lib/gather/manualtab.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py index 8774939b1..37f285fc4 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py @@ -834,6 +834,10 @@ def _save_server( } config.commit() bui.getsound('gunCocking').play() + bui.screenmessage( + bui.Lstr(resource='addedToFavoritesText'), + color=(0, 1, 0), + ) else: bui.screenmessage( bui.Lstr(resource='internal.invalidAddressErrorText'), From 88e28cadb47ca83f3f701411805cac5c7491d7b2 Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 30 Nov 2023 08:18:56 +0530 Subject: [PATCH 21/32] Update edit.py --- src/assets/ba_data/python/bauiv1lib/profile/edit.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/profile/edit.py b/src/assets/ba_data/python/bauiv1lib/profile/edit.py index 1ef3079a2..5870a4844 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/edit.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/edit.py @@ -392,21 +392,14 @@ def __init__( ) self._random_name_button = bui.buttonwidget( parent=self._root_widget, - label='', - size=(20, 20), - position=(500 + x_inset, v - 20), + label=bui.Lstr(resource='randomText'), + size=(30, 20), + position=(495 + x_inset, v - 20), button_type='square', color=(0.6, 0.5, 0.65), autoselect=True, on_activate_call=self.assign_random_name, ) - bui.imagewidget( - parent=self._root_widget, - size=(20, 20), - draw_controller=self._random_name_button, - position=(501 + x_inset, v - 20), - texture=bui.gettexture('replayIcon'), - ) self._update_clipped_name() self._clipped_name_timer = bui.AppTimer( From c466da4673d7298104af3f505cda0d9582a98bee Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 30 Nov 2023 08:26:04 +0530 Subject: [PATCH 22/32] Update party.py --- src/assets/ba_data/python/bauiv1lib/party.py | 90 +------------------- 1 file changed, 1 insertion(+), 89 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/party.py b/src/assets/ba_data/python/bauiv1lib/party.py index d49e6864c..72aa274fa 100644 --- a/src/assets/ba_data/python/bauiv1lib/party.py +++ b/src/assets/ba_data/python/bauiv1lib/party.py @@ -237,12 +237,11 @@ def _on_menu_button_press(self) -> None: if uiscale is bui.UIScale.MEDIUM else 1.23 ), - choices=['unmute' if is_muted else 'mute', 'add_to_favorites'], + choices=['unmute' if is_muted else 'mute'], choices_display=[ bui.Lstr( resource='chatUnMuteText' if is_muted else 'chatMuteText' ), - bui.Lstr(resource='addToFavoritesText') ], current_choice='unmute' if is_muted else 'mute', delegate=self, @@ -470,96 +469,9 @@ def popup_menu_selected_choice( cfg.apply_and_commit() self._display_old_msgs = True self._update() - if choice == 'add_to_favorites': - plus = bui.app.plus - assert plus is not None - - if plus.get_v1_account_state() == 'signed_in': - plus.add_v1_account_transaction( - { - 'type': 'PUBLIC_PARTY_QUERY', - 'proto': bs.protocol_version(), - 'lang': bui.app.lang.language, - }, - callback=bui.WeakCall(self._add_to_favorites), - ) - plus.run_v1_account_transactions() - else: - self._add_to_favorites(None) - else: print(f'unhandled popup type: {self._popup_type}') - def _add_to_favorites(self, result: dict[str, Any] | None) -> None: - if result is None: - return - - parties_in = result['l'] - - assert isinstance(parties_in, list) - info = bs.get_connection_to_host_info() - - if info.get('name', '') != '': - title = info['name'] - else: - return - - for party_in in parties_in: - server_name = party_in['n'] - if server_name == title: - assert isinstance(party_in['a'], str) - assert isinstance(party_in['p'], int) - self._save_server(title, party_in['a'], party_in['p']) - return - - def _save_server( - self, - name_text: str, - address: str, - port_num: int - ) -> None: - addr = address - if addr == '': - bui.screenmessage( - bui.Lstr(resource='internal.invalidAddressErrorText'), - color=(1, 0, 0), - ) - bui.getsound('error').play() - return - try: - port = port_num - except ValueError: - port = -1 - if port > 65535 or port < 0: - bui.screenmessage( - bui.Lstr(resource='internal.invalidPortErrorText'), - color=(1, 0, 0), - ) - bui.getsound('error').play() - return - config = bui.app.config - - if addr: - if not isinstance(config.get('Saved Servers'), dict): - config['Saved Servers'] = {} - config['Saved Servers'][f'{addr}@{port}'] = { - 'addr': addr, - 'port': port, - 'name': name_text, - } - config.commit() - bui.getsound('gunCocking').play() - bui.screenmessage( - bui.Lstr(resource='addedToFavoritesText'), - color=(0, 1, 0), - ) - else: - bui.screenmessage( - bui.Lstr(resource='internal.invalidAddressErrorText'), - color=(1, 0, 0), - ) - bui.getsound('error').play() - def popup_menu_closing(self, popup_window: PopupWindow) -> None: """Called when the popup is closing.""" From c632941136cb2b8c6477217d78796eaf11b9845a Mon Sep 17 00:00:00 2001 From: Vishal Date: Thu, 30 Nov 2023 23:02:06 +0530 Subject: [PATCH 23/32] Update party.py --- src/assets/ba_data/python/bauiv1lib/party.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/assets/ba_data/python/bauiv1lib/party.py b/src/assets/ba_data/python/bauiv1lib/party.py index 72aa274fa..5fa2bddd9 100644 --- a/src/assets/ba_data/python/bauiv1lib/party.py +++ b/src/assets/ba_data/python/bauiv1lib/party.py @@ -241,7 +241,7 @@ def _on_menu_button_press(self) -> None: choices_display=[ bui.Lstr( resource='chatUnMuteText' if is_muted else 'chatMuteText' - ), + ) ], current_choice='unmute' if is_muted else 'mute', delegate=self, From 6e06f041abf2c4f318fc9399aed6ef5e6c5bd54d Mon Sep 17 00:00:00 2001 From: Vishal Date: Fri, 15 Dec 2023 17:10:55 +0530 Subject: [PATCH 24/32] Update manualtab.py --- src/assets/ba_data/python/bauiv1lib/gather/manualtab.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py index 37f285fc4..ce8bb81d0 100644 --- a/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py +++ b/src/assets/ba_data/python/bauiv1lib/gather/manualtab.py @@ -746,6 +746,7 @@ def _refresh_favorites(self) -> None: ) if i == 0: bui.widget(edit=txt, up_widget=self._favorites_text) + self._favorite_selected = server bui.widget( edit=txt, left_widget=self._favorites_connect_button, From e8d2437a9be0c1d37f1b9dfad7e71ea708612849 Mon Sep 17 00:00:00 2001 From: Vishal Date: Sat, 16 Dec 2023 22:37:52 +0530 Subject: [PATCH 25/32] Update party.py --- src/assets/ba_data/python/bauiv1lib/party.py | 60 +++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/src/assets/ba_data/python/bauiv1lib/party.py b/src/assets/ba_data/python/bauiv1lib/party.py index b4905e1b0..9a85dd9e4 100644 --- a/src/assets/ba_data/python/bauiv1lib/party.py +++ b/src/assets/ba_data/python/bauiv1lib/party.py @@ -238,10 +238,13 @@ def _on_menu_button_press(self) -> None: if uiscale is bui.UIScale.MEDIUM else 1.23 ), - choices=['unmute' if is_muted else 'mute'], + choices=['unmute' if is_muted else 'mute', 'add_to_favorites'], choices_display=[ bui.Lstr( resource='chatUnMuteText' if is_muted else 'chatMuteText' + ), + bui.Lstr( + resource='AddToFavoritesText' ) ], current_choice='unmute' if is_muted else 'mute', @@ -470,9 +473,64 @@ def popup_menu_selected_choice( cfg.apply_and_commit() self._display_old_msgs = True self._update() + if choice == 'add_to_favorites': + info = bs.get_connection_to_host_info_2() + if info is not None: + self._add_to_favorites( + name=info.name, + address=info.address, + port_num=info.port, + ) + else: + bui.screenmessage('Not connected to a server') else: print(f'unhandled popup type: {self._popup_type}') + def _add_to_favorites( + self, + name: str, + address: str, + port_num: int + ) -> None: + addr = address + if addr == '': + bui.screenmessage( + bui.Lstr(resource='internal.invalidAddressErrorText'), + color=(1, 0, 0), + ) + bui.getsound('error').play() + return + port = port_num + if port > 65535 or port < 0: + bui.screenmessage( + bui.Lstr(resource='internal.invalidPortErrorText'), + color=(1, 0, 0), + ) + bui.getsound('error').play() + return + config = bui.app.config + + if addr: + if not isinstance(config.get('Saved Servers'), dict): + config['Saved Servers'] = {} + config['Saved Servers'][f'{addr}@{port}'] = { + 'addr': addr, + 'port': port, + 'name': name, + } + config.commit() + bui.getsound('gunCocking').play() + bui.screenmessage( + bui.Lstr(value='Added To Favorites'), + color=(0, 1, 0), + ) + else: + bui.screenmessage( + bui.Lstr(resource='internal.invalidAddressErrorText'), + color=(1, 0, 0), + ) + bui.getsound('error').play() + def popup_menu_closing(self, popup_window: PopupWindow) -> None: """Called when the popup is closing.""" From e237a3755f7d149295a4ad3aaf713d9f5d4962e7 Mon Sep 17 00:00:00 2001 From: Vishal Date: Sat, 16 Dec 2023 22:47:29 +0530 Subject: [PATCH 26/32] Update party.py --- src/assets/ba_data/python/bauiv1lib/party.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/party.py b/src/assets/ba_data/python/bauiv1lib/party.py index 9a85dd9e4..3ac28fba7 100644 --- a/src/assets/ba_data/python/bauiv1lib/party.py +++ b/src/assets/ba_data/python/bauiv1lib/party.py @@ -489,8 +489,8 @@ def popup_menu_selected_choice( def _add_to_favorites( self, name: str, - address: str, - port_num: int + address: str | None, + port_num: int | None ) -> None: addr = address if addr == '': From 50fa53ebfe45b7803ac0c74e55854baa7ce4518c Mon Sep 17 00:00:00 2001 From: Vishal Date: Sat, 16 Dec 2023 22:53:36 +0530 Subject: [PATCH 27/32] Update party.py --- src/assets/ba_data/python/bauiv1lib/party.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/assets/ba_data/python/bauiv1lib/party.py b/src/assets/ba_data/python/bauiv1lib/party.py index 3ac28fba7..1219b5ebc 100644 --- a/src/assets/ba_data/python/bauiv1lib/party.py +++ b/src/assets/ba_data/python/bauiv1lib/party.py @@ -482,7 +482,11 @@ def popup_menu_selected_choice( port_num=info.port, ) else: - bui.screenmessage('Not connected to a server') + bui.screenmessage( + bui.Lstr( + resource='NotConnectedToServerText' + ) + ) else: print(f'unhandled popup type: {self._popup_type}') @@ -501,6 +505,8 @@ def _add_to_favorites( bui.getsound('error').play() return port = port_num + if port_num is None: + port = -1 if port > 65535 or port < 0: bui.screenmessage( bui.Lstr(resource='internal.invalidPortErrorText'), From d94e88803a663495ac885f49ac1b2d5761a7f558 Mon Sep 17 00:00:00 2001 From: Vishal Date: Sat, 16 Dec 2023 22:59:12 +0530 Subject: [PATCH 28/32] Update party.py --- src/assets/ba_data/python/bauiv1lib/party.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/party.py b/src/assets/ba_data/python/bauiv1lib/party.py index 1219b5ebc..98323f857 100644 --- a/src/assets/ba_data/python/bauiv1lib/party.py +++ b/src/assets/ba_data/python/bauiv1lib/party.py @@ -504,9 +504,7 @@ def _add_to_favorites( ) bui.getsound('error').play() return - port = port_num - if port_num is None: - port = -1 + port = port_num if port_num is not None else -1 if port > 65535 or port < 0: bui.screenmessage( bui.Lstr(resource='internal.invalidPortErrorText'), From e0180666eb56f12b9ba4a65d09107dd3036d4d2d Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 18 Dec 2023 14:43:51 +0530 Subject: [PATCH 29/32] Update mainmenu.py --- .../ba_data/python/bauiv1lib/mainmenu.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/src/assets/ba_data/python/bauiv1lib/mainmenu.py b/src/assets/ba_data/python/bauiv1lib/mainmenu.py index 16f318ae4..978e50464 100644 --- a/src/assets/ba_data/python/bauiv1lib/mainmenu.py +++ b/src/assets/ba_data/python/bauiv1lib/mainmenu.py @@ -511,6 +511,41 @@ def _do_quit() -> None: size=(0, 0), scale=3.0 * t_scale, ) + btn = bui.buttonwidget( + parent=self._root_widget, + position=(h + b_buffer + 60, v - b_size - b_buffer + v_offs), + button_type='square', + size=(b_size, b_size), + label='', + autoselect=True, + on_activate_call=bui.Call(self._pause_replay), + ) + bui.textwidget( + parent=self._root_widget, + draw_controller=btn, + text='|', + position=( + (h + b_size * 0.5 + b_buffer) + 54, + v - b_size * 0.5 - b_buffer + 5 * t_scale + v_offs, + ), + h_align='center', + v_align='center', + size=(0, 0), + scale=0.7, + ) + bui.textwidget( + parent=self._root_widget, + draw_controller=btn, + text='>', + position=( + (h + b_size * 0.5 + b_buffer) + 62, + v - b_size * 0.5 - b_buffer + 5 * t_scale + v_offs, + ), + h_align='center', + v_align='center', + size=(0, 0), + scale=3.0 * t_scale, + ) def _refresh_not_in_game( self, positions: list[tuple[float, float, float]] @@ -1034,6 +1069,9 @@ def _change_replay_speed(self, offs: int) -> None: ), ) + def _pause_replay(self) -> None: + bs.pause_replay() + def _quit(self) -> None: # pylint: disable=cyclic-import from bauiv1lib.confirm import QuitWindow From 60db12174f1a108b389baa48d2948b21f4e51a5f Mon Sep 17 00:00:00 2001 From: Vishal Date: Mon, 18 Dec 2023 14:48:56 +0530 Subject: [PATCH 30/32] Update mainmenu.py --- .../ba_data/python/bauiv1lib/mainmenu.py | 38 ------------------- 1 file changed, 38 deletions(-) diff --git a/src/assets/ba_data/python/bauiv1lib/mainmenu.py b/src/assets/ba_data/python/bauiv1lib/mainmenu.py index 978e50464..16f318ae4 100644 --- a/src/assets/ba_data/python/bauiv1lib/mainmenu.py +++ b/src/assets/ba_data/python/bauiv1lib/mainmenu.py @@ -511,41 +511,6 @@ def _do_quit() -> None: size=(0, 0), scale=3.0 * t_scale, ) - btn = bui.buttonwidget( - parent=self._root_widget, - position=(h + b_buffer + 60, v - b_size - b_buffer + v_offs), - button_type='square', - size=(b_size, b_size), - label='', - autoselect=True, - on_activate_call=bui.Call(self._pause_replay), - ) - bui.textwidget( - parent=self._root_widget, - draw_controller=btn, - text='|', - position=( - (h + b_size * 0.5 + b_buffer) + 54, - v - b_size * 0.5 - b_buffer + 5 * t_scale + v_offs, - ), - h_align='center', - v_align='center', - size=(0, 0), - scale=0.7, - ) - bui.textwidget( - parent=self._root_widget, - draw_controller=btn, - text='>', - position=( - (h + b_size * 0.5 + b_buffer) + 62, - v - b_size * 0.5 - b_buffer + 5 * t_scale + v_offs, - ), - h_align='center', - v_align='center', - size=(0, 0), - scale=3.0 * t_scale, - ) def _refresh_not_in_game( self, positions: list[tuple[float, float, float]] @@ -1069,9 +1034,6 @@ def _change_replay_speed(self, offs: int) -> None: ), ) - def _pause_replay(self) -> None: - bs.pause_replay() - def _quit(self) -> None: # pylint: disable=cyclic-import from bauiv1lib.confirm import QuitWindow From 5c2d524c8d068ea4691c02c7679e1112a2364827 Mon Sep 17 00:00:00 2001 From: Vishal Date: Tue, 19 Dec 2023 06:48:52 +0530 Subject: [PATCH 31/32] Update watch.py --- src/assets/ba_data/python/bauiv1lib/watch.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/assets/ba_data/python/bauiv1lib/watch.py b/src/assets/ba_data/python/bauiv1lib/watch.py index c2e50e4ce..b43b93210 100644 --- a/src/assets/ba_data/python/bauiv1lib/watch.py +++ b/src/assets/ba_data/python/bauiv1lib/watch.py @@ -598,6 +598,7 @@ def _refresh_my_replays(self) -> None: edit=txt, up_widget=self._tab_row.tabs[self.TabID.MY_REPLAYS].button, ) + self._my_replay_selected = name def _save_state(self) -> None: try: From 4a1ba28809d0303c2fdd30ba7a66920b7a53b654 Mon Sep 17 00:00:00 2001 From: Vishal Date: Tue, 19 Dec 2023 20:14:56 +0530 Subject: [PATCH 32/32] Update browser.py --- src/assets/ba_data/python/bauiv1lib/profile/browser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/assets/ba_data/python/bauiv1lib/profile/browser.py b/src/assets/ba_data/python/bauiv1lib/profile/browser.py index 097d3d66a..2d79765b0 100644 --- a/src/assets/ba_data/python/bauiv1lib/profile/browser.py +++ b/src/assets/ba_data/python/bauiv1lib/profile/browser.py @@ -447,6 +447,8 @@ def _refresh(self) -> None: ) if index == 0: bui.widget(edit=txtw, up_widget=self._back_button) + if self._selected_profile is None: + self._selected_profile = p_name bui.widget(edit=txtw, show_buffer_top=40, show_buffer_bottom=40) self._profile_widgets.append(txtw) self._profile_widgets.append(character)