disabled mypy implicit optionals

This commit is contained in:
Eric Froemling 2022-06-25 07:30:37 -07:00
parent 5c601a36df
commit bbd17fe791
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
105 changed files with 718 additions and 647 deletions

View File

@ -420,7 +420,7 @@
"assets/build/ba_data/audio/zoeOw.ogg": "https://files.ballistica.net/cache/ba1/dc/d2/160fc27fcaff10793327ac2c70fd", "assets/build/ba_data/audio/zoeOw.ogg": "https://files.ballistica.net/cache/ba1/dc/d2/160fc27fcaff10793327ac2c70fd",
"assets/build/ba_data/audio/zoePickup01.ogg": "https://files.ballistica.net/cache/ba1/11/7a/87d6bca0acfb877fd4fd8fe3a598", "assets/build/ba_data/audio/zoePickup01.ogg": "https://files.ballistica.net/cache/ba1/11/7a/87d6bca0acfb877fd4fd8fe3a598",
"assets/build/ba_data/audio/zoeScream01.ogg": "https://files.ballistica.net/cache/ba1/44/f5/c943c9075abb3e1835d2408a1ef8", "assets/build/ba_data/audio/zoeScream01.ogg": "https://files.ballistica.net/cache/ba1/44/f5/c943c9075abb3e1835d2408a1ef8",
"assets/build/ba_data/data/langdata.json": "https://files.ballistica.net/cache/ba1/d9/7a/82db6c8a2513ebd2a2db9f2b25f7", "assets/build/ba_data/data/langdata.json": "https://files.ballistica.net/cache/ba1/08/f4/15b670652c536067374b14a0097c",
"assets/build/ba_data/data/languages/arabic.json": "https://files.ballistica.net/cache/ba1/4c/fd/67a9dcdecb85dbaf549a8fbbdc78", "assets/build/ba_data/data/languages/arabic.json": "https://files.ballistica.net/cache/ba1/4c/fd/67a9dcdecb85dbaf549a8fbbdc78",
"assets/build/ba_data/data/languages/belarussian.json": "https://files.ballistica.net/cache/ba1/61/03/89070ca765e06da3a419a579f503", "assets/build/ba_data/data/languages/belarussian.json": "https://files.ballistica.net/cache/ba1/61/03/89070ca765e06da3a419a579f503",
"assets/build/ba_data/data/languages/chinese.json": "https://files.ballistica.net/cache/ba1/32/a7/b9208ab804dfe2d1c3960256e9f8", "assets/build/ba_data/data/languages/chinese.json": "https://files.ballistica.net/cache/ba1/32/a7/b9208ab804dfe2d1c3960256e9f8",
@ -444,7 +444,7 @@
"assets/build/ba_data/data/languages/persian.json": "https://files.ballistica.net/cache/ba1/02/ab/e310f81582b6dc2ae93348d45166", "assets/build/ba_data/data/languages/persian.json": "https://files.ballistica.net/cache/ba1/02/ab/e310f81582b6dc2ae93348d45166",
"assets/build/ba_data/data/languages/polish.json": "https://files.ballistica.net/cache/ba1/76/be/84e567de0aabd9f9145b62179c2c", "assets/build/ba_data/data/languages/polish.json": "https://files.ballistica.net/cache/ba1/76/be/84e567de0aabd9f9145b62179c2c",
"assets/build/ba_data/data/languages/portuguese.json": "https://files.ballistica.net/cache/ba1/26/41/f1246ab56c6b7853f605c3a95889", "assets/build/ba_data/data/languages/portuguese.json": "https://files.ballistica.net/cache/ba1/26/41/f1246ab56c6b7853f605c3a95889",
"assets/build/ba_data/data/languages/romanian.json": "https://files.ballistica.net/cache/ba1/f4/74/a9e2f85b531061703d08a4118bed", "assets/build/ba_data/data/languages/romanian.json": "https://files.ballistica.net/cache/ba1/c9/5c/ccbae41f2baa11599563b4aabe00",
"assets/build/ba_data/data/languages/russian.json": "https://files.ballistica.net/cache/ba1/8c/a7/1dea3643720ced9fa40a0b3d1add", "assets/build/ba_data/data/languages/russian.json": "https://files.ballistica.net/cache/ba1/8c/a7/1dea3643720ced9fa40a0b3d1add",
"assets/build/ba_data/data/languages/serbian.json": "https://files.ballistica.net/cache/ba1/13/19/828be486951be254445263f36c6e", "assets/build/ba_data/data/languages/serbian.json": "https://files.ballistica.net/cache/ba1/13/19/828be486951be254445263f36c6e",
"assets/build/ba_data/data/languages/slovak.json": "https://files.ballistica.net/cache/ba1/f9/4b/d9f01814224066856695452ef57c", "assets/build/ba_data/data/languages/slovak.json": "https://files.ballistica.net/cache/ba1/f9/4b/d9f01814224066856695452ef57c",
@ -3992,50 +3992,50 @@
"assets/src/ba_data/python/ba/_generated/__init__.py": "https://files.ballistica.net/cache/ba1/ee/e8/cad05aa531c7faf7ff7b96db7f6e", "assets/src/ba_data/python/ba/_generated/__init__.py": "https://files.ballistica.net/cache/ba1/ee/e8/cad05aa531c7faf7ff7b96db7f6e",
"assets/src/ba_data/python/ba/_generated/enums.py": "https://files.ballistica.net/cache/ba1/b2/e5/0ee0561e16257a32830645239f34", "assets/src/ba_data/python/ba/_generated/enums.py": "https://files.ballistica.net/cache/ba1/b2/e5/0ee0561e16257a32830645239f34",
"ballisticacore-windows/Generic/BallisticaCore.ico": "https://files.ballistica.net/cache/ba1/89/c0/e32c7d2a35dc9aef57cc73b0911a", "ballisticacore-windows/Generic/BallisticaCore.ico": "https://files.ballistica.net/cache/ba1/89/c0/e32c7d2a35dc9aef57cc73b0911a",
"build/prefab/full/linux_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/8e/62/a0b2c36ae4c9946ff6d2bbe60536", "build/prefab/full/linux_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/15/d2/1a406b0b7e999e8aa662b52d04e9",
"build/prefab/full/linux_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/9c/6d/1958ddd5d36372cd05984f3f1491", "build/prefab/full/linux_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/2d/dc/cc6582bcb2eb248dc475c7d4494d",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/06/b0/3383daecf55590156851be31ddca", "build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/3b/1d/6f9bbaaf443e222b479ab5b8a591",
"build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/10/2d/73f8d6e8d15b5d8e613768eab9fe", "build/prefab/full/linux_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/22/88/b04e74dbc00d435e3a8267c7f602",
"build/prefab/full/linux_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/74/bf/2493e50c4a6211c05d46e61ee690", "build/prefab/full/linux_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/14/31/a8d35d1b4a1cfe687e959e8b5d73",
"build/prefab/full/linux_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/af/be/a8c7f280bb5c0eb70feacc95cb70", "build/prefab/full/linux_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/f4/5a/d79e44ef4b78c0fd259fd8b145aa",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/f4/14/f16305c17e826ba5304e3560b37b", "build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/0c/51/926b9b9ca55b84db740be8dd811f",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/2e/ee/5cc95994525b837afd6b0a344e07", "build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/35/e7/1d06c3c41c7fac2f19d8ddbfb260",
"build/prefab/full/mac_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/6e/25/2eb19336aa18f243c3818f3d684e", "build/prefab/full/mac_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/4e/8e/9fd62508758abc41804ea7483534",
"build/prefab/full/mac_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/63/3d/52c08aceafbba0ec1ee22929e233", "build/prefab/full/mac_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/32/8e/d55d91a23defc5f3dcc9308afc6a",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/3b/76/2651de6a14dfac76523954383768", "build/prefab/full/mac_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/ab/92/d7e8c5cdda5c6434c7d78a7c725c",
"build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/97/11/8c34021257c1717d12e02755e361", "build/prefab/full/mac_arm64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/fc/44/28f780d39db0cd0eaaecdb9c74c8",
"build/prefab/full/mac_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/5e/35/16f3aa9f5dddfae1e8a8f44bd288", "build/prefab/full/mac_x86_64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/25/89/b1c5f1dffd8e15d1a0dfe34e05e6",
"build/prefab/full/mac_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/ed/68/61d55a826b44c31804e53fe9f2f8", "build/prefab/full/mac_x86_64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/13/e7/2c15ca0d38d3e6dcf730d3df3073",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/27/da/ae61a120f83942040698e3c62795", "build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/11/8e/da14bd06757a23c8e0839c33925a",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/21/a5/7dfb46884bf50c97a1b170161de5", "build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/9f/a5/38b0fc67536dda40901ac518a92a",
"build/prefab/full/windows_x86_gui/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/bc/b3/d41ad33e7a27bb687126b59f6a63", "build/prefab/full/windows_x86_gui/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/e8/16/88ebb15d93868a5060c77d98c693",
"build/prefab/full/windows_x86_gui/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/73/d0/9ea990d6c6a22eafe5e39b7c9bf0", "build/prefab/full/windows_x86_gui/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/88/1b/0b5e22fc847f71005add59642d27",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/89/35/af5225fb6248d580ce4a62c0dff7", "build/prefab/full/windows_x86_server/debug/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/71/15/68af3e30dfc3a5f24551c0562bb4",
"build/prefab/full/windows_x86_server/release/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/1b/ea/24741222a48bf6b0ae2b33c345ee", "build/prefab/full/windows_x86_server/release/dist/BallisticaCoreHeadless.exe": "https://files.ballistica.net/cache/ba1/95/1e/15388f9638f7ceedb2950f8ee48b",
"build/prefab/lib/linux_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/36/63/4eea616b1c44d1fc80881d583063", "build/prefab/lib/linux_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/3f/60/5fb1cb5bd1ee656517914df2eb26",
"build/prefab/lib/linux_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/78/eb/361435ad4449473fcc8e79b2d253", "build/prefab/lib/linux_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/95/92/1bac3bcac3e1f71417b7ff053b52",
"build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/80/16/8ebbc8bdb0447272ad4a7322e15c", "build/prefab/lib/linux_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/54/55/b16bb20de7c3ab30311e73707e17",
"build/prefab/lib/linux_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/19/be/351a09a6c93b0292ff6da126d235", "build/prefab/lib/linux_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/6d/79/9b588be3e8d74c8c8bd761899be5",
"build/prefab/lib/linux_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/9c/1b/9bdd35fc65ef082610332b01a022", "build/prefab/lib/linux_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/e2/17/168f29b83ee04a412c0fa402258b",
"build/prefab/lib/linux_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/6c/eb/95720079e16a95041f84237aecfc", "build/prefab/lib/linux_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/a5/60/8d865d088dbc8d34d739b2c16fee",
"build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/23/55/28f16c8fe69a5bb4fa04f623d24e", "build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/38/4d/101a78df34eada8ffa73636cd178",
"build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/6e/c0/b576e08d61b99805b78a85e443d8", "build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/54/4b/4f8648af8ea56398da8b56babffa",
"build/prefab/lib/mac_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/7b/d0/f2187807f1a355fd5daf06ba9a89", "build/prefab/lib/mac_arm64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/3a/08/e5955806784ca0dbc2e9e679136a",
"build/prefab/lib/mac_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/32/1b/b420610ac31a1cc159e5bfedbf90", "build/prefab/lib/mac_arm64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/e2/7c/6d600a764587eb8d74b9701fe73f",
"build/prefab/lib/mac_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/44/42/217f4f3ae262675236d95b4f041a", "build/prefab/lib/mac_arm64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/96/4f/a761ffd6cbcc9d19015e8a2ebbd2",
"build/prefab/lib/mac_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/3b/75/a9bf8aa210df3295631b8ef64fe0", "build/prefab/lib/mac_arm64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/4a/18/c94f7cf05127e82cd71f46dc7dd6",
"build/prefab/lib/mac_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/c9/61/d337eb64ba80d29129b3baaaefb2", "build/prefab/lib/mac_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/39/d1/0bd6a2cf0f447642d8e58b538243",
"build/prefab/lib/mac_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/a4/73/03ba13813ed884e063bc070cb3a3", "build/prefab/lib/mac_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/bc/c0/1230a5a3ff3786fc335b57800324",
"build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/53/53/66b919b922f258938548e46bdce3", "build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/b5/7f/0e2c1cf8683876727192587148ac",
"build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/fb/51/05b095fe3c094e9709d68fc69cda", "build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/fe/04/375a70cb1510e2ec904a8d413a84",
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/80/9f/a4168a2e1ff84f84f753321171b8", "build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/95/fd/76e14f54aa05b9893d7e51a9b72f",
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/60/bb/dbea49521034f0f31e8af2d52472", "build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/5f/2a/3f294394d9b3cac746e72d12371a",
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/31/90/95e999162f9ad805643b4b9db8d4", "build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/18/12/6ce38decdc15438730d6599e1205",
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/7a/8f/1a82c5c7bdc2d684428d7670e712", "build/prefab/lib/windows/Debug_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/cf/1e/cfc52166831c2845b52c3fdfe97e",
"build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/87/39/769a4deb741ad42185e05c3bfc85", "build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/8a/1e/496af892e73099ad8d019f48c0d6",
"build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/9c/16/c967168be6fa2dd864724d4ac69c", "build/prefab/lib/windows/Release_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/94/be/26c915da46e21c50c266e5067fab",
"build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/a6/09/908ad0fda6281e0c07b5f84c89cc", "build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.lib": "https://files.ballistica.net/cache/ba1/a4/e4/58fbe24e57b0cd7ccfc89b728c9a",
"build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/80/4d/03fb2d4ffb5543f78c4f25795bc9", "build/prefab/lib/windows/Release_Win32/BallisticaCoreHeadlessInternal.pdb": "https://files.ballistica.net/cache/ba1/83/20/3576abd41776af09082ebc4e798c",
"src/ballistica/generated/python_embedded/binding.inc": "https://files.ballistica.net/cache/ba1/6e/6f/004b696e9a13b083069374e4bb6a", "src/ballistica/generated/python_embedded/binding.inc": "https://files.ballistica.net/cache/ba1/6e/6f/004b696e9a13b083069374e4bb6a",
"src/ballistica/generated/python_embedded/bootstrap.inc": "https://files.ballistica.net/cache/ba1/d3/db/e73d4dcf1280d5f677c3cf8b47c3" "src/ballistica/generated/python_embedded/bootstrap.inc": "https://files.ballistica.net/cache/ba1/d3/db/e73d4dcf1280d5f677c3cf8b47c3"
} }

View File

@ -1,4 +1,4 @@
### 1.7.2 (20617, 2022-06-24) ### 1.7.2 (20620, 2022-06-25)
- Minor fixes in some minigames (Thanks Droopy!) - Minor fixes in some minigames (Thanks Droopy!)
- Fixed a bug preventing 'clients' arg from working in _ba.chatmessage (Thanks imayushsaini!) - Fixed a bug preventing 'clients' arg from working in _ba.chatmessage (Thanks imayushsaini!)
- Fixed a bug where ba.Player.getdelegate(doraise=True) could return None instead of raising a ba.DelegateNotFoundError (thanks Dliwk!) - Fixed a bug where ba.Player.getdelegate(doraise=True) could return None instead of raising a ba.DelegateNotFoundError (thanks Dliwk!)

View File

@ -1 +1 @@
44699636502161276713676076818512618612 82822179102970206444201557696312438222

View File

@ -325,7 +325,7 @@ class Material:
ba.Material.add_actions() method to define what the material does. ba.Material.add_actions() method to define what the material does.
""" """
def __init__(self, label: str = None): def __init__(self, label: str | None = None):
pass pass
label: str label: str
@ -838,7 +838,7 @@ class SessionPlayer:
def setname(self, def setname(self,
name: str, name: str,
full_name: str = None, full_name: str | None = None,
real: bool = True) -> None: real: bool = True) -> None:
"""Set the player's name to the provided string. """Set the player's name to the provided string.
A number will automatically be appended if the name is not unique from A number will automatically be appended if the name is not unique from
@ -1108,7 +1108,8 @@ def add_clean_frame_callback(call: Callable) -> None:
return None return None
def add_transaction(transaction: dict, callback: Callable = None) -> None: def add_transaction(transaction: dict,
callback: Callable | None = None) -> None:
"""(internal)""" """(internal)"""
return None return None
@ -1165,43 +1166,43 @@ def bless() -> None:
return None return None
def buttonwidget(edit: ba.Widget = None, def buttonwidget(edit: ba.Widget | None = None,
parent: ba.Widget = None, parent: ba.Widget | None = None,
size: Sequence[float] = None, size: Sequence[float] | None = None,
position: Sequence[float] = None, position: Sequence[float] | None = None,
on_activate_call: Callable = None, on_activate_call: Callable | None = None,
label: str | ba.Lstr | None = None, label: str | ba.Lstr | None = None,
color: Sequence[float] = None, color: Sequence[float] | None = None,
down_widget: ba.Widget = None, down_widget: ba.Widget | None = None,
up_widget: ba.Widget = None, up_widget: ba.Widget | None = None,
left_widget: ba.Widget = None, left_widget: ba.Widget | None = None,
right_widget: ba.Widget = None, right_widget: ba.Widget | None = None,
texture: ba.Texture = None, texture: ba.Texture | None = None,
text_scale: float = None, text_scale: float | None = None,
textcolor: Sequence[float] = None, textcolor: Sequence[float] | None = None,
enable_sound: bool = None, enable_sound: bool | None = None,
model_transparent: ba.Model = None, model_transparent: ba.Model | None = None,
model_opaque: ba.Model = None, model_opaque: ba.Model | None = None,
repeat: bool = None, repeat: bool | None = None,
scale: float = None, scale: float | None = None,
transition_delay: float = None, transition_delay: float | None = None,
on_select_call: Callable = None, on_select_call: Callable | None = None,
button_type: str = None, button_type: str | None = None,
extra_touch_border_scale: float = None, extra_touch_border_scale: float | None = None,
selectable: bool = None, selectable: bool | None = None,
show_buffer_top: float = None, show_buffer_top: float | None = None,
icon: ba.Texture = None, icon: ba.Texture | None = None,
iconscale: float = None, iconscale: float | None = None,
icon_tint: float = None, icon_tint: float | None = None,
icon_color: Sequence[float] = None, icon_color: Sequence[float] | None = None,
autoselect: bool = None, autoselect: bool | None = None,
mask_texture: ba.Texture = None, mask_texture: ba.Texture | None = None,
tint_texture: ba.Texture = None, tint_texture: ba.Texture | None = None,
tint_color: Sequence[float] = None, tint_color: Sequence[float] | None = None,
tint2_color: Sequence[float] = None, tint2_color: Sequence[float] | None = None,
text_flatness: float = None, text_flatness: float | None = None,
text_res_scale: float = None, text_res_scale: float | None = None,
enabled: bool = None) -> ba.Widget: enabled: bool | None = None) -> ba.Widget:
"""Create or edit a button widget. """Create or edit a button widget.
Category: **User Interface Functions** Category: **User Interface Functions**
@ -1269,27 +1270,27 @@ def charstr(char_id: ba.SpecialChar) -> str:
def chatmessage(message: str | ba.Lstr, def chatmessage(message: str | ba.Lstr,
clients: Sequence[int] = None, clients: Sequence[int] | None = None,
sender_override: str = None) -> None: sender_override: str | None = None) -> None:
"""(internal)""" """(internal)"""
return None return None
def checkboxwidget(edit: ba.Widget = None, def checkboxwidget(edit: ba.Widget | None = None,
parent: ba.Widget = None, parent: ba.Widget | None = None,
size: Sequence[float] = None, size: Sequence[float] | None = None,
position: Sequence[float] = None, position: Sequence[float] | None = None,
text: str | ba.Lstr | None = None, text: str | ba.Lstr | None = None,
value: bool = None, value: bool | None = None,
on_value_change_call: Callable[[bool], None] = None, on_value_change_call: Callable[[bool], None] | None = None,
on_select_call: Callable[[], None] = None, on_select_call: Callable[[], None] | None = None,
text_scale: float = None, text_scale: float | None = None,
textcolor: Sequence[float] = None, textcolor: Sequence[float] | None = None,
scale: float = None, scale: float | None = None,
is_radio_button: bool = None, is_radio_button: bool | None = None,
maxwidth: float = None, maxwidth: float | None = None,
autoselect: bool = None, autoselect: bool | None = None,
color: Sequence[float] = None) -> ba.Widget: color: Sequence[float] | None = None) -> ba.Widget:
"""Create or edit a check-box widget. """Create or edit a check-box widget.
Category: **User Interface Functions** Category: **User Interface Functions**
@ -1351,23 +1352,23 @@ def clipboard_set_text(value: str) -> None:
return None return None
def columnwidget(edit: ba.Widget = None, def columnwidget(edit: ba.Widget | None = None,
parent: ba.Widget = None, parent: ba.Widget | None = None,
size: Sequence[float] = None, size: Sequence[float] | None = None,
position: Sequence[float] = None, position: Sequence[float] | None = None,
background: bool = None, background: bool | None = None,
selected_child: ba.Widget = None, selected_child: ba.Widget | None = None,
visible_child: ba.Widget = None, visible_child: ba.Widget | None = None,
single_depth: bool = None, single_depth: bool | None = None,
print_list_exit_instructions: bool = None, print_list_exit_instructions: bool | None = None,
left_border: float = None, left_border: float | None = None,
top_border: float = None, top_border: float | None = None,
bottom_border: float = None, bottom_border: float | None = None,
selection_loops_to_parent: bool = None, selection_loops_to_parent: bool | None = None,
border: float = None, border: float | None = None,
margin: float = None, margin: float | None = None,
claims_left_right: bool = None, claims_left_right: bool | None = None,
claims_tab: bool = None) -> ba.Widget: claims_tab: bool | None = None) -> ba.Widget:
"""Create or edit a column widget. """Create or edit a column widget.
Category: **User Interface Functions** Category: **User Interface Functions**
@ -1386,7 +1387,7 @@ def commit_config(config: str) -> None:
def connect_to_party(address: str, def connect_to_party(address: str,
port: int = None, port: int | None = None,
print_progress: bool = True) -> None: print_progress: bool = True) -> None:
"""(internal)""" """(internal)"""
return None return None
@ -1402,37 +1403,37 @@ def console_print(*args: Any) -> None:
return None return None
def containerwidget(edit: ba.Widget = None, def containerwidget(edit: ba.Widget | None = None,
parent: ba.Widget = None, parent: ba.Widget | None = None,
size: Sequence[float] = None, size: Sequence[float] | None = None,
position: Sequence[float] = None, position: Sequence[float] | None = None,
background: bool = None, background: bool | None = None,
selected_child: ba.Widget = None, selected_child: ba.Widget | None = None,
transition: str = None, transition: str | None = None,
cancel_button: ba.Widget = None, cancel_button: ba.Widget | None = None,
start_button: ba.Widget = None, start_button: ba.Widget | None = None,
root_selectable: bool = None, root_selectable: bool | None = None,
on_activate_call: Callable[[], None] = None, on_activate_call: Callable[[], None] | None = None,
claims_left_right: bool = None, claims_left_right: bool | None = None,
claims_tab: bool = None, claims_tab: bool | None = None,
selection_loops: bool = None, selection_loops: bool | None = None,
selection_loops_to_parent: bool = None, selection_loops_to_parent: bool | None = None,
scale: float = None, scale: float | None = None,
on_outside_click_call: Callable[[], None] = None, on_outside_click_call: Callable[[], None] | None = None,
single_depth: bool = None, single_depth: bool | None = None,
visible_child: ba.Widget = None, visible_child: ba.Widget | None = None,
stack_offset: Sequence[float] = None, stack_offset: Sequence[float] | None = None,
color: Sequence[float] = None, color: Sequence[float] | None = None,
on_cancel_call: Callable[[], None] = None, on_cancel_call: Callable[[], None] | None = None,
print_list_exit_instructions: bool = None, print_list_exit_instructions: bool | None = None,
click_activate: bool = None, click_activate: bool | None = None,
always_highlight: bool = None, always_highlight: bool | None = None,
selectable: bool = None, selectable: bool | None = None,
scale_origin_stack_offset: Sequence[float] = None, scale_origin_stack_offset: Sequence[float] | None = None,
toolbar_visibility: str = None, toolbar_visibility: str | None = None,
on_select_call: Callable[[], None] = None, on_select_call: Callable[[], None] | None = None,
claim_outside_clicks: bool = None, claim_outside_clicks: bool | None = None,
claims_up_down: bool = None) -> ba.Widget: claims_up_down: bool | None = None) -> ba.Widget:
"""Create or edit a container widget. """Create or edit a container widget.
Category: **User Interface Functions** Category: **User Interface Functions**
@ -2160,22 +2161,22 @@ def host_scan_cycle() -> list:
return list() return list()
def hscrollwidget(edit: ba.Widget = None, def hscrollwidget(edit: ba.Widget | None = None,
parent: ba.Widget = None, parent: ba.Widget | None = None,
size: Sequence[float] = None, size: Sequence[float] | None = None,
position: Sequence[float] = None, position: Sequence[float] | None = None,
background: bool = None, background: bool | None = None,
selected_child: ba.Widget = None, selected_child: ba.Widget | None = None,
capture_arrows: bool = None, capture_arrows: bool | None = None,
on_select_call: Callable[[], None] = None, on_select_call: Callable[[], None] | None = None,
center_small_content: bool = None, center_small_content: bool | None = None,
color: Sequence[float] = None, color: Sequence[float] | None = None,
highlight: bool = None, highlight: bool | None = None,
border_opacity: float = None, border_opacity: float | None = None,
simple_culling_h: float = None, simple_culling_h: float | None = None,
claims_left_right: bool = None, claims_left_right: bool | None = None,
claims_up_down: bool = None, claims_up_down: bool | None = None,
claims_tab: bool = None) -> ba.Widget: claims_tab: bool | None = None) -> ba.Widget:
"""Create or edit a horizontal scroll widget. """Create or edit a horizontal scroll widget.
Category: **User Interface Functions** Category: **User Interface Functions**
@ -2188,24 +2189,24 @@ def hscrollwidget(edit: ba.Widget = None,
return ba.Widget() return ba.Widget()
def imagewidget(edit: ba.Widget = None, def imagewidget(edit: ba.Widget | None = None,
parent: ba.Widget = None, parent: ba.Widget | None = None,
size: Sequence[float] = None, size: Sequence[float] | None = None,
position: Sequence[float] = None, position: Sequence[float] | None = None,
color: Sequence[float] = None, color: Sequence[float] | None = None,
texture: ba.Texture = None, texture: ba.Texture | None = None,
opacity: float = None, opacity: float | None = None,
model_transparent: ba.Model = None, model_transparent: ba.Model | None = None,
model_opaque: ba.Model = None, model_opaque: ba.Model | None = None,
has_alpha_channel: bool = True, has_alpha_channel: bool = True,
tint_texture: ba.Texture = None, tint_texture: ba.Texture | None = None,
tint_color: Sequence[float] = None, tint_color: Sequence[float] | None = None,
transition_delay: float = None, transition_delay: float | None = None,
draw_controller: ba.Widget = None, draw_controller: ba.Widget | None = None,
tint2_color: Sequence[float] = None, tint2_color: Sequence[float] | None = None,
tilt_scale: float = None, tilt_scale: float | None = None,
mask_texture: ba.Texture = None, mask_texture: ba.Texture | None = None,
radial_amount: float = None) -> ba.Widget: radial_amount: float | None = None) -> ba.Widget:
"""Create or edit an image widget. """Create or edit an image widget.
Category: **User Interface Functions** Category: **User Interface Functions**
@ -2406,7 +2407,7 @@ def music_player_stop() -> None:
def new_host_session(sessiontype: type[ba.Session], def new_host_session(sessiontype: type[ba.Session],
benchmark_type: str = None) -> None: benchmark_type: str | None = None) -> None:
"""(internal)""" """(internal)"""
return None return None
@ -2417,7 +2418,7 @@ def new_replay_session(file_name: str) -> None:
def newactivity(activity_type: type[ba.Activity], def newactivity(activity_type: type[ba.Activity],
settings: dict = None) -> ba.Activity: settings: dict | None = None) -> ba.Activity:
"""Instantiates a ba.Activity given a type object. """Instantiates a ba.Activity given a type object.
Category: **General Utility Functions** Category: **General Utility Functions**
@ -2430,9 +2431,9 @@ def newactivity(activity_type: type[ba.Activity],
def newnode(type: str, def newnode(type: str,
owner: ba.Node = None, owner: ba.Node | None = None,
attrs: dict = None, attrs: dict | None = None,
name: str = None, name: str | None = None,
delegate: Any = None) -> Node: delegate: Any = None) -> Node:
"""Add a node of the given type to the game. """Add a node of the given type to the game.
@ -2484,7 +2485,7 @@ def open_url(address: str) -> None:
def playsound(sound: Sound, def playsound(sound: Sound,
volume: float = 1.0, volume: float = 1.0,
position: Sequence[float] = None, position: Sequence[float] | None = None,
host_only: bool = False) -> None: host_only: bool = False) -> None:
"""Play a ba.Sound a single time. """Play a ba.Sound a single time.
@ -2652,16 +2653,16 @@ def restore_purchases() -> None:
return None return None
def rowwidget(edit: ba.Widget = None, def rowwidget(edit: ba.Widget | None = None,
parent: ba.Widget = None, parent: ba.Widget | None = None,
size: Sequence[float] = None, size: Sequence[float] | None = None,
position: Sequence[float] = None, position: Sequence[float] | None = None,
background: bool = None, background: bool | None = None,
selected_child: ba.Widget = None, selected_child: ba.Widget | None = None,
visible_child: ba.Widget = None, visible_child: ba.Widget | None = None,
claims_left_right: bool = None, claims_left_right: bool | None = None,
claims_tab: bool = None, claims_tab: bool | None = None,
selection_loops_to_parent: bool = None) -> ba.Widget: selection_loops_to_parent: bool | None = None) -> ba.Widget:
"""Create or edit a row widget. """Create or edit a row widget.
Category: **User Interface Functions** Category: **User Interface Functions**
@ -2692,11 +2693,11 @@ def safecolor(color: Sequence[float],
def screenmessage(message: str | ba.Lstr, def screenmessage(message: str | ba.Lstr,
color: Sequence[float] = None, color: Sequence[float] | None = None,
top: bool = False, top: bool = False,
image: dict[str, Any] = None, image: dict[str, Any] | None = None,
log: bool = False, log: bool = False,
clients: Sequence[int] = None, clients: Sequence[int] | None = None,
transient: bool = False) -> None: transient: bool = False) -> None:
"""Print a message to the local client's screen, in a given color. """Print a message to the local client's screen, in a given color.
@ -2715,24 +2716,24 @@ def screenmessage(message: str | ba.Lstr,
return None return None
def scrollwidget(edit: ba.Widget = None, def scrollwidget(edit: ba.Widget | None = None,
parent: ba.Widget = None, parent: ba.Widget | None = None,
size: Sequence[float] = None, size: Sequence[float] | None = None,
position: Sequence[float] = None, position: Sequence[float] | None = None,
background: bool = None, background: bool | None = None,
selected_child: ba.Widget = None, selected_child: ba.Widget | None = None,
capture_arrows: bool = False, capture_arrows: bool = False,
on_select_call: Callable = None, on_select_call: Callable | None = None,
center_small_content: bool = None, center_small_content: bool | None = None,
color: Sequence[float] = None, color: Sequence[float] | None = None,
highlight: bool = None, highlight: bool | None = None,
border_opacity: float = None, border_opacity: float | None = None,
simple_culling_v: float = None, simple_culling_v: float | None = None,
selection_loops_to_parent: bool = None, selection_loops_to_parent: bool | None = None,
claims_left_right: bool = None, claims_left_right: bool | None = None,
claims_up_down: bool = None, claims_up_down: bool | None = None,
claims_tab: bool = None, claims_tab: bool | None = None,
autoselect: bool = None) -> ba.Widget: autoselect: bool | None = None) -> ba.Widget:
"""Create or edit a scroll widget. """Create or edit a scroll widget.
Category: **User Interface Functions** Category: **User Interface Functions**
@ -2923,13 +2924,14 @@ def setup_sigint() -> None:
def show_ad(purpose: str, def show_ad(purpose: str,
on_completion_call: Callable[[], None] = None) -> None: on_completion_call: Callable[[], None] | None = None) -> None:
"""(internal)""" """(internal)"""
return None return None
def show_ad_2(purpose: str, def show_ad_2(
on_completion_call: Callable[[bool], None] = None) -> None: purpose: str,
on_completion_call: Callable[[bool], None] | None = None) -> None:
"""(internal)""" """(internal)"""
return None return None
@ -2944,8 +2946,8 @@ def show_app_invite(title: str | ba.Lstr, message: str | ba.Lstr,
def show_online_score_ui(show: str = 'general', def show_online_score_ui(show: str = 'general',
game: str = None, game: str | None = None,
game_version: str = None) -> None: game_version: str | None = None) -> None:
"""(internal)""" """(internal)"""
return None return None
@ -3000,41 +3002,41 @@ def submit_score(game: str,
return None return None
def textwidget(edit: ba.Widget = None, def textwidget(edit: ba.Widget | None = None,
parent: ba.Widget = None, parent: ba.Widget | None = None,
size: Sequence[float] = None, size: Sequence[float] | None = None,
position: Sequence[float] = None, position: Sequence[float] | None = None,
text: str | ba.Lstr | None = None, text: str | ba.Lstr | None = None,
v_align: str = None, v_align: str | None = None,
h_align: str = None, h_align: str | None = None,
editable: bool = None, editable: bool | None = None,
padding: float = None, padding: float | None = None,
on_return_press_call: Callable[[], None] = None, on_return_press_call: Callable[[], None] | None = None,
on_activate_call: Callable[[], None] = None, on_activate_call: Callable[[], None] | None = None,
selectable: bool = None, selectable: bool | None = None,
query: ba.Widget = None, query: ba.Widget | None = None,
max_chars: int = None, max_chars: int | None = None,
color: Sequence[float] = None, color: Sequence[float] | None = None,
click_activate: bool = None, click_activate: bool | None = None,
on_select_call: Callable[[], None] = None, on_select_call: Callable[[], None] | None = None,
always_highlight: bool = None, always_highlight: bool | None = None,
draw_controller: ba.Widget = None, draw_controller: ba.Widget | None = None,
scale: float = None, scale: float | None = None,
corner_scale: float = None, corner_scale: float | None = None,
description: str | ba.Lstr | None = None, description: str | ba.Lstr | None = None,
transition_delay: float = None, transition_delay: float | None = None,
maxwidth: float = None, maxwidth: float | None = None,
max_height: float = None, max_height: float | None = None,
flatness: float = None, flatness: float | None = None,
shadow: float = None, shadow: float | None = None,
autoselect: bool = None, autoselect: bool | None = None,
rotate: float = None, rotate: float | None = None,
enabled: bool = None, enabled: bool | None = None,
force_internal_editing: bool = None, force_internal_editing: bool | None = None,
always_show_carat: bool = None, always_show_carat: bool | None = None,
big: bool = None, big: bool | None = None,
extra_touch_border_scale: float = None, extra_touch_border_scale: float | None = None,
res_scale: float = None) -> Widget: res_scale: float | None = None) -> Widget:
"""Create or edit a text widget. """Create or edit a text widget.
Category: **User Interface Functions** Category: **User Interface Functions**
@ -3204,22 +3206,22 @@ def unlock_all_input() -> None:
def value_test(arg: str, def value_test(arg: str,
change: float = None, change: float | None = None,
absolute: float = None) -> float: absolute: float | None = None) -> float:
"""(internal)""" """(internal)"""
return float() return float()
def widget(edit: ba.Widget = None, def widget(edit: ba.Widget | None = None,
up_widget: ba.Widget = None, up_widget: ba.Widget | None = None,
down_widget: ba.Widget = None, down_widget: ba.Widget | None = None,
left_widget: ba.Widget = None, left_widget: ba.Widget | None = None,
right_widget: ba.Widget = None, right_widget: ba.Widget | None = None,
show_buffer_top: float = None, show_buffer_top: float | None = None,
show_buffer_bottom: float = None, show_buffer_bottom: float | None = None,
show_buffer_left: float = None, show_buffer_left: float | None = None,
show_buffer_right: float = None, show_buffer_right: float | None = None,
autoselect: bool = None) -> None: autoselect: bool | None = None) -> None:
"""Edit common attributes of any widget. """Edit common attributes of any widget.
Category: **User Interface Functions** Category: **User Interface Functions**

View File

@ -74,7 +74,7 @@ class AccountV1Subsystem:
def get_league_rank_points(self, def get_league_rank_points(self,
data: dict[str, Any] | None, data: dict[str, Any] | None,
subset: str = None) -> int: subset: str | None = None) -> int:
"""(internal)""" """(internal)"""
if data is None: if data is None:
return 0 return 0

View File

@ -610,8 +610,8 @@ class Achievement:
x: float, x: float,
y: float, y: float,
delay: float, delay: float,
outdelay: float = None, outdelay: float | None = None,
color: Sequence[float] = None, color: Sequence[float] | None = None,
style: str = 'post_game') -> list[ba.Actor]: style: str = 'post_game') -> list[ba.Actor]:
"""Create a display for the Achievement. """Create a display for the Achievement.

View File

@ -53,14 +53,15 @@ class AdsSubsystem:
def show_ad(self, def show_ad(self,
purpose: str, purpose: str,
on_completion_call: Callable[[], Any] = None) -> None: on_completion_call: Callable[[], Any] | None = None) -> None:
"""(internal)""" """(internal)"""
self.last_ad_purpose = purpose self.last_ad_purpose = purpose
_ba.show_ad(purpose, on_completion_call) _ba.show_ad(purpose, on_completion_call)
def show_ad_2(self, def show_ad_2(
purpose: str, self,
on_completion_call: Callable[[bool], Any] = None) -> None: purpose: str,
on_completion_call: Callable[[bool], Any] | None = None) -> None:
"""(internal)""" """(internal)"""
self.last_ad_purpose = purpose self.last_ad_purpose = purpose
_ba.show_ad_2(purpose, on_completion_call) _ba.show_ad_2(purpose, on_completion_call)

View File

@ -577,7 +577,7 @@ class App:
def launch_coop_game(self, def launch_coop_game(self,
game: str, game: str,
force: bool = False, force: bool = False,
args: dict = None) -> bool: args: dict | None = None) -> bool:
"""High level way to launch a local co-op session.""" """High level way to launch a local co-op session."""
# pylint: disable=cyclic-import # pylint: disable=cyclic-import
from ba._campaign import getcampaign from ba._campaign import getcampaign

View File

@ -177,9 +177,10 @@ def garbage_collect() -> None:
gc.collect() gc.collect()
def print_live_object_warnings(when: Any, def print_live_object_warnings(
ignore_session: ba.Session = None, when: Any,
ignore_activity: ba.Activity = None) -> None: ignore_session: ba.Session | None = None,
ignore_activity: ba.Activity | None = None) -> None:
"""Print warnings for remaining objects in the current context.""" """Print warnings for remaining objects in the current context."""
# pylint: disable=cyclic-import # pylint: disable=cyclic-import
from ba._session import Session from ba._session import Session

View File

@ -177,7 +177,7 @@ class CoopGameActivity(GameActivity[PlayerType, TeamType]):
def spawn_player_spaz(self, def spawn_player_spaz(self,
player: PlayerType, player: PlayerType,
position: Sequence[float] = (0.0, 0.0, 0.0), position: Sequence[float] = (0.0, 0.0, 0.0),
angle: float = None) -> PlayerSpaz: angle: float | None = None) -> PlayerSpaz:
"""Spawn and wire up a standard player spaz.""" """Spawn and wire up a standard player spaz."""
spaz = super().spawn_player_spaz(player, position, angle) spaz = super().spawn_player_spaz(player, position, angle)

View File

@ -841,7 +841,7 @@ class GameActivity(Activity[PlayerType, TeamType]):
def spawn_player_spaz(self, def spawn_player_spaz(self,
player: PlayerType, player: PlayerType,
position: Sequence[float] = (0, 0, 0), position: Sequence[float] = (0, 0, 0),
angle: float = None) -> PlayerSpaz: angle: float | None = None) -> PlayerSpaz:
"""Create and wire up a ba.PlayerSpaz for the provided ba.Player.""" """Create and wire up a ba.PlayerSpaz for the provided ba.Player."""
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
# pylint: disable=cyclic-import # pylint: disable=cyclic-import

View File

@ -360,7 +360,7 @@ def _verify_object_death(wref: weakref.ref) -> None:
print_active_refs(obj) print_active_refs(obj)
def storagename(suffix: str = None) -> str: def storagename(suffix: str | None = None) -> str:
"""Generate a unique name for storing class data in shared places. """Generate a unique name for storing class data in shared places.
Category: **General Utility Functions** Category: **General Utility Functions**

View File

@ -240,7 +240,7 @@ class LanguageSubsystem:
def get_resource(self, def get_resource(self,
resource: str, resource: str,
fallback_resource: str = None, fallback_resource: str | None = None,
fallback_value: Any = None) -> Any: fallback_value: Any = None) -> Any:
"""Return a translation resource by name. """Return a translation resource by name.

View File

@ -25,7 +25,7 @@ class Level:
gametype: type[ba.GameActivity], gametype: type[ba.GameActivity],
settings: dict, settings: dict,
preview_texture_name: str, preview_texture_name: str,
displayname: str = None): displayname: str | None = None):
self._name = name self._name = name
self._gametype = gametype self._gametype = gametype
self._settings = settings self._settings = settings

View File

@ -384,7 +384,8 @@ class Map(Actor):
assert farthestpt is not None assert farthestpt is not None
return tuple(farthestpt) return tuple(farthestpt)
def get_flag_position(self, team_index: int = None) -> Sequence[float]: def get_flag_position(self,
team_index: int | None = None) -> Sequence[float]:
"""Return a flag position on the map for the given team index. """Return a flag position on the map for the given team index.
Pass None to get the default flag point. Pass None to get the default flag point.

View File

@ -236,17 +236,17 @@ class HitMessage:
""" """
def __init__(self, def __init__(self,
srcnode: ba.Node = None, srcnode: ba.Node | None = None,
pos: Sequence[float] = None, pos: Sequence[float] | None = None,
velocity: Sequence[float] = None, velocity: Sequence[float] | None = None,
magnitude: float = 1.0, magnitude: float = 1.0,
velocity_magnitude: float = 0.0, velocity_magnitude: float = 0.0,
radius: float = 1.0, radius: float = 1.0,
source_player: ba.Player = None, source_player: ba.Player | None = None,
kick_back: float = 1.0, kick_back: float = 1.0,
flat_damage: float = None, flat_damage: float | None = None,
hit_type: str = 'generic', hit_type: str = 'generic',
force_direction: Sequence[float] = None, force_direction: Sequence[float] | None = None,
hit_subtype: str = 'default'): hit_subtype: str = 'default'):
"""Instantiate a message with given values.""" """Instantiate a message with given values."""

View File

@ -273,7 +273,7 @@ class MusicSubsystem:
musictype: MusicType | str | None, musictype: MusicType | str | None,
continuous: bool = False, continuous: bool = False,
mode: MusicPlayMode = MusicPlayMode.REGULAR, mode: MusicPlayMode = MusicPlayMode.REGULAR,
testsoundtrack: dict[str, Any] = None) -> None: testsoundtrack: dict[str, Any] | None = None) -> None:
"""Plays the requested music type/mode. """Plays the requested music type/mode.
For most cases, setmusic() is the proper call to use, which itself For most cases, setmusic() is the proper call to use, which itself

View File

@ -50,7 +50,7 @@ def get_player_profile_icon(profilename: str) -> str:
def get_player_profile_colors( def get_player_profile_colors(
profilename: str | None, profilename: str | None,
profiles: dict[str, dict[str, Any]] = None profiles: dict[str, dict[str, Any]] | None = None
) -> tuple[tuple[float, float, float], tuple[float, float, float]]: ) -> tuple[tuple[float, float, float], tuple[float, float, float]]:
"""Given a profile, return colors for them.""" """Given a profile, return colors for them."""
appconfig = _ba.app.config appconfig = _ba.app.config

View File

@ -72,8 +72,8 @@ class Session:
def __init__(self, def __init__(self,
depsets: Sequence[ba.DependencySet], depsets: Sequence[ba.DependencySet],
team_names: Sequence[str] = None, team_names: Sequence[str] | None = None,
team_colors: Sequence[Sequence[float]] = None, team_colors: Sequence[Sequence[float]] | None = None,
min_players: int = 1, min_players: int = 1,
max_players: int = 8): max_players: int = 8):
"""Instantiate a session. """Instantiate a session.

View File

@ -314,11 +314,11 @@ class Stats:
def player_scored(self, def player_scored(self,
player: ba.Player, player: ba.Player,
base_points: int = 1, base_points: int = 1,
target: Sequence[float] = None, target: Sequence[float] | None = None,
kill: bool = False, kill: bool = False,
victim_player: ba.Player = None, victim_player: ba.Player | None = None,
scale: float = 1.0, scale: float = 1.0,
color: Sequence[float] = None, color: Sequence[float] | None = None,
title: str | ba.Lstr | None = None, title: str | ba.Lstr | None = None,
screenmessage: bool = True, screenmessage: bool = True,
display: bool = True, display: bool = True,
@ -422,7 +422,7 @@ class Stats:
def player_was_killed(self, def player_was_killed(self,
player: ba.Player, player: ba.Player,
killed: bool = False, killed: bool = False,
killer: ba.Player = None) -> None: killer: ba.Player | None = None) -> None:
"""Should be called when a player is killed.""" """Should be called when a player is killed."""
from ba._language import Lstr from ba._language import Lstr
name = player.getname() name = player.getname()

View File

@ -398,7 +398,7 @@ def get_clean_price(price_string: str) -> str:
return psubs.get(price_string, price_string) return psubs.get(price_string, price_string)
def get_available_purchase_count(tab: str = None) -> int: def get_available_purchase_count(tab: str | None = None) -> int:
"""(internal)""" """(internal)"""
try: try:
if _ba.get_v1_account_state() != 'signed_in': if _ba.get_v1_account_state() != 'signed_in':

View File

@ -91,8 +91,8 @@ class TeamGameActivity(GameActivity[PlayerType, TeamType]):
def spawn_player_spaz(self, def spawn_player_spaz(self,
player: PlayerType, player: PlayerType,
position: Sequence[float] = None, position: Sequence[float] | None = None,
angle: float = None) -> PlayerSpaz: angle: float | None = None) -> PlayerSpaz:
""" """
Method override; spawns and wires up a standard ba.PlayerSpaz for Method override; spawns and wires up a standard ba.PlayerSpaz for
a ba.Player. a ba.Player.

View File

@ -144,7 +144,7 @@ class UISubsystem:
_ba.timer(1.0, _delay_kill, timetype=TimeType.REAL) _ba.timer(1.0, _delay_kill, timetype=TimeType.REAL)
self._main_menu_window = window self._main_menu_window = window
def clear_main_menu_window(self, transition: str = None) -> None: def clear_main_menu_window(self, transition: str | None = None) -> None:
"""Clear any existing 'main' window with the provided transition.""" """Clear any existing 'main' window with the provided transition."""
if self._main_menu_window: if self._main_menu_window:
if transition is not None: if transition is not None:

View File

@ -327,7 +327,7 @@ class Blast(ba.Actor):
velocity: Sequence[float] = (0.0, 0.0, 0.0), velocity: Sequence[float] = (0.0, 0.0, 0.0),
blast_radius: float = 2.0, blast_radius: float = 2.0,
blast_type: str = 'normal', blast_type: str = 'normal',
source_player: ba.Player = None, source_player: ba.Player | None = None,
hit_type: str = 'explosion', hit_type: str = 'explosion',
hit_subtype: str = 'normal'): hit_subtype: str = 'normal'):
"""Instantiate with given values.""" """Instantiate with given values."""
@ -657,8 +657,8 @@ class Bomb(ba.Actor):
bomb_type: str = 'normal', bomb_type: str = 'normal',
blast_radius: float = 2.0, blast_radius: float = 2.0,
bomb_scale: float = 1.0, bomb_scale: float = 1.0,
source_player: ba.Player = None, source_player: ba.Player | None = None,
owner: ba.Node = None): owner: ba.Node | None = None):
"""Create a new Bomb. """Create a new Bomb.
bomb_type can be 'ice','impact','land_mine','normal','sticky', or bomb_type can be 'ice','impact','land_mine','normal','sticky', or

View File

@ -27,7 +27,7 @@ class ControlsGuide(ba.Actor):
position: tuple[float, float] = (390.0, 120.0), position: tuple[float, float] = (390.0, 120.0),
scale: float = 1.0, scale: float = 1.0,
delay: float = 0.0, delay: float = 0.0,
lifespan: float = None, lifespan: float | None = None,
bright: bool = False): bright: bool = False):
"""Instantiate an overlay. """Instantiate an overlay.

View File

@ -167,9 +167,9 @@ class Flag(ba.Actor):
def __init__(self, def __init__(self,
position: Sequence[float] = (0.0, 1.0, 0.0), position: Sequence[float] = (0.0, 1.0, 0.0),
color: Sequence[float] = (1.0, 1.0, 1.0), color: Sequence[float] = (1.0, 1.0, 1.0),
materials: Sequence[ba.Material] = None, materials: Sequence[ba.Material] | None = None,
touchable: bool = True, touchable: bool = True,
dropped_timeout: int = None): dropped_timeout: int | None = None):
"""Instantiate a flag. """Instantiate a flag.
If 'touchable' is False, the flag will only touch terrain; If 'touchable' is False, the flag will only touch terrain;

View File

@ -40,9 +40,9 @@ class Image(ba.Actor):
attach: Attach = Attach.CENTER, attach: Attach = Attach.CENTER,
color: Sequence[float] = (1.0, 1.0, 1.0, 1.0), color: Sequence[float] = (1.0, 1.0, 1.0, 1.0),
scale: tuple[float, float] = (100.0, 100.0), scale: tuple[float, float] = (100.0, 100.0),
transition_out_delay: float = None, transition_out_delay: float | None = None,
model_opaque: ba.Model = None, model_opaque: ba.Model | None = None,
model_transparent: ba.Model = None, model_transparent: ba.Model | None = None,
vr_depth: float = 0.0, vr_depth: float = 0.0,
host_only: bool = False, host_only: bool = False,
front: bool = False): front: bool = False):

View File

@ -20,7 +20,9 @@ class OnScreenCountdown(ba.Actor):
Useful for time-based games that count down to zero. Useful for time-based games that count down to zero.
""" """
def __init__(self, duration: int, endcall: Callable[[], Any] = None): def __init__(self,
duration: int,
endcall: Callable[[], Any] | None = None):
"""Duration is provided in seconds.""" """Duration is provided in seconds."""
super().__init__() super().__init__()
self._timeremaining = duration self._timeremaining = duration
@ -73,7 +75,7 @@ class OnScreenCountdown(ba.Actor):
# Release callbacks/refs. # Release callbacks/refs.
self._endcall = None self._endcall = None
def _update(self, forcevalue: int = None) -> None: def _update(self, forcevalue: int | None = None) -> None:
if forcevalue is not None: if forcevalue is not None:
tval = forcevalue tval = forcevalue
else: else:

View File

@ -137,8 +137,8 @@ class PowerupBoxFactory:
self._powerupdist.append(powerup) self._powerupdist.append(powerup)
def get_random_powerup_type(self, def get_random_powerup_type(self,
forcetype: str = None, forcetype: str | None = None,
excludetypes: list[str] = None) -> str: excludetypes: list[str] | None = None) -> str:
"""Returns a random powerup type (string). """Returns a random powerup type (string).
See ba.Powerup.poweruptype for available type values. See ba.Powerup.poweruptype for available type values.

View File

@ -241,7 +241,7 @@ class _Entry:
def set_value(self, def set_value(self,
score: float, score: float,
max_score: float = None, max_score: float | None = None,
countdown: bool = False, countdown: bool = False,
flash: bool = True, flash: bool = True,
show_value: bool = True) -> None: show_value: bool = True) -> None:
@ -327,7 +327,7 @@ class Scoreboard:
_ENTRYSTORENAME = ba.storagename('entry') _ENTRYSTORENAME = ba.storagename('entry')
def __init__(self, label: ba.Lstr = None, score_split: float = 0.7): def __init__(self, label: ba.Lstr | None = None, score_split: float = 0.7):
"""Instantiate a scoreboard. """Instantiate a scoreboard.
Label can be something like 'points' and will Label can be something like 'points' and will
@ -356,7 +356,7 @@ class Scoreboard:
def set_team_value(self, def set_team_value(self,
team: ba.Team, team: ba.Team,
score: float, score: float,
max_score: float = None, max_score: float | None = None,
countdown: bool = False, countdown: bool = False,
flash: bool = True, flash: bool = True,
show_value: bool = True) -> None: show_value: bool = True) -> None:

View File

@ -54,7 +54,7 @@ class Spawner:
pt: Sequence[float] = (0, 0, 0), # pylint: disable=invalid-name pt: Sequence[float] = (0, 0, 0), # pylint: disable=invalid-name
spawn_time: float = 1.0, spawn_time: float = 1.0,
send_spawn_message: bool = True, send_spawn_message: bool = True,
spawn_callback: Callable[[], Any] = None): spawn_callback: Callable[[], Any] | None = None):
"""Instantiate a Spawner. """Instantiate a Spawner.
Requires some custom data, a position, Requires some custom data, a position,

View File

@ -67,7 +67,7 @@ class Spaz(ba.Actor):
color: Sequence[float] = (1.0, 1.0, 1.0), color: Sequence[float] = (1.0, 1.0, 1.0),
highlight: Sequence[float] = (0.5, 0.5, 0.5), highlight: Sequence[float] = (0.5, 0.5, 0.5),
character: str = 'Spaz', character: str = 'Spaz',
source_player: ba.Player = None, source_player: ba.Player | None = None,
start_invincible: bool = True, start_invincible: bool = True,
can_accept_powerups: bool = True, can_accept_powerups: bool = True,
powerups_expire: bool = False, powerups_expire: bool = False,
@ -1266,7 +1266,7 @@ class Spaz(ba.Actor):
else: else:
self.node.counter_text = '' self.node.counter_text = ''
def curse_explode(self, source_player: ba.Player = None) -> None: def curse_explode(self, source_player: ba.Player | None = None) -> None:
"""Explode the poor spaz spectacularly.""" """Explode the poor spaz spectacularly."""
if self._cursed and self.node: if self._cursed and self.node:
self.shatter(extreme=True) self.shatter(extreme=True)

View File

@ -888,11 +888,12 @@ class SpazBotSet:
def __del__(self) -> None: def __del__(self) -> None:
self.clear() self.clear()
def spawn_bot(self, def spawn_bot(
bot_type: type[SpazBot], self,
pos: Sequence[float], bot_type: type[SpazBot],
spawn_time: float = 3.0, pos: Sequence[float],
on_spawn_call: Callable[[SpazBot], Any] = None) -> None: spawn_time: float = 3.0,
on_spawn_call: Callable[[SpazBot], Any] | None = None) -> None:
"""Spawn a bot from this set.""" """Spawn a bot from this set."""
from bastd.actor import spawner from bastd.actor import spawner
spawner.Spawner(pt=pos, spawner.Spawner(pt=pos,

View File

@ -60,8 +60,8 @@ class Text(ba.Actor):
v_attach: VAttach = VAttach.CENTER, v_attach: VAttach = VAttach.CENTER,
h_attach: HAttach = HAttach.CENTER, h_attach: HAttach = HAttach.CENTER,
scale: float = 1.0, scale: float = 1.0,
transition_out_delay: float = None, transition_out_delay: float | None = None,
maxwidth: float = None, maxwidth: float | None = None,
shadow: float = 0.5, shadow: float = 0.5,
flatness: float = 0.0, flatness: float = 0.0,
vr_depth: float = 0.0, vr_depth: float = 0.0,

View File

@ -24,9 +24,9 @@ class ZoomText(ba.Actor):
def __init__(self, def __init__(self,
text: str | ba.Lstr, text: str | ba.Lstr,
position: tuple[float, float] = (0.0, 0.0), position: tuple[float, float] = (0.0, 0.0),
shiftposition: tuple[float, float] = None, shiftposition: tuple[float, float] | None = None,
shiftdelay: float = None, shiftdelay: float | None = None,
lifespan: float = None, lifespan: float | None = None,
flash: bool = True, flash: bool = True,
trail: bool = True, trail: bool = True,
h_align: str = 'center', h_align: str = 'center',
@ -36,7 +36,7 @@ class ZoomText(ba.Actor):
scale: float = 1.0, scale: float = 1.0,
project_scale: float = 1.0, project_scale: float = 1.0,
tilt_translate: float = 0.0, tilt_translate: float = 0.0,
maxwidth: float = None): maxwidth: float | None = None):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
super().__init__() super().__init__()
self._dying = False self._dying = False

View File

@ -492,8 +492,8 @@ class CaptureTheFlagGame(ba.TeamGameActivity[Player, Team]):
def spawn_player_spaz(self, def spawn_player_spaz(self,
player: Player, player: Player,
position: Sequence[float] = None, position: Sequence[float] | None = None,
angle: float = None) -> PlayerSpaz: angle: float | None = None) -> PlayerSpaz:
"""Intercept new spazzes and add our team material for them.""" """Intercept new spazzes and add our team material for them."""
spaz = super().spawn_player_spaz(player, position, angle) spaz = super().spawn_player_spaz(player, position, angle)
player = spaz.getplayer(Player, True) player = spaz.getplayer(Player, True)

View File

@ -596,7 +596,9 @@ class FootballCoopGame(ba.CoopGameActivity[Player, Team]):
if closest_bot is not None: if closest_bot is not None:
closest_bot.target_flag = self._flag closest_bot.target_flag = self._flag
def _drop_powerup(self, index: int, poweruptype: str = None) -> None: def _drop_powerup(self,
index: int,
poweruptype: str | None = None) -> None:
if poweruptype is None: if poweruptype is None:
poweruptype = (PowerupBoxFactory.get().get_random_powerup_type( poweruptype = (PowerupBoxFactory.get().get_random_powerup_type(
excludetypes=self._exclude_powerups)) excludetypes=self._exclude_powerups))
@ -610,7 +612,7 @@ class FootballCoopGame(ba.CoopGameActivity[Player, Team]):
def _drop_powerups(self, def _drop_powerups(self,
standard_points: bool = False, standard_points: bool = False,
poweruptype: str = None) -> None: poweruptype: str | None = None) -> None:
"""Generic powerup drop.""" """Generic powerup drop."""
if standard_points: if standard_points:
spawnpoints = self.map.powerup_spawn_points spawnpoints = self.map.powerup_spawn_points

View File

@ -690,7 +690,9 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
del player, bomb # Unused. del player, bomb # Unused.
self._player_has_dropped_bomb = True self._player_has_dropped_bomb = True
def _drop_powerup(self, index: int, poweruptype: str = None) -> None: def _drop_powerup(self,
index: int,
poweruptype: str | None = None) -> None:
poweruptype = (PowerupBoxFactory.get().get_random_powerup_type( poweruptype = (PowerupBoxFactory.get().get_random_powerup_type(
forcetype=poweruptype, excludetypes=self._excluded_powerups)) forcetype=poweruptype, excludetypes=self._excluded_powerups))
PowerupBox(position=self.map.powerup_spawn_points[index], PowerupBox(position=self.map.powerup_spawn_points[index],
@ -703,7 +705,7 @@ class OnslaughtGame(ba.CoopGameActivity[Player, Team]):
def _drop_powerups(self, def _drop_powerups(self,
standard_points: bool = False, standard_points: bool = False,
poweruptype: str = None) -> None: poweruptype: str | None = None) -> None:
"""Generic powerup drop.""" """Generic powerup drop."""
if standard_points: if standard_points:
points = self.map.powerup_spawn_points points = self.map.powerup_spawn_points

View File

@ -497,7 +497,9 @@ class RunaroundGame(ba.CoopGameActivity[Player, Team]):
del player # Unused. del player # Unused.
self._player_has_picked_up_powerup = True self._player_has_picked_up_powerup = True
def _drop_powerup(self, index: int, poweruptype: str = None) -> None: def _drop_powerup(self,
index: int,
poweruptype: str | None = None) -> None:
if poweruptype is None: if poweruptype is None:
poweruptype = (PowerupBoxFactory.get().get_random_powerup_type( poweruptype = (PowerupBoxFactory.get().get_random_powerup_type(
excludetypes=self._exclude_powerups)) excludetypes=self._exclude_powerups))
@ -509,7 +511,7 @@ class RunaroundGame(ba.CoopGameActivity[Player, Team]):
def _drop_powerups(self, def _drop_powerups(self,
standard_points: bool = False, standard_points: bool = False,
force_first: str = None) -> None: force_first: str | None = None) -> None:
"""Generic powerup drop.""" """Generic powerup drop."""
# If its been a minute since our last wave finished emerging, stop # If its been a minute since our last wave finished emerging, stop

View File

@ -132,7 +132,9 @@ class TheLastStandGame(ba.CoopGameActivity[Player, Team]):
self._bot_update_timer = ba.Timer(self._bot_update_interval, self._bot_update_timer = ba.Timer(self._bot_update_interval,
ba.WeakCall(self._update_bots)) ba.WeakCall(self._update_bots))
def _drop_powerup(self, index: int, poweruptype: str = None) -> None: def _drop_powerup(self,
index: int,
poweruptype: str | None = None) -> None:
if poweruptype is None: if poweruptype is None:
poweruptype = (PowerupBoxFactory.get().get_random_powerup_type( poweruptype = (PowerupBoxFactory.get().get_random_powerup_type(
excludetypes=self._excludepowerups)) excludetypes=self._excludepowerups))
@ -146,7 +148,7 @@ class TheLastStandGame(ba.CoopGameActivity[Player, Team]):
def _drop_powerups(self, def _drop_powerups(self,
standard_points: bool = False, standard_points: bool = False,
force_first: str = None) -> None: force_first: str | None = None) -> None:
"""Generic powerup drop.""" """Generic powerup drop."""
from bastd.actor import powerupbox from bastd.actor import powerupbox
if standard_points: if standard_points:

View File

@ -767,7 +767,7 @@ class MainMenuActivity(ba.Activity[ba.Player, ba.Team]):
y: float, y: float,
scale: float, scale: float,
delay: float, delay: float,
custom_texture: str = None, custom_texture: str | None = None,
jitter_scale: float = 1.0, jitter_scale: float = 1.0,
rotate: float = 0.0, rotate: float = 0.0,
vr_depth_offset: float = 0.0) -> None: vr_depth_offset: float = 0.0) -> None:

View File

@ -178,7 +178,7 @@ class Team(ba.Team[Player]):
class TutorialActivity(ba.Activity[Player, Team]): class TutorialActivity(ba.Activity[Player, Team]):
def __init__(self, settings: dict = None): def __init__(self, settings: dict | None = None):
from bastd.maps import Rampage from bastd.maps import Rampage
if settings is None: if settings is None:
settings = {} settings = {}
@ -492,7 +492,7 @@ class TutorialActivity(ba.Activity[Player, Team]):
position: Sequence[float], position: Sequence[float],
color: Sequence[float] = (1.0, 1.0, 1.0), color: Sequence[float] = (1.0, 1.0, 1.0),
make_current: bool = False, make_current: bool = False,
relative_to: int = None, relative_to: int | None = None,
name: str | ba.Lstr = '', name: str | ba.Lstr = '',
flash: bool = True, flash: bool = True,
angle: float = 0.0): angle: float = 0.0):
@ -550,7 +550,7 @@ class TutorialActivity(ba.Activity[Player, Team]):
position: Sequence[float], position: Sequence[float],
color: Sequence[float] = (1.0, 1.0, 1.0), color: Sequence[float] = (1.0, 1.0, 1.0),
make_current: bool = False, make_current: bool = False,
relative_to: int = None): relative_to: int | None = None):
self._position = position self._position = position
self._relative_to = relative_to self._relative_to = relative_to
@ -761,7 +761,7 @@ class TutorialActivity(ba.Activity[Player, Team]):
class PrintPos: class PrintPos:
def __init__(self, spaz_num: int = None): def __init__(self, spaz_num: int | None = None):
self._spaz_num = spaz_num self._spaz_num = spaz_num
def run(self, a: TutorialActivity) -> None: def run(self, a: TutorialActivity) -> None:
@ -787,7 +787,7 @@ class TutorialActivity(ba.Activity[Player, Team]):
def __init__(self, def __init__(self,
celebrate_type: str = 'both', celebrate_type: str = 'both',
spaz_num: int = None, spaz_num: int | None = None,
duration: int = 1000): duration: int = 1000):
self._spaz_num = spaz_num self._spaz_num = spaz_num
self._celebrate_type = celebrate_type self._celebrate_type = celebrate_type

View File

@ -8,7 +8,7 @@ import _ba
import ba import ba
def show_sign_in_prompt(account_type: str = None) -> None: def show_sign_in_prompt(account_type: str | None = None) -> None:
"""Bring up a prompt telling the user they must sign in.""" """Bring up a prompt telling the user they must sign in."""
from bastd.ui.confirm import ConfirmWindow from bastd.ui.confirm import ConfirmWindow
from bastd.ui.account import settings from bastd.ui.account import settings

View File

@ -18,7 +18,7 @@ if TYPE_CHECKING:
class AccountLinkWindow(ba.Window): class AccountLinkWindow(ba.Window):
"""Window for linking accounts.""" """Window for linking accounts."""
def __init__(self, origin_widget: ba.Widget = None): def __init__(self, origin_widget: ba.Widget | None = None):
scale_origin: tuple[float, float] | None scale_origin: tuple[float, float] | None
if origin_widget is not None: if origin_widget is not None:
self._transition_out = 'out_scale' self._transition_out = 'out_scale'

View File

@ -21,7 +21,7 @@ class AccountSettingsWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str = 'in_right', transition: str = 'in_right',
modal: bool = False, modal: bool = False,
origin_widget: ba.Widget = None, origin_widget: ba.Widget | None = None,
close_once_signed_in: bool = False): close_once_signed_in: bool = False):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements

View File

@ -17,7 +17,7 @@ if TYPE_CHECKING:
class AccountUnlinkWindow(ba.Window): class AccountUnlinkWindow(ba.Window):
"""A window to kick off account unlinks.""" """A window to kick off account unlinks."""
def __init__(self, origin_widget: ba.Widget = None): def __init__(self, origin_widget: ba.Widget | None = None):
scale_origin: tuple[float, float] | None scale_origin: tuple[float, float] | None
if origin_widget is not None: if origin_widget is not None:
self._transition_out = 'out_scale' self._transition_out = 'out_scale'

View File

@ -19,9 +19,9 @@ class AccountViewerWindow(popup.PopupWindow):
def __init__(self, def __init__(self,
account_id: str, account_id: str,
profile_id: str = None, profile_id: str | None = None,
position: tuple[float, float] = (0.0, 0.0), position: tuple[float, float] = (0.0, 0.0),
scale: float = None, scale: float | None = None,
offset: tuple[float, float] = (0.0, 0.0)): offset: tuple[float, float] = (0.0, 0.0)):
from ba.internal import is_browser_likely_available, master_server_get from ba.internal import is_browser_likely_available, master_server_get

View File

@ -16,7 +16,9 @@ if TYPE_CHECKING:
class AchievementsWindow(popup.PopupWindow): class AchievementsWindow(popup.PopupWindow):
"""Popup window to view achievements.""" """Popup window to view achievements."""
def __init__(self, position: tuple[float, float], scale: float = None): def __init__(self,
position: tuple[float, float],
scale: float | None = None):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
uiscale = ba.app.ui.uiscale uiscale = ba.app.ui.uiscale
if scale is None: if scale is None:

View File

@ -22,11 +22,11 @@ class CharacterPicker(popup.PopupWindow):
parent: ba.Widget, parent: ba.Widget,
position: tuple[float, float] = (0.0, 0.0), position: tuple[float, float] = (0.0, 0.0),
delegate: Any = None, delegate: Any = None,
scale: float = None, scale: float | None = None,
offset: tuple[float, float] = (0.0, 0.0), offset: tuple[float, float] = (0.0, 0.0),
tint_color: Sequence[float] = (1.0, 1.0, 1.0), tint_color: Sequence[float] = (1.0, 1.0, 1.0),
tint2_color: Sequence[float] = (1.0, 1.0, 1.0), tint2_color: Sequence[float] = (1.0, 1.0, 1.0),
selected_character: str = None): selected_character: str | None = None):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
from bastd.actor import spazappearance from bastd.actor import spazappearance
del parent # unused here del parent # unused here

View File

@ -24,7 +24,7 @@ class ColorPicker(PopupWindow):
position: tuple[float, float], position: tuple[float, float],
initial_color: Sequence[float] = (1.0, 1.0, 1.0), initial_color: Sequence[float] = (1.0, 1.0, 1.0),
delegate: Any = None, delegate: Any = None,
scale: float = None, scale: float | None = None,
offset: tuple[float, float] = (0.0, 0.0), offset: tuple[float, float] = (0.0, 0.0),
tag: Any = ''): tag: Any = ''):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
@ -162,7 +162,7 @@ class ColorPickerExact(PopupWindow):
position: tuple[float, float], position: tuple[float, float],
initial_color: Sequence[float] = (1.0, 1.0, 1.0), initial_color: Sequence[float] = (1.0, 1.0, 1.0),
delegate: Any = None, delegate: Any = None,
scale: float = None, scale: float | None = None,
offset: tuple[float, float] = (0.0, 0.0), offset: tuple[float, float] = (0.0, 0.0),
tag: Any = ''): tag: Any = ''):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals

View File

@ -28,10 +28,10 @@ class ConfigCheckBox:
position: tuple[float, float], position: tuple[float, float],
size: tuple[float, float], size: tuple[float, float],
displayname: str | ba.Lstr | None = None, displayname: str | ba.Lstr | None = None,
scale: float = None, scale: float | None = None,
maxwidth: float = None, maxwidth: float | None = None,
autoselect: bool = True, autoselect: bool = True,
value_change_call: Callable[[Any], Any] = None): value_change_call: Callable[[Any], Any] | None = None):
if displayname is None: if displayname is None:
displayname = configkey displayname = configkey
self._value_change_call = value_change_call self._value_change_call = value_change_call
@ -84,7 +84,7 @@ class ConfigNumberEdit:
minval: float = 0.0, minval: float = 0.0,
maxval: float = 100.0, maxval: float = 100.0,
increment: float = 1.0, increment: float = 1.0,
callback: Callable[[float], Any] = None, callback: Callable[[float], Any] | None = None,
xoffset: float = 0.0, xoffset: float = 0.0,
displayname: str | ba.Lstr | None = None, displayname: str | ba.Lstr | None = None,
changesound: bool = True, changesound: bool = True,

View File

@ -18,7 +18,7 @@ class ConfirmWindow:
def __init__(self, def __init__(self,
text: str | ba.Lstr = 'Are you sure?', text: str | ba.Lstr = 'Are you sure?',
action: Callable[[], Any] = None, action: Callable[[], Any] | None = None,
width: float = 360.0, width: float = 360.0,
height: float = 100.0, height: float = 100.0,
cancel_button: bool = True, cancel_button: bool = True,
@ -27,7 +27,7 @@ class ConfirmWindow:
text_scale: float = 1.0, text_scale: float = 1.0,
ok_text: str | ba.Lstr | None = None, ok_text: str | ba.Lstr | None = None,
cancel_text: str | ba.Lstr | None = None, cancel_text: str | ba.Lstr | None = None,
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
if ok_text is None: if ok_text is None:
ok_text = ba.Lstr(resource='okText') ok_text = ba.Lstr(resource='okText')
@ -127,7 +127,7 @@ class QuitWindow:
def __init__(self, def __init__(self,
swish: bool = False, swish: bool = False,
back: bool = False, back: bool = False,
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
ui = ba.app.ui ui = ba.app.ui
app = ba.app app = ba.app
self._back = back self._back = back

View File

@ -37,7 +37,7 @@ class CoopBrowserWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str | None = 'in_right', transition: str | None = 'in_right',
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=cyclic-import # pylint: disable=cyclic-import
import threading import threading
@ -1415,7 +1415,7 @@ class CoopBrowserWindow(ba.Window):
def run(self, def run(self,
game: str | None, game: str | None,
tournament_button: dict[str, Any] = None) -> None: tournament_button: dict[str, Any] | None = None) -> None:
"""Run the provided game.""" """Run the provided game."""
# pylint: disable=too-many-branches # pylint: disable=too-many-branches
# pylint: disable=too-many-statements # pylint: disable=too-many-statements

View File

@ -16,7 +16,7 @@ if TYPE_CHECKING:
class CreditsListWindow(ba.Window): class CreditsListWindow(ba.Window):
"""Window for displaying game credits.""" """Window for displaying game credits."""
def __init__(self, origin_widget: ba.Widget = None): def __init__(self, origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
import json import json

View File

@ -21,9 +21,9 @@ class FileSelectorWindow(ba.Window):
def __init__(self, def __init__(self,
path: str, path: str,
callback: Callable[[str | None], Any] = None, callback: Callable[[str | None], Any] | None = None,
show_base_path: bool = True, show_base_path: bool = True,
valid_file_extensions: Sequence[str] = None, valid_file_extensions: Sequence[str] | None = None,
allow_folders: bool = False): allow_folders: bool = False):
if valid_file_extensions is None: if valid_file_extensions is None:
valid_file_extensions = [] valid_file_extensions = []

View File

@ -68,7 +68,7 @@ class GatherWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str | None = 'in_right', transition: str | None = 'in_right',
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
# pylint: disable=cyclic-import # pylint: disable=cyclic-import

View File

@ -20,8 +20,8 @@ class GetCurrencyWindow(ba.Window):
transition: str = 'in_right', transition: str = 'in_right',
from_modal_store: bool = False, from_modal_store: bool = False,
modal: bool = False, modal: bool = False,
origin_widget: ba.Widget = None, origin_widget: ba.Widget | None = None,
store_back_location: str = None): store_back_location: str | None = None):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
@ -105,8 +105,8 @@ class GetCurrencyWindow(ba.Window):
position: tuple[float, float], position: tuple[float, float],
size: tuple[float, float], size: tuple[float, float],
label: ba.Lstr, label: ba.Lstr,
price: str = None, price: str | None = None,
tex_name: str = None, tex_name: str | None = None,
tex_opacity: float = 1.0, tex_opacity: float = 1.0,
tex_scale: float = 1.0, tex_scale: float = 1.0,
enabled: bool = True, enabled: bool = True,

View File

@ -18,7 +18,7 @@ class HelpWindow(ba.Window):
def __init__(self, def __init__(self,
main_menu: bool = False, main_menu: bool = False,
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
from ba.internal import get_remote_app_name from ba.internal import get_remote_app_name

View File

@ -22,11 +22,11 @@ class IconPicker(popup.PopupWindow):
parent: ba.Widget, parent: ba.Widget,
position: tuple[float, float] = (0.0, 0.0), position: tuple[float, float] = (0.0, 0.0),
delegate: Any = None, delegate: Any = None,
scale: float = None, scale: float | None = None,
offset: tuple[float, float] = (0.0, 0.0), offset: tuple[float, float] = (0.0, 0.0),
tint_color: Sequence[float] = (1.0, 1.0, 1.0), tint_color: Sequence[float] = (1.0, 1.0, 1.0),
tint2_color: Sequence[float] = (1.0, 1.0, 1.0), tint2_color: Sequence[float] = (1.0, 1.0, 1.0),
selected_icon: str = None): selected_icon: str | None = None):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
del parent # unused here del parent # unused here
del tint_color # unused_here del tint_color # unused_here

View File

@ -21,11 +21,11 @@ class LeagueRankButton:
position: tuple[float, float], position: tuple[float, float],
size: tuple[float, float], size: tuple[float, float],
scale: float, scale: float,
on_activate_call: Callable[[], Any] = None, on_activate_call: Callable[[], Any] | None = None,
transition_delay: float = None, transition_delay: float | None = None,
color: tuple[float, float, float] = None, color: tuple[float, float, float] | None = None,
textcolor: tuple[float, float, float] = None, textcolor: tuple[float, float, float] | None = None,
smooth_update_delay: float = None): smooth_update_delay: float | None = None):
if on_activate_call is None: if on_activate_call is None:
on_activate_call = ba.WeakCall(self._default_on_activate_call) on_activate_call = ba.WeakCall(self._default_on_activate_call)
self._on_activate_call = on_activate_call self._on_activate_call = on_activate_call

View File

@ -21,7 +21,7 @@ class LeagueRankWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str = 'in_right', transition: str = 'in_right',
modal: bool = False, modal: bool = False,
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
ba.set_analytics_screen('League Rank Window') ba.set_analytics_screen('League Rank Window')
self._league_rank_data: dict[str, Any] | None = None self._league_rank_data: dict[str, Any] | None = None

View File

@ -18,7 +18,7 @@ class PlayWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str = 'in_right', transition: str = 'in_right',
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
import threading import threading

View File

@ -21,7 +21,7 @@ class PlaylistBrowserWindow(ba.Window):
def __init__(self, def __init__(self,
sessiontype: type[ba.Session], sessiontype: type[ba.Session],
transition: str | None = 'in_right', transition: str | None = 'in_right',
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=cyclic-import # pylint: disable=cyclic-import
from bastd.ui.playlist import PlaylistTypeVars from bastd.ui.playlist import PlaylistTypeVars

View File

@ -21,8 +21,8 @@ class PlaylistCustomizeBrowserWindow(ba.Window):
def __init__(self, def __init__(self,
sessiontype: type[ba.Session], sessiontype: type[ba.Session],
transition: str = 'in_right', transition: str = 'in_right',
select_playlist: str = None, select_playlist: str | None = None,
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# Yes this needs tidying. # Yes this needs tidying.
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
@ -297,7 +297,7 @@ class PlaylistCustomizeBrowserWindow(ba.Window):
_ba.fade_screen(False, endcall=self._run_selected_playlist) _ba.fade_screen(False, endcall=self._run_selected_playlist)
_ba.lock_all_input() _ba.lock_all_input()
def _refresh(self, select_playlist: str = None) -> None: def _refresh(self, select_playlist: str | None = None) -> None:
from efro.util import asserttype from efro.util import asserttype
old_selection = self._selected_playlist_name old_selection = self._selected_playlist_name

View File

@ -18,10 +18,10 @@ class PlaylistEditController:
def __init__(self, def __init__(self,
sessiontype: type[ba.Session], sessiontype: type[ba.Session],
existing_playlist_name: str = None, existing_playlist_name: str | None = None,
transition: str = 'in_right', transition: str = 'in_right',
playlist: list[dict[str, Any]] = None, playlist: list[dict[str, Any]] | None = None,
playlist_name: str = None): playlist_name: str | None = None):
from ba.internal import preload_map_preview_media, filter_playlist from ba.internal import preload_map_preview_media, filter_playlist
from bastd.ui.playlist import PlaylistTypeVars from bastd.ui.playlist import PlaylistTypeVars
from bastd.ui.playlist.edit import PlaylistEditWindow from bastd.ui.playlist.edit import PlaylistEditWindow

View File

@ -23,9 +23,9 @@ class PlaylistEditGameWindow(ba.Window):
sessiontype: type[ba.Session], sessiontype: type[ba.Session],
config: dict[str, Any] | None, config: dict[str, Any] | None,
completion_call: Callable[[dict[str, Any] | None], Any], completion_call: Callable[[dict[str, Any] | None], Any],
default_selection: str = None, default_selection: str | None = None,
transition: str = 'in_right', transition: str = 'in_right',
edit_info: dict[str, Any] = None): edit_info: dict[str, Any] | None = None):
# pylint: disable=too-many-branches # pylint: disable=too-many-branches
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=too-many-locals # pylint: disable=too-many-locals

View File

@ -19,8 +19,8 @@ class SharePlaylistImportWindow(promocode.PromoCodeWindow):
"""Window for importing a shared playlist.""" """Window for importing a shared playlist."""
def __init__(self, def __init__(self,
origin_widget: ba.Widget = None, origin_widget: ba.Widget | None = None,
on_success_callback: Callable[[], Any] = None): on_success_callback: Callable[[], Any] | None = None):
promocode.PromoCodeWindow.__init__(self, promocode.PromoCodeWindow.__init__(self,
modal=True, modal=True,
origin_widget=origin_widget) origin_widget=origin_widget)

View File

@ -26,7 +26,7 @@ class PopupWindow:
offset: tuple[float, float] = (0, 0), offset: tuple[float, float] = (0, 0),
bg_color: tuple[float, float, float] = (0.35, 0.55, 0.15), bg_color: tuple[float, float, float] = (0.35, 0.55, 0.15),
focus_position: tuple[float, float] = (0, 0), focus_position: tuple[float, float] = (0, 0),
focus_size: tuple[float, float] = None, focus_size: tuple[float, float] | None = None,
toolbar_visibility: str = 'menu_minimal_no_back'): toolbar_visibility: str = 'menu_minimal_no_back'):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
if focus_size is None: if focus_size is None:
@ -108,10 +108,10 @@ class PopupMenuWindow(PopupWindow):
current_choice: str, current_choice: str,
delegate: Any = None, delegate: Any = None,
width: float = 230.0, width: float = 230.0,
maxwidth: float = None, maxwidth: float | None = None,
scale: float = 1.0, scale: float = 1.0,
choices_disabled: Sequence[str] = None, choices_disabled: Sequence[str] | None = None,
choices_display: Sequence[ba.Lstr] = None): choices_display: Sequence[ba.Lstr] | None = None):
# FIXME: Clean up a bit. # FIXME: Clean up a bit.
# pylint: disable=too-many-branches # pylint: disable=too-many-branches
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
@ -268,15 +268,15 @@ class PopupMenu:
parent: ba.Widget, parent: ba.Widget,
position: tuple[float, float], position: tuple[float, float],
choices: Sequence[str], choices: Sequence[str],
current_choice: str = None, current_choice: str | None = None,
on_value_change_call: Callable[[str], Any] = None, on_value_change_call: Callable[[str], Any] | None = None,
opening_call: Callable[[], Any] = None, opening_call: Callable[[], Any] | None = None,
closing_call: Callable[[], Any] = None, closing_call: Callable[[], Any] | None = None,
width: float = 230.0, width: float = 230.0,
maxwidth: float = None, maxwidth: float | None = None,
scale: float = None, scale: float | None = None,
choices_disabled: Sequence[str] = None, choices_disabled: Sequence[str] | None = None,
choices_display: Sequence[ba.Lstr] = None, choices_display: Sequence[ba.Lstr] | None = None,
button_size: tuple[float, float] = (160.0, 50.0), button_size: tuple[float, float] = (160.0, 50.0),
autoselect: bool = True): autoselect: bool = True):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals

View File

@ -19,8 +19,8 @@ class ProfileBrowserWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str = 'in_right', transition: str = 'in_right',
in_main_menu: bool = True, in_main_menu: bool = True,
selected_profile: str = None, selected_profile: str | None = None,
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
self._in_main_menu = in_main_menu self._in_main_menu = in_main_menu

View File

@ -17,7 +17,9 @@ if TYPE_CHECKING:
class PromoCodeWindow(ba.Window): class PromoCodeWindow(ba.Window):
"""Window for entering promo codes.""" """Window for entering promo codes."""
def __init__(self, modal: bool = False, origin_widget: ba.Widget = None): def __init__(self,
modal: bool = False,
origin_widget: ba.Widget | None = None):
scale_origin: tuple[float, float] | None scale_origin: tuple[float, float] | None
if origin_widget is not None: if origin_widget is not None:

View File

@ -19,7 +19,7 @@ class PurchaseWindow(ba.Window):
def __init__(self, def __init__(self,
items: list[str], items: list[str],
transition: str = 'in_right', transition: str = 'in_right',
header_text: ba.Lstr = None): header_text: ba.Lstr | None = None):
from ba.internal import get_store_item_display_size from ba.internal import get_store_item_display_size
from bastd.ui.store import item as storeitemui from bastd.ui.store import item as storeitemui
if header_text is None: if header_text is None:

View File

@ -19,7 +19,7 @@ class AdvancedSettingsWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str = 'in_right', transition: str = 'in_right',
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
from ba.internal import master_server_get from ba.internal import master_server_get
import threading import threading

View File

@ -18,7 +18,7 @@ class AllSettingsWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str = 'in_right', transition: str = 'in_right',
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
import threading import threading

View File

@ -18,7 +18,7 @@ class AudioSettingsWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str = 'in_right', transition: str = 'in_right',
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
# pylint: disable=cyclic-import # pylint: disable=cyclic-import

View File

@ -18,7 +18,7 @@ class ControlsSettingsWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str = 'in_right', transition: str = 'in_right',
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# FIXME: should tidy up here. # FIXME: should tidy up here.
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=too-many-branches # pylint: disable=too-many-branches

View File

@ -21,7 +21,7 @@ class GamepadSettingsWindow(ba.Window):
is_main_menu: bool = True, is_main_menu: bool = True,
transition: str = 'in_right', transition: str = 'in_right',
transition_out: str = 'out_right', transition_out: str = 'out_right',
settings: dict = None): settings: dict | None = None):
self._input = gamepad self._input = gamepad
# If our input-device went away, just return an empty zombie. # If our input-device went away, just return an empty zombie.
@ -652,8 +652,8 @@ class GamepadSettingsWindow(ba.Window):
texture: ba.Texture, texture: ba.Texture,
button: str, button: str,
scale: float = 1.0, scale: float = 1.0,
message: ba.Lstr = None, message: ba.Lstr | None = None,
message2: ba.Lstr = None, message2: ba.Lstr | None = None,
maxwidth: float = 80.0) -> ba.Widget: maxwidth: float = 80.0) -> ba.Widget:
if message is None: if message is None:
message = ba.Lstr(resource=self._r + '.pressAnyButtonText') message = ba.Lstr(resource=self._r + '.pressAnyButtonText')
@ -754,8 +754,8 @@ class AwaitGamepadInputWindow(ba.Window):
button: str, button: str,
callback: Callable[[str, dict[str, Any], AwaitGamepadInputWindow], callback: Callable[[str, dict[str, Any], AwaitGamepadInputWindow],
Any], Any],
message: ba.Lstr = None, message: ba.Lstr | None = None,
message2: ba.Lstr = None): message2: ba.Lstr | None = None):
if message is None: if message is None:
print('AwaitGamepadInputWindow message is None!') print('AwaitGamepadInputWindow message is None!')
# Shouldn't get here. # Shouldn't get here.

View File

@ -404,7 +404,7 @@ class GamepadAdvancedSettingsWindow(ba.Window):
increment: float = 1.0, increment: float = 1.0,
change_sound: bool = True, change_sound: bool = True,
x_offset: float = 0.0, x_offset: float = 0.0,
displayname: ba.Lstr = None) -> tuple[ba.Widget, ba.Widget]: displayname: ba.Lstr | None = None) -> tuple[ba.Widget, ba.Widget]:
if displayname is None: if displayname is None:
displayname = name displayname = name

View File

@ -18,7 +18,7 @@ class GraphicsSettingsWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str = 'in_right', transition: str = 'in_right',
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
# pylint: disable=too-many-branches # pylint: disable=too-many-branches
# pylint: disable=too-many-statements # pylint: disable=too-many-statements

View File

@ -131,7 +131,8 @@ def _run_diagnostics(weakwin: weakref.ref[NetTestingWindow]) -> None:
# We're running in a background thread but UI stuff needs to run # We're running in a background thread but UI stuff needs to run
# in the logic thread; give ourself a way to pass stuff to it. # in the logic thread; give ourself a way to pass stuff to it.
def _print(text: str, color: tuple[float, float, float] = None) -> None: def _print(text: str,
color: tuple[float, float, float] | None = None) -> None:
def _print_in_logic_thread() -> None: def _print_in_logic_thread() -> None:
win = weakwin() win = weakwin()

View File

@ -17,7 +17,7 @@ class PluginSettingsWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str = 'in_right', transition: str = 'in_right',
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
app = ba.app app = ba.app

View File

@ -19,7 +19,7 @@ class SoundtrackBrowserWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str = 'in_right', transition: str = 'in_right',
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
@ -355,7 +355,7 @@ class SoundtrackBrowserWindow(ba.Window):
return ba.Lstr(resource=self._r + '.defaultSoundtrackNameText') return ba.Lstr(resource=self._r + '.defaultSoundtrackNameText')
return ba.Lstr(value=soundtrack) return ba.Lstr(value=soundtrack)
def _refresh(self, select_soundtrack: str = None) -> None: def _refresh(self, select_soundtrack: str | None = None) -> None:
from efro.util import asserttype from efro.util import asserttype
self._allow_changing_soundtracks = False self._allow_changing_soundtracks = False
old_selection = self._selected_soundtrack old_selection = self._selected_soundtrack

View File

@ -31,10 +31,10 @@ class StoreBrowserWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str = 'in_right', transition: str = 'in_right',
modal: bool = False, modal: bool = False,
show_tab: StoreBrowserWindow.TabID = None, show_tab: StoreBrowserWindow.TabID | None = None,
on_close_call: Callable[[], Any] = None, on_close_call: Callable[[], Any] | None = None,
back_location: str = None, back_location: str | None = None,
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
from bastd.ui.tabs import TabRow from bastd.ui.tabs import TabRow

View File

@ -20,12 +20,12 @@ class StoreButton:
position: Sequence[float], position: Sequence[float],
size: Sequence[float], size: Sequence[float],
scale: float, scale: float,
on_activate_call: Callable[[], Any] = None, on_activate_call: Callable[[], Any] | None = None,
transition_delay: float = None, transition_delay: float | None = None,
color: Sequence[float] = None, color: Sequence[float] | None = None,
textcolor: Sequence[float] = None, textcolor: Sequence[float] | None = None,
show_tickets: bool = False, show_tickets: bool = False,
button_type: str = None, button_type: str | None = None,
sale_scale: float = 1.0): sale_scale: float = 1.0):
self._position = position self._position = position
self._size = size self._size = size

View File

@ -35,7 +35,7 @@ class TabRow(Generic[T]):
tabdefs: list[tuple[T, ba.Lstr]], tabdefs: list[tuple[T, ba.Lstr]],
pos: tuple[float, float], pos: tuple[float, float],
size: tuple[float, float], size: tuple[float, float],
on_select_call: Callable[[T], None] = None) -> None: on_select_call: Callable[[T], None] | None = None) -> None:
if not tabdefs: if not tabdefs:
raise ValueError('At least one tab def is required') raise ValueError('At least one tab def is required')
self.tabs: dict[T, Tab] = {} self.tabs: dict[T, Tab] = {}

View File

@ -19,12 +19,12 @@ class TournamentEntryWindow(popup.PopupWindow):
def __init__(self, def __init__(self,
tournament_id: str, tournament_id: str,
tournament_activity: ba.Activity = None, tournament_activity: ba.Activity | None = None,
position: tuple[float, float] = (0.0, 0.0), position: tuple[float, float] = (0.0, 0.0),
delegate: Any = None, delegate: Any = None,
scale: float = None, scale: float | None = None,
offset: tuple[float, float] = (0.0, 0.0), offset: tuple[float, float] = (0.0, 0.0),
on_close_call: Callable[[], Any] = None): on_close_call: Callable[[], Any] | None = None):
# Needs some tidying. # Needs some tidying.
# pylint: disable=too-many-branches # pylint: disable=too-many-branches
# pylint: disable=too-many-statements # pylint: disable=too-many-statements

View File

@ -19,14 +19,14 @@ class TournamentScoresWindow(popup_ui.PopupWindow):
def __init__(self, def __init__(self,
tournament_id: str, tournament_id: str,
tournament_activity: ba.GameActivity = None, tournament_activity: ba.GameActivity | None = None,
position: tuple[float, float] = (0.0, 0.0), position: tuple[float, float] = (0.0, 0.0),
scale: float = None, scale: float | None = None,
offset: tuple[float, float] = (0.0, 0.0), offset: tuple[float, float] = (0.0, 0.0),
tint_color: Sequence[float] = (1.0, 1.0, 1.0), tint_color: Sequence[float] = (1.0, 1.0, 1.0),
tint2_color: Sequence[float] = (1.0, 1.0, 1.0), tint2_color: Sequence[float] = (1.0, 1.0, 1.0),
selected_character: str = None, selected_character: str | None = None,
on_close_call: Callable[[], Any] = None): on_close_call: Callable[[], Any] | None = None):
del tournament_activity # unused arg del tournament_activity # unused arg
del tint_color # unused arg del tint_color # unused arg

View File

@ -19,7 +19,7 @@ class TrophiesWindow(popup.PopupWindow):
def __init__(self, def __init__(self,
position: tuple[float, float], position: tuple[float, float],
data: dict[str, Any], data: dict[str, Any],
scale: float = None): scale: float | None = None):
self._data = data self._data = data
uiscale = ba.app.ui.uiscale uiscale = ba.app.ui.uiscale
if scale is None: if scale is None:

View File

@ -25,7 +25,7 @@ class WatchWindow(ba.Window):
def __init__(self, def __init__(self,
transition: str | None = 'in_right', transition: str | None = 'in_right',
origin_widget: ba.Widget = None): origin_widget: ba.Widget | None = None):
# pylint: disable=too-many-locals # pylint: disable=too-many-locals
# pylint: disable=too-many-statements # pylint: disable=too-many-statements
from bastd.ui.tabs import TabRow from bastd.ui.tabs import TabRow

View File

@ -21,7 +21,7 @@
namespace ballistica { namespace ballistica {
// These are set automatically via script; don't modify them here. // These are set automatically via script; don't modify them here.
const int kAppBuildNumber = 20617; const int kAppBuildNumber = 20620;
const char* kAppVersion = "1.7.2"; const char* kAppVersion = "1.7.2";
// Our standalone globals. // Our standalone globals.

View File

@ -47,7 +47,7 @@ void PythonClassMaterial::SetupType(PyTypeObject* obj) {
// clang-format off // clang-format off
obj->tp_doc = obj->tp_doc =
"Material(label: str = None)\n" "Material(label: str | None = None)\n"
"\n" "\n"
"An entity applied to game objects to modify collision behavior.\n" "An entity applied to game objects to modify collision behavior.\n"
"\n" "\n"

View File

@ -680,7 +680,7 @@ PyMethodDef PythonClassSessionPlayer::tp_methods[] = {
"Returns the player's name. If icon is True, the long version of the\n" "Returns the player's name. If icon is True, the long version of the\n"
"name may include an icon."}, "name may include an icon."},
{"setname", (PyCFunction)SetName, METH_VARARGS | METH_KEYWORDS, {"setname", (PyCFunction)SetName, METH_VARARGS | METH_KEYWORDS,
"setname(name: str, full_name: str = None, real: bool = True)\n" "setname(name: str, full_name: str | None = None, real: bool = True)\n"
" -> None\n" " -> None\n"
"\n" "\n"
"Set the player's name to the provided string.\n" "Set the player's name to the provided string.\n"

View File

@ -996,9 +996,13 @@ auto PythonMethodsApp::GetMethods() -> std::vector<PyMethodDef> {
{"screenmessage", (PyCFunction)PyScreenMessage, {"screenmessage", (PyCFunction)PyScreenMessage,
METH_VARARGS | METH_KEYWORDS, METH_VARARGS | METH_KEYWORDS,
"screenmessage(message: str | ba.Lstr,\n" "screenmessage(message: str | ba.Lstr,\n"
" color: Sequence[float] = None, top: bool = False,\n" " color: Sequence[float] | None = None,\n"
" image: dict[str, Any] = None, log: bool = False,\n" " top: bool = False,\n"
" clients: Sequence[int] = None, transient: bool = False) -> None\n" " image: dict[str, Any] | None = None,\n"
" log: bool = False,\n"
" clients: Sequence[int] | None = None,\n"
" transient: bool = False)"
" -> None\n"
"\n" "\n"
"Print a message to the local client's screen, in a given color.\n" "Print a message to the local client's screen, in a given color.\n"
"\n" "\n"
@ -1157,7 +1161,7 @@ auto PythonMethodsApp::GetMethods() -> std::vector<PyMethodDef> {
{"newactivity", (PyCFunction)PyNewActivity, {"newactivity", (PyCFunction)PyNewActivity,
METH_VARARGS | METH_KEYWORDS, METH_VARARGS | METH_KEYWORDS,
"newactivity(activity_type: type[ba.Activity],\n" "newactivity(activity_type: type[ba.Activity],\n"
" settings: dict = None) -> ba.Activity\n" " settings: dict | None = None) -> ba.Activity\n"
"\n" "\n"
"Instantiates a ba.Activity given a type object.\n" "Instantiates a ba.Activity given a type object.\n"
"\n" "\n"
@ -1203,7 +1207,7 @@ auto PythonMethodsApp::GetMethods() -> std::vector<PyMethodDef> {
{"new_host_session", (PyCFunction)PyNewHostSession, {"new_host_session", (PyCFunction)PyNewHostSession,
METH_VARARGS | METH_KEYWORDS, METH_VARARGS | METH_KEYWORDS,
"new_host_session(sessiontype: type[ba.Session],\n" "new_host_session(sessiontype: type[ba.Session],\n"
" benchmark_type: str = None) -> None\n" " benchmark_type: str | None = None) -> None\n"
"\n" "\n"
"(internal)"}, "(internal)"},

View File

@ -693,8 +693,10 @@ auto PythonMethodsGameplay::GetMethods() -> std::vector<PyMethodDef> {
"settings, exiting element counts, or other factors."}, "settings, exiting element counts, or other factors."},
{"playsound", (PyCFunction)PyPlaySound, METH_VARARGS | METH_KEYWORDS, {"playsound", (PyCFunction)PyPlaySound, METH_VARARGS | METH_KEYWORDS,
"playsound(sound: Sound, volume: float = 1.0,\n" "playsound(sound: Sound,\n"
" position: Sequence[float] = None, host_only: bool = False) -> None\n" " volume: float = 1.0,\n"
" position: Sequence[float] | None = None,\n"
" host_only: bool = False) -> None\n"
"\n" "\n"
"Play a ba.Sound a single time.\n" "Play a ba.Sound a single time.\n"
"\n" "\n"
@ -740,9 +742,10 @@ auto PythonMethodsGameplay::GetMethods() -> std::vector<PyMethodDef> {
"Category: **Gameplay Functions**"}, "Category: **Gameplay Functions**"},
{"newnode", (PyCFunction)PyNewNode, METH_VARARGS | METH_KEYWORDS, {"newnode", (PyCFunction)PyNewNode, METH_VARARGS | METH_KEYWORDS,
"newnode(type: str, owner: ba.Node = None,\n" "newnode(type: str, owner: ba.Node | None = None,\n"
"attrs: dict = None, name: str = None, delegate: Any = None)\n" " attrs: dict | None = None,\n"
" -> Node\n" " name: str | None = None,\n"
" delegate: Any = None) -> Node\n"
"\n" "\n"
"Add a node of the given type to the game.\n" "Add a node of the given type to the game.\n"
"\n" "\n"

View File

@ -493,7 +493,7 @@ auto PythonMethodsNetworking::GetMethods() -> std::vector<PyMethodDef> {
{"connect_to_party", (PyCFunction)PyConnectToParty, {"connect_to_party", (PyCFunction)PyConnectToParty,
METH_VARARGS | METH_KEYWORDS, METH_VARARGS | METH_KEYWORDS,
"connect_to_party(address: str, port: int = None,\n" "connect_to_party(address: str, port: int | None = None,\n"
" print_progress: bool = True) -> None\n" " print_progress: bool = True) -> None\n"
"\n" "\n"
"(internal)"}, "(internal)"},

View File

@ -1048,8 +1048,8 @@ auto PythonMethodsSystem::GetMethods() -> std::vector<PyMethodDef> {
"Debugging func for tracking leaked Python errors in the C++ layer.."}, "Debugging func for tracking leaked Python errors in the C++ layer.."},
{"value_test", (PyCFunction)PyValueTest, METH_VARARGS | METH_KEYWORDS, {"value_test", (PyCFunction)PyValueTest, METH_VARARGS | METH_KEYWORDS,
"value_test(arg: str, change: float = None, absolute: float = None)\n" "value_test(arg: str, change: float | None = None,\n"
" -> float\n" " absolute: float | None = None) -> float\n"
"\n" "\n"
"(internal)"}, "(internal)"},

View File

@ -2366,8 +2366,8 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
{"chatmessage", (PyCFunction)PyChatMessage, METH_VARARGS | METH_KEYWORDS, {"chatmessage", (PyCFunction)PyChatMessage, METH_VARARGS | METH_KEYWORDS,
"chatmessage(message: str | ba.Lstr,\n" "chatmessage(message: str | ba.Lstr,\n"
" clients: Sequence[int] = None,\n" " clients: Sequence[int] | None = None,\n"
" sender_override: str = None) -> None\n" " sender_override: str | None = None) -> None\n"
"\n" "\n"
"(internal)"}, "(internal)"},
@ -2396,14 +2396,15 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
"Category: **General Utility Functions**"}, "Category: **General Utility Functions**"},
{"show_ad", (PyCFunction)PyShowAd, METH_VARARGS | METH_KEYWORDS, {"show_ad", (PyCFunction)PyShowAd, METH_VARARGS | METH_KEYWORDS,
"show_ad(purpose: str, on_completion_call: Callable[[], None] = None)\n" "show_ad(purpose: str,\n"
" on_completion_call: Callable[[], None] | None = None)\n"
" -> None\n" " -> None\n"
"\n" "\n"
"(internal)"}, "(internal)"},
{"show_ad_2", (PyCFunction)PyShowAd2, METH_VARARGS | METH_KEYWORDS, {"show_ad_2", (PyCFunction)PyShowAd2, METH_VARARGS | METH_KEYWORDS,
"show_ad_2(purpose: str,\n" "show_ad_2(purpose: str,\n"
" on_completion_call: Callable[[bool], None] = None)\n" " on_completion_call: Callable[[bool], None] | None = None)\n"
" -> None\n" " -> None\n"
"\n" "\n"
"(internal)"}, "(internal)"},
@ -2423,8 +2424,8 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
{"show_online_score_ui", (PyCFunction)PyShowOnlineScoreUI, {"show_online_score_ui", (PyCFunction)PyShowOnlineScoreUI,
METH_VARARGS | METH_KEYWORDS, METH_VARARGS | METH_KEYWORDS,
"show_online_score_ui(show: str = 'general', game: str = None,\n" "show_online_score_ui(show: str = 'general', game: str | None = None,\n"
" game_version: str = None) -> None\n" " game_version: str | None = None) -> None\n"
"\n" "\n"
"(internal)"}, "(internal)"},
@ -2448,43 +2449,43 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
{"buttonwidget", (PyCFunction)PyButtonWidget, {"buttonwidget", (PyCFunction)PyButtonWidget,
METH_VARARGS | METH_KEYWORDS, METH_VARARGS | METH_KEYWORDS,
"buttonwidget(edit: ba.Widget = None,\n" "buttonwidget(edit: ba.Widget | None = None,\n"
" parent: ba.Widget = None,\n" " parent: ba.Widget | None = None,\n"
" size: Sequence[float] = None,\n" " size: Sequence[float] | None = None,\n"
" position: Sequence[float] = None,\n" " position: Sequence[float] | None = None,\n"
" on_activate_call: Callable = None,\n" " on_activate_call: Callable | None = None,\n"
" label: str | ba.Lstr | None = None,\n" " label: str | ba.Lstr | None = None,\n"
" color: Sequence[float] = None,\n" " color: Sequence[float] | None = None,\n"
" down_widget: ba.Widget = None,\n" " down_widget: ba.Widget | None = None,\n"
" up_widget: ba.Widget = None,\n" " up_widget: ba.Widget | None = None,\n"
" left_widget: ba.Widget = None,\n" " left_widget: ba.Widget | None = None,\n"
" right_widget: ba.Widget = None,\n" " right_widget: ba.Widget | None = None,\n"
" texture: ba.Texture = None,\n" " texture: ba.Texture | None = None,\n"
" text_scale: float = None,\n" " text_scale: float | None = None,\n"
" textcolor: Sequence[float] = None,\n" " textcolor: Sequence[float] | None = None,\n"
" enable_sound: bool = None,\n" " enable_sound: bool | None = None,\n"
" model_transparent: ba.Model = None,\n" " model_transparent: ba.Model | None = None,\n"
" model_opaque: ba.Model = None,\n" " model_opaque: ba.Model | None = None,\n"
" repeat: bool = None,\n" " repeat: bool | None = None,\n"
" scale: float = None,\n" " scale: float | None = None,\n"
" transition_delay: float = None,\n" " transition_delay: float | None = None,\n"
" on_select_call: Callable = None,\n" " on_select_call: Callable | None = None,\n"
" button_type: str = None,\n" " button_type: str | None = None,\n"
" extra_touch_border_scale: float = None,\n" " extra_touch_border_scale: float | None = None,\n"
" selectable: bool = None,\n" " selectable: bool | None = None,\n"
" show_buffer_top: float = None,\n" " show_buffer_top: float | None = None,\n"
" icon: ba.Texture = None,\n" " icon: ba.Texture | None = None,\n"
" iconscale: float = None,\n" " iconscale: float | None = None,\n"
" icon_tint: float = None,\n" " icon_tint: float | None = None,\n"
" icon_color: Sequence[float] = None,\n" " icon_color: Sequence[float] | None = None,\n"
" autoselect: bool = None,\n" " autoselect: bool | None = None,\n"
" mask_texture: ba.Texture = None,\n" " mask_texture: ba.Texture | None = None,\n"
" tint_texture: ba.Texture = None,\n" " tint_texture: ba.Texture | None = None,\n"
" tint_color: Sequence[float] = None,\n" " tint_color: Sequence[float] | None = None,\n"
" tint2_color: Sequence[float] = None,\n" " tint2_color: Sequence[float] | None = None,\n"
" text_flatness: float = None,\n" " text_flatness: float | None = None,\n"
" text_res_scale: float = None,\n" " text_res_scale: float | None = None,\n"
" enabled: bool = None) -> ba.Widget\n" " enabled: bool | None = None) -> ba.Widget\n"
"\n" "\n"
"Create or edit a button widget.\n" "Create or edit a button widget.\n"
"\n" "\n"
@ -2496,21 +2497,21 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
{"checkboxwidget", (PyCFunction)PyCheckBoxWidget, {"checkboxwidget", (PyCFunction)PyCheckBoxWidget,
METH_VARARGS | METH_KEYWORDS, METH_VARARGS | METH_KEYWORDS,
"checkboxwidget(edit: ba.Widget = None,\n" "checkboxwidget(edit: ba.Widget | None = None,\n"
" parent: ba.Widget = None,\n" " parent: ba.Widget | None = None,\n"
" size: Sequence[float] = None,\n" " size: Sequence[float] | None = None,\n"
" position: Sequence[float] = None,\n" " position: Sequence[float] | None = None,\n"
" text: str | ba.Lstr | None = None,\n" " text: str | ba.Lstr | None = None,\n"
" value: bool = None,\n" " value: bool | None = None,\n"
" on_value_change_call: Callable[[bool], None] = None,\n" " on_value_change_call: Callable[[bool], None] | None = None,\n"
" on_select_call: Callable[[], None] = None,\n" " on_select_call: Callable[[], None] | None = None,\n"
" text_scale: float = None,\n" " text_scale: float | None = None,\n"
" textcolor: Sequence[float] = None,\n" " textcolor: Sequence[float] | None = None,\n"
" scale: float = None,\n" " scale: float | None = None,\n"
" is_radio_button: bool = None,\n" " is_radio_button: bool | None = None,\n"
" maxwidth: float = None,\n" " maxwidth: float | None = None,\n"
" autoselect: bool = None,\n" " autoselect: bool | None = None,\n"
" color: Sequence[float] = None) -> ba.Widget\n" " color: Sequence[float] | None = None) -> ba.Widget\n"
"\n" "\n"
"Create or edit a check-box widget.\n" "Create or edit a check-box widget.\n"
"\n" "\n"
@ -2521,16 +2522,24 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
"are applied to the Widget."}, "are applied to the Widget."},
{"imagewidget", (PyCFunction)PyImageWidget, METH_VARARGS | METH_KEYWORDS, {"imagewidget", (PyCFunction)PyImageWidget, METH_VARARGS | METH_KEYWORDS,
"imagewidget(edit: ba.Widget = None, parent: ba.Widget = None,\n" "imagewidget(edit: ba.Widget | None = None,\n"
" size: Sequence[float] = None, position: Sequence[float] = None,\n" " parent: ba.Widget | None = None,\n"
" color: Sequence[float] = None, texture: ba.Texture = None,\n" " size: Sequence[float] | None = None,\n"
" opacity: float = None, model_transparent: ba.Model = None,\n" " position: Sequence[float] | None = None,\n"
" model_opaque: ba.Model = None, has_alpha_channel: bool = True,\n" " color: Sequence[float] | None = None,\n"
" tint_texture: ba.Texture = None, tint_color: Sequence[float] = " " texture: ba.Texture | None = None,\n"
"None,\n" " opacity: float | None = None,\n"
" transition_delay: float = None, draw_controller: ba.Widget = None,\n" " model_transparent: ba.Model | None = None,\n"
" tint2_color: Sequence[float] = None, tilt_scale: float = None,\n" " model_opaque: ba.Model | None = None,\n"
" mask_texture: ba.Texture = None, radial_amount: float = None)\n" " has_alpha_channel: bool = True,\n"
" tint_texture: ba.Texture | None = None,\n"
" tint_color: Sequence[float] | None = None,\n"
" transition_delay: float | None = None,\n"
" draw_controller: ba.Widget | None = None,\n"
" tint2_color: Sequence[float] | None = None,\n"
" tilt_scale: float | None = None,\n"
" mask_texture: ba.Texture | None = None,\n"
" radial_amount: float | None = None)\n"
" -> ba.Widget\n" " -> ba.Widget\n"
"\n" "\n"
"Create or edit an image widget.\n" "Create or edit an image widget.\n"
@ -2543,23 +2552,23 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
{"columnwidget", (PyCFunction)PyColumnWidget, {"columnwidget", (PyCFunction)PyColumnWidget,
METH_VARARGS | METH_KEYWORDS, METH_VARARGS | METH_KEYWORDS,
"columnwidget(edit: ba.Widget = None,\n" "columnwidget(edit: ba.Widget | None = None,\n"
" parent: ba.Widget = None,\n" " parent: ba.Widget | None = None,\n"
" size: Sequence[float] = None,\n" " size: Sequence[float] | None = None,\n"
" position: Sequence[float] = None,\n" " position: Sequence[float] | None = None,\n"
" background: bool = None,\n" " background: bool | None = None,\n"
" selected_child: ba.Widget = None,\n" " selected_child: ba.Widget | None = None,\n"
" visible_child: ba.Widget = None,\n" " visible_child: ba.Widget | None = None,\n"
" single_depth: bool = None,\n" " single_depth: bool | None = None,\n"
" print_list_exit_instructions: bool = None,\n" " print_list_exit_instructions: bool | None = None,\n"
" left_border: float = None,\n" " left_border: float | None = None,\n"
" top_border: float = None,\n" " top_border: float | None = None,\n"
" bottom_border: float = None,\n" " bottom_border: float | None = None,\n"
" selection_loops_to_parent: bool = None,\n" " selection_loops_to_parent: bool | None = None,\n"
" border: float = None,\n" " border: float | None = None,\n"
" margin: float = None,\n" " margin: float | None = None,\n"
" claims_left_right: bool = None,\n" " claims_left_right: bool | None = None,\n"
" claims_tab: bool = None) -> ba.Widget\n" " claims_tab: bool | None = None) -> ba.Widget\n"
"\n" "\n"
"Create or edit a column widget.\n" "Create or edit a column widget.\n"
"\n" "\n"
@ -2571,37 +2580,37 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
{"containerwidget", (PyCFunction)PyContainerWidget, {"containerwidget", (PyCFunction)PyContainerWidget,
METH_VARARGS | METH_KEYWORDS, METH_VARARGS | METH_KEYWORDS,
"containerwidget(edit: ba.Widget = None,\n" "containerwidget(edit: ba.Widget | None = None,\n"
" parent: ba.Widget = None,\n" " parent: ba.Widget | None = None,\n"
" size: Sequence[float] = None,\n" " size: Sequence[float] | None = None,\n"
" position: Sequence[float] = None,\n" " position: Sequence[float] | None = None,\n"
" background: bool = None,\n" " background: bool | None = None,\n"
" selected_child: ba.Widget = None,\n" " selected_child: ba.Widget | None = None,\n"
" transition: str = None,\n" " transition: str | None = None,\n"
" cancel_button: ba.Widget = None,\n" " cancel_button: ba.Widget | None = None,\n"
" start_button: ba.Widget = None,\n" " start_button: ba.Widget | None = None,\n"
" root_selectable: bool = None,\n" " root_selectable: bool | None = None,\n"
" on_activate_call: Callable[[], None] = None,\n" " on_activate_call: Callable[[], None] | None = None,\n"
" claims_left_right: bool = None,\n" " claims_left_right: bool | None = None,\n"
" claims_tab: bool = None,\n" " claims_tab: bool | None = None,\n"
" selection_loops: bool = None,\n" " selection_loops: bool | None = None,\n"
" selection_loops_to_parent: bool = None,\n" " selection_loops_to_parent: bool | None = None,\n"
" scale: float = None,\n" " scale: float | None = None,\n"
" on_outside_click_call: Callable[[], None] = None,\n" " on_outside_click_call: Callable[[], None] | None = None,\n"
" single_depth: bool = None,\n" " single_depth: bool | None = None,\n"
" visible_child: ba.Widget = None,\n" " visible_child: ba.Widget | None = None,\n"
" stack_offset: Sequence[float] = None,\n" " stack_offset: Sequence[float] | None = None,\n"
" color: Sequence[float] = None,\n" " color: Sequence[float] | None = None,\n"
" on_cancel_call: Callable[[], None] = None,\n" " on_cancel_call: Callable[[], None] | None = None,\n"
" print_list_exit_instructions: bool = None,\n" " print_list_exit_instructions: bool | None = None,\n"
" click_activate: bool = None,\n" " click_activate: bool | None = None,\n"
" always_highlight: bool = None,\n" " always_highlight: bool | None = None,\n"
" selectable: bool = None,\n" " selectable: bool | None = None,\n"
" scale_origin_stack_offset: Sequence[float] = None,\n" " scale_origin_stack_offset: Sequence[float] | None = None,\n"
" toolbar_visibility: str = None,\n" " toolbar_visibility: str | None = None,\n"
" on_select_call: Callable[[], None] = None,\n" " on_select_call: Callable[[], None] | None = None,\n"
" claim_outside_clicks: bool = None,\n" " claim_outside_clicks: bool | None = None,\n"
" claims_up_down: bool = None) -> ba.Widget\n" " claims_up_down: bool | None = None) -> ba.Widget\n"
"\n" "\n"
"Create or edit a container widget.\n" "Create or edit a container widget.\n"
"\n" "\n"
@ -2612,14 +2621,16 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
"are applied to the Widget."}, "are applied to the Widget."},
{"rowwidget", (PyCFunction)PyRowWidget, METH_VARARGS | METH_KEYWORDS, {"rowwidget", (PyCFunction)PyRowWidget, METH_VARARGS | METH_KEYWORDS,
"rowwidget(edit: ba.Widget = None, parent: ba.Widget = None,\n" "rowwidget(edit: ba.Widget | None = None,\n"
" size: Sequence[float] = None,\n" " parent: ba.Widget | None = None,\n"
" position: Sequence[float] = None,\n" " size: Sequence[float] | None = None,\n"
" background: bool = None, selected_child: ba.Widget = None,\n" " position: Sequence[float] | None = None,\n"
" visible_child: ba.Widget = None,\n" " background: bool | None = None,\n"
" claims_left_right: bool = None,\n" " selected_child: ba.Widget | None = None,\n"
" claims_tab: bool = None,\n" " visible_child: ba.Widget | None = None,\n"
" selection_loops_to_parent: bool = None) -> ba.Widget\n" " claims_left_right: bool | None = None,\n"
" claims_tab: bool | None = None,\n"
" selection_loops_to_parent: bool | None = None) -> ba.Widget\n"
"\n" "\n"
"Create or edit a row widget.\n" "Create or edit a row widget.\n"
"\n" "\n"
@ -2631,18 +2642,24 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
{"scrollwidget", (PyCFunction)PyScrollWidget, {"scrollwidget", (PyCFunction)PyScrollWidget,
METH_VARARGS | METH_KEYWORDS, METH_VARARGS | METH_KEYWORDS,
"scrollwidget(edit: ba.Widget = None, parent: ba.Widget = None,\n" "scrollwidget(edit: ba.Widget | None = None,\n"
" size: Sequence[float] = None, position: Sequence[float] = None,\n" " parent: ba.Widget | None = None,\n"
" background: bool = None, selected_child: ba.Widget = None,\n" " size: Sequence[float] | None = None,\n"
" capture_arrows: bool = False, on_select_call: Callable = None,\n" " position: Sequence[float] | None = None,\n"
" center_small_content: bool = None, color: Sequence[float] = None,\n" " background: bool | None = None,\n"
" highlight: bool = None, border_opacity: float = None,\n" " selected_child: ba.Widget | None = None,\n"
" simple_culling_v: float = None,\n" " capture_arrows: bool = False,\n"
" selection_loops_to_parent: bool = None,\n" " on_select_call: Callable | None = None,\n"
" claims_left_right: bool = None,\n" " center_small_content: bool | None = None,\n"
" claims_up_down: bool = None,\n" " color: Sequence[float] | None = None,\n"
" claims_tab: bool = None,\n" " highlight: bool | None = None,\n"
" autoselect: bool = None) -> ba.Widget\n" " border_opacity: float | None = None,\n"
" simple_culling_v: float | None = None,\n"
" selection_loops_to_parent: bool | None = None,\n"
" claims_left_right: bool | None = None,\n"
" claims_up_down: bool | None = None,\n"
" claims_tab: bool | None = None,\n"
" autoselect: bool | None = None) -> ba.Widget\n"
"\n" "\n"
"Create or edit a scroll widget.\n" "Create or edit a scroll widget.\n"
"\n" "\n"
@ -2654,17 +2671,22 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
{"hscrollwidget", (PyCFunction)PyHScrollWidget, {"hscrollwidget", (PyCFunction)PyHScrollWidget,
METH_VARARGS | METH_KEYWORDS, METH_VARARGS | METH_KEYWORDS,
"hscrollwidget(edit: ba.Widget = None, parent: ba.Widget = None,\n" "hscrollwidget(edit: ba.Widget | None = None,\n"
" size: Sequence[float] = None, position: Sequence[float] = None,\n" " parent: ba.Widget | None = None,\n"
" background: bool = None, selected_child: ba.Widget = None,\n" " size: Sequence[float] | None = None,\n"
" capture_arrows: bool = None,\n" " position: Sequence[float] | None = None,\n"
" on_select_call: Callable[[], None] = None,\n" " background: bool | None = None,\n"
" center_small_content: bool = None, color: Sequence[float] = None,\n" " selected_child: ba.Widget | None = None,\n"
" highlight: bool = None, border_opacity: float = None,\n" " capture_arrows: bool | None = None,\n"
" simple_culling_h: float = None,\n" " on_select_call: Callable[[], None] | None = None,\n"
" claims_left_right: bool = None,\n" " center_small_content: bool | None = None,\n"
" claims_up_down: bool = None,\n" " color: Sequence[float] | None = None,\n"
" claims_tab: bool = None) -> ba.Widget\n" " highlight: bool | None = None,\n"
" border_opacity: float | None = None,\n"
" simple_culling_h: float | None = None,\n"
" claims_left_right: bool | None = None,\n"
" claims_up_down: bool | None = None,\n"
" claims_tab: bool | None = None) -> ba.Widget\n"
"\n" "\n"
"Create or edit a horizontal scroll widget.\n" "Create or edit a horizontal scroll widget.\n"
"\n" "\n"
@ -2675,26 +2697,41 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
"are applied to the Widget."}, "are applied to the Widget."},
{"textwidget", (PyCFunction)PyTextWidget, METH_VARARGS | METH_KEYWORDS, {"textwidget", (PyCFunction)PyTextWidget, METH_VARARGS | METH_KEYWORDS,
"textwidget(edit: ba.Widget = None, parent: ba.Widget = None,\n" "textwidget(edit: ba.Widget | None = None,\n"
" size: Sequence[float] = None, position: Sequence[float] = None,\n" " parent: ba.Widget | None = None,\n"
" text: str | ba.Lstr | None = None, v_align: str = None,\n" " size: Sequence[float] | None = None,\n"
" h_align: str = None, editable: bool = None, padding: float = None,\n" " position: Sequence[float] | None = None,\n"
" on_return_press_call: Callable[[], None] = None,\n" " text: str | ba.Lstr | None = None,\n"
" on_activate_call: Callable[[], None] = None,\n" " v_align: str | None = None,\n"
" selectable: bool = None, query: ba.Widget = None, max_chars: int = " " h_align: str | None = None,\n"
"None,\n" " editable: bool | None = None,\n"
" color: Sequence[float] = None, click_activate: bool = None,\n" " padding: float | None = None,\n"
" on_select_call: Callable[[], None] = None,\n" " on_return_press_call: Callable[[], None] | None = None,\n"
" always_highlight: bool = None, draw_controller: ba.Widget = None,\n" " on_activate_call: Callable[[], None] | None = None,\n"
" scale: float = None, corner_scale: float = None,\n" " selectable: bool | None = None,\n"
" query: ba.Widget | None = None,\n"
" max_chars: int | None = None,\n"
" color: Sequence[float] | None = None,\n"
" click_activate: bool | None = None,\n"
" on_select_call: Callable[[], None] | None = None,\n"
" always_highlight: bool | None = None,\n"
" draw_controller: ba.Widget | None = None,\n"
" scale: float | None = None,\n"
" corner_scale: float | None = None,\n"
" description: str | ba.Lstr | None = None,\n" " description: str | ba.Lstr | None = None,\n"
" transition_delay: float = None, maxwidth: float = None,\n" " transition_delay: float | None = None,\n"
" max_height: float = None, flatness: float = None,\n" " maxwidth: float | None = None,\n"
" shadow: float = None, autoselect: bool = None, rotate: float = " " max_height: float | None = None,\n"
"None,\n" " flatness: float | None = None,\n"
" enabled: bool = None, force_internal_editing: bool = None,\n" " shadow: float | None = None,\n"
" always_show_carat: bool = None, big: bool = None,\n" " autoselect: bool | None = None,\n"
" extra_touch_border_scale: float = None, res_scale: float = None)\n" " rotate: float | None = None,\n"
" enabled: bool | None = None,\n"
" force_internal_editing: bool | None = None,\n"
" always_show_carat: bool | None = None,\n"
" big: bool | None = None,\n"
" extra_touch_border_scale: float | None = None,\n"
" res_scale: float | None = None)\n"
" -> Widget\n" " -> Widget\n"
"\n" "\n"
"Create or edit a text widget.\n" "Create or edit a text widget.\n"
@ -2706,11 +2743,16 @@ auto PythonMethodsUI::GetMethods() -> std::vector<PyMethodDef> {
"are applied to the Widget."}, "are applied to the Widget."},
{"widget", (PyCFunction)PyWidgetCall, METH_VARARGS | METH_KEYWORDS, {"widget", (PyCFunction)PyWidgetCall, METH_VARARGS | METH_KEYWORDS,
"widget(edit: ba.Widget = None, up_widget: ba.Widget = None,\n" "widget(edit: ba.Widget | None = None,\n"
" down_widget: ba.Widget = None, left_widget: ba.Widget = None,\n" " up_widget: ba.Widget | None = None,\n"
" right_widget: ba.Widget = None, show_buffer_top: float = None,\n" " down_widget: ba.Widget | None = None,\n"
" show_buffer_bottom: float = None, show_buffer_left: float = None,\n" " left_widget: ba.Widget | None = None,\n"
" show_buffer_right: float = None, autoselect: bool = None) -> None\n" " right_widget: ba.Widget | None = None,\n"
" show_buffer_top: float | None = None,\n"
" show_buffer_bottom: float | None = None,\n"
" show_buffer_left: float | None = None,\n"
" show_buffer_right: float | None = None,\n"
" autoselect: bool | None = None) -> None\n"
"\n" "\n"
"Edit common attributes of any widget.\n" "Edit common attributes of any widget.\n"
"\n" "\n"

View File

@ -119,7 +119,7 @@ class App:
def _servercmd(self, def _servercmd(self,
cmd: str, cmd: str,
payload: dict, payload: dict,
files: dict[str, IO] = None) -> ResponseData: files: dict[str, IO] | None = None) -> ResponseData:
"""Issue a command to the server and get a response.""" """Issue a command to the server and get a response."""
response_raw = requests.post( response_raw = requests.post(

View File

@ -23,7 +23,7 @@ def _get_targets(varname: str,
inext: str, inext: str,
outext: str, outext: str,
all_targets: set, all_targets: set,
limit_to_prefix: str = None) -> str: limit_to_prefix: str | None = None) -> str:
"""Generic function to map source extension to dst files.""" """Generic function to map source extension to dst files."""
src = 'assets/src' src = 'assets/src'

View File

@ -19,7 +19,7 @@ T = TypeVar('T')
class _PathCapture: class _PathCapture:
"""Utility for obtaining dataclass storage paths in a type safe way.""" """Utility for obtaining dataclass storage paths in a type safe way."""
def __init__(self, obj: Any, pathparts: list[str] = None): def __init__(self, obj: Any, pathparts: list[str] | None = None):
self._is_dataclass = dataclasses.is_dataclass(obj) self._is_dataclass = dataclasses.is_dataclass(obj)
if pathparts is None: if pathparts is None:
pathparts = [] pathparts = []

View File

@ -38,7 +38,7 @@ PREP_ATTR = '_DCIOPREP'
PREP_SESSION_ATTR = '_DCIOPREPSESSION' PREP_SESSION_ATTR = '_DCIOPREPSESSION'
def ioprep(cls: type, globalns: dict = None) -> None: def ioprep(cls: type, globalns: dict | None = None) -> None:
"""Prep a dataclass type for use with this module's functionality. """Prep a dataclass type for use with this module's functionality.
Prepping ensures that all types contained in a data class as well as Prepping ensures that all types contained in a data class as well as

Some files were not shown because too many files have changed in this diff Show More