mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-30 19:23:20 +08:00
Update party.py
This commit is contained in:
parent
897896d704
commit
716d01487f
@ -40,6 +40,7 @@ class PartyWindow(bui.Window):
|
||||
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 @@ class PartyWindow(bui.Window):
|
||||
)
|
||||
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 @@ class PartyWindow(bui.Window):
|
||||
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 @@ class PartyWindow(bui.Window):
|
||||
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}')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user