mirror of
https://github.com/bombsquad-community/plugin-manager.git
synced 2025-11-07 17:36:00 +00:00
[ci] auto-format
This commit is contained in:
parent
85304770d3
commit
d58e326d4c
5 changed files with 564 additions and 530 deletions
|
|
@ -19,9 +19,9 @@ if TYPE_CHECKING:
|
|||
lang = ba.app.lang.language
|
||||
|
||||
if lang == 'Spanish':
|
||||
custom_txt = 'personalizar...'
|
||||
custom_txt = 'personalizar...'
|
||||
else:
|
||||
custom_txt = 'custom...'
|
||||
custom_txt = 'custom...'
|
||||
|
||||
|
||||
if 'quick_game_button' in ba.app.config:
|
||||
|
|
@ -31,6 +31,7 @@ else:
|
|||
ba.app.config['quick_game_button'] = config
|
||||
ba.app.config.commit()
|
||||
|
||||
|
||||
def start_game(session: ba.Session, fadeout: bool = True):
|
||||
def callback():
|
||||
if fadeout:
|
||||
|
|
@ -50,6 +51,7 @@ def start_game(session: ba.Session, fadeout: bool = True):
|
|||
else:
|
||||
callback()
|
||||
|
||||
|
||||
class SimplePlaylist:
|
||||
|
||||
def __init__(self,
|
||||
|
|
@ -66,6 +68,7 @@ class SimplePlaylist:
|
|||
settings = self.settings['settings']
|
||||
return dict(resolved_type=self.gametype, settings=settings)
|
||||
|
||||
|
||||
class CustomSession(FreeForAllSession):
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
@ -305,6 +308,8 @@ class SelectGameWindow(PlaylistAddGameWindow):
|
|||
|
||||
|
||||
PlayWindow._old_init = PlayWindow.__init__
|
||||
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
self._old_init()
|
||||
|
||||
|
|
@ -331,6 +336,7 @@ def __init__(self, *args, **kwargs):
|
|||
|
||||
self._restore_state()
|
||||
|
||||
|
||||
def states(self) -> None:
|
||||
return {
|
||||
'Team Games': self._teams_button,
|
||||
|
|
@ -340,6 +346,7 @@ def states(self) -> None:
|
|||
'Quick Game': self._quick_game_button
|
||||
}
|
||||
|
||||
|
||||
def _save_state(self) -> None:
|
||||
swapped = {v: k for k, v in states(self).items()}
|
||||
if self._root_widget.get_selected_child() in swapped:
|
||||
|
|
@ -349,6 +356,7 @@ def _save_state(self) -> None:
|
|||
else:
|
||||
ba.print_exception(f'Error saving state for {self}.')
|
||||
|
||||
|
||||
def _restore_state(self) -> None:
|
||||
if not hasattr(self, '_quick_game_button'):
|
||||
return # ensure that our monkey patched init ran
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue