mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-19 21:37:57 +08:00
woohoo pycharm checks are finally passing again
This commit is contained in:
parent
f966ee330d
commit
2de0bed496
32
.efrocachemap
generated
32
.efrocachemap
generated
@ -4080,18 +4080,18 @@
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/b0/85/d8778105cf5a536cb5e6e618c723",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/e8/41/5128ac78c21f238d0613ab8e2ece",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/7f/4d/96dadaf30683f4a69426518ca334",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/c3/ca/939e97f16820b0ee1af7d190ca85",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/14/14/9f38fb471edd66d076b9d611ba55",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/12/37/d741089b132fbcb8b22d9795479a",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/d7/ab/b4e7f9aa5b15b38606051341deae",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/b0/4f/e9ab4d8fc7405d9c8f667eaacb73",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/7e/2f/2e475906c60e960a63fdd3e5f24d",
|
||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/c1/fb/5c472b18817431b3e5d5dc7ed27e",
|
||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/34/48/662a2168751cd25eaae50f0707df",
|
||||
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/1d/2f/ab1c77b292726178d0eb1f5699ad",
|
||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/e5/f3/6ac25a8397a62ec4af1d9d5d2c37",
|
||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/44/b8/3c6e810fa14f014b9c91db7ab88a",
|
||||
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/14/59/2164e23d78a6b16a97b3bfe7bdb2",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/f1/74/0cd435f4a2c4c585f96f7f92f0d9",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/7b/af/0a54bb0a94e2054e486d41a54952",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/e5/9a/0de72b7deec764c81076a97a0a00",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/e0/69/2dd80316d1d73969095a85b1d0aa",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/4f/91/83fa21e46183f74300820e98f4a1",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/61/f5/18b5f9055fb48a1c91ce25f45dee",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/87/53/556e49d3273d4be8bfeba546ecb8",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/98/9b/73c254c31fe68fc21cae40a1761e",
|
||||
"build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/29/dc/e5b08aae2dbe3222082aaa1e90e7",
|
||||
"build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/ce/bb/5796a83ce9d1c9cf58e08f3ff351",
|
||||
"build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/31/65/014221e46f7974f40aa84c8922dc",
|
||||
@ -4108,14 +4108,14 @@
|
||||
"build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/14/4b/68a0ece3c1f191183b695cf45a4d",
|
||||
"build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/1f/3f/d899a46cc0dc8bc4f1b38f9318a5",
|
||||
"build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/de/99/95fdcb3f614a7b83ada148bca38d",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/f5/47/9db7c01a8a19ea55583a909adf14",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/ad/20/3b72e7abc0d54e7b94780bc6edbe",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/38/61/f5eb3377a746196a6fcad3707926",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/59/6d/f02c05860b022da85fcd56b5f6a8",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/8e/6f/61887ab9d3bc3ddc1a411b78b625",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/2a/3e/9ef7f4d59cbbc8ce2b92913b3f6f",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/7d/1a/63e81c69d5fc9275932c15ca8fc1",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/2d/f1/fd7463cf926c19c5e7fe1232e997",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/74/cb/8be4f4dec7fd2bf11920a48c5446",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/ee/30/7d0a59834145150a5a64d29f2add",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/ad/53/a20f19509c6f90472c46004618e7",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/d7/20/8311a232ef822de08b7eea1185e5",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/f9/bb/cfb390d5f9d37997cacc804ee7ae",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/a6/fa/5651f4f3329109515ad15fbf7fbc",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/d8/49/3f000f69e2b50364b7d444f90b3f",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/7b/bd/aff34983fc5a00bfb59fd47d14cb",
|
||||
"src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/52/c6/c11130af7b10d6c0321add5518fa",
|
||||
"src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/38/c3/1dedd5e74f2508efc5974c8815a1",
|
||||
"src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/ea/6a/6a4721b144e5e297b542d2a0eea2",
|
||||
|
||||
2
.idea/dictionaries/ericf.xml
generated
2
.idea/dictionaries/ericf.xml
generated
@ -264,6 +264,7 @@
|
||||
<w>basntoclient</w>
|
||||
<w>bastd</w>
|
||||
<w>batemplatefs</w>
|
||||
<w>batemplatefsmeta</w>
|
||||
<w>batocloud</w>
|
||||
<w>batools</w>
|
||||
<w>batoolsinternal</w>
|
||||
@ -2639,6 +2640,7 @@
|
||||
<w>spinoffconfig</w>
|
||||
<w>spinoffdata</w>
|
||||
<w>spinoffs</w>
|
||||
<w>spinofftest</w>
|
||||
<w>spinup</w>
|
||||
<w>splayer</w>
|
||||
<w>splitlen</w>
|
||||
|
||||
26
Makefile
26
Makefile
@ -751,20 +751,14 @@ check-full: py_check_prereqs
|
||||
|
||||
# Same as 'check' plus optional/slow extra checks.
|
||||
check2: py_check_prereqs
|
||||
# TEMP - disabling some during 1.7.20 refactor.
|
||||
@$(DMAKE) -j$(CPUS) update-check cpplint pylint mypy
|
||||
@$(DMAKE) -j$(CPUS) update-check cpplint pylint mypy pycharm
|
||||
@tools/pcommand echo SGRN BLD ALL CHECKS PASSED!
|
||||
# @$(DMAKE) -j$(CPUS) update-check cpplint pylint mypy pycharm
|
||||
# @tools/pcommand echo SGRN BLD ALL CHECKS PASSED!
|
||||
|
||||
# Same as check2 but no caching (all files are checked).
|
||||
# TEMP - disabling some checks during 1.7.20 refactor.
|
||||
check2-full: py_check_prereqs
|
||||
@$(DMAKE) -j$(CPUS) update-check cpplint-full pylint-full mypy-full
|
||||
@$(DMAKE) -j$(CPUS) update-check cpplint-full pylint-full mypy-full \
|
||||
pycharm-full
|
||||
@tools/pcommand echo SGRN BLD ALL CHECKS PASSED!
|
||||
# @$(DMAKE) -j$(CPUS) update-check cpplint-full pylint-full mypy-full \
|
||||
# pycharm-full
|
||||
# @tools/pcommand echo SGRN BLD ALL CHECKS PASSED!
|
||||
|
||||
# Run Cpplint checks on all C/C++ code.
|
||||
cpplint: prereqs meta
|
||||
@ -894,27 +888,17 @@ preflight-full:
|
||||
|
||||
# Same as 'preflight' plus optional/slow extra checks.
|
||||
preflight2:
|
||||
# TEMP - disabling some checks during the 1.7.20 refactor
|
||||
@$(MAKE) format
|
||||
@$(MAKE) update
|
||||
@$(MAKE) -j$(CPUS) cpplint pylint mypy test
|
||||
@$(MAKE) -j$(CPUS) cpplint pylint mypy pycharm test
|
||||
@tools/pcommand echo SGRN BLD PREFLIGHT SUCCESSFUL!
|
||||
# @$(MAKE) format
|
||||
# @$(MAKE) update
|
||||
# @$(MAKE) -j$(CPUS) cpplint pylint mypy pycharm test
|
||||
# @tools/pcommand echo SGRN BLD PREFLIGHT SUCCESSFUL!
|
||||
|
||||
# Same as 'preflight2' but without caching (all files visited).
|
||||
preflight2-full:
|
||||
# TEMP - disabling some checks during the 1.7.20 refactor
|
||||
@$(MAKE) format-full
|
||||
@$(MAKE) update
|
||||
@$(MAKE) -j$(CPUS) cpplint-full pylint-full mypy-full test-full
|
||||
@$(MAKE) -j$(CPUS) cpplint-full pylint-full mypy-full pycharm-full test-full
|
||||
@tools/pcommand echo SGRN BLD PREFLIGHT SUCCESSFUL!
|
||||
# @$(MAKE) format-full
|
||||
# @$(MAKE) update
|
||||
# @$(MAKE) -j$(CPUS) cpplint-full pylint-full mypy-full pycharm-full test-full
|
||||
# @tools/pcommand echo SGRN BLD PREFLIGHT SUCCESSFUL!
|
||||
|
||||
# Tell make which of these targets don't represent files.
|
||||
.PHONY: preflight preflight-full preflight2 preflight2-full
|
||||
|
||||
2
ballisticakit-cmake/.idea/dictionaries/ericf.xml
generated
2
ballisticakit-cmake/.idea/dictionaries/ericf.xml
generated
@ -160,6 +160,7 @@
|
||||
<w>basntoclient</w>
|
||||
<w>bastd</w>
|
||||
<w>batemplatefs</w>
|
||||
<w>batemplatefsmeta</w>
|
||||
<w>batocloud</w>
|
||||
<w>batoolsinternal</w>
|
||||
<w>bauiv</w>
|
||||
@ -1509,6 +1510,7 @@
|
||||
<w>sphrand</w>
|
||||
<w>spinoff's</w>
|
||||
<w>spinoffconfig</w>
|
||||
<w>spinofftest</w>
|
||||
<w>spinup</w>
|
||||
<w>spivak</w>
|
||||
<w>spwd</w>
|
||||
|
||||
@ -19,9 +19,7 @@ import logging
|
||||
# module to keep things simple.
|
||||
|
||||
from efro.util import set_canonical_module_names
|
||||
|
||||
|
||||
from _babase import (
|
||||
from babase import (
|
||||
app,
|
||||
ContextRef,
|
||||
lock_all_input,
|
||||
@ -38,25 +36,25 @@ from _babase import (
|
||||
displaytime,
|
||||
displaytimer,
|
||||
DisplayTimer,
|
||||
)
|
||||
from babase import Plugin
|
||||
from babase._appintent import AppIntent, AppIntentDefault, AppIntentExec
|
||||
from babase._appmode import AppMode
|
||||
from babase._error import NotFoundError, NodeNotFoundError, ContextError
|
||||
from babase._language import Lstr
|
||||
from babase._general import (
|
||||
Plugin,
|
||||
AppIntent,
|
||||
AppIntentDefault,
|
||||
AppIntentExec,
|
||||
AppMode,
|
||||
NotFoundError,
|
||||
NodeNotFoundError,
|
||||
ContextError,
|
||||
Lstr,
|
||||
WeakCall,
|
||||
Call,
|
||||
storagename,
|
||||
existing,
|
||||
AppTime,
|
||||
DisplayTime,
|
||||
)
|
||||
from babase._math import is_point_in_box, normalized_color
|
||||
from babase._text import timestring
|
||||
from babase._apputils import get_remote_app_name
|
||||
|
||||
from babase._mgen.enums import (
|
||||
is_point_in_box,
|
||||
normalized_color,
|
||||
timestring,
|
||||
get_remote_app_name,
|
||||
UIScale,
|
||||
InputType,
|
||||
)
|
||||
@ -140,7 +138,6 @@ from _bascenev1 import (
|
||||
basetimer,
|
||||
BaseTimer,
|
||||
)
|
||||
|
||||
from bascenev1._profile import (
|
||||
get_player_colors,
|
||||
get_player_profile_icon,
|
||||
|
||||
@ -224,9 +224,7 @@ class Activity(DependencyComponent, Generic[PlayerT, TeamT]):
|
||||
bascenev1.NotFoundError.
|
||||
"""
|
||||
if self._stats is None:
|
||||
from babase._error import NotFoundError
|
||||
|
||||
raise NotFoundError()
|
||||
raise babase.NotFoundError()
|
||||
return self._stats
|
||||
|
||||
def on_expire(self) -> None:
|
||||
@ -337,9 +335,7 @@ class Activity(DependencyComponent, Generic[PlayerT, TeamT]):
|
||||
"""
|
||||
session = self._session()
|
||||
if session is None:
|
||||
from babase._error import SessionNotFoundError
|
||||
|
||||
raise SessionNotFoundError()
|
||||
raise babase.SessionNotFoundError()
|
||||
return session
|
||||
|
||||
def on_player_join(self, player: PlayerT) -> None:
|
||||
|
||||
@ -734,7 +734,6 @@ class GameActivity(Activity[PlayerT, TeamT]):
|
||||
|
||||
def _show_tip(self) -> None:
|
||||
# pylint: disable=too-many-locals
|
||||
from babase._mgen.enums import SpecialChar
|
||||
from bascenev1._gameutils import animate, GameTip
|
||||
|
||||
# If there's any tips left on the list, display one.
|
||||
@ -754,7 +753,9 @@ class GameActivity(Activity[PlayerT, TeamT]):
|
||||
# Do a few substitutions.
|
||||
tip_lstr = babase.Lstr(
|
||||
translate=('tips', tip),
|
||||
subs=[('${PICKUP}', babase.charstr(SpecialChar.TOP_BUTTON))],
|
||||
subs=[
|
||||
('${PICKUP}', babase.charstr(babase.SpecialChar.TOP_BUTTON))
|
||||
],
|
||||
)
|
||||
base_position = (75, 50)
|
||||
tip_scale = 0.8
|
||||
@ -944,7 +945,6 @@ class GameActivity(Activity[PlayerT, TeamT]):
|
||||
"""Create and wire up a bascenev1.PlayerSpaz for the provided Player."""
|
||||
# pylint: disable=too-many-locals
|
||||
# pylint: disable=cyclic-import
|
||||
from babase import _math
|
||||
from bascenev1._gameutils import animate
|
||||
from bascenev1._coopsession import CoopSession
|
||||
from bascenev1lib.actor.playerspaz import PlayerSpaz
|
||||
@ -957,7 +957,7 @@ class GameActivity(Activity[PlayerT, TeamT]):
|
||||
if not issubclass(playerspaztype, PlayerSpaz):
|
||||
playerspaztype = PlayerSpaz
|
||||
|
||||
light_color = _math.normalized_color(color)
|
||||
light_color = babase.normalized_color(color)
|
||||
display_color = babase.safecolor(color, target_intensity=0.75)
|
||||
spaz = playerspaztype(
|
||||
color=color,
|
||||
|
||||
@ -7,6 +7,8 @@ import copy
|
||||
import weakref
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
import babase
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Any
|
||||
|
||||
@ -66,9 +68,7 @@ class Level:
|
||||
@property
|
||||
def displayname(self) -> bascenev1.Lstr:
|
||||
"""The localized name for this Level."""
|
||||
from babase import _language
|
||||
|
||||
return _language.Lstr(
|
||||
return babase.Lstr(
|
||||
translate=(
|
||||
'coopLevelNames',
|
||||
self._displayname
|
||||
|
||||
@ -138,8 +138,6 @@ class PlayerRecord:
|
||||
"""Submit a kill for this player entry."""
|
||||
# FIXME Clean this up.
|
||||
# pylint: disable=too-many-statements
|
||||
from babase._language import Lstr
|
||||
from babase._general import Call
|
||||
|
||||
self._multi_kill_count += 1
|
||||
stats = self._stats()
|
||||
@ -153,35 +151,35 @@ class PlayerRecord:
|
||||
sound = None
|
||||
elif self._multi_kill_count == 2:
|
||||
score = 20
|
||||
name = Lstr(resource='twoKillText')
|
||||
name = babase.Lstr(resource='twoKillText')
|
||||
color = (0.1, 1.0, 0.0, 1)
|
||||
scale = 1.0
|
||||
delay = 0.0
|
||||
sound = stats.orchestrahitsound1
|
||||
elif self._multi_kill_count == 3:
|
||||
score = 40
|
||||
name = Lstr(resource='threeKillText')
|
||||
name = babase.Lstr(resource='threeKillText')
|
||||
color = (1.0, 0.7, 0.0, 1)
|
||||
scale = 1.1
|
||||
delay = 0.3
|
||||
sound = stats.orchestrahitsound2
|
||||
elif self._multi_kill_count == 4:
|
||||
score = 60
|
||||
name = Lstr(resource='fourKillText')
|
||||
name = babase.Lstr(resource='fourKillText')
|
||||
color = (1.0, 1.0, 0.0, 1)
|
||||
scale = 1.2
|
||||
delay = 0.6
|
||||
sound = stats.orchestrahitsound3
|
||||
elif self._multi_kill_count == 5:
|
||||
score = 80
|
||||
name = Lstr(resource='fiveKillText')
|
||||
name = babase.Lstr(resource='fiveKillText')
|
||||
color = (1.0, 0.5, 0.0, 1)
|
||||
scale = 1.3
|
||||
delay = 0.9
|
||||
sound = stats.orchestrahitsound4
|
||||
else:
|
||||
score = 100
|
||||
name = Lstr(
|
||||
name = babase.Lstr(
|
||||
resource='multiKillText',
|
||||
subs=[('${COUNT}', str(self._multi_kill_count))],
|
||||
)
|
||||
@ -191,7 +189,7 @@ class PlayerRecord:
|
||||
sound = stats.orchestrahitsound4
|
||||
|
||||
def _apply(
|
||||
name2: Lstr,
|
||||
name2: babase.Lstr,
|
||||
score2: int,
|
||||
showpoints2: bool,
|
||||
color2: tuple[float, float, float, float],
|
||||
@ -221,7 +219,7 @@ class PlayerRecord:
|
||||
activity = self.getactivity()
|
||||
if activity is not None:
|
||||
PopupText(
|
||||
Lstr(
|
||||
babase.Lstr(
|
||||
value=(('+' + str(score2) + ' ') if showpoints2 else '')
|
||||
+ '${N}',
|
||||
subs=[('${N}', name2)],
|
||||
@ -243,7 +241,9 @@ class PlayerRecord:
|
||||
if name is not None:
|
||||
_bascenev1.timer(
|
||||
0.3 + delay,
|
||||
Call(_apply, name, score, showpoints, color, scale, sound),
|
||||
babase.Call(
|
||||
_apply, name, score, showpoints, color, scale, sound
|
||||
),
|
||||
)
|
||||
|
||||
# Keep the tally rollin'...
|
||||
@ -361,10 +361,8 @@ class Stats:
|
||||
# pylint: disable=cyclic-import
|
||||
# pylint: disable=too-many-branches
|
||||
# pylint: disable=too-many-locals
|
||||
# pylint: disable=too-many-statements
|
||||
from bascenev1lib.actor.popuptext import PopupText
|
||||
from babase import _math
|
||||
from babase._language import Lstr
|
||||
|
||||
from bascenev1._gameactivity import GameActivity
|
||||
|
||||
del victim_player # Currently unused.
|
||||
@ -390,11 +388,11 @@ class Stats:
|
||||
if isinstance(activity, GameActivity):
|
||||
name_full = player.getname(full=True, icon=False)
|
||||
activity.show_zoom_message(
|
||||
Lstr(
|
||||
babase.Lstr(
|
||||
resource='nameScoresText',
|
||||
subs=[('${NAME}', name_full)],
|
||||
),
|
||||
color=_math.normalized_color(player.team.color),
|
||||
color=babase.normalized_color(player.team.color),
|
||||
)
|
||||
except Exception:
|
||||
logging.exception('Error showing big_message.')
|
||||
@ -416,12 +414,14 @@ class Stats:
|
||||
activity = self.getactivity()
|
||||
if activity is not None:
|
||||
if title is not None:
|
||||
sval = Lstr(
|
||||
sval = babase.Lstr(
|
||||
value='+${A} ${B}',
|
||||
subs=[('${A}', str(points)), ('${B}', title)],
|
||||
)
|
||||
else:
|
||||
sval = Lstr(value='+${A}', subs=[('${A}', str(points))])
|
||||
sval = babase.Lstr(
|
||||
value='+${A}', subs=[('${A}', str(points))]
|
||||
)
|
||||
PopupText(
|
||||
sval,
|
||||
color=display_color,
|
||||
@ -438,7 +438,9 @@ class Stats:
|
||||
try:
|
||||
if screenmessage and not kill:
|
||||
_bascenev1.screenmessage(
|
||||
Lstr(resource='nameScoresText', subs=[('${NAME}', name)]),
|
||||
babase.Lstr(
|
||||
resource='nameScoresText', subs=[('${NAME}', name)]
|
||||
),
|
||||
top=True,
|
||||
color=player.color,
|
||||
image=player.get_icon(),
|
||||
@ -464,8 +466,6 @@ class Stats:
|
||||
killer: bascenev1.Player | None = None,
|
||||
) -> None:
|
||||
"""Should be called when a player is killed."""
|
||||
from babase._language import Lstr
|
||||
|
||||
name = player.getname()
|
||||
prec = self._player_records[name]
|
||||
prec.streak = 0
|
||||
@ -476,7 +476,7 @@ class Stats:
|
||||
if killed and _bascenev1.getactivity().announce_player_deaths:
|
||||
if killer is player:
|
||||
_bascenev1.screenmessage(
|
||||
Lstr(
|
||||
babase.Lstr(
|
||||
resource='nameSuicideText', subs=[('${NAME}', name)]
|
||||
),
|
||||
top=True,
|
||||
@ -486,7 +486,7 @@ class Stats:
|
||||
elif killer is not None:
|
||||
if killer.team is player.team:
|
||||
_bascenev1.screenmessage(
|
||||
Lstr(
|
||||
babase.Lstr(
|
||||
resource='nameBetrayedText',
|
||||
subs=[
|
||||
('${NAME}', killer.getname()),
|
||||
@ -499,7 +499,7 @@ class Stats:
|
||||
)
|
||||
else:
|
||||
_bascenev1.screenmessage(
|
||||
Lstr(
|
||||
babase.Lstr(
|
||||
resource='nameKilledText',
|
||||
subs=[
|
||||
('${NAME}', killer.getname()),
|
||||
@ -512,7 +512,9 @@ class Stats:
|
||||
)
|
||||
else:
|
||||
_bascenev1.screenmessage(
|
||||
Lstr(resource='nameDiedText', subs=[('${NAME}', name)]),
|
||||
babase.Lstr(
|
||||
resource='nameDiedText', subs=[('${NAME}', name)]
|
||||
),
|
||||
top=True,
|
||||
color=player.color,
|
||||
image=player.get_icon(),
|
||||
|
||||
@ -4,6 +4,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from typing import TYPE_CHECKING, TypeVar
|
||||
|
||||
import babase
|
||||
@ -99,9 +100,7 @@ class TeamGameActivity(GameActivity[PlayerT, TeamT]):
|
||||
'Team Player'
|
||||
)
|
||||
except Exception:
|
||||
from babase import _error
|
||||
|
||||
_error.print_exception()
|
||||
logging.exception('Error in on_begin.')
|
||||
|
||||
def spawn_player_spaz(
|
||||
self,
|
||||
|
||||
@ -1427,6 +1427,8 @@ class CoopScoreScreen(bs.Activity[bs.Player, bs.Team]):
|
||||
tourney_info = bs.app.classic.accounts.tournament_info[
|
||||
tournament_id
|
||||
]
|
||||
# pylint: disable=useless-suppression
|
||||
# pylint: disable=unbalanced-tuple-unpacking
|
||||
(
|
||||
pr1,
|
||||
pv1,
|
||||
@ -1437,6 +1439,8 @@ class CoopScoreScreen(bs.Activity[bs.Player, bs.Team]):
|
||||
) = bs.app.classic.get_tournament_prize_strings(
|
||||
tourney_info
|
||||
)
|
||||
# pylint: enable=unbalanced-tuple-unpacking
|
||||
# pylint: enable=useless-suppression
|
||||
|
||||
Text(
|
||||
bs.Lstr(resource='coopSelectWindow.prizesText'),
|
||||
|
||||
@ -87,7 +87,7 @@ class StoreBrowserWindow(bui.Window):
|
||||
self._current_tab: StoreBrowserWindow.TabID | None = None
|
||||
extra_top = 30 if uiscale is bui.UIScale.SMALL else 0
|
||||
|
||||
self._request: Any = None
|
||||
self.request: Any = None
|
||||
self._r = 'store'
|
||||
self._last_buy_time: float | None = None
|
||||
|
||||
@ -467,13 +467,13 @@ class StoreBrowserWindow(bui.Window):
|
||||
# FIXME: clean this up.
|
||||
# pylint: disable=protected-access
|
||||
window = self._window()
|
||||
if window is not None and (window._request is self):
|
||||
window._request = None
|
||||
if window is not None and (window.request is self):
|
||||
window.request = None
|
||||
# noinspection PyProtectedMember
|
||||
window._on_response(data)
|
||||
|
||||
# Kick off a server request.
|
||||
self._request = _Request(self)
|
||||
self.request = _Request(self)
|
||||
|
||||
# Actually start the purchase locally.
|
||||
def _purchase_check_result(
|
||||
|
||||
@ -179,12 +179,17 @@ def _writefuncs(
|
||||
if is_classmethod:
|
||||
defslines = f'{indstr}@classmethod\n{defslines}'
|
||||
|
||||
if funcname == 'quit':
|
||||
if funcname in {'quit', 'newnode', 'basetimer'}:
|
||||
defslines = (
|
||||
f'{indstr}# noinspection PyShadowingBuiltins\n'
|
||||
f'{defslines}'
|
||||
)
|
||||
|
||||
if funcname in {'basetimer', 'timer'}:
|
||||
defslines = (
|
||||
f'{indstr}# noinspection PyShadowingNames\n' f'{defslines}'
|
||||
)
|
||||
|
||||
# Types can be strings for forward-declaration cases.
|
||||
if (returns[0] == "'" and returns[-1] == "'") or (
|
||||
returns[0] == '"' and returns[-1] == '"'
|
||||
@ -654,6 +659,7 @@ def _formatdoc(
|
||||
|
||||
def _writeclasses(module: ModuleType, classnames: Sequence[str]) -> str:
|
||||
# pylint: disable=too-many-branches
|
||||
# pylint: disable=too-many-statements
|
||||
from batools.docs import parse_docs_attrs
|
||||
|
||||
out = ''
|
||||
@ -663,6 +669,13 @@ def _writeclasses(module: ModuleType, classnames: Sequence[str]) -> str:
|
||||
raise RuntimeError('unexpected')
|
||||
out += '\n' '\n'
|
||||
|
||||
# Special case: get PyCharm to shut up about Node's methods
|
||||
# shadowing builtin types.
|
||||
if classname in {'Node', 'SessionPlayer'}:
|
||||
out += '# noinspection PyShadowingBuiltins\n'
|
||||
if classname in {'Timer', 'BaseTimer'}:
|
||||
out += '# noinspection PyShadowingNames\n'
|
||||
|
||||
# Special case:
|
||||
if classname == 'Vec3':
|
||||
out += f'class {classname}(Sequence[float]):\n'
|
||||
@ -818,7 +831,8 @@ class Generator:
|
||||
enum_import_lines = (
|
||||
''
|
||||
if self.mname == '_babase'
|
||||
else 'from babase._mgen.enums import TimeFormat, TimeType\n\n'
|
||||
# else 'from babase._mgen.enums import TimeFormat, TimeType\n\n'
|
||||
else ''
|
||||
if self.mname == '_bascenev1'
|
||||
else ''
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user