mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-07 16:13:23 +08:00
more
This commit is contained in:
parent
8e127a7c48
commit
08bcf88929
@ -6,7 +6,8 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from typing import TYPE_CHECKING, TypeVar
|
from typing import TYPE_CHECKING, TypeVar
|
||||||
|
|
||||||
import _babase
|
import babase
|
||||||
|
|
||||||
import _bascenev1
|
import _bascenev1
|
||||||
from bascenev1._freeforallsession import FreeForAllSession
|
from bascenev1._freeforallsession import FreeForAllSession
|
||||||
from bascenev1._gameactivity import GameActivity
|
from bascenev1._gameactivity import GameActivity
|
||||||
@ -15,8 +16,9 @@ from bascenev1._dualteamsession import DualTeamSession
|
|||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Any, Sequence
|
from typing import Any, Sequence
|
||||||
|
|
||||||
from bascenev1lib.actor.playerspaz import PlayerSpaz
|
from bascenev1lib.actor.playerspaz import PlayerSpaz
|
||||||
import babase
|
|
||||||
import bascenev1
|
import bascenev1
|
||||||
|
|
||||||
PlayerT = TypeVar('PlayerT', bound='bascenev1.Player')
|
PlayerT = TypeVar('PlayerT', bound='bascenev1.Player')
|
||||||
@ -86,14 +88,14 @@ class TeamGameActivity(GameActivity[PlayerT, TeamT]):
|
|||||||
# Award a few (classic) achievements.
|
# Award a few (classic) achievements.
|
||||||
if isinstance(self.session, FreeForAllSession):
|
if isinstance(self.session, FreeForAllSession):
|
||||||
if len(self.players) >= 2:
|
if len(self.players) >= 2:
|
||||||
if _babase.app.classic is not None:
|
if babase.app.classic is not None:
|
||||||
_babase.app.classic.ach.award_local_achievement(
|
babase.app.classic.ach.award_local_achievement(
|
||||||
'Free Loader'
|
'Free Loader'
|
||||||
)
|
)
|
||||||
elif isinstance(self.session, DualTeamSession):
|
elif isinstance(self.session, DualTeamSession):
|
||||||
if len(self.players) >= 4:
|
if len(self.players) >= 4:
|
||||||
if _babase.app.classic is not None:
|
if babase.app.classic is not None:
|
||||||
_babase.app.classic.ach.award_local_achievement(
|
babase.app.classic.ach.award_local_achievement(
|
||||||
'Team Player'
|
'Team Player'
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
@ -9,15 +9,15 @@ import random
|
|||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from bascenev1lib.actor.text import Text
|
|
||||||
from bascenev1lib.actor.zoomtext import ZoomText
|
|
||||||
import bascenev1 as bs
|
import bascenev1 as bs
|
||||||
import bauiv1 as bui
|
import bauiv1 as bui
|
||||||
|
|
||||||
|
from bascenev1lib.actor.text import Text
|
||||||
|
from bascenev1lib.actor.zoomtext import ZoomText
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Any, Sequence
|
from typing import Any, Sequence
|
||||||
|
|
||||||
import baclassic
|
|
||||||
from bauiv1lib.store.button import StoreButton
|
from bauiv1lib.store.button import StoreButton
|
||||||
from bauiv1lib.league.rankbutton import LeagueRankButton
|
from bauiv1lib.league.rankbutton import LeagueRankButton
|
||||||
|
|
||||||
|
|||||||
@ -21,13 +21,12 @@ from collections import deque
|
|||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import bascenev1 as bs
|
import bascenev1 as bs
|
||||||
|
|
||||||
from bascenev1lib.actor.spaz import Spaz
|
from bascenev1lib.actor.spaz import Spaz
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Any, Callable, Sequence
|
from typing import Any, Callable, Sequence
|
||||||
|
|
||||||
import baclassic
|
|
||||||
|
|
||||||
|
|
||||||
def _safesetattr(node: bs.Node | None, attr: str, value: Any) -> None:
|
def _safesetattr(node: bs.Node | None, attr: str, value: Any) -> None:
|
||||||
if node:
|
if node:
|
||||||
|
|||||||
@ -10,8 +10,7 @@ import babase
|
|||||||
import bascenev1 as bs
|
import bascenev1 as bs
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
import baclassic
|
pass
|
||||||
import bascenev1 as bs
|
|
||||||
|
|
||||||
|
|
||||||
# FIXME: Could change this to be a classmethod of session types?
|
# FIXME: Could change this to be a classmethod of session types?
|
||||||
@ -31,7 +30,7 @@ class PlaylistTypeVars:
|
|||||||
resource='playModes.teamsText', fallback_resource='teamsText'
|
resource='playModes.teamsText', fallback_resource='teamsText'
|
||||||
)
|
)
|
||||||
self.get_default_list_call = get_default_teams_playlist
|
self.get_default_list_call = get_default_teams_playlist
|
||||||
self.session_type_name = 'ba.DualTeamSession'
|
self.session_type_name = 'bascenev1.DualTeamSession'
|
||||||
self.config_name = 'Team Tournament'
|
self.config_name = 'Team Tournament'
|
||||||
self.window_title_name = babase.Lstr(
|
self.window_title_name = babase.Lstr(
|
||||||
resource='playModes.teamsText', fallback_resource='teamsText'
|
resource='playModes.teamsText', fallback_resource='teamsText'
|
||||||
@ -44,7 +43,7 @@ class PlaylistTypeVars:
|
|||||||
fallback_resource='freeForAllText',
|
fallback_resource='freeForAllText',
|
||||||
)
|
)
|
||||||
self.get_default_list_call = get_default_free_for_all_playlist
|
self.get_default_list_call = get_default_free_for_all_playlist
|
||||||
self.session_type_name = 'ba.FreeForAllSession'
|
self.session_type_name = 'bascenev1.FreeForAllSession'
|
||||||
self.config_name = 'Free-for-All'
|
self.config_name = 'Free-for-All'
|
||||||
self.window_title_name = babase.Lstr(
|
self.window_title_name = babase.Lstr(
|
||||||
resource='playModes.freeForAllText',
|
resource='playModes.freeForAllText',
|
||||||
|
|||||||
@ -302,6 +302,7 @@ class PluginWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
# Make sure we handle all cases.
|
# Make sure we handle all cases.
|
||||||
assert_never(self._category)
|
assert_never(self._category)
|
||||||
|
sub_height = 0
|
||||||
|
|
||||||
num_shown = 0
|
num_shown = 0
|
||||||
for i, availplug in enumerate(pluglist):
|
for i, availplug in enumerate(pluglist):
|
||||||
@ -320,6 +321,7 @@ class PluginWindow(bui.Window):
|
|||||||
show = availplug.available and not active
|
show = availplug.available and not active
|
||||||
else:
|
else:
|
||||||
assert_never(self._category)
|
assert_never(self._category)
|
||||||
|
show = False
|
||||||
|
|
||||||
if not show:
|
if not show:
|
||||||
continue
|
continue
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user