bascenev1lib.activity.multiteamscore

Functionality related to teams mode score screen.

  1# Released under the MIT License. See LICENSE for details.
  2#
  3"""Functionality related to teams mode score screen."""
  4from __future__ import annotations
  5
  6import bascenev1 as bs
  7from bascenev1lib.actor.text import Text
  8from bascenev1lib.actor.image import Image
  9
 10
 11class MultiTeamScoreScreenActivity(bs.ScoreScreenActivity):
 12    """Base class for score screens."""
 13
 14    def __init__(self, settings: dict):
 15        super().__init__(settings=settings)
 16        self._score_display_sound = bs.getsound('scoreHit01')
 17        self._score_display_sound_small = bs.getsound('scoreHit02')
 18
 19        self._show_up_next: bool = True
 20
 21    def on_begin(self) -> None:
 22        super().on_begin()
 23        session = self.session
 24        if self._show_up_next and isinstance(session, bs.MultiTeamSession):
 25            txt = bs.Lstr(
 26                value='${A}   ${B}',
 27                subs=[
 28                    (
 29                        '${A}',
 30                        bs.Lstr(
 31                            resource='upNextText',
 32                            subs=[
 33                                ('${COUNT}', str(session.get_game_number() + 1))
 34                            ],
 35                        ),
 36                    ),
 37                    ('${B}', session.get_next_game_description()),
 38                ],
 39            )
 40            Text(
 41                txt,
 42                maxwidth=900,
 43                h_attach=Text.HAttach.CENTER,
 44                v_attach=Text.VAttach.BOTTOM,
 45                h_align=Text.HAlign.CENTER,
 46                v_align=Text.VAlign.CENTER,
 47                position=(0, 53),
 48                flash=False,
 49                color=(0.3, 0.3, 0.35, 1.0),
 50                transition=Text.Transition.FADE_IN,
 51                transition_delay=2.0,
 52            ).autoretain()
 53
 54    def show_player_scores(
 55        self,
 56        delay: float = 2.5,
 57        results: bs.GameResults | None = None,
 58        scale: float = 1.0,
 59        x_offset: float = 0.0,
 60        y_offset: float = 0.0,
 61    ) -> None:
 62        """Show scores for individual players."""
 63        # pylint: disable=too-many-locals
 64        # pylint: disable=too-many-statements
 65
 66        ts_v_offset = 150.0 + y_offset
 67        ts_h_offs = 80.0 + x_offset
 68        tdelay = delay
 69        spacing = 40
 70
 71        is_free_for_all = isinstance(self.session, bs.FreeForAllSession)
 72
 73        def _get_prec_score(p_rec: bs.PlayerRecord) -> int | None:
 74            if is_free_for_all and results is not None:
 75                assert isinstance(results, bs.GameResults)
 76                assert p_rec.team.activityteam is not None
 77                val = results.get_sessionteam_score(p_rec.team)
 78                return val
 79            return p_rec.accumscore
 80
 81        def _get_prec_score_str(p_rec: bs.PlayerRecord) -> str | bs.Lstr:
 82            if is_free_for_all and results is not None:
 83                assert isinstance(results, bs.GameResults)
 84                assert p_rec.team.activityteam is not None
 85                val = results.get_sessionteam_score_str(p_rec.team)
 86                assert val is not None
 87                return val
 88            return str(p_rec.accumscore)
 89
 90        # stats.get_records() can return players that are no longer in
 91        # the game.. if we're using results we have to filter those out
 92        # (since they're not in results and that's where we pull their
 93        # scores from)
 94        if results is not None:
 95            assert isinstance(results, bs.GameResults)
 96            player_records = []
 97            valid_players = list(self.stats.get_records().items())
 98
 99            # noinspection PyUnresolvedReferences
100            def _get_player_score_set_entry(
101                player: bs.SessionPlayer,
102            ) -> bs.PlayerRecord | None:
103                for p_rec in valid_players:
104                    if p_rec[1].player is player:
105                        return p_rec[1]
106                return None
107
108            # Results is already sorted; just convert it into a list of
109            # score-set-entries.
110            for winnergroup in results.winnergroups:
111                for team in winnergroup.teams:
112                    if len(team.players) == 1:
113                        player_entry = _get_player_score_set_entry(
114                            team.players[0]
115                        )
116                        if player_entry is not None:
117                            player_records.append(player_entry)
118        else:
119            player_records = []
120            player_records_scores = [
121                (_get_prec_score(p), name, p)
122                for name, p in list(self.stats.get_records().items())
123            ]
124            player_records_scores.sort(reverse=True)
125            player_records = [p[2] for p in player_records_scores]
126
127        voffs = -140.0 + spacing * len(player_records) * 0.5
128
129        def _txt(
130            xoffs: float,
131            yoffs: float,
132            text: bs.Lstr,
133            h_align: Text.HAlign = Text.HAlign.RIGHT,
134            extrascale: float = 1.0,
135            maxwidth: float | None = 120.0,
136        ) -> None:
137            Text(
138                text,
139                color=(0.5, 0.5, 0.6, 0.5),
140                position=(
141                    ts_h_offs + xoffs * scale,
142                    ts_v_offset + (voffs + yoffs + 4.0) * scale,
143                ),
144                h_align=h_align,
145                v_align=Text.VAlign.CENTER,
146                scale=0.8 * scale * extrascale,
147                maxwidth=maxwidth,
148                transition=Text.Transition.IN_LEFT,
149                transition_delay=tdelay,
150            ).autoretain()
151
152        session = self.session
153        assert isinstance(session, bs.MultiTeamSession)
154        tval = bs.Lstr(
155            resource='gameLeadersText',
156            subs=[('${COUNT}', str(session.get_game_number()))],
157        )
158        _txt(
159            180,
160            43,
161            tval,
162            h_align=Text.HAlign.CENTER,
163            extrascale=1.4,
164            maxwidth=None,
165        )
166        _txt(-15, 4, bs.Lstr(resource='playerText'), h_align=Text.HAlign.LEFT)
167        _txt(180, 4, bs.Lstr(resource='killsText'))
168        _txt(280, 4, bs.Lstr(resource='deathsText'), maxwidth=100)
169
170        score_label = 'Score' if results is None else results.score_label
171        translated = bs.Lstr(translate=('scoreNames', score_label))
172
173        _txt(390, 0, translated)
174
175        topkillcount = 0
176        topkilledcount = 99999
177        top_score = (
178            0 if not player_records else _get_prec_score(player_records[0])
179        )
180
181        for prec in player_records:
182            topkillcount = max(topkillcount, prec.accum_kill_count)
183            topkilledcount = min(topkilledcount, prec.accum_killed_count)
184
185        def _scoretxt(
186            text: str | bs.Lstr,
187            x_offs: float,
188            highlight: bool,
189            delay2: float,
190            maxwidth: float = 70.0,
191        ) -> None:
192            Text(
193                text,
194                position=(
195                    ts_h_offs + x_offs * scale,
196                    ts_v_offset + (voffs + 15) * scale,
197                ),
198                scale=scale,
199                color=(1.0, 0.9, 0.5, 1.0)
200                if highlight
201                else (0.5, 0.5, 0.6, 0.5),
202                h_align=Text.HAlign.RIGHT,
203                v_align=Text.VAlign.CENTER,
204                maxwidth=maxwidth,
205                transition=Text.Transition.IN_LEFT,
206                transition_delay=tdelay + delay2,
207            ).autoretain()
208
209        for playerrec in player_records:
210            tdelay += 0.05
211            voffs -= spacing
212            Image(
213                playerrec.get_icon(),
214                position=(
215                    ts_h_offs - 12 * scale,
216                    ts_v_offset + (voffs + 15.0) * scale,
217                ),
218                scale=(30.0 * scale, 30.0 * scale),
219                transition=Image.Transition.IN_LEFT,
220                transition_delay=tdelay,
221            ).autoretain()
222            Text(
223                bs.Lstr(value=playerrec.getname(full=True)),
224                maxwidth=160,
225                scale=0.75 * scale,
226                position=(
227                    ts_h_offs + 10.0 * scale,
228                    ts_v_offset + (voffs + 15) * scale,
229                ),
230                h_align=Text.HAlign.LEFT,
231                v_align=Text.VAlign.CENTER,
232                color=bs.safecolor(playerrec.team.color + (1,)),
233                transition=Text.Transition.IN_LEFT,
234                transition_delay=tdelay,
235            ).autoretain()
236            _scoretxt(
237                str(playerrec.accum_kill_count),
238                180,
239                playerrec.accum_kill_count == topkillcount,
240                0.1,
241            )
242            _scoretxt(
243                str(playerrec.accum_killed_count),
244                280,
245                playerrec.accum_killed_count == topkilledcount,
246                0.1,
247            )
248            _scoretxt(
249                _get_prec_score_str(playerrec),
250                390,
251                _get_prec_score(playerrec) == top_score,
252                0.2,
253            )
class MultiTeamScoreScreenActivity(bascenev1._activity.Activity[bascenev1._player.EmptyPlayer, bascenev1._team.EmptyTeam]):
 12class MultiTeamScoreScreenActivity(bs.ScoreScreenActivity):
 13    """Base class for score screens."""
 14
 15    def __init__(self, settings: dict):
 16        super().__init__(settings=settings)
 17        self._score_display_sound = bs.getsound('scoreHit01')
 18        self._score_display_sound_small = bs.getsound('scoreHit02')
 19
 20        self._show_up_next: bool = True
 21
 22    def on_begin(self) -> None:
 23        super().on_begin()
 24        session = self.session
 25        if self._show_up_next and isinstance(session, bs.MultiTeamSession):
 26            txt = bs.Lstr(
 27                value='${A}   ${B}',
 28                subs=[
 29                    (
 30                        '${A}',
 31                        bs.Lstr(
 32                            resource='upNextText',
 33                            subs=[
 34                                ('${COUNT}', str(session.get_game_number() + 1))
 35                            ],
 36                        ),
 37                    ),
 38                    ('${B}', session.get_next_game_description()),
 39                ],
 40            )
 41            Text(
 42                txt,
 43                maxwidth=900,
 44                h_attach=Text.HAttach.CENTER,
 45                v_attach=Text.VAttach.BOTTOM,
 46                h_align=Text.HAlign.CENTER,
 47                v_align=Text.VAlign.CENTER,
 48                position=(0, 53),
 49                flash=False,
 50                color=(0.3, 0.3, 0.35, 1.0),
 51                transition=Text.Transition.FADE_IN,
 52                transition_delay=2.0,
 53            ).autoretain()
 54
 55    def show_player_scores(
 56        self,
 57        delay: float = 2.5,
 58        results: bs.GameResults | None = None,
 59        scale: float = 1.0,
 60        x_offset: float = 0.0,
 61        y_offset: float = 0.0,
 62    ) -> None:
 63        """Show scores for individual players."""
 64        # pylint: disable=too-many-locals
 65        # pylint: disable=too-many-statements
 66
 67        ts_v_offset = 150.0 + y_offset
 68        ts_h_offs = 80.0 + x_offset
 69        tdelay = delay
 70        spacing = 40
 71
 72        is_free_for_all = isinstance(self.session, bs.FreeForAllSession)
 73
 74        def _get_prec_score(p_rec: bs.PlayerRecord) -> int | None:
 75            if is_free_for_all and results is not None:
 76                assert isinstance(results, bs.GameResults)
 77                assert p_rec.team.activityteam is not None
 78                val = results.get_sessionteam_score(p_rec.team)
 79                return val
 80            return p_rec.accumscore
 81
 82        def _get_prec_score_str(p_rec: bs.PlayerRecord) -> str | bs.Lstr:
 83            if is_free_for_all and results is not None:
 84                assert isinstance(results, bs.GameResults)
 85                assert p_rec.team.activityteam is not None
 86                val = results.get_sessionteam_score_str(p_rec.team)
 87                assert val is not None
 88                return val
 89            return str(p_rec.accumscore)
 90
 91        # stats.get_records() can return players that are no longer in
 92        # the game.. if we're using results we have to filter those out
 93        # (since they're not in results and that's where we pull their
 94        # scores from)
 95        if results is not None:
 96            assert isinstance(results, bs.GameResults)
 97            player_records = []
 98            valid_players = list(self.stats.get_records().items())
 99
100            # noinspection PyUnresolvedReferences
101            def _get_player_score_set_entry(
102                player: bs.SessionPlayer,
103            ) -> bs.PlayerRecord | None:
104                for p_rec in valid_players:
105                    if p_rec[1].player is player:
106                        return p_rec[1]
107                return None
108
109            # Results is already sorted; just convert it into a list of
110            # score-set-entries.
111            for winnergroup in results.winnergroups:
112                for team in winnergroup.teams:
113                    if len(team.players) == 1:
114                        player_entry = _get_player_score_set_entry(
115                            team.players[0]
116                        )
117                        if player_entry is not None:
118                            player_records.append(player_entry)
119        else:
120            player_records = []
121            player_records_scores = [
122                (_get_prec_score(p), name, p)
123                for name, p in list(self.stats.get_records().items())
124            ]
125            player_records_scores.sort(reverse=True)
126            player_records = [p[2] for p in player_records_scores]
127
128        voffs = -140.0 + spacing * len(player_records) * 0.5
129
130        def _txt(
131            xoffs: float,
132            yoffs: float,
133            text: bs.Lstr,
134            h_align: Text.HAlign = Text.HAlign.RIGHT,
135            extrascale: float = 1.0,
136            maxwidth: float | None = 120.0,
137        ) -> None:
138            Text(
139                text,
140                color=(0.5, 0.5, 0.6, 0.5),
141                position=(
142                    ts_h_offs + xoffs * scale,
143                    ts_v_offset + (voffs + yoffs + 4.0) * scale,
144                ),
145                h_align=h_align,
146                v_align=Text.VAlign.CENTER,
147                scale=0.8 * scale * extrascale,
148                maxwidth=maxwidth,
149                transition=Text.Transition.IN_LEFT,
150                transition_delay=tdelay,
151            ).autoretain()
152
153        session = self.session
154        assert isinstance(session, bs.MultiTeamSession)
155        tval = bs.Lstr(
156            resource='gameLeadersText',
157            subs=[('${COUNT}', str(session.get_game_number()))],
158        )
159        _txt(
160            180,
161            43,
162            tval,
163            h_align=Text.HAlign.CENTER,
164            extrascale=1.4,
165            maxwidth=None,
166        )
167        _txt(-15, 4, bs.Lstr(resource='playerText'), h_align=Text.HAlign.LEFT)
168        _txt(180, 4, bs.Lstr(resource='killsText'))
169        _txt(280, 4, bs.Lstr(resource='deathsText'), maxwidth=100)
170
171        score_label = 'Score' if results is None else results.score_label
172        translated = bs.Lstr(translate=('scoreNames', score_label))
173
174        _txt(390, 0, translated)
175
176        topkillcount = 0
177        topkilledcount = 99999
178        top_score = (
179            0 if not player_records else _get_prec_score(player_records[0])
180        )
181
182        for prec in player_records:
183            topkillcount = max(topkillcount, prec.accum_kill_count)
184            topkilledcount = min(topkilledcount, prec.accum_killed_count)
185
186        def _scoretxt(
187            text: str | bs.Lstr,
188            x_offs: float,
189            highlight: bool,
190            delay2: float,
191            maxwidth: float = 70.0,
192        ) -> None:
193            Text(
194                text,
195                position=(
196                    ts_h_offs + x_offs * scale,
197                    ts_v_offset + (voffs + 15) * scale,
198                ),
199                scale=scale,
200                color=(1.0, 0.9, 0.5, 1.0)
201                if highlight
202                else (0.5, 0.5, 0.6, 0.5),
203                h_align=Text.HAlign.RIGHT,
204                v_align=Text.VAlign.CENTER,
205                maxwidth=maxwidth,
206                transition=Text.Transition.IN_LEFT,
207                transition_delay=tdelay + delay2,
208            ).autoretain()
209
210        for playerrec in player_records:
211            tdelay += 0.05
212            voffs -= spacing
213            Image(
214                playerrec.get_icon(),
215                position=(
216                    ts_h_offs - 12 * scale,
217                    ts_v_offset + (voffs + 15.0) * scale,
218                ),
219                scale=(30.0 * scale, 30.0 * scale),
220                transition=Image.Transition.IN_LEFT,
221                transition_delay=tdelay,
222            ).autoretain()
223            Text(
224                bs.Lstr(value=playerrec.getname(full=True)),
225                maxwidth=160,
226                scale=0.75 * scale,
227                position=(
228                    ts_h_offs + 10.0 * scale,
229                    ts_v_offset + (voffs + 15) * scale,
230                ),
231                h_align=Text.HAlign.LEFT,
232                v_align=Text.VAlign.CENTER,
233                color=bs.safecolor(playerrec.team.color + (1,)),
234                transition=Text.Transition.IN_LEFT,
235                transition_delay=tdelay,
236            ).autoretain()
237            _scoretxt(
238                str(playerrec.accum_kill_count),
239                180,
240                playerrec.accum_kill_count == topkillcount,
241                0.1,
242            )
243            _scoretxt(
244                str(playerrec.accum_killed_count),
245                280,
246                playerrec.accum_killed_count == topkilledcount,
247                0.1,
248            )
249            _scoretxt(
250                _get_prec_score_str(playerrec),
251                390,
252                _get_prec_score(playerrec) == top_score,
253                0.2,
254            )

Base class for score screens.

MultiTeamScoreScreenActivity(settings: dict)
15    def __init__(self, settings: dict):
16        super().__init__(settings=settings)
17        self._score_display_sound = bs.getsound('scoreHit01')
18        self._score_display_sound_small = bs.getsound('scoreHit02')
19
20        self._show_up_next: bool = True

Creates an Activity in the current bascenev1.Session.

The activity will not be actually run until bascenev1.Session.setactivity is called. 'settings' should be a dict of key/value pairs specific to the activity.

Activities should preload as much of their media/etc as possible in their constructor, but none of it should actually be used until they are transitioned in.

def on_begin(self) -> None:
22    def on_begin(self) -> None:
23        super().on_begin()
24        session = self.session
25        if self._show_up_next and isinstance(session, bs.MultiTeamSession):
26            txt = bs.Lstr(
27                value='${A}   ${B}',
28                subs=[
29                    (
30                        '${A}',
31                        bs.Lstr(
32                            resource='upNextText',
33                            subs=[
34                                ('${COUNT}', str(session.get_game_number() + 1))
35                            ],
36                        ),
37                    ),
38                    ('${B}', session.get_next_game_description()),
39                ],
40            )
41            Text(
42                txt,
43                maxwidth=900,
44                h_attach=Text.HAttach.CENTER,
45                v_attach=Text.VAttach.BOTTOM,
46                h_align=Text.HAlign.CENTER,
47                v_align=Text.VAlign.CENTER,
48                position=(0, 53),
49                flash=False,
50                color=(0.3, 0.3, 0.35, 1.0),
51                transition=Text.Transition.FADE_IN,
52                transition_delay=2.0,
53            ).autoretain()

Called once the previous Activity has finished transitioning out.

At this point the activity's initial players and teams are filled in and it should begin its actual game logic.

def show_player_scores( self, delay: float = 2.5, results: bascenev1._gameresults.GameResults | None = None, scale: float = 1.0, x_offset: float = 0.0, y_offset: float = 0.0) -> None:
 55    def show_player_scores(
 56        self,
 57        delay: float = 2.5,
 58        results: bs.GameResults | None = None,
 59        scale: float = 1.0,
 60        x_offset: float = 0.0,
 61        y_offset: float = 0.0,
 62    ) -> None:
 63        """Show scores for individual players."""
 64        # pylint: disable=too-many-locals
 65        # pylint: disable=too-many-statements
 66
 67        ts_v_offset = 150.0 + y_offset
 68        ts_h_offs = 80.0 + x_offset
 69        tdelay = delay
 70        spacing = 40
 71
 72        is_free_for_all = isinstance(self.session, bs.FreeForAllSession)
 73
 74        def _get_prec_score(p_rec: bs.PlayerRecord) -> int | None:
 75            if is_free_for_all and results is not None:
 76                assert isinstance(results, bs.GameResults)
 77                assert p_rec.team.activityteam is not None
 78                val = results.get_sessionteam_score(p_rec.team)
 79                return val
 80            return p_rec.accumscore
 81
 82        def _get_prec_score_str(p_rec: bs.PlayerRecord) -> str | bs.Lstr:
 83            if is_free_for_all and results is not None:
 84                assert isinstance(results, bs.GameResults)
 85                assert p_rec.team.activityteam is not None
 86                val = results.get_sessionteam_score_str(p_rec.team)
 87                assert val is not None
 88                return val
 89            return str(p_rec.accumscore)
 90
 91        # stats.get_records() can return players that are no longer in
 92        # the game.. if we're using results we have to filter those out
 93        # (since they're not in results and that's where we pull their
 94        # scores from)
 95        if results is not None:
 96            assert isinstance(results, bs.GameResults)
 97            player_records = []
 98            valid_players = list(self.stats.get_records().items())
 99
100            # noinspection PyUnresolvedReferences
101            def _get_player_score_set_entry(
102                player: bs.SessionPlayer,
103            ) -> bs.PlayerRecord | None:
104                for p_rec in valid_players:
105                    if p_rec[1].player is player:
106                        return p_rec[1]
107                return None
108
109            # Results is already sorted; just convert it into a list of
110            # score-set-entries.
111            for winnergroup in results.winnergroups:
112                for team in winnergroup.teams:
113                    if len(team.players) == 1:
114                        player_entry = _get_player_score_set_entry(
115                            team.players[0]
116                        )
117                        if player_entry is not None:
118                            player_records.append(player_entry)
119        else:
120            player_records = []
121            player_records_scores = [
122                (_get_prec_score(p), name, p)
123                for name, p in list(self.stats.get_records().items())
124            ]
125            player_records_scores.sort(reverse=True)
126            player_records = [p[2] for p in player_records_scores]
127
128        voffs = -140.0 + spacing * len(player_records) * 0.5
129
130        def _txt(
131            xoffs: float,
132            yoffs: float,
133            text: bs.Lstr,
134            h_align: Text.HAlign = Text.HAlign.RIGHT,
135            extrascale: float = 1.0,
136            maxwidth: float | None = 120.0,
137        ) -> None:
138            Text(
139                text,
140                color=(0.5, 0.5, 0.6, 0.5),
141                position=(
142                    ts_h_offs + xoffs * scale,
143                    ts_v_offset + (voffs + yoffs + 4.0) * scale,
144                ),
145                h_align=h_align,
146                v_align=Text.VAlign.CENTER,
147                scale=0.8 * scale * extrascale,
148                maxwidth=maxwidth,
149                transition=Text.Transition.IN_LEFT,
150                transition_delay=tdelay,
151            ).autoretain()
152
153        session = self.session
154        assert isinstance(session, bs.MultiTeamSession)
155        tval = bs.Lstr(
156            resource='gameLeadersText',
157            subs=[('${COUNT}', str(session.get_game_number()))],
158        )
159        _txt(
160            180,
161            43,
162            tval,
163            h_align=Text.HAlign.CENTER,
164            extrascale=1.4,
165            maxwidth=None,
166        )
167        _txt(-15, 4, bs.Lstr(resource='playerText'), h_align=Text.HAlign.LEFT)
168        _txt(180, 4, bs.Lstr(resource='killsText'))
169        _txt(280, 4, bs.Lstr(resource='deathsText'), maxwidth=100)
170
171        score_label = 'Score' if results is None else results.score_label
172        translated = bs.Lstr(translate=('scoreNames', score_label))
173
174        _txt(390, 0, translated)
175
176        topkillcount = 0
177        topkilledcount = 99999
178        top_score = (
179            0 if not player_records else _get_prec_score(player_records[0])
180        )
181
182        for prec in player_records:
183            topkillcount = max(topkillcount, prec.accum_kill_count)
184            topkilledcount = min(topkilledcount, prec.accum_killed_count)
185
186        def _scoretxt(
187            text: str | bs.Lstr,
188            x_offs: float,
189            highlight: bool,
190            delay2: float,
191            maxwidth: float = 70.0,
192        ) -> None:
193            Text(
194                text,
195                position=(
196                    ts_h_offs + x_offs * scale,
197                    ts_v_offset + (voffs + 15) * scale,
198                ),
199                scale=scale,
200                color=(1.0, 0.9, 0.5, 1.0)
201                if highlight
202                else (0.5, 0.5, 0.6, 0.5),
203                h_align=Text.HAlign.RIGHT,
204                v_align=Text.VAlign.CENTER,
205                maxwidth=maxwidth,
206                transition=Text.Transition.IN_LEFT,
207                transition_delay=tdelay + delay2,
208            ).autoretain()
209
210        for playerrec in player_records:
211            tdelay += 0.05
212            voffs -= spacing
213            Image(
214                playerrec.get_icon(),
215                position=(
216                    ts_h_offs - 12 * scale,
217                    ts_v_offset + (voffs + 15.0) * scale,
218                ),
219                scale=(30.0 * scale, 30.0 * scale),
220                transition=Image.Transition.IN_LEFT,
221                transition_delay=tdelay,
222            ).autoretain()
223            Text(
224                bs.Lstr(value=playerrec.getname(full=True)),
225                maxwidth=160,
226                scale=0.75 * scale,
227                position=(
228                    ts_h_offs + 10.0 * scale,
229                    ts_v_offset + (voffs + 15) * scale,
230                ),
231                h_align=Text.HAlign.LEFT,
232                v_align=Text.VAlign.CENTER,
233                color=bs.safecolor(playerrec.team.color + (1,)),
234                transition=Text.Transition.IN_LEFT,
235                transition_delay=tdelay,
236            ).autoretain()
237            _scoretxt(
238                str(playerrec.accum_kill_count),
239                180,
240                playerrec.accum_kill_count == topkillcount,
241                0.1,
242            )
243            _scoretxt(
244                str(playerrec.accum_killed_count),
245                280,
246                playerrec.accum_killed_count == topkilledcount,
247                0.1,
248            )
249            _scoretxt(
250                _get_prec_score_str(playerrec),
251                390,
252                _get_prec_score(playerrec) == top_score,
253                0.2,
254            )

Show scores for individual players.

Inherited Members
bascenev1._activitytypes.ScoreScreenActivity
transition_time
inherits_tint
inherits_vr_camera_offset
use_fixed_vr_overlay
default_music
on_player_join
on_transition_in
bascenev1._activity.Activity
settings_raw
teams
players
announce_player_deaths
is_joining_activity
allow_pausing
allow_kick_idle_players
slow_motion
inherits_slow_motion
inherits_music
inherits_vr_overlay_center
allow_mid_activity_joins
can_show_ad_on_death
paused_text
preloads
lobby
context
globalsnode
stats
on_expire
customdata
expired
playertype
teamtype
retain_actor
add_actor_weak_ref
session
on_player_leave
on_team_join
on_team_leave
on_transition_out
handlemessage
has_transitioned_in
has_begun
has_ended
is_transitioning_out
transition_out
end
create_player
create_team
bascenev1._dependency.DependencyComponent
dep_is_present
get_dynamic_deps