Skip to content

Commit

Permalink
tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
efroemling committed Dec 25, 2024
1 parent da64da2 commit 65575e9
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 47 deletions.
72 changes: 36 additions & 36 deletions .efrocachemap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/assets/ba_data/python/baclassic/_accountv1.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def ensure_have_account_player_profile(self) -> None:
'Player Profiles' not in config
or '__account__' not in config['Player Profiles']
):
print('CREATING INITIAL')
# Create a spaz with a nice default purply color.
plus.add_v1_account_transaction(
{
Expand Down
24 changes: 13 additions & 11 deletions src/assets/ba_data/python/baclassic/_appmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ def _update_for_primary_account(
chest_2_appearance='',
chest_3_appearance='',
)
self._have_account_values = False
self._update_ui_live_state()

else:
with account:
self._account_data_sub = (
Expand All @@ -220,16 +223,15 @@ def _update_for_primary_account(
def _update_for_connectivity_change(self, connected: bool) -> None:
"""Update when the app's connectivity state changes."""
self._have_connectivity = connected
self._update_have_live_values()

def _update_have_live_values(self) -> None:

# We want to show ui elements faded out unless we have a live
# connection to the master-server AND have received a set of UI
# values from them. If we just plug in connectivity here we get
# UI stuff un-fading a moment or two before values appear (since
# the subscriptions have not sent us any values yet) which looks
# odd.
self._update_ui_live_state()

def _update_ui_live_state(self) -> None:
# We want to show ui elements faded if we don't have a live
# connection to the master-server OR if we haven't received a
# set of account values from them yet. If we just plug in raw
# connectivity state here we get UI stuff un-fading a moment or
# two before values appear (since the subscriptions have not
# sent us any values yet) which looks odd.
_baclassic.set_root_ui_have_live_values(
self._have_connectivity and self._have_account_values
)
Expand Down Expand Up @@ -281,7 +283,7 @@ def _on_classic_account_data_change(

# Note that we have values and updated faded state accordingly.
self._have_account_values = True
self._update_have_live_values()
self._update_ui_live_state()

def _root_ui_menu_press(self) -> None:
from babase import push_back_press
Expand Down

0 comments on commit 65575e9

Please sign in to comment.