mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-07 16:13:23 +08:00
subsystems cleanup
This commit is contained in:
parent
9b262e2d8a
commit
111f0e65c5
90
.efrocachemap
generated
90
.efrocachemap
generated
@ -4072,53 +4072,53 @@
|
|||||||
"build/assets/workspace/ninjafightplug.py": "https://files.ballistica.net/cache/ba1/c5/09/4f10b8a21ba87aa5509cff7a164b",
|
"build/assets/workspace/ninjafightplug.py": "https://files.ballistica.net/cache/ba1/c5/09/4f10b8a21ba87aa5509cff7a164b",
|
||||||
"build/assets/workspace/onslaughtplug.py": "https://files.ballistica.net/cache/ba1/ff/0a/a354984f9c074dab0676ac7e4877",
|
"build/assets/workspace/onslaughtplug.py": "https://files.ballistica.net/cache/ba1/ff/0a/a354984f9c074dab0676ac7e4877",
|
||||||
"build/assets/workspace/runaroundplug.py": "https://files.ballistica.net/cache/ba1/2a/1c/9ee5db6d1bceca7fa6638fb8abde",
|
"build/assets/workspace/runaroundplug.py": "https://files.ballistica.net/cache/ba1/2a/1c/9ee5db6d1bceca7fa6638fb8abde",
|
||||||
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/8c/c5/1ab61baa2ab42107532a2066f703",
|
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/7a/07/c4705a424f294fd9edd6b23d0b36",
|
||||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/16/ee/19f2761bda0f16e0aef2812c7404",
|
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/15/d0/28bb8ccda6ac709b134eca933bc1",
|
||||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/56/b0/e44cfcc94d3cec25afda3f465e3e",
|
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/d6/9f/eb5f169aaf9a683a603ee2e0d1b5",
|
||||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/3a/36/4eea8f47f1f95cc5d59785ecd5dd",
|
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/5f/b2/c364417b2b3a2a77140bc3f76a19",
|
||||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/23/60/927bef0741495968aaf6ff76d7fa",
|
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/24/8b/003c2cf32712cf4b31614afc4e19",
|
||||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/1b/1f/e305488cde988719cbdd809310be",
|
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/4b/0f/3935287e71cc6a0a329707f157b0",
|
||||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/78/5f/aa480b563fd76f78464187f253af",
|
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/e9/90/66b477c087a7a5e123182ec4bbfa",
|
||||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/b7/8a/a2c43257db6b2fe719e42edc7f7c",
|
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/34/d4/30dcd4b7cc36e00a0b24b4a4e638",
|
||||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/c2/06/d670a8ce6cabe2a610a6b5ff1c3d",
|
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/f2/f1/89d36ee327de1da930edf5f6ba41",
|
||||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/45/0c/e32dc75d2aae3b467dfd3ed8ec60",
|
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/9d/e0/f1d9a6b64086c97314a07d612747",
|
||||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/5c/9f/8598937d62c127e4acd63d62964c",
|
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/85/7f/f547e472c4fde1ed8488a926e84c",
|
||||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/32/8f/367e559358022cfc4fc89fdc33d9",
|
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/63/b4/081ae5a491ae7734142c322efdb1",
|
||||||
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/ba/91/fd975fabcdb2d147c2f88332e24d",
|
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/17/a1/f424cdb674b5320c032afbf671b1",
|
||||||
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/50/a3/08545f4a5e3ff16bd7b9cb264cc9",
|
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/c5/f3/a191439ea2f83d5ba2402d0aa85b",
|
||||||
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/bd/df/a48bbb8b6ecd10c18cb40d674839",
|
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/30/14/0ea9faf33057d6adbf544ada0680",
|
||||||
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/29/9b/67559ca332af03f6a0911db1b74a",
|
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/48/24/b6ba4eaa4c87f35c1b55b7c2be42",
|
||||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/28/51/b572feb62ba0889ce9edf42f7ad4",
|
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/f5/3c/db8f2bf671f379fb301bac0d4d59",
|
||||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/c5/1d/40b9757c75338e6523769cd46fe8",
|
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/0c/51/f7e6da10c24601b55e4076cc5053",
|
||||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/f2/25/636d5643d06a81c1c02c43747848",
|
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/2b/6f/347ff35f0b7deb20aaf4ef22dd39",
|
||||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/f0/2e/9f2abc81af086b32c1f8f12a1de7",
|
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/5f/ad/a306b072ae102fb92193d88d4f4a",
|
||||||
"build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/58/55/b6ae6dd4f3615fa87bb170a43233",
|
"build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/08/f1/36613a6c3ca87c93b4fbbe0de451",
|
||||||
"build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/b9/f8/37285d0ced7794a82534d13c33ac",
|
"build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/08/67/849330893eeb104e5a4dd44db54d",
|
||||||
"build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/c7/cc/0c5f0afbfa0ddabaea8d5838562a",
|
"build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/d4/63/436f0f9b3c22d669bbd6262dee66",
|
||||||
"build/prefab/lib/linux_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/95/cb/bd23376108f02e1b0fdbe3b878aa",
|
"build/prefab/lib/linux_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/d5/44/3ed0e031bd6c69146992c205dc63",
|
||||||
"build/prefab/lib/linux_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/cc/78/7e9380defb9cea4e8a69e42d8c05",
|
"build/prefab/lib/linux_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/dd/33/acb639ccf6bde9a5f5d7dae26d6d",
|
||||||
"build/prefab/lib/linux_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/50/b8/c87593b43bc1cf4e7bc7cb8c2b12",
|
"build/prefab/lib/linux_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/11/99/c4ef35cc03c49dea52754fcbf5ea",
|
||||||
"build/prefab/lib/linux_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/71/cf/469e8f60cee5ee8629abe50308a6",
|
"build/prefab/lib/linux_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/73/22/6a60aec57ed125d029a0142a6b51",
|
||||||
"build/prefab/lib/linux_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/b2/50/d67d896575e16d5a28f933b48482",
|
"build/prefab/lib/linux_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/55/7d/d1640e390c3c7c2ecf489e02b5d6",
|
||||||
"build/prefab/lib/mac_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/33/3a/d246df62f19be9f2a764bd7a013b",
|
"build/prefab/lib/mac_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/ba/ae/cc4da45850521ff4220d3d1bb4cf",
|
||||||
"build/prefab/lib/mac_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/35/65/377250a2a44c8db0c3776ef5bc22",
|
"build/prefab/lib/mac_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/f1/3b/30dd20fd1a7c5394297957e4788c",
|
||||||
"build/prefab/lib/mac_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/d7/72/47506e999cceddbc1d0f3aafe1c4",
|
"build/prefab/lib/mac_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/2f/be/a883f9521e792865a06fd8a1b851",
|
||||||
"build/prefab/lib/mac_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/24/f6/3b47f98ae75b30c1b2babf242830",
|
"build/prefab/lib/mac_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/fd/da/6ac5ed28aac4435cbce3c4cf812e",
|
||||||
"build/prefab/lib/mac_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/90/76/9cfa1c44d742382e5bdab9f0fa54",
|
"build/prefab/lib/mac_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/42/4c/3477fb7ec067e90334719f5e487c",
|
||||||
"build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/96/2e/1b0ba43fe24fe9cc223a434db647",
|
"build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/0d/da/cf2b3140c0c83b3e368623f1d705",
|
||||||
"build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/f3/83/581b7df96f6516032a0747b83e15",
|
"build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/94/6c/3489c9df42324ad7f089d6271c4b",
|
||||||
"build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/6a/6d/7aaf7617929eeff41bc5a574e6c8",
|
"build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/a6/0b/3ae5a82111a12bb75cd62252c2cc",
|
||||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/75/20/54a441ddd17ff76dd104811b3a9e",
|
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/46/0c/c77944f3b0a4012542de15d3b349",
|
||||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/12/be/87fd5bdbac03c1d83fb3ba22c720",
|
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/1b/94/b10456205880528c350e5a1d0c80",
|
||||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/b8/99/ff380157fbcfbf1401410d5c71e7",
|
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/e1/23/9b002389e809ca4771777cc6c336",
|
||||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/46/ca/68ffabc0270a5ac3fbe7fdeca2d6",
|
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/4e/3a/e02dfde664b36ac2764828c847ca",
|
||||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/6f/13/6bc8ed23710e9257fc6f4877d7a4",
|
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/64/6d/69559ece8d1e5b98e6b6c438e20b",
|
||||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/cf/26/5c062d2e911565aa5b9668e38613",
|
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/29/f0/65577466c5028765c2e34dcb8c14",
|
||||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/ba/79/2fdbbeb60550a81d4af9386813ea",
|
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/f6/7c/6f0d3d4c17849246b305718eabe3",
|
||||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/e6/79/77af4a1a7281cad9fcc501dac03d",
|
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/0d/a7/dd1a7478fef846c6f17dcc1a2a1a",
|
||||||
"src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/52/c6/c11130af7b10d6c0321add5518fa",
|
"src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/52/c6/c11130af7b10d6c0321add5518fa",
|
||||||
"src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/38/c3/1dedd5e74f2508efc5974c8815a1",
|
"src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/38/c3/1dedd5e74f2508efc5974c8815a1",
|
||||||
"src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/75/9f/bcf597b362c9f2480cb348188bdd",
|
"src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/fe/d2/3be7462aaff43bd651b5b5ac9d04",
|
||||||
"src/ballistica/base/mgen/pyembed/binding_base_app.inc": "https://files.ballistica.net/cache/ba1/ba/0a/f528c175ef4cea9d50431cd768a8",
|
"src/ballistica/base/mgen/pyembed/binding_base_app.inc": "https://files.ballistica.net/cache/ba1/ba/0a/f528c175ef4cea9d50431cd768a8",
|
||||||
"src/ballistica/classic/mgen/pyembed/binding_classic.inc": "https://files.ballistica.net/cache/ba1/b2/fd/f5c362e9093b2d0721fb59fc0056",
|
"src/ballistica/classic/mgen/pyembed/binding_classic.inc": "https://files.ballistica.net/cache/ba1/b2/fd/f5c362e9093b2d0721fb59fc0056",
|
||||||
"src/ballistica/core/mgen/pyembed/binding_core.inc": "https://files.ballistica.net/cache/ba1/09/2b/17a249d6cfcb9a3774413f6e9156",
|
"src/ballistica/core/mgen/pyembed/binding_core.inc": "https://files.ballistica.net/cache/ba1/09/2b/17a249d6cfcb9a3774413f6e9156",
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
### 1.7.20 (build 21081, api 8, 2023-06-08)
|
### 1.7.20 (build 21084, api 8, 2023-06-09)
|
||||||
|
|
||||||
- This seems like a good time for a `refactoring` release in anticipation of
|
- This seems like a good time for a `refactoring` release in anticipation of
|
||||||
changes coming in 1.8. Basically this means that a lot of things will be
|
changes coming in 1.8. Basically this means that a lot of things will be
|
||||||
|
|||||||
1
Makefile
1
Makefile
@ -156,6 +156,7 @@ dummymodules: prereqs meta
|
|||||||
rm -rf build/dummymodules \&\& ./tools/pcommand gen_dummy_modules
|
rm -rf build/dummymodules \&\& ./tools/pcommand gen_dummy_modules
|
||||||
|
|
||||||
dummymodules-clean:
|
dummymodules-clean:
|
||||||
|
rm -f $(LAZYBUILDDIR)/dummymodules
|
||||||
rm -rf build/dummymodules
|
rm -rf build/dummymodules
|
||||||
|
|
||||||
# Generate docs.
|
# Generate docs.
|
||||||
|
|||||||
@ -14,8 +14,15 @@ fset = FeatureSet.get_active()
|
|||||||
|
|
||||||
fset.requirements = {'core', 'base', 'scene_v1', 'scene_v1_lib', 'ui_v1'}
|
fset.requirements = {'core', 'base', 'scene_v1', 'scene_v1_lib', 'ui_v1'}
|
||||||
|
|
||||||
|
# We can make use of plus stuff but can live without it.
|
||||||
|
fset.soft_requirements = {'plus'}
|
||||||
|
|
||||||
# We provide 'babase.app.classic'.
|
# We provide 'babase.app.classic'.
|
||||||
fset.has_python_app_subsystem = True
|
fset.has_python_app_subsystem = True
|
||||||
|
|
||||||
|
# If 'plus' is present, our subsystem should be inited after it
|
||||||
|
# (classic accounts key off of plus's v2 accounts)
|
||||||
|
fset.python_app_subsystem_dependencies = {'plus'}
|
||||||
|
|
||||||
# We want things to work without us.
|
# We want things to work without us.
|
||||||
fset.allow_as_soft_requirement = True
|
fset.allow_as_soft_requirement = True
|
||||||
|
|||||||
@ -14,5 +14,8 @@ fset = FeatureSet.get_active()
|
|||||||
|
|
||||||
fset.requirements = {'core', 'base'}
|
fset.requirements = {'core', 'base'}
|
||||||
|
|
||||||
|
# We provide 'babase.app.ui_v1'.
|
||||||
|
fset.has_python_app_subsystem = True
|
||||||
|
|
||||||
# We'd prefer our name's title form to be 'UI V1', not the default 'Ui V1'.
|
# We'd prefer our name's title form to be 'UI V1', not the default 'Ui V1'.
|
||||||
fset.name_title = 'UI V1'
|
fset.name_title = 'UI V1'
|
||||||
|
|||||||
@ -76,7 +76,6 @@
|
|||||||
"ba_data/python/baclassic/__pycache__/_subsystem.cpython-311.opt-1.pyc",
|
"ba_data/python/baclassic/__pycache__/_subsystem.cpython-311.opt-1.pyc",
|
||||||
"ba_data/python/baclassic/__pycache__/_tips.cpython-311.opt-1.pyc",
|
"ba_data/python/baclassic/__pycache__/_tips.cpython-311.opt-1.pyc",
|
||||||
"ba_data/python/baclassic/__pycache__/_tournament.cpython-311.opt-1.pyc",
|
"ba_data/python/baclassic/__pycache__/_tournament.cpython-311.opt-1.pyc",
|
||||||
"ba_data/python/baclassic/__pycache__/_ui.cpython-311.opt-1.pyc",
|
|
||||||
"ba_data/python/baclassic/__pycache__/macmusicapp.cpython-311.opt-1.pyc",
|
"ba_data/python/baclassic/__pycache__/macmusicapp.cpython-311.opt-1.pyc",
|
||||||
"ba_data/python/baclassic/__pycache__/osmusic.cpython-311.opt-1.pyc",
|
"ba_data/python/baclassic/__pycache__/osmusic.cpython-311.opt-1.pyc",
|
||||||
"ba_data/python/baclassic/_accountv1.py",
|
"ba_data/python/baclassic/_accountv1.py",
|
||||||
@ -93,7 +92,6 @@
|
|||||||
"ba_data/python/baclassic/_subsystem.py",
|
"ba_data/python/baclassic/_subsystem.py",
|
||||||
"ba_data/python/baclassic/_tips.py",
|
"ba_data/python/baclassic/_tips.py",
|
||||||
"ba_data/python/baclassic/_tournament.py",
|
"ba_data/python/baclassic/_tournament.py",
|
||||||
"ba_data/python/baclassic/_ui.py",
|
|
||||||
"ba_data/python/baclassic/macmusicapp.py",
|
"ba_data/python/baclassic/macmusicapp.py",
|
||||||
"ba_data/python/baclassic/osmusic.py",
|
"ba_data/python/baclassic/osmusic.py",
|
||||||
"ba_data/python/bacommon/__init__.py",
|
"ba_data/python/bacommon/__init__.py",
|
||||||
@ -348,11 +346,13 @@
|
|||||||
"ba_data/python/bauiv1/__init__.py",
|
"ba_data/python/bauiv1/__init__.py",
|
||||||
"ba_data/python/bauiv1/__pycache__/__init__.cpython-311.opt-1.pyc",
|
"ba_data/python/bauiv1/__pycache__/__init__.cpython-311.opt-1.pyc",
|
||||||
"ba_data/python/bauiv1/__pycache__/_hooks.cpython-311.opt-1.pyc",
|
"ba_data/python/bauiv1/__pycache__/_hooks.cpython-311.opt-1.pyc",
|
||||||
|
"ba_data/python/bauiv1/__pycache__/_subsystem.cpython-311.opt-1.pyc",
|
||||||
|
"ba_data/python/bauiv1/__pycache__/_uitypes.cpython-311.opt-1.pyc",
|
||||||
"ba_data/python/bauiv1/__pycache__/onscreenkeyboard.cpython-311.opt-1.pyc",
|
"ba_data/python/bauiv1/__pycache__/onscreenkeyboard.cpython-311.opt-1.pyc",
|
||||||
"ba_data/python/bauiv1/_hooks.py",
|
"ba_data/python/bauiv1/_hooks.py",
|
||||||
|
"ba_data/python/bauiv1/_subsystem.py",
|
||||||
|
"ba_data/python/bauiv1/_uitypes.py",
|
||||||
"ba_data/python/bauiv1/onscreenkeyboard.py",
|
"ba_data/python/bauiv1/onscreenkeyboard.py",
|
||||||
"ba_data/python/bauiv1/ui/__init__.py",
|
|
||||||
"ba_data/python/bauiv1/ui/__pycache__/__init__.cpython-311.opt-1.pyc",
|
|
||||||
"ba_data/python/bauiv1lib/__init__.py",
|
"ba_data/python/bauiv1lib/__init__.py",
|
||||||
"ba_data/python/bauiv1lib/__pycache__/__init__.cpython-311.opt-1.pyc",
|
"ba_data/python/bauiv1lib/__pycache__/__init__.cpython-311.opt-1.pyc",
|
||||||
"ba_data/python/bauiv1lib/__pycache__/achievements.cpython-311.opt-1.pyc",
|
"ba_data/python/bauiv1lib/__pycache__/achievements.cpython-311.opt-1.pyc",
|
||||||
|
|||||||
@ -190,7 +190,6 @@ SCRIPT_TARGETS_PY_PUBLIC = \
|
|||||||
$(BUILD_DIR)/ba_data/python/baclassic/_subsystem.py \
|
$(BUILD_DIR)/ba_data/python/baclassic/_subsystem.py \
|
||||||
$(BUILD_DIR)/ba_data/python/baclassic/_tips.py \
|
$(BUILD_DIR)/ba_data/python/baclassic/_tips.py \
|
||||||
$(BUILD_DIR)/ba_data/python/baclassic/_tournament.py \
|
$(BUILD_DIR)/ba_data/python/baclassic/_tournament.py \
|
||||||
$(BUILD_DIR)/ba_data/python/baclassic/_ui.py \
|
|
||||||
$(BUILD_DIR)/ba_data/python/baclassic/macmusicapp.py \
|
$(BUILD_DIR)/ba_data/python/baclassic/macmusicapp.py \
|
||||||
$(BUILD_DIR)/ba_data/python/baclassic/osmusic.py \
|
$(BUILD_DIR)/ba_data/python/baclassic/osmusic.py \
|
||||||
$(BUILD_DIR)/ba_data/python/baenv.py \
|
$(BUILD_DIR)/ba_data/python/baenv.py \
|
||||||
@ -311,8 +310,9 @@ SCRIPT_TARGETS_PY_PUBLIC = \
|
|||||||
$(BUILD_DIR)/ba_data/python/batemplatefs/_subsystem.py \
|
$(BUILD_DIR)/ba_data/python/batemplatefs/_subsystem.py \
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1/__init__.py \
|
$(BUILD_DIR)/ba_data/python/bauiv1/__init__.py \
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1/_hooks.py \
|
$(BUILD_DIR)/ba_data/python/bauiv1/_hooks.py \
|
||||||
|
$(BUILD_DIR)/ba_data/python/bauiv1/_subsystem.py \
|
||||||
|
$(BUILD_DIR)/ba_data/python/bauiv1/_uitypes.py \
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1/onscreenkeyboard.py \
|
$(BUILD_DIR)/ba_data/python/bauiv1/onscreenkeyboard.py \
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1/ui/__init__.py \
|
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1lib/__init__.py \
|
$(BUILD_DIR)/ba_data/python/bauiv1lib/__init__.py \
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1lib/account/__init__.py \
|
$(BUILD_DIR)/ba_data/python/bauiv1lib/account/__init__.py \
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1lib/account/link.py \
|
$(BUILD_DIR)/ba_data/python/bauiv1lib/account/link.py \
|
||||||
@ -462,7 +462,6 @@ SCRIPT_TARGETS_PYC_PUBLIC = \
|
|||||||
$(BUILD_DIR)/ba_data/python/baclassic/__pycache__/_subsystem.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/baclassic/__pycache__/_subsystem.cpython-311.opt-1.pyc \
|
||||||
$(BUILD_DIR)/ba_data/python/baclassic/__pycache__/_tips.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/baclassic/__pycache__/_tips.cpython-311.opt-1.pyc \
|
||||||
$(BUILD_DIR)/ba_data/python/baclassic/__pycache__/_tournament.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/baclassic/__pycache__/_tournament.cpython-311.opt-1.pyc \
|
||||||
$(BUILD_DIR)/ba_data/python/baclassic/__pycache__/_ui.cpython-311.opt-1.pyc \
|
|
||||||
$(BUILD_DIR)/ba_data/python/baclassic/__pycache__/macmusicapp.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/baclassic/__pycache__/macmusicapp.cpython-311.opt-1.pyc \
|
||||||
$(BUILD_DIR)/ba_data/python/baclassic/__pycache__/osmusic.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/baclassic/__pycache__/osmusic.cpython-311.opt-1.pyc \
|
||||||
$(BUILD_DIR)/ba_data/python/__pycache__/baenv.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/__pycache__/baenv.cpython-311.opt-1.pyc \
|
||||||
@ -583,8 +582,9 @@ SCRIPT_TARGETS_PYC_PUBLIC = \
|
|||||||
$(BUILD_DIR)/ba_data/python/batemplatefs/__pycache__/_subsystem.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/batemplatefs/__pycache__/_subsystem.cpython-311.opt-1.pyc \
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1/__pycache__/__init__.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/bauiv1/__pycache__/__init__.cpython-311.opt-1.pyc \
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1/__pycache__/_hooks.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/bauiv1/__pycache__/_hooks.cpython-311.opt-1.pyc \
|
||||||
|
$(BUILD_DIR)/ba_data/python/bauiv1/__pycache__/_subsystem.cpython-311.opt-1.pyc \
|
||||||
|
$(BUILD_DIR)/ba_data/python/bauiv1/__pycache__/_uitypes.cpython-311.opt-1.pyc \
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1/__pycache__/onscreenkeyboard.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/bauiv1/__pycache__/onscreenkeyboard.cpython-311.opt-1.pyc \
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1/ui/__pycache__/__init__.cpython-311.opt-1.pyc \
|
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/__init__.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/bauiv1lib/__pycache__/__init__.cpython-311.opt-1.pyc \
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1lib/account/__pycache__/__init__.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/bauiv1lib/account/__pycache__/__init__.cpython-311.opt-1.pyc \
|
||||||
$(BUILD_DIR)/ba_data/python/bauiv1lib/account/__pycache__/link.cpython-311.opt-1.pyc \
|
$(BUILD_DIR)/ba_data/python/bauiv1lib/account/__pycache__/link.cpython-311.opt-1.pyc \
|
||||||
|
|||||||
@ -56,11 +56,11 @@ class AccountV2Subsystem:
|
|||||||
|
|
||||||
self.login_adapters[LoginType.GPGS] = LoginAdapterGPGS()
|
self.login_adapters[LoginType.GPGS] = LoginAdapterGPGS()
|
||||||
|
|
||||||
def on_app_launching(self) -> None:
|
def on_app_loading(self) -> None:
|
||||||
"""Should be called at standard on_app_launching time."""
|
"""Should be called at standard on_app_loading time."""
|
||||||
|
|
||||||
for adapter in self.login_adapters.values():
|
for adapter in self.login_adapters.values():
|
||||||
adapter.on_app_launching()
|
adapter.on_app_loading()
|
||||||
|
|
||||||
def set_primary_credentials(self, credentials: str | None) -> None:
|
def set_primary_credentials(self, credentials: str | None) -> None:
|
||||||
"""Set credentials for the primary app account."""
|
"""Set credentials for the primary app account."""
|
||||||
|
|||||||
@ -34,6 +34,7 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
from baclassic import ClassicSubsystem
|
from baclassic import ClassicSubsystem
|
||||||
from baplus import PlusSubsystem
|
from baplus import PlusSubsystem
|
||||||
|
from bauiv1 import UIV1Subsystem
|
||||||
|
|
||||||
# __FEATURESET_APP_SUBSYSTEM_IMPORTS_END__
|
# __FEATURESET_APP_SUBSYSTEM_IMPORTS_END__
|
||||||
|
|
||||||
@ -241,6 +242,7 @@ class App:
|
|||||||
self._called_on_app_loading = False
|
self._called_on_app_loading = False
|
||||||
self._called_on_app_running = False
|
self._called_on_app_running = False
|
||||||
self._app_paused = False
|
self._app_paused = False
|
||||||
|
self._subsystem_registration_ended = False
|
||||||
|
|
||||||
# Config.
|
# Config.
|
||||||
self.config_file_healthy = False
|
self.config_file_healthy = False
|
||||||
@ -306,10 +308,9 @@ class App:
|
|||||||
# reached the 'running' state. This ensures that all subsystems
|
# reached the 'running' state. This ensures that all subsystems
|
||||||
# receive a consistent set of callbacks starting with
|
# receive a consistent set of callbacks starting with
|
||||||
# on_app_running().
|
# on_app_running().
|
||||||
if self._called_on_app_running:
|
if self._subsystem_registration_ended:
|
||||||
raise RuntimeError(
|
raise RuntimeError(
|
||||||
'Subsystems cannot be registered after the'
|
'Subsystems can no longer be registered at this point.'
|
||||||
' app has reached the running state.'
|
|
||||||
)
|
)
|
||||||
self._subsystems.append(subsystem)
|
self._subsystems.append(subsystem)
|
||||||
|
|
||||||
@ -361,6 +362,14 @@ class App:
|
|||||||
logging.exception('Error importing baplus.')
|
logging.exception('Error importing baplus.')
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def ui_v1(self) -> UIV1Subsystem:
|
||||||
|
"""Our ui_v1 subsystem (always available)."""
|
||||||
|
|
||||||
|
from bauiv1 import UIV1Subsystem
|
||||||
|
|
||||||
|
return UIV1Subsystem()
|
||||||
|
|
||||||
# __FEATURESET_APP_SUBSYSTEM_PROPERTIES_END__
|
# __FEATURESET_APP_SUBSYSTEM_PROPERTIES_END__
|
||||||
|
|
||||||
def set_intent(self, intent: AppIntent) -> None:
|
def set_intent(self, intent: AppIntent) -> None:
|
||||||
@ -481,12 +490,12 @@ class App:
|
|||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
from babase import _asyncio
|
from babase import _asyncio
|
||||||
from babase import _appconfig
|
from babase import _appconfig
|
||||||
from babase._apputils import log_dumped_app_state, AppHealthMonitor
|
from babase._apputils import AppHealthMonitor
|
||||||
import babase._env
|
from babase import _env
|
||||||
|
|
||||||
assert _babase.in_logic_thread()
|
assert _babase.in_logic_thread()
|
||||||
|
|
||||||
babase._env.on_app_launching()
|
_env.on_app_launching()
|
||||||
|
|
||||||
self._aioloop = _asyncio.setup_asyncio()
|
self._aioloop = _asyncio.setup_asyncio()
|
||||||
self.health_monitor = AppHealthMonitor()
|
self.health_monitor = AppHealthMonitor()
|
||||||
@ -504,34 +513,19 @@ class App:
|
|||||||
# to disk.
|
# to disk.
|
||||||
_appconfig.commit_app_config(force=True)
|
_appconfig.commit_app_config(force=True)
|
||||||
|
|
||||||
# Get meta-system scanning built-in stuff in the bg.
|
# __FEATURESET_APP_SUBSYSTEM_CREATE_BEGIN__
|
||||||
self.meta.start_scan(scan_complete_cb=self.on_meta_scan_complete)
|
# This section generated by batools.appmodule; do not edit.
|
||||||
|
|
||||||
if self.plus is not None:
|
# Poke these attrs to create all our subsystems.
|
||||||
self.plus.on_app_launching()
|
_ = self.plus
|
||||||
|
_ = self.classic
|
||||||
|
_ = self.ui_v1
|
||||||
|
|
||||||
# Make sure this runs after we init our plus, since
|
# __FEATURESET_APP_SUBSYSTEM_CREATE_END__
|
||||||
# classic accounts here key off of our v2 ones in plus.
|
|
||||||
if self.classic is not None:
|
|
||||||
self.classic.on_app_launching()
|
|
||||||
|
|
||||||
# If any traceback dumps happened last run, log and clear them.
|
|
||||||
log_dumped_app_state()
|
|
||||||
|
|
||||||
self._launch_completed = True
|
self._launch_completed = True
|
||||||
self._update_state()
|
self._update_state()
|
||||||
|
|
||||||
def on_meta_scan_complete(self) -> None:
|
|
||||||
"""Called when meta-scan is done doing its thing."""
|
|
||||||
assert _babase.in_logic_thread()
|
|
||||||
|
|
||||||
# Now that we know what's out there, build our final plugin set.
|
|
||||||
self.plugins.on_meta_scan_complete()
|
|
||||||
|
|
||||||
assert not self._meta_scan_completed
|
|
||||||
self._meta_scan_completed = True
|
|
||||||
self._update_state()
|
|
||||||
|
|
||||||
def on_app_loading(self) -> None:
|
def on_app_loading(self) -> None:
|
||||||
"""Called when the app enters the loading state.
|
"""Called when the app enters the loading state.
|
||||||
|
|
||||||
@ -541,14 +535,44 @@ class App:
|
|||||||
download workspaces, and otherwise prepare itself to really
|
download workspaces, and otherwise prepare itself to really
|
||||||
'run'.
|
'run'.
|
||||||
"""
|
"""
|
||||||
|
from babase._apputils import log_dumped_app_state
|
||||||
|
|
||||||
assert _babase.in_logic_thread()
|
assert _babase.in_logic_thread()
|
||||||
|
|
||||||
|
# Get meta-system scanning built-in stuff in the bg.
|
||||||
|
self.meta.start_scan(scan_complete_cb=self.on_meta_scan_complete)
|
||||||
|
|
||||||
|
# If any traceback dumps happened last run, log and clear them.
|
||||||
|
log_dumped_app_state()
|
||||||
|
|
||||||
|
# Inform all app subsystems in the same order they were inited.
|
||||||
|
# Operate on a copy here because subsystems can still be added
|
||||||
|
# at this point.
|
||||||
|
for subsystem in self._subsystems.copy():
|
||||||
|
try:
|
||||||
|
subsystem.on_app_loading()
|
||||||
|
except Exception:
|
||||||
|
logging.exception(
|
||||||
|
'Error in on_app_loading for subsystem %s.', subsystem
|
||||||
|
)
|
||||||
|
|
||||||
# Normally plus tells us when initial sign-in is done. If it's
|
# Normally plus tells us when initial sign-in is done. If it's
|
||||||
# not present, however, we just do that ourself so we can
|
# not present, however, we just do that ourself so we can
|
||||||
# proceed on to the running state.
|
# proceed on to the running state.
|
||||||
if self.plus is None:
|
if self.plus is None:
|
||||||
_babase.pushcall(self.on_initial_sign_in_completed)
|
_babase.pushcall(self.on_initial_sign_in_completed)
|
||||||
|
|
||||||
|
def on_meta_scan_complete(self) -> None:
|
||||||
|
"""Called when meta-scan is done doing its thing."""
|
||||||
|
assert _babase.in_logic_thread()
|
||||||
|
|
||||||
|
# Now that we know what's out there, build our final plugin set.
|
||||||
|
self.plugins.on_meta_scan_complete()
|
||||||
|
|
||||||
|
assert not self._meta_scan_completed
|
||||||
|
self._meta_scan_completed = True
|
||||||
|
self._update_state()
|
||||||
|
|
||||||
def on_app_running(self) -> None:
|
def on_app_running(self) -> None:
|
||||||
"""Called when the app enters the running state.
|
"""Called when the app enters the running state.
|
||||||
|
|
||||||
@ -565,7 +589,9 @@ class App:
|
|||||||
self.mode_selector = self.DefaultAppModeSelector()
|
self.mode_selector = self.DefaultAppModeSelector()
|
||||||
|
|
||||||
# Inform all app subsystems in the same order they were inited.
|
# Inform all app subsystems in the same order they were inited.
|
||||||
for subsystem in self._subsystems:
|
# Operate on a copy here because subsystems can still be added
|
||||||
|
# at this point.
|
||||||
|
for subsystem in self._subsystems.copy():
|
||||||
try:
|
try:
|
||||||
subsystem.on_app_running()
|
subsystem.on_app_running()
|
||||||
except Exception:
|
except Exception:
|
||||||
@ -573,6 +599,9 @@ class App:
|
|||||||
'Error in on_app_running for subsystem %s.', subsystem
|
'Error in on_app_running for subsystem %s.', subsystem
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Cut off new subsystem additions at this point.
|
||||||
|
self._subsystem_registration_ended = True
|
||||||
|
|
||||||
# If 'exec' code was provided to the app, always kick that off
|
# If 'exec' code was provided to the app, always kick that off
|
||||||
# here as an intent.
|
# here as an intent.
|
||||||
exec_cmd = _babase.exec_arg()
|
exec_cmd = _babase.exec_arg()
|
||||||
|
|||||||
@ -21,13 +21,21 @@ class AppSubsystem:
|
|||||||
building one out of this base class provides some conveniences such
|
building one out of this base class provides some conveniences such
|
||||||
as predefined callbacks during app state changes.
|
as predefined callbacks during app state changes.
|
||||||
|
|
||||||
Subsystems must be registered with the app before it reaches the
|
Subsystems must be registered with the app before it completes its
|
||||||
'running' state.
|
transition to the 'running' state.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
_babase.app.register_subsystem(self)
|
_babase.app.register_subsystem(self)
|
||||||
|
|
||||||
|
def on_app_loading(self) -> None:
|
||||||
|
"""Called when the app reaches the loading state.
|
||||||
|
|
||||||
|
Note that subsystems created after the app switches to the
|
||||||
|
loading state will not receive this callback. Subsystems created
|
||||||
|
by plugins are an example of this.
|
||||||
|
"""
|
||||||
|
|
||||||
def on_app_running(self) -> None:
|
def on_app_running(self) -> None:
|
||||||
"""Called when the app reaches the running state."""
|
"""Called when the app reaches the running state."""
|
||||||
|
|
||||||
|
|||||||
@ -235,13 +235,6 @@ def purchases_restored_message() -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def dismiss_wii_remotes_window() -> None:
|
|
||||||
assert _babase.app.classic is not None
|
|
||||||
call = _babase.app.classic.ui.dismiss_wii_remotes_window_call
|
|
||||||
if call is not None:
|
|
||||||
call()
|
|
||||||
|
|
||||||
|
|
||||||
def unavailable_message() -> None:
|
def unavailable_message() -> None:
|
||||||
from babase._language import Lstr
|
from babase._language import Lstr
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ class LoginAdapter:
|
|||||||
self._implicit_login_state: LoginAdapter.ImplicitLoginState | None = (
|
self._implicit_login_state: LoginAdapter.ImplicitLoginState | None = (
|
||||||
None
|
None
|
||||||
)
|
)
|
||||||
self._on_app_launching_called = False
|
self._on_app_loading_called = False
|
||||||
self._implicit_login_state_dirty = False
|
self._implicit_login_state_dirty = False
|
||||||
self._back_end_active = False
|
self._back_end_active = False
|
||||||
|
|
||||||
@ -61,11 +61,11 @@ class LoginAdapter:
|
|||||||
self._last_sign_in_time: float | None = None
|
self._last_sign_in_time: float | None = None
|
||||||
self._last_sign_in_desc: str | None = None
|
self._last_sign_in_desc: str | None = None
|
||||||
|
|
||||||
def on_app_launching(self) -> None:
|
def on_app_loading(self) -> None:
|
||||||
"""Should be called for each adapter in on_app_launching."""
|
"""Should be called for each adapter in on_app_loading."""
|
||||||
|
|
||||||
assert not self._on_app_launching_called
|
assert not self._on_app_loading_called
|
||||||
self._on_app_launching_called = True
|
self._on_app_loading_called = True
|
||||||
|
|
||||||
# Any implicit state we received up until now needs to be pushed
|
# Any implicit state we received up until now needs to be pushed
|
||||||
# to the app account subsystem.
|
# to the app account subsystem.
|
||||||
@ -297,7 +297,7 @@ class LoginAdapter:
|
|||||||
# sent along to the app. We wait until on-app-launch has been
|
# sent along to the app. We wait until on-app-launch has been
|
||||||
# called so that account-client-v2 has had a chance to load
|
# called so that account-client-v2 has had a chance to load
|
||||||
# any existing state so it can properly respond to this.
|
# any existing state so it can properly respond to this.
|
||||||
if self._implicit_login_state_dirty and self._on_app_launching_called:
|
if self._implicit_login_state_dirty and self._on_app_loading_called:
|
||||||
from babase._general import Call
|
from babase._general import Call
|
||||||
|
|
||||||
if DEBUG_LOG:
|
if DEBUG_LOG:
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class AccountV1Subsystem:
|
|||||||
# not be signed in yet; go ahead and queue them up in that case.
|
# not be signed in yet; go ahead and queue them up in that case.
|
||||||
self.pending_promo_codes: list[str] = []
|
self.pending_promo_codes: list[str] = []
|
||||||
|
|
||||||
def on_app_launching(self) -> None:
|
def on_app_loading(self) -> None:
|
||||||
"""Called when the app is done bootstrapping."""
|
"""Called when the app is done bootstrapping."""
|
||||||
|
|
||||||
# Auto-sign-in to a local account in a moment if we're set to.
|
# Auto-sign-in to a local account in a moment if we're set to.
|
||||||
|
|||||||
@ -35,8 +35,8 @@ class AppDelegate:
|
|||||||
from bauiv1lib.playlist.editgame import PlaylistEditGameWindow
|
from bauiv1lib.playlist.editgame import PlaylistEditGameWindow
|
||||||
|
|
||||||
assert _babase.app.classic is not None
|
assert _babase.app.classic is not None
|
||||||
_babase.app.classic.ui.clear_main_menu_window(transition='out_left')
|
_babase.app.ui_v1.clear_main_menu_window(transition='out_left')
|
||||||
_babase.app.classic.ui.set_main_menu_window(
|
_babase.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistEditGameWindow(
|
PlaylistEditGameWindow(
|
||||||
gameclass,
|
gameclass,
|
||||||
sessiontype,
|
sessiontype,
|
||||||
|
|||||||
@ -112,8 +112,8 @@ class MusicSubsystem:
|
|||||||
|
|
||||||
self._music_player_type = MacMusicAppMusicPlayer
|
self._music_player_type = MacMusicAppMusicPlayer
|
||||||
|
|
||||||
def on_app_launching(self) -> None:
|
def on_app_loading(self) -> None:
|
||||||
"""Should be called by app on_app_launching()."""
|
"""Should be called by app on_app_loading()."""
|
||||||
|
|
||||||
# If we're using a non-default playlist, lets go ahead and get our
|
# If we're using a non-default playlist, lets go ahead and get our
|
||||||
# music-player going since it may hitch (better while we're faded
|
# music-player going since it may hitch (better while we're faded
|
||||||
|
|||||||
@ -65,7 +65,7 @@ class StoreSubsystem:
|
|||||||
0.72
|
0.72
|
||||||
if (
|
if (
|
||||||
_babase.app.config.get('Merch Link')
|
_babase.app.config.get('Merch Link')
|
||||||
and _babase.app.classic.ui.uiscale is UIScale.SMALL
|
and _babase.app.ui_v1.uiscale is UIScale.SMALL
|
||||||
)
|
)
|
||||||
else 0.85
|
else 0.85
|
||||||
)
|
)
|
||||||
|
|||||||
@ -4,7 +4,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import random
|
import random
|
||||||
import weakref
|
|
||||||
import logging
|
import logging
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
@ -25,7 +24,6 @@ from baclassic._net import MasterServerResponseType, MasterServerV1CallThread
|
|||||||
from baclassic._achievement import AchievementSubsystem
|
from baclassic._achievement import AchievementSubsystem
|
||||||
from baclassic._tips import get_all_tips
|
from baclassic._tips import get_all_tips
|
||||||
from baclassic._store import StoreSubsystem
|
from baclassic._store import StoreSubsystem
|
||||||
from baclassic._ui import UISubsystem
|
|
||||||
from baclassic import _input
|
from baclassic import _input
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
@ -69,7 +67,6 @@ class ClassicSubsystem(AppSubsystem):
|
|||||||
self.ach = AchievementSubsystem()
|
self.ach = AchievementSubsystem()
|
||||||
self.store = StoreSubsystem()
|
self.store = StoreSubsystem()
|
||||||
self.music = MusicSubsystem()
|
self.music = MusicSubsystem()
|
||||||
self.ui = UISubsystem()
|
|
||||||
|
|
||||||
# Co-op Campaigns.
|
# Co-op Campaigns.
|
||||||
self.campaigns: dict[str, bascenev1.Campaign] = {}
|
self.campaigns: dict[str, bascenev1.Campaign] = {}
|
||||||
@ -122,7 +119,6 @@ class ClassicSubsystem(AppSubsystem):
|
|||||||
self.first_main_menu = True # FIXME: Move to mainmenu class.
|
self.first_main_menu = True # FIXME: Move to mainmenu class.
|
||||||
self.did_menu_intro = False # FIXME: Move to mainmenu class.
|
self.did_menu_intro = False # FIXME: Move to mainmenu class.
|
||||||
self.main_menu_window_refresh_check_count = 0 # FIXME: Mv to mainmenu.
|
self.main_menu_window_refresh_check_count = 0 # FIXME: Mv to mainmenu.
|
||||||
self.main_menu_resume_callbacks: list = [] # Can probably go away.
|
|
||||||
self.invite_confirm_windows: list[Any] = [] # FIXME: Don't use Any.
|
self.invite_confirm_windows: list[Any] = [] # FIXME: Don't use Any.
|
||||||
self.delegate: AppDelegate | None = None
|
self.delegate: AppDelegate | None = None
|
||||||
|
|
||||||
@ -157,18 +153,7 @@ class ClassicSubsystem(AppSubsystem):
|
|||||||
assert isinstance(self._env['user_agent_string'], str)
|
assert isinstance(self._env['user_agent_string'], str)
|
||||||
return self._env['user_agent_string']
|
return self._env['user_agent_string']
|
||||||
|
|
||||||
def add_main_menu_close_callback(self, call: Callable[[], Any]) -> None:
|
def on_app_loading(self) -> None:
|
||||||
"""(internal)"""
|
|
||||||
|
|
||||||
# If there's no main menu up, just call immediately.
|
|
||||||
if not self.ui.has_main_menu_window():
|
|
||||||
with _babase.ContextRef.empty():
|
|
||||||
call()
|
|
||||||
else:
|
|
||||||
self.main_menu_resume_callbacks.append(call)
|
|
||||||
|
|
||||||
def on_app_launching(self) -> None:
|
|
||||||
"""Called when the app is first entering the launching state."""
|
|
||||||
# pylint: disable=too-many-locals
|
# pylint: disable=too-many-locals
|
||||||
from bascenev1 import _campaign
|
from bascenev1 import _campaign
|
||||||
from bascenev1 import _map
|
from bascenev1 import _map
|
||||||
@ -183,8 +168,7 @@ class ClassicSubsystem(AppSubsystem):
|
|||||||
|
|
||||||
cfg = _babase.app.config
|
cfg = _babase.app.config
|
||||||
|
|
||||||
self.ui.on_app_launching()
|
self.music.on_app_loading()
|
||||||
self.music.on_app_launching()
|
|
||||||
|
|
||||||
self.delegate = AppDelegate()
|
self.delegate = AppDelegate()
|
||||||
|
|
||||||
@ -256,7 +240,7 @@ class ClassicSubsystem(AppSubsystem):
|
|||||||
# master-server and/or get rid of it.
|
# master-server and/or get rid of it.
|
||||||
handle_leftover_v1_cloud_log_file()
|
handle_leftover_v1_cloud_log_file()
|
||||||
|
|
||||||
self.accounts.on_app_launching()
|
self.accounts.on_app_loading()
|
||||||
|
|
||||||
def on_app_pause(self) -> None:
|
def on_app_pause(self) -> None:
|
||||||
self.accounts.on_app_pause()
|
self.accounts.on_app_pause()
|
||||||
@ -398,7 +382,7 @@ class ClassicSubsystem(AppSubsystem):
|
|||||||
assert plus is not None
|
assert plus is not None
|
||||||
|
|
||||||
if reset_ui:
|
if reset_ui:
|
||||||
self.ui.clear_main_menu_window()
|
_babase.app.ui_v1.clear_main_menu_window()
|
||||||
|
|
||||||
if isinstance(bascenev1.get_foreground_host_session(), MainMenuSession):
|
if isinstance(bascenev1.get_foreground_host_session(), MainMenuSession):
|
||||||
# It may be possible we're on the main menu but the screen is faded
|
# It may be possible we're on the main menu but the screen is faded
|
||||||
@ -691,39 +675,6 @@ class ClassicSubsystem(AppSubsystem):
|
|||||||
origin_widget=_bauiv1.get_special_widget('tickets_info_button')
|
origin_widget=_bauiv1.get_special_widget('tickets_info_button')
|
||||||
)
|
)
|
||||||
|
|
||||||
def party_icon_activate(self, origin: Sequence[float]) -> None:
|
|
||||||
"""(internal)"""
|
|
||||||
from bauiv1lib.party import PartyWindow
|
|
||||||
from babase import app
|
|
||||||
|
|
||||||
assert not app.headless_mode
|
|
||||||
|
|
||||||
_bauiv1.getsound('swish').play()
|
|
||||||
|
|
||||||
# If it exists, dismiss it; otherwise make a new one.
|
|
||||||
if (
|
|
||||||
self.ui.party_window is not None
|
|
||||||
and self.ui.party_window() is not None
|
|
||||||
):
|
|
||||||
self.ui.party_window().close()
|
|
||||||
else:
|
|
||||||
self.ui.party_window = weakref.ref(PartyWindow(origin=origin))
|
|
||||||
|
|
||||||
def device_menu_press(self, device_id: int | None) -> None:
|
|
||||||
"""(internal)"""
|
|
||||||
from bauiv1lib.mainmenu import MainMenuWindow
|
|
||||||
from bauiv1 import set_ui_input_device
|
|
||||||
|
|
||||||
assert _babase.app is not None
|
|
||||||
in_main_menu = self.ui.has_main_menu_window()
|
|
||||||
if not in_main_menu:
|
|
||||||
set_ui_input_device(device_id)
|
|
||||||
|
|
||||||
if not _babase.app.headless_mode:
|
|
||||||
_bauiv1.getsound('swish').play()
|
|
||||||
|
|
||||||
self.ui.set_main_menu_window(MainMenuWindow().get_root_widget())
|
|
||||||
|
|
||||||
def show_url_window(self, address: str) -> None:
|
def show_url_window(self, address: str) -> None:
|
||||||
"""(internal)"""
|
"""(internal)"""
|
||||||
from bauiv1lib.url import ShowURLWindow
|
from bauiv1lib.url import ShowURLWindow
|
||||||
|
|||||||
@ -28,7 +28,7 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
# Build number and version of the ballistica binary we expect to be
|
# Build number and version of the ballistica binary we expect to be
|
||||||
# using.
|
# using.
|
||||||
TARGET_BALLISTICA_BUILD = 21081
|
TARGET_BALLISTICA_BUILD = 21084
|
||||||
TARGET_BALLISTICA_VERSION = '1.7.20'
|
TARGET_BALLISTICA_VERSION = '1.7.20'
|
||||||
|
|
||||||
_g_env_config: EnvConfig | None = None
|
_g_env_config: EnvConfig | None = None
|
||||||
|
|||||||
@ -33,10 +33,9 @@ class PlusSubsystem(AppSubsystem):
|
|||||||
accounts: AccountV2Subsystem
|
accounts: AccountV2Subsystem
|
||||||
cloud: CloudSubsystem
|
cloud: CloudSubsystem
|
||||||
|
|
||||||
def on_app_launching(self) -> None:
|
def on_app_loading(self) -> None:
|
||||||
"""(internal)"""
|
_baplus.on_app_loading()
|
||||||
_baplus.on_app_launching()
|
self.accounts.on_app_loading()
|
||||||
self.accounts.on_app_launching()
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def add_v1_account_transaction(
|
def add_v1_account_transaction(
|
||||||
|
|||||||
@ -188,7 +188,7 @@ class ScoreScreenActivity(Activity[EmptyPlayer, EmptyTeam]):
|
|||||||
# min-view-time show a 'press any button to continue..'
|
# min-view-time show a 'press any button to continue..'
|
||||||
# thing after a bit.
|
# thing after a bit.
|
||||||
assert _babase.app.classic is not None
|
assert _babase.app.classic is not None
|
||||||
if _babase.app.classic.ui.uiscale is UIScale.LARGE:
|
if _babase.app.ui_v1.uiscale is UIScale.LARGE:
|
||||||
# FIXME: Need a better way to determine whether we've probably
|
# FIXME: Need a better way to determine whether we've probably
|
||||||
# got a keyboard.
|
# got a keyboard.
|
||||||
sval = _language.Lstr(resource='pressAnyKeyButtonText')
|
sval = _language.Lstr(resource='pressAnyKeyButtonText')
|
||||||
|
|||||||
@ -460,7 +460,7 @@ class GameActivity(Activity[PlayerT, TeamT]):
|
|||||||
# Only attempt this if we're not currently paused
|
# Only attempt this if we're not currently paused
|
||||||
# and there appears to be no UI.
|
# and there appears to be no UI.
|
||||||
assert _babase.app.classic is not None
|
assert _babase.app.classic is not None
|
||||||
hmmw = _babase.app.classic.ui.has_main_menu_window()
|
hmmw = _babase.app.ui_v1.has_main_menu_window()
|
||||||
if not gnode.paused and not hmmw:
|
if not gnode.paused and not hmmw:
|
||||||
self._is_waiting_for_continue = True
|
self._is_waiting_for_continue = True
|
||||||
with _babase.ContextRef.empty():
|
with _babase.ContextRef.empty():
|
||||||
|
|||||||
@ -189,7 +189,7 @@ def show_damage_count(
|
|||||||
# (connected clients may have differing configs so they won't
|
# (connected clients may have differing configs so they won't
|
||||||
# get the intended results).
|
# get the intended results).
|
||||||
assert app.classic is not None
|
assert app.classic is not None
|
||||||
do_big = app.classic.ui.uiscale is UIScale.SMALL or app.vr_mode
|
do_big = app.ui_v1.uiscale is UIScale.SMALL or app.vr_mode
|
||||||
txtnode = _bascenev1.newnode(
|
txtnode = _bascenev1.newnode(
|
||||||
'text',
|
'text',
|
||||||
attrs={
|
attrs={
|
||||||
|
|||||||
@ -47,7 +47,7 @@ def filter_chat_message(msg: str, client_id: int) -> str | None:
|
|||||||
def local_chat_message(msg: str) -> None:
|
def local_chat_message(msg: str) -> None:
|
||||||
assert _babase.app.classic is not None
|
assert _babase.app.classic is not None
|
||||||
if (
|
if (
|
||||||
_babase.app.classic.ui.party_window is not None
|
_babase.app.ui_v1.party_window is not None
|
||||||
and _babase.app.classic.ui.party_window() is not None
|
and _babase.app.ui_v1.party_window() is not None
|
||||||
):
|
):
|
||||||
_babase.app.classic.ui.party_window().on_chat_message(msg)
|
_babase.app.ui_v1.party_window().on_chat_message(msg)
|
||||||
|
|||||||
@ -341,7 +341,7 @@ class CoopScoreScreen(bs.Activity[bs.Player, bs.Team]):
|
|||||||
# main menu up, so instead we add a callback for when the menu
|
# main menu up, so instead we add a callback for when the menu
|
||||||
# closes; if we're still alive, we'll come up then.
|
# closes; if we're still alive, we'll come up then.
|
||||||
# If there's no main menu this gets called immediately.
|
# If there's no main menu this gets called immediately.
|
||||||
bui.app.classic.add_main_menu_close_callback(bui.WeakCall(self.show_ui))
|
bui.app.ui_v1.add_main_menu_close_callback(bui.WeakCall(self.show_ui))
|
||||||
|
|
||||||
def show_ui(self) -> None:
|
def show_ui(self) -> None:
|
||||||
"""Show the UI for restarting, playing the next Level, etc."""
|
"""Show the UI for restarting, playing the next Level, etc."""
|
||||||
|
|||||||
@ -41,7 +41,7 @@ class TeamSeriesVictoryScoreScreenActivity(MultiTeamScoreScreenActivity):
|
|||||||
else 'Teams Series Victory Screen'
|
else 'Teams Series Victory Screen'
|
||||||
)
|
)
|
||||||
assert babase.app.classic is not None
|
assert babase.app.classic is not None
|
||||||
if babase.app.classic.ui.uiscale is babase.UIScale.LARGE:
|
if babase.app.ui_v1.uiscale is babase.UIScale.LARGE:
|
||||||
sval = babase.Lstr(resource='pressAnyKeyButtonPlayAgainText')
|
sval = babase.Lstr(resource='pressAnyKeyButtonPlayAgainText')
|
||||||
else:
|
else:
|
||||||
sval = babase.Lstr(resource='pressAnyButtonPlayAgainText')
|
sval = babase.Lstr(resource='pressAnyButtonPlayAgainText')
|
||||||
|
|||||||
@ -453,7 +453,7 @@ class RunaroundGame(bs.CoopGameActivity[Player, Team]):
|
|||||||
|
|
||||||
# Make sure to stay out of the way of menu/party buttons in the corner.
|
# Make sure to stay out of the way of menu/party buttons in the corner.
|
||||||
assert bs.app.classic is not None
|
assert bs.app.classic is not None
|
||||||
uiscale = bs.app.classic.ui.uiscale
|
uiscale = bs.app.ui_v1.uiscale
|
||||||
l_offs = (
|
l_offs = (
|
||||||
-80
|
-80
|
||||||
if uiscale is bs.UIScale.SMALL
|
if uiscale is bs.UIScale.SMALL
|
||||||
|
|||||||
@ -67,7 +67,7 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]):
|
|||||||
# FIXME: Need a node attr for vr-specific-scale.
|
# FIXME: Need a node attr for vr-specific-scale.
|
||||||
scale = (
|
scale = (
|
||||||
0.9
|
0.9
|
||||||
if (app.classic.ui.uiscale is bs.UIScale.SMALL or vr_mode)
|
if (app.ui_v1.uiscale is bs.UIScale.SMALL or vr_mode)
|
||||||
else 0.7
|
else 0.7
|
||||||
)
|
)
|
||||||
self.my_name = bs.NodeActor(
|
self.my_name = bs.NodeActor(
|
||||||
@ -118,7 +118,7 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]):
|
|||||||
# Any differences need to happen at the engine level so everyone sees
|
# Any differences need to happen at the engine level so everyone sees
|
||||||
# things in their own optimal way.
|
# things in their own optimal way.
|
||||||
vr_mode = app.vr_mode
|
vr_mode = app.vr_mode
|
||||||
uiscale = app.classic.ui.uiscale
|
uiscale = app.ui_v1.uiscale
|
||||||
|
|
||||||
# In cases where we're doing lots of dev work lets always show the
|
# In cases where we're doing lots of dev work lets always show the
|
||||||
# build number.
|
# build number.
|
||||||
@ -322,11 +322,11 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]):
|
|||||||
|
|
||||||
assert bs.app.classic is not None
|
assert bs.app.classic is not None
|
||||||
if bool(False):
|
if bool(False):
|
||||||
uicontroller = bs.app.classic.ui.controller
|
uicontroller = bs.app.ui_v1.controller
|
||||||
assert uicontroller is not None
|
assert uicontroller is not None
|
||||||
uicontroller.show_main_menu()
|
uicontroller.show_main_menu()
|
||||||
else:
|
else:
|
||||||
main_menu_location = bs.app.classic.ui.get_main_menu_location()
|
main_menu_location = bs.app.ui_v1.get_main_menu_location()
|
||||||
|
|
||||||
# When coming back from a kiosk-mode game, jump to
|
# When coming back from a kiosk-mode game, jump to
|
||||||
# the kiosk start screen.
|
# the kiosk start screen.
|
||||||
@ -334,7 +334,7 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]):
|
|||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
from bauiv1lib.kiosk import KioskWindow
|
from bauiv1lib.kiosk import KioskWindow
|
||||||
|
|
||||||
bs.app.classic.ui.set_main_menu_window(
|
bs.app.ui_v1.set_main_menu_window(
|
||||||
KioskWindow().get_root_widget()
|
KioskWindow().get_root_widget()
|
||||||
)
|
)
|
||||||
# ..or in normal cases go back to the main menu
|
# ..or in normal cases go back to the main menu
|
||||||
@ -343,14 +343,14 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]):
|
|||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
from bauiv1lib.gather import GatherWindow
|
from bauiv1lib.gather import GatherWindow
|
||||||
|
|
||||||
bs.app.classic.ui.set_main_menu_window(
|
bs.app.ui_v1.set_main_menu_window(
|
||||||
GatherWindow(transition=None).get_root_widget()
|
GatherWindow(transition=None).get_root_widget()
|
||||||
)
|
)
|
||||||
elif main_menu_location == 'Watch':
|
elif main_menu_location == 'Watch':
|
||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
from bauiv1lib.watch import WatchWindow
|
from bauiv1lib.watch import WatchWindow
|
||||||
|
|
||||||
bs.app.classic.ui.set_main_menu_window(
|
bs.app.ui_v1.set_main_menu_window(
|
||||||
WatchWindow(transition=None).get_root_widget()
|
WatchWindow(transition=None).get_root_widget()
|
||||||
)
|
)
|
||||||
elif main_menu_location == 'Team Game Select':
|
elif main_menu_location == 'Team Game Select':
|
||||||
@ -359,7 +359,7 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]):
|
|||||||
PlaylistBrowserWindow,
|
PlaylistBrowserWindow,
|
||||||
)
|
)
|
||||||
|
|
||||||
bs.app.classic.ui.set_main_menu_window(
|
bs.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistBrowserWindow(
|
PlaylistBrowserWindow(
|
||||||
sessiontype=bs.DualTeamSession, transition=None
|
sessiontype=bs.DualTeamSession, transition=None
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -370,7 +370,7 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]):
|
|||||||
PlaylistBrowserWindow,
|
PlaylistBrowserWindow,
|
||||||
)
|
)
|
||||||
|
|
||||||
bs.app.classic.ui.set_main_menu_window(
|
bs.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistBrowserWindow(
|
PlaylistBrowserWindow(
|
||||||
sessiontype=bs.FreeForAllSession,
|
sessiontype=bs.FreeForAllSession,
|
||||||
transition=None,
|
transition=None,
|
||||||
@ -380,21 +380,21 @@ class MainMenuActivity(bs.Activity[bs.Player, bs.Team]):
|
|||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
from bauiv1lib.coop.browser import CoopBrowserWindow
|
from bauiv1lib.coop.browser import CoopBrowserWindow
|
||||||
|
|
||||||
bs.app.classic.ui.set_main_menu_window(
|
bs.app.ui_v1.set_main_menu_window(
|
||||||
CoopBrowserWindow(transition=None).get_root_widget()
|
CoopBrowserWindow(transition=None).get_root_widget()
|
||||||
)
|
)
|
||||||
elif main_menu_location == 'Benchmarks & Stress Tests':
|
elif main_menu_location == 'Benchmarks & Stress Tests':
|
||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
from bauiv1lib.debug import DebugWindow
|
from bauiv1lib.debug import DebugWindow
|
||||||
|
|
||||||
bs.app.classic.ui.set_main_menu_window(
|
bs.app.ui_v1.set_main_menu_window(
|
||||||
DebugWindow(transition=None).get_root_widget()
|
DebugWindow(transition=None).get_root_widget()
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
from bauiv1lib.mainmenu import MainMenuWindow
|
from bauiv1lib.mainmenu import MainMenuWindow
|
||||||
|
|
||||||
bs.app.classic.ui.set_main_menu_window(
|
bs.app.ui_v1.set_main_menu_window(
|
||||||
MainMenuWindow(transition=None).get_root_widget()
|
MainMenuWindow(transition=None).get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -982,10 +982,7 @@ class NewsDisplay:
|
|||||||
assert bs.app.classic is not None
|
assert bs.app.classic is not None
|
||||||
scl = (
|
scl = (
|
||||||
1.2
|
1.2
|
||||||
if (
|
if (bs.app.ui_v1.uiscale is bs.UIScale.SMALL or bs.app.vr_mode)
|
||||||
bs.app.classic.ui.uiscale is bs.UIScale.SMALL
|
|
||||||
or bs.app.vr_mode
|
|
||||||
)
|
|
||||||
else 0.8
|
else 0.8
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -82,7 +82,6 @@ from babase._mgen.enums import (
|
|||||||
)
|
)
|
||||||
from babase._text import timestring
|
from babase._text import timestring
|
||||||
|
|
||||||
|
|
||||||
from _bauiv1 import (
|
from _bauiv1 import (
|
||||||
uibounds,
|
uibounds,
|
||||||
set_party_window_open,
|
set_party_window_open,
|
||||||
@ -112,7 +111,8 @@ from _bauiv1 import (
|
|||||||
Widget,
|
Widget,
|
||||||
widget,
|
widget,
|
||||||
)
|
)
|
||||||
from bauiv1.ui import Window, uicleanupcheck
|
from bauiv1._uitypes import Window, uicleanupcheck
|
||||||
|
from bauiv1._subsystem import UIV1Subsystem
|
||||||
|
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
@ -209,6 +209,7 @@ __all__ = [
|
|||||||
'AppIntentDefault',
|
'AppIntentDefault',
|
||||||
'AppIntentExec',
|
'AppIntentExec',
|
||||||
'AppMode',
|
'AppMode',
|
||||||
|
'UIV1Subsystem',
|
||||||
]
|
]
|
||||||
|
|
||||||
# We want stuff to show up as bauiv1.Foo instead of bauiv1._sub.Foo.
|
# We want stuff to show up as bauiv1.Foo instead of bauiv1._sub.Foo.
|
||||||
|
|||||||
@ -51,11 +51,7 @@ def friends_button_press() -> None:
|
|||||||
def party_icon_activate(origin: Sequence[float]) -> None:
|
def party_icon_activate(origin: Sequence[float]) -> None:
|
||||||
from babase import app
|
from babase import app
|
||||||
|
|
||||||
if app.classic is None:
|
app.ui_v1.party_icon_activate(origin)
|
||||||
logging.exception('Classic not present.')
|
|
||||||
return
|
|
||||||
|
|
||||||
app.classic.party_icon_activate(origin)
|
|
||||||
|
|
||||||
|
|
||||||
def quit_window() -> None:
|
def quit_window() -> None:
|
||||||
@ -71,11 +67,7 @@ def quit_window() -> None:
|
|||||||
def device_menu_press(device_id: int | None) -> None:
|
def device_menu_press(device_id: int | None) -> None:
|
||||||
from babase import app
|
from babase import app
|
||||||
|
|
||||||
if app.classic is None:
|
app.ui_v1.device_menu_press(device_id)
|
||||||
logging.exception('Classic not present.')
|
|
||||||
return
|
|
||||||
|
|
||||||
app.classic.device_menu_press(device_id)
|
|
||||||
|
|
||||||
|
|
||||||
def show_url_window(address: str) -> None:
|
def show_url_window(address: str) -> None:
|
||||||
|
|||||||
@ -5,19 +5,22 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
import weakref
|
||||||
|
|
||||||
import bauiv1 as bui
|
|
||||||
import _babase
|
import _babase
|
||||||
from babase._mgen.enums import UIScale
|
from babase._mgen.enums import UIScale
|
||||||
|
from babase._appsubsystem import AppSubsystem
|
||||||
|
import _bauiv1
|
||||||
|
import bauiv1
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Any, Callable
|
from typing import Any, Callable, Sequence
|
||||||
|
|
||||||
from bauiv1.ui import UICleanupCheck, UIController
|
from bauiv1._uitypes import UICleanupCheck, UIController
|
||||||
import babase
|
import babase
|
||||||
|
|
||||||
|
|
||||||
class UISubsystem:
|
class UIV1Subsystem(AppSubsystem):
|
||||||
"""Consolidated UI functionality for the app.
|
"""Consolidated UI functionality for the app.
|
||||||
|
|
||||||
Category: **App Classes**
|
Category: **App Classes**
|
||||||
@ -26,13 +29,17 @@ class UISubsystem:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
|
super().__init__()
|
||||||
env = _babase.env()
|
env = _babase.env()
|
||||||
|
|
||||||
self.controller: UIController | None = None
|
self.controller: UIController | None = None
|
||||||
|
|
||||||
self._main_menu_window: bui.Widget | None = None
|
self._main_menu_window: bauiv1.Widget | None = None
|
||||||
self._main_menu_location: str | None = None
|
self._main_menu_location: str | None = None
|
||||||
|
|
||||||
|
# From classic.
|
||||||
|
self.main_menu_resume_callbacks: list = [] # Can probably go away.
|
||||||
|
|
||||||
self._uiscale: babase.UIScale
|
self._uiscale: babase.UIScale
|
||||||
|
|
||||||
interfacetype = env['ui_scale']
|
interfacetype = env['ui_scale']
|
||||||
@ -49,7 +56,6 @@ class UISubsystem:
|
|||||||
self.main_menu_selection: str | None = None # FIXME: Kill this.
|
self.main_menu_selection: str | None = None # FIXME: Kill this.
|
||||||
self.have_party_queue_window = False
|
self.have_party_queue_window = False
|
||||||
self.quit_window: Any = None
|
self.quit_window: Any = None
|
||||||
self.dismiss_wii_remotes_window_call: (Callable[[], Any] | None) = None
|
|
||||||
self.cleanupchecks: list[UICleanupCheck] = []
|
self.cleanupchecks: list[UICleanupCheck] = []
|
||||||
self.upkeeptimer: babase.AppTimer | None = None
|
self.upkeeptimer: babase.AppTimer | None = None
|
||||||
self.use_toolbars = env.get('toolbar_test', True)
|
self.use_toolbars = env.get('toolbar_test', True)
|
||||||
@ -68,9 +74,8 @@ class UISubsystem:
|
|||||||
"""Current ui scale for the app."""
|
"""Current ui scale for the app."""
|
||||||
return self._uiscale
|
return self._uiscale
|
||||||
|
|
||||||
def on_app_launching(self) -> None:
|
def on_app_loading(self) -> None:
|
||||||
"""Should be run on app launch."""
|
from bauiv1._uitypes import UIController, ui_upkeep
|
||||||
from bauiv1.ui import UIController, ui_upkeep
|
|
||||||
|
|
||||||
# IMPORTANT: If tweaking UI stuff, make sure it behaves for small,
|
# IMPORTANT: If tweaking UI stuff, make sure it behaves for small,
|
||||||
# medium, and large UI modes. (doesn't run off screen, etc).
|
# medium, and large UI modes. (doesn't run off screen, etc).
|
||||||
@ -104,7 +109,7 @@ class UISubsystem:
|
|||||||
# FIXME: Can probably kill this if we do immediate UI death checks.
|
# FIXME: Can probably kill this if we do immediate UI death checks.
|
||||||
self.upkeeptimer = _babase.AppTimer(2.6543, ui_upkeep, repeat=True)
|
self.upkeeptimer = _babase.AppTimer(2.6543, ui_upkeep, repeat=True)
|
||||||
|
|
||||||
def set_main_menu_window(self, window: bui.Widget) -> None:
|
def set_main_menu_window(self, window: bauiv1.Widget) -> None:
|
||||||
"""Set the current 'main' window, replacing any existing."""
|
"""Set the current 'main' window, replacing any existing."""
|
||||||
existing = self._main_menu_window
|
existing = self._main_menu_window
|
||||||
from inspect import currentframe, getframeinfo
|
from inspect import currentframe, getframeinfo
|
||||||
@ -145,19 +150,29 @@ class UISubsystem:
|
|||||||
)
|
)
|
||||||
existing.delete()
|
existing.delete()
|
||||||
|
|
||||||
bui.apptimer(1.0, _delay_kill)
|
bauiv1.apptimer(1.0, _delay_kill)
|
||||||
self._main_menu_window = window
|
self._main_menu_window = window
|
||||||
|
|
||||||
def clear_main_menu_window(self, transition: str | None = 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:
|
||||||
bui.containerwidget(
|
bauiv1.containerwidget(
|
||||||
edit=self._main_menu_window, transition=transition
|
edit=self._main_menu_window, transition=transition
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self._main_menu_window.delete()
|
self._main_menu_window.delete()
|
||||||
|
|
||||||
|
def add_main_menu_close_callback(self, call: Callable[[], Any]) -> None:
|
||||||
|
"""(internal)"""
|
||||||
|
|
||||||
|
# If there's no main menu up, just call immediately.
|
||||||
|
if not self.has_main_menu_window():
|
||||||
|
with _babase.ContextRef.empty():
|
||||||
|
call()
|
||||||
|
else:
|
||||||
|
self.main_menu_resume_callbacks.append(call)
|
||||||
|
|
||||||
def has_main_menu_window(self) -> bool:
|
def has_main_menu_window(self) -> bool:
|
||||||
"""Return whether a main menu window is present."""
|
"""Return whether a main menu window is present."""
|
||||||
return bool(self._main_menu_window)
|
return bool(self._main_menu_window)
|
||||||
@ -169,3 +184,33 @@ class UISubsystem:
|
|||||||
def get_main_menu_location(self) -> str | None:
|
def get_main_menu_location(self) -> str | None:
|
||||||
"""Return the current named main menu location, if any."""
|
"""Return the current named main menu location, if any."""
|
||||||
return self._main_menu_location
|
return self._main_menu_location
|
||||||
|
|
||||||
|
def party_icon_activate(self, origin: Sequence[float]) -> None:
|
||||||
|
"""(internal)"""
|
||||||
|
from bauiv1lib.party import PartyWindow
|
||||||
|
from babase import app
|
||||||
|
|
||||||
|
assert not app.headless_mode
|
||||||
|
|
||||||
|
_bauiv1.getsound('swish').play()
|
||||||
|
|
||||||
|
# If it exists, dismiss it; otherwise make a new one.
|
||||||
|
if self.party_window is not None and self.party_window() is not None:
|
||||||
|
self.party_window().close()
|
||||||
|
else:
|
||||||
|
self.party_window = weakref.ref(PartyWindow(origin=origin))
|
||||||
|
|
||||||
|
def device_menu_press(self, device_id: int | None) -> None:
|
||||||
|
"""(internal)"""
|
||||||
|
from bauiv1lib.mainmenu import MainMenuWindow
|
||||||
|
from bauiv1 import set_ui_input_device
|
||||||
|
|
||||||
|
assert _babase.app is not None
|
||||||
|
in_main_menu = self.has_main_menu_window()
|
||||||
|
if not in_main_menu:
|
||||||
|
set_ui_input_device(device_id)
|
||||||
|
|
||||||
|
if not _babase.app.headless_mode:
|
||||||
|
_bauiv1.getsound('swish').play()
|
||||||
|
|
||||||
|
self.set_main_menu_window(MainMenuWindow().get_root_widget())
|
||||||
@ -201,7 +201,7 @@ def uicleanupcheck(obj: Any, widget: bauiv1.Widget) -> None:
|
|||||||
widget.add_delete_callback(foobar)
|
widget.add_delete_callback(foobar)
|
||||||
|
|
||||||
assert _babase.app.classic is not None
|
assert _babase.app.classic is not None
|
||||||
_babase.app.classic.ui.cleanupchecks.append(
|
_babase.app.ui_v1.cleanupchecks.append(
|
||||||
UICleanupCheck(
|
UICleanupCheck(
|
||||||
obj=weakref.ref(obj), widget=widget, widget_death_time=None
|
obj=weakref.ref(obj), widget=widget, widget_death_time=None
|
||||||
)
|
)
|
||||||
@ -211,7 +211,7 @@ def uicleanupcheck(obj: Any, widget: bauiv1.Widget) -> None:
|
|||||||
def ui_upkeep() -> None:
|
def ui_upkeep() -> None:
|
||||||
"""Run UI cleanup checks, etc. should be called periodically."""
|
"""Run UI cleanup checks, etc. should be called periodically."""
|
||||||
assert _babase.app.classic is not None
|
assert _babase.app.classic is not None
|
||||||
ui = _babase.app.classic.ui
|
ui = _babase.app.ui_v1
|
||||||
remainingchecks = []
|
remainingchecks = []
|
||||||
now = _babase.apptime()
|
now = _babase.apptime()
|
||||||
for check in ui.cleanupchecks:
|
for check in ui.cleanupchecks:
|
||||||
@ -12,7 +12,7 @@ from typing import TYPE_CHECKING
|
|||||||
import babase
|
import babase
|
||||||
from _babase import screenmessage
|
from _babase import screenmessage
|
||||||
import _bauiv1
|
import _bauiv1
|
||||||
from bauiv1.ui import Window
|
from bauiv1._uitypes import Window
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
import bauiv1 as bui
|
import bauiv1 as bui
|
||||||
@ -26,7 +26,7 @@ class OnScreenKeyboardWindow(Window):
|
|||||||
self._width = 700
|
self._width = 700
|
||||||
self._height = 400
|
self._height = 400
|
||||||
assert babase.app.classic is not None
|
assert babase.app.classic is not None
|
||||||
uiscale = babase.app.classic.ui.uiscale
|
uiscale = babase.app.ui_v1.uiscale
|
||||||
top_extra = 20 if uiscale is babase.UIScale.SMALL else 0
|
top_extra = 20 if uiscale is babase.UIScale.SMALL else 0
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=_bauiv1.containerwidget(
|
root_widget=_bauiv1.containerwidget(
|
||||||
@ -71,7 +71,7 @@ class OnScreenKeyboardWindow(Window):
|
|||||||
scale=0.95,
|
scale=0.95,
|
||||||
text=label,
|
text=label,
|
||||||
maxwidth=self._width - 140,
|
maxwidth=self._width - 140,
|
||||||
color=babase.app.classic.ui.title_color,
|
color=babase.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class AccountLinkWindow(bui.Window):
|
|||||||
self._width = 560
|
self._width = 560
|
||||||
self._height = 420
|
self._height = 420
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
base_scale = (
|
base_scale = (
|
||||||
1.65
|
1.65
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
@ -77,7 +77,7 @@ class AccountLinkWindow(bui.Window):
|
|||||||
subs=[('${COUNT}', str(maxlinks))],
|
subs=[('${COUNT}', str(maxlinks))],
|
||||||
),
|
),
|
||||||
maxwidth=self._width * 0.9,
|
maxwidth=self._width * 0.9,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
max_height=self._height * 0.6,
|
max_height=self._height * 0.6,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -150,7 +150,7 @@ class AccountLinkCodeWindow(bui.Window):
|
|||||||
self._width = 350
|
self._width = 350
|
||||||
self._height = 200
|
self._height = 200
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
|
|||||||
@ -73,7 +73,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
|
|
||||||
app = bui.app
|
app = bui.app
|
||||||
assert app.classic is not None
|
assert app.classic is not None
|
||||||
uiscale = app.classic.ui.uiscale
|
uiscale = app.ui_v1.uiscale
|
||||||
|
|
||||||
self._width = 760 if uiscale is bui.UIScale.SMALL else 660
|
self._width = 760 if uiscale is bui.UIScale.SMALL else 660
|
||||||
x_offs = 50 if uiscale is bui.UIScale.SMALL else 0
|
x_offs = 50 if uiscale is bui.UIScale.SMALL else 0
|
||||||
@ -124,7 +124,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
else (0, 0),
|
else (0, 0),
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
if uiscale is bui.UIScale.SMALL and app.classic.ui.use_toolbars:
|
if uiscale is bui.UIScale.SMALL and app.ui_v1.use_toolbars:
|
||||||
self._back_button = None
|
self._back_button = None
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
edit=self._root_widget, on_cancel_call=self._back
|
edit=self._root_widget, on_cancel_call=self._back
|
||||||
@ -157,7 +157,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
position=(self._width * 0.5, self._height - 41),
|
position=(self._width * 0.5, self._height - 41),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
color=app.classic.ui.title_color,
|
color=app.ui_v1.title_color,
|
||||||
maxwidth=self._width - 340,
|
maxwidth=self._width - 340,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -419,7 +419,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
text=txt,
|
text=txt,
|
||||||
scale=0.9,
|
scale=0.9,
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=self._sub_width * 0.9,
|
maxwidth=self._sub_width * 0.9,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -563,7 +563,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -618,7 +618,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -687,7 +687,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -712,7 +712,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -735,7 +735,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -765,7 +765,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -818,7 +818,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -849,7 +849,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -927,7 +927,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -992,7 +992,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -1024,7 +1024,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -1094,7 +1094,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -1115,7 +1115,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if first_selectable is None:
|
if first_selectable is None:
|
||||||
first_selectable = btn
|
first_selectable = btn
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -1537,7 +1537,7 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
|
|
||||||
if not self._modal:
|
if not self._modal:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
MainMenuWindow(transition='in_left').get_root_widget()
|
MainMenuWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1551,14 +1551,14 @@ class AccountSettingsWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
raise ValueError('unrecognized selection')
|
raise ValueError('unrecognized selection')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = sel_name
|
bui.app.ui_v1.window_states[type(self)] = sel_name
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception('Error saving state for %s.', self)
|
logging.exception('Error saving state for %s.', self)
|
||||||
|
|
||||||
def _restore_state(self) -> None:
|
def _restore_state(self) -> None:
|
||||||
try:
|
try:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
sel_name = bui.app.classic.ui.window_states.get(type(self))
|
sel_name = bui.app.ui_v1.window_states.get(type(self))
|
||||||
if sel_name == 'Back':
|
if sel_name == 'Back':
|
||||||
sel = self._back_button
|
sel = self._back_button
|
||||||
elif sel_name == 'Scroll':
|
elif sel_name == 'Scroll':
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class AccountUnlinkWindow(bui.Window):
|
|||||||
self._scroll_width = 400
|
self._scroll_width = 400
|
||||||
self._scroll_height = 200
|
self._scroll_height = 200
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
base_scale = (
|
base_scale = (
|
||||||
2.0
|
2.0
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
@ -74,7 +74,7 @@ class AccountUnlinkWindow(bui.Window):
|
|||||||
resource='accountSettingsWindow.unlinkAccountsInstructionsText'
|
resource='accountSettingsWindow.unlinkAccountsInstructionsText'
|
||||||
),
|
),
|
||||||
maxwidth=self._width * 0.7,
|
maxwidth=self._width * 0.7,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
|
|||||||
@ -23,7 +23,7 @@ class V2ProxySignInWindow(bui.Window):
|
|||||||
self._proxykey: str | None = None
|
self._proxykey: str | None = None
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
@ -107,7 +107,7 @@ class V2ProxySignInWindow(bui.Window):
|
|||||||
text=bui.Lstr(
|
text=bui.Lstr(
|
||||||
resource='accountSettingsWindow.v2LinkInstructionsText'
|
resource='accountSettingsWindow.v2LinkInstructionsText'
|
||||||
),
|
),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=self._width * 0.9,
|
maxwidth=self._width * 0.9,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class AccountViewerWindow(PopupWindow):
|
|||||||
self._account_id = account_id
|
self._account_id = account_id
|
||||||
self._profile_id = profile_id
|
self._profile_id = profile_id
|
||||||
|
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
if scale is None:
|
if scale is None:
|
||||||
scale = (
|
scale = (
|
||||||
2.6
|
2.6
|
||||||
@ -178,7 +178,7 @@ class AccountViewerWindow(PopupWindow):
|
|||||||
choices_display.append(bui.Lstr(resource='banThisPlayerText'))
|
choices_display.append(bui.Lstr(resource='banThisPlayerText'))
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
PopupMenuWindow(
|
PopupMenuWindow(
|
||||||
position=self._extras_menu_button.get_screen_space_center(),
|
position=self._extras_menu_button.get_screen_space_center(),
|
||||||
scale=(
|
scale=(
|
||||||
@ -344,7 +344,7 @@ class AccountViewerWindow(PopupWindow):
|
|||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
scale=title_scale,
|
scale=title_scale,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
text=account_title,
|
text=account_title,
|
||||||
maxwidth=sub_width * maxwidth_scale,
|
maxwidth=sub_width * maxwidth_scale,
|
||||||
)
|
)
|
||||||
@ -376,7 +376,7 @@ class AccountViewerWindow(PopupWindow):
|
|||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
scale=title_scale,
|
scale=title_scale,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
text=bui.Lstr(resource='rankText'),
|
text=bui.Lstr(resource='rankText'),
|
||||||
maxwidth=sub_width * maxwidth_scale,
|
maxwidth=sub_width * maxwidth_scale,
|
||||||
)
|
)
|
||||||
@ -532,7 +532,7 @@ class AccountViewerWindow(PopupWindow):
|
|||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
scale=title_scale,
|
scale=title_scale,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
text=bui.Lstr(resource='achievementsText'),
|
text=bui.Lstr(resource='achievementsText'),
|
||||||
maxwidth=sub_width * maxwidth_scale,
|
maxwidth=sub_width * maxwidth_scale,
|
||||||
)
|
)
|
||||||
@ -566,7 +566,7 @@ class AccountViewerWindow(PopupWindow):
|
|||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
scale=title_scale,
|
scale=title_scale,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
flatness=1.0,
|
flatness=1.0,
|
||||||
text=bui.Lstr(
|
text=bui.Lstr(
|
||||||
resource='trophiesThisSeasonText',
|
resource='trophiesThisSeasonText',
|
||||||
|
|||||||
@ -16,7 +16,7 @@ class AchievementsWindow(PopupWindow):
|
|||||||
):
|
):
|
||||||
# pylint: disable=too-many-locals
|
# pylint: disable=too-many-locals
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
if scale is None:
|
if scale is None:
|
||||||
scale = (
|
scale = (
|
||||||
2.3
|
2.3
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class ShowFriendCodeWindow(bui.Window):
|
|||||||
self._width = 650
|
self._width = 650
|
||||||
self._height = 400
|
self._height = 400
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
@ -61,7 +61,7 @@ class ShowFriendCodeWindow(bui.Window):
|
|||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(self._width * 0.5, self._height * 0.8),
|
position=(self._width * 0.5, self._height * 0.8),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
scale=1.0,
|
scale=1.0,
|
||||||
flatness=1.0,
|
flatness=1.0,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -94,7 +94,7 @@ class ShowFriendCodeWindow(bui.Window):
|
|||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(self._width * 0.5, self._height * 0.37),
|
position=(self._width * 0.5, self._height * 0.37),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
scale=1.0,
|
scale=1.0,
|
||||||
flatness=1.0,
|
flatness=1.0,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
|
|||||||
@ -34,7 +34,7 @@ class CharacterPicker(PopupWindow):
|
|||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
|
|
||||||
del parent # unused here
|
del parent # unused here
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
if scale is None:
|
if scale is None:
|
||||||
scale = (
|
scale = (
|
||||||
1.85
|
1.85
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class ColorPicker(PopupWindow):
|
|||||||
assert len(c_raw) == 16
|
assert len(c_raw) == 16
|
||||||
self.colors = [c_raw[0:4], c_raw[4:8], c_raw[8:12], c_raw[12:16]]
|
self.colors = [c_raw[0:4], c_raw[4:8], c_raw[8:12], c_raw[12:16]]
|
||||||
|
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
if scale is None:
|
if scale is None:
|
||||||
scale = (
|
scale = (
|
||||||
2.3
|
2.3
|
||||||
@ -198,7 +198,7 @@ class ColorPickerExact(PopupWindow):
|
|||||||
assert len(c_raw) == 16
|
assert len(c_raw) == 16
|
||||||
self.colors = [c_raw[0:4], c_raw[4:8], c_raw[8:12], c_raw[12:16]]
|
self.colors = [c_raw[0:4], c_raw[4:8], c_raw[8:12], c_raw[12:16]]
|
||||||
|
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
if scale is None:
|
if scale is None:
|
||||||
scale = (
|
scale = (
|
||||||
2.3
|
2.3
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class ConfirmWindow:
|
|||||||
transition = 'in_right'
|
transition = 'in_right'
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self.root_widget = bui.containerwidget(
|
self.root_widget = bui.containerwidget(
|
||||||
size=(width, height),
|
size=(width, height),
|
||||||
transition=transition,
|
transition=transition,
|
||||||
@ -158,7 +158,7 @@ class QuitWindow:
|
|||||||
origin_widget: bui.Widget | None = None,
|
origin_widget: bui.Widget | None = None,
|
||||||
):
|
):
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
ui = bui.app.classic.ui
|
ui = bui.app.ui_v1
|
||||||
app = bui.app
|
app = bui.app
|
||||||
self._back = back
|
self._back = back
|
||||||
|
|
||||||
|
|||||||
@ -100,7 +100,7 @@ class ContinuesWindow(bui.Window):
|
|||||||
|
|
||||||
self._tickets_text_base: str | None
|
self._tickets_text_base: str | None
|
||||||
self._tickets_text: bui.Widget | None
|
self._tickets_text: bui.Widget | None
|
||||||
if not bui.app.classic.ui.use_toolbars:
|
if not bui.app.ui_v1.use_toolbars:
|
||||||
self._tickets_text_base = bui.Lstr(
|
self._tickets_text_base = bui.Lstr(
|
||||||
resource='getTicketsWindow.youHaveShortText',
|
resource='getTicketsWindow.youHaveShortText',
|
||||||
fallback_resource='getTicketsWindow.youHaveText',
|
fallback_resource='getTicketsWindow.youHaveText',
|
||||||
|
|||||||
@ -84,7 +84,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
self._campaign_percent_text: bui.Widget | None = None
|
self._campaign_percent_text: bui.Widget | None = None
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 1320 if uiscale is bui.UIScale.SMALL else 1120
|
self._width = 1320 if uiscale is bui.UIScale.SMALL else 1120
|
||||||
self._x_inset = x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
self._x_inset = x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -94,7 +94,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
if uiscale is bui.UIScale.MEDIUM
|
if uiscale is bui.UIScale.MEDIUM
|
||||||
else 800
|
else 800
|
||||||
)
|
)
|
||||||
app.classic.ui.set_main_menu_location('Coop Select')
|
app.ui_v1.set_main_menu_location('Coop Select')
|
||||||
self._r = 'coopSelectWindow'
|
self._r = 'coopSelectWindow'
|
||||||
top_extra = 20 if uiscale is bui.UIScale.SMALL else 0
|
top_extra = 20 if uiscale is bui.UIScale.SMALL else 0
|
||||||
|
|
||||||
@ -127,7 +127,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if app.classic.ui.use_toolbars and uiscale is bui.UIScale.SMALL:
|
if app.ui_v1.use_toolbars and uiscale is bui.UIScale.SMALL:
|
||||||
self._back_button = None
|
self._back_button = None
|
||||||
else:
|
else:
|
||||||
self._back_button = bui.buttonwidget(
|
self._back_button = bui.buttonwidget(
|
||||||
@ -150,7 +150,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
self._store_button_widget: bui.Widget | None
|
self._store_button_widget: bui.Widget | None
|
||||||
self._league_rank_button_widget: bui.Widget | None
|
self._league_rank_button_widget: bui.Widget | None
|
||||||
|
|
||||||
if not app.classic.ui.use_toolbars:
|
if not app.ui_v1.use_toolbars:
|
||||||
prb = self._league_rank_button = LeagueRankButton(
|
prb = self._league_rank_button = LeagueRankButton(
|
||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(
|
position=(
|
||||||
@ -232,13 +232,13 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
fallback_resource='playModes.coopText',
|
fallback_resource='playModes.coopText',
|
||||||
),
|
),
|
||||||
h_align='center',
|
h_align='center',
|
||||||
color=app.classic.ui.title_color,
|
color=app.ui_v1.title_color,
|
||||||
scale=1.5,
|
scale=1.5,
|
||||||
maxwidth=500,
|
maxwidth=500,
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
|
|
||||||
if app.classic.ui.use_toolbars and uiscale is bui.UIScale.SMALL:
|
if app.ui_v1.use_toolbars and uiscale is bui.UIScale.SMALL:
|
||||||
bui.textwidget(edit=txt, text='')
|
bui.textwidget(edit=txt, text='')
|
||||||
|
|
||||||
if self._back_button is not None:
|
if self._back_button is not None:
|
||||||
@ -261,7 +261,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
self._scroll_width = self._width - (130 + 2 * x_inset)
|
self._scroll_width = self._width - (130 + 2 * x_inset)
|
||||||
self._scroll_height = self._height - (
|
self._scroll_height = self._height - (
|
||||||
190
|
190
|
||||||
if uiscale is bui.UIScale.SMALL and app.classic.ui.use_toolbars
|
if uiscale is bui.UIScale.SMALL and app.ui_v1.use_toolbars
|
||||||
else 160
|
else 160
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -272,7 +272,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
highlight=False,
|
highlight=False,
|
||||||
position=(65 + x_inset, 120)
|
position=(65 + x_inset, 120)
|
||||||
if uiscale is bui.UIScale.SMALL and app.classic.ui.use_toolbars
|
if uiscale is bui.UIScale.SMALL and app.ui_v1.use_toolbars
|
||||||
else (65 + x_inset, 70),
|
else (65 + x_inset, 70),
|
||||||
size=(self._scroll_width, self._scroll_height),
|
size=(self._scroll_width, self._scroll_height),
|
||||||
simple_culling_v=10.0,
|
simple_culling_v=10.0,
|
||||||
@ -322,7 +322,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
|
|
||||||
def _update_corner_button_positions(self) -> None:
|
def _update_corner_button_positions(self) -> None:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
offs = (
|
offs = (
|
||||||
-55
|
-55
|
||||||
if uiscale is bui.UIScale.SMALL and bui.is_party_icon_visible()
|
if uiscale is bui.UIScale.SMALL and bui.is_party_icon_visible()
|
||||||
@ -734,7 +734,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
text='',
|
text='',
|
||||||
h_align='left',
|
h_align='left',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
scale=1.1,
|
scale=1.1,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -784,7 +784,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
text=txt,
|
text=txt,
|
||||||
h_align='left',
|
h_align='left',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
scale=1.1,
|
scale=1.1,
|
||||||
)
|
)
|
||||||
self._tournament_info_button = bui.buttonwidget(
|
self._tournament_info_button = bui.buttonwidget(
|
||||||
@ -826,7 +826,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
text=unavailable_text,
|
text=unavailable_text,
|
||||||
h_align='left',
|
h_align='left',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
scale=0.9,
|
scale=0.9,
|
||||||
)
|
)
|
||||||
v -= 40
|
v -= 40
|
||||||
@ -890,7 +890,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
),
|
),
|
||||||
h_align='left',
|
h_align='left',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
scale=1.1,
|
scale=1.1,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1029,7 +1029,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert self._league_rank_button is not None
|
assert self._league_rank_button is not None
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
LeagueRankWindow(
|
LeagueRankWindow(
|
||||||
origin_widget=self._league_rank_button.get_button()
|
origin_widget=self._league_rank_button.get_button()
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -1053,7 +1053,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert self._store_button is not None
|
assert self._store_button is not None
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
StoreBrowserWindow(
|
StoreBrowserWindow(
|
||||||
origin_widget=self._store_button.get_button(),
|
origin_widget=self._store_button.get_button(),
|
||||||
show_tab=show_tab,
|
show_tab=show_tab,
|
||||||
@ -1224,7 +1224,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlayWindow(transition='in_left').get_root_widget()
|
PlayWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1243,9 +1243,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
raise ValueError('unrecognized selection')
|
raise ValueError('unrecognized selection')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = {
|
bui.app.ui_v1.window_states[type(self)] = {'sel_name': sel_name}
|
||||||
'sel_name': sel_name
|
|
||||||
}
|
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception('Error saving state for %s.', self)
|
logging.exception('Error saving state for %s.', self)
|
||||||
|
|
||||||
@ -1257,7 +1255,7 @@ class CoopBrowserWindow(bui.Window):
|
|||||||
def _restore_state(self) -> None:
|
def _restore_state(self) -> None:
|
||||||
try:
|
try:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
sel_name = bui.app.classic.ui.window_states.get(type(self), {}).get(
|
sel_name = bui.app.ui_v1.window_states.get(type(self), {}).get(
|
||||||
'sel_name'
|
'sel_name'
|
||||||
)
|
)
|
||||||
if sel_name == 'Back':
|
if sel_name == 'Back':
|
||||||
|
|||||||
@ -15,7 +15,7 @@ class CoopLevelLockedWindow(bui.Window):
|
|||||||
height = 250.0
|
height = 250.0
|
||||||
lock_tex = bui.gettexture('lock')
|
lock_tex = bui.gettexture('lock')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(width, height),
|
size=(width, height),
|
||||||
@ -53,7 +53,7 @@ class CoopLevelLockedWindow(bui.Window):
|
|||||||
subs=[('${LEVEL}', dep_name)],
|
subs=[('${LEVEL}', dep_name)],
|
||||||
),
|
),
|
||||||
maxwidth=400,
|
maxwidth=400,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
scale=0.8,
|
scale=0.8,
|
||||||
)
|
)
|
||||||
bui.imagewidget(
|
bui.imagewidget(
|
||||||
|
|||||||
@ -36,7 +36,7 @@ class CreditsListWindow(bui.Window):
|
|||||||
transition = 'in_right'
|
transition = 'in_right'
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
width = 870 if uiscale is bui.UIScale.SMALL else 670
|
width = 870 if uiscale is bui.UIScale.SMALL else 670
|
||||||
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||||
height = 398 if uiscale is bui.UIScale.SMALL else 500
|
height = 398 if uiscale is bui.UIScale.SMALL else 500
|
||||||
@ -61,7 +61,7 @@ class CreditsListWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if bui.app.classic.ui.use_toolbars and uiscale is bui.UIScale.SMALL:
|
if bui.app.ui_v1.use_toolbars and uiscale is bui.UIScale.SMALL:
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
edit=self._root_widget, on_cancel_call=self._back
|
edit=self._root_widget, on_cancel_call=self._back
|
||||||
)
|
)
|
||||||
@ -101,7 +101,7 @@ class CreditsListWindow(bui.Window):
|
|||||||
subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))],
|
subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))],
|
||||||
),
|
),
|
||||||
h_align='center',
|
h_align='center',
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=330,
|
maxwidth=330,
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
@ -113,7 +113,7 @@ class CreditsListWindow(bui.Window):
|
|||||||
capture_arrows=True,
|
capture_arrows=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=scroll,
|
edit=scroll,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -360,6 +360,6 @@ class CreditsListWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
MainMenuWindow(transition='in_left').get_root_widget()
|
MainMenuWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|||||||
@ -19,8 +19,8 @@ class DebugWindow(bui.Window):
|
|||||||
from bauiv1lib import popup
|
from bauiv1lib import popup
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_location('Benchmarks & Stress Tests')
|
bui.app.ui_v1.set_main_menu_location('Benchmarks & Stress Tests')
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = width = 580
|
self._width = width = 580
|
||||||
self._height = height = (
|
self._height = height = (
|
||||||
350
|
350
|
||||||
@ -42,7 +42,7 @@ class DebugWindow(bui.Window):
|
|||||||
self._stress_test_round_duration = 30
|
self._stress_test_round_duration = 30
|
||||||
|
|
||||||
self._r = 'debugWindow'
|
self._r = 'debugWindow'
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(width, height),
|
size=(width, height),
|
||||||
@ -76,7 +76,7 @@ class DebugWindow(bui.Window):
|
|||||||
size=(width, 30),
|
size=(width, 30),
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
h_align='center',
|
h_align='center',
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
v_align='center',
|
v_align='center',
|
||||||
maxwidth=260,
|
maxwidth=260,
|
||||||
)
|
)
|
||||||
@ -136,7 +136,7 @@ class DebugWindow(bui.Window):
|
|||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
text=bui.Lstr(resource=self._r + '.stressTestTitleText'),
|
text=bui.Lstr(resource=self._r + '.stressTestTitleText'),
|
||||||
maxwidth=200,
|
maxwidth=200,
|
||||||
color=bui.app.classic.ui.heading_color,
|
color=bui.app.ui_v1.heading_color,
|
||||||
scale=0.85,
|
scale=0.85,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -150,7 +150,7 @@ class DebugWindow(bui.Window):
|
|||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
text=bui.Lstr(resource=self._r + '.stressTestPlaylistTypeText'),
|
text=bui.Lstr(resource=self._r + '.stressTestPlaylistTypeText'),
|
||||||
maxwidth=130,
|
maxwidth=130,
|
||||||
color=bui.app.classic.ui.heading_color,
|
color=bui.app.ui_v1.heading_color,
|
||||||
scale=0.65,
|
scale=0.65,
|
||||||
h_align='right',
|
h_align='right',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -180,7 +180,7 @@ class DebugWindow(bui.Window):
|
|||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
text=bui.Lstr(resource=self._r + '.stressTestPlaylistNameText'),
|
text=bui.Lstr(resource=self._r + '.stressTestPlaylistNameText'),
|
||||||
maxwidth=130,
|
maxwidth=130,
|
||||||
color=bui.app.classic.ui.heading_color,
|
color=bui.app.ui_v1.heading_color,
|
||||||
scale=0.65,
|
scale=0.65,
|
||||||
h_align='right',
|
h_align='right',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -381,6 +381,6 @@ class DebugWindow(bui.Window):
|
|||||||
|
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
AdvancedSettingsWindow(transition='in_left').get_root_widget()
|
AdvancedSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|||||||
@ -26,7 +26,7 @@ def ask_for_rating() -> bui.Widget | None:
|
|||||||
height = 400
|
height = 400
|
||||||
spacing = 40
|
spacing = 40
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
dlg = bui.containerwidget(
|
dlg = bui.containerwidget(
|
||||||
size=(width, height),
|
size=(width, height),
|
||||||
transition='in_right',
|
transition='in_right',
|
||||||
@ -51,7 +51,7 @@ def ask_for_rating() -> bui.Widget | None:
|
|||||||
parent=dlg,
|
parent=dlg,
|
||||||
position=(15, v - 55),
|
position=(15, v - 55),
|
||||||
size=(width - 30, 30),
|
size=(width - 30, 30),
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
text=bui.Lstr(
|
text=bui.Lstr(
|
||||||
resource='pleaseRateText',
|
resource='pleaseRateText',
|
||||||
subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))],
|
subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))],
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class FileSelectorWindow(bui.Window):
|
|||||||
if valid_file_extensions is None:
|
if valid_file_extensions is None:
|
||||||
valid_file_extensions = []
|
valid_file_extensions = []
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 700 if uiscale is bui.UIScale.SMALL else 600
|
self._width = 700 if uiscale is bui.UIScale.SMALL else 600
|
||||||
self._x_inset = x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
|
self._x_inset = x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = 365 if uiscale is bui.UIScale.SMALL else 418
|
self._height = 365 if uiscale is bui.UIScale.SMALL else 418
|
||||||
@ -68,7 +68,7 @@ class FileSelectorWindow(bui.Window):
|
|||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(self._width * 0.5, self._height - 42),
|
position=(self._width * 0.5, self._height - 42),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
text=bui.Lstr(resource=self._r + '.titleFolderText')
|
text=bui.Lstr(resource=self._r + '.titleFolderText')
|
||||||
@ -121,7 +121,7 @@ class FileSelectorWindow(bui.Window):
|
|||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(self._folder_center, self._height - 98),
|
position=(self._folder_center, self._height - 98),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
text=self._path,
|
text=self._path,
|
||||||
|
|||||||
@ -91,9 +91,9 @@ class GatherWindow(bui.Window):
|
|||||||
self._transition_out = 'out_right'
|
self._transition_out = 'out_right'
|
||||||
scale_origin = None
|
scale_origin = None
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_location('Gather')
|
bui.app.ui_v1.set_main_menu_location('Gather')
|
||||||
bui.set_party_icon_always_visible(True)
|
bui.set_party_icon_always_visible(True)
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 1240 if uiscale is bui.UIScale.SMALL else 1040
|
self._width = 1240 if uiscale is bui.UIScale.SMALL else 1040
|
||||||
x_offs = 100 if uiscale is bui.UIScale.SMALL else 0
|
x_offs = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -128,7 +128,7 @@ class GatherWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if uiscale is bui.UIScale.SMALL and bui.app.classic.ui.use_toolbars:
|
if uiscale is bui.UIScale.SMALL and bui.app.ui_v1.use_toolbars:
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
edit=self._root_widget, on_cancel_call=self._back
|
edit=self._root_widget, on_cancel_call=self._back
|
||||||
)
|
)
|
||||||
@ -161,7 +161,7 @@ class GatherWindow(bui.Window):
|
|||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(self._width * 0.5, self._height - 42 + t_offs_y),
|
position=(self._width * 0.5, self._height - 42 + t_offs_y),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
scale=(
|
scale=(
|
||||||
1.5
|
1.5
|
||||||
if not condensed
|
if not condensed
|
||||||
@ -224,7 +224,7 @@ class GatherWindow(bui.Window):
|
|||||||
if tabtype is not None:
|
if tabtype is not None:
|
||||||
self._tabs[tab_id] = tabtype(self)
|
self._tabs[tab_id] = tabtype(self)
|
||||||
|
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=self._tab_row.tabs[tabdefs[-1][0]].button,
|
edit=self._tab_row.tabs[tabdefs[-1][0]].button,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -273,8 +273,8 @@ class GatherWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.selecting_private_party_playlist = True
|
bui.app.ui_v1.selecting_private_party_playlist = True
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlayWindow(origin_widget=origin_widget).get_root_widget()
|
PlayWindow(origin_widget=origin_widget).get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ class GatherWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
raise ValueError(f'unrecognized selection: \'{sel}\'')
|
raise ValueError(f'unrecognized selection: \'{sel}\'')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = {
|
bui.app.ui_v1.window_states[type(self)] = {
|
||||||
'sel_name': sel_name,
|
'sel_name': sel_name,
|
||||||
}
|
}
|
||||||
except Exception:
|
except Exception:
|
||||||
@ -349,7 +349,7 @@ class GatherWindow(bui.Window):
|
|||||||
|
|
||||||
sel: bui.Widget | None
|
sel: bui.Widget | None
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
winstate = bui.app.classic.ui.window_states.get(type(self), {})
|
winstate = bui.app.ui_v1.window_states.get(type(self), {})
|
||||||
sel_name = winstate.get('sel_name', None)
|
sel_name = winstate.get('sel_name', None)
|
||||||
assert isinstance(sel_name, (str, type(None)))
|
assert isinstance(sel_name, (str, type(None)))
|
||||||
current_tab = self.TabID.ABOUT
|
current_tab = self.TabID.ABOUT
|
||||||
@ -388,6 +388,6 @@ class GatherWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
MainMenuWindow(transition='in_left').get_root_widget()
|
MainMenuWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|||||||
@ -179,13 +179,11 @@ class ManualGatherTab(GatherTab):
|
|||||||
|
|
||||||
def save_state(self) -> None:
|
def save_state(self) -> None:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = State(
|
bui.app.ui_v1.window_states[type(self)] = State(sub_tab=self._sub_tab)
|
||||||
sub_tab=self._sub_tab
|
|
||||||
)
|
|
||||||
|
|
||||||
def restore_state(self) -> None:
|
def restore_state(self) -> None:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
state = bui.app.classic.ui.window_states.get(type(self))
|
state = bui.app.ui_v1.window_states.get(type(self))
|
||||||
if state is None:
|
if state is None:
|
||||||
state = State()
|
state = State()
|
||||||
assert isinstance(state, State)
|
assert isinstance(state, State)
|
||||||
@ -342,7 +340,7 @@ class ManualGatherTab(GatherTab):
|
|||||||
v = c_height - 35 - 25 - 30
|
v = c_height - 35 - 25 - 30
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 1240 if uiscale is bui.UIScale.SMALL else 1040
|
self._width = 1240 if uiscale is bui.UIScale.SMALL else 1040
|
||||||
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -405,7 +403,7 @@ class ManualGatherTab(GatherTab):
|
|||||||
label=bui.Lstr(resource='gatherWindow.manualConnectText'),
|
label=bui.Lstr(resource='gatherWindow.manualConnectText'),
|
||||||
autoselect=True,
|
autoselect=True,
|
||||||
)
|
)
|
||||||
if uiscale is bui.UIScale.SMALL and bui.app.classic.ui.use_toolbars:
|
if uiscale is bui.UIScale.SMALL and bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn1,
|
edit=btn1,
|
||||||
left_widget=bui.get_special_widget('back_button'),
|
left_widget=bui.get_special_widget('back_button'),
|
||||||
@ -484,7 +482,7 @@ class ManualGatherTab(GatherTab):
|
|||||||
c_width = 600
|
c_width = 600
|
||||||
c_height = 310
|
c_height = 310
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._favorite_edit_window = cnt = bui.containerwidget(
|
self._favorite_edit_window = cnt = bui.containerwidget(
|
||||||
scale=(
|
scale=(
|
||||||
1.8
|
1.8
|
||||||
|
|||||||
@ -539,7 +539,7 @@ class PrivateGatherTab(GatherTab):
|
|||||||
and hostingstate.party_code is None
|
and hostingstate.party_code is None
|
||||||
and hostingstate.tickets_to_host_now != 0
|
and hostingstate.tickets_to_host_now != 0
|
||||||
):
|
):
|
||||||
if not bui.app.classic.ui.use_toolbars:
|
if not bui.app.ui_v1.use_toolbars:
|
||||||
if bui.app.classic.allow_ticket_purchases:
|
if bui.app.classic.allow_ticket_purchases:
|
||||||
self._get_tickets_button = bui.buttonwidget(
|
self._get_tickets_button = bui.buttonwidget(
|
||||||
parent=self._container,
|
parent=self._container,
|
||||||
@ -615,12 +615,12 @@ class PrivateGatherTab(GatherTab):
|
|||||||
|
|
||||||
# If it appears we're coming back from playlist selection,
|
# If it appears we're coming back from playlist selection,
|
||||||
# re-select our playlist button.
|
# re-select our playlist button.
|
||||||
if bui.app.classic.ui.selecting_private_party_playlist:
|
if bui.app.ui_v1.selecting_private_party_playlist:
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
edit=self._container,
|
edit=self._container,
|
||||||
selected_child=self._host_playlist_button,
|
selected_child=self._host_playlist_button,
|
||||||
)
|
)
|
||||||
bui.app.classic.ui.selecting_private_party_playlist = False
|
bui.app.ui_v1.selecting_private_party_playlist = False
|
||||||
else:
|
else:
|
||||||
# We've got a current party; show its info.
|
# We've got a current party; show its info.
|
||||||
bui.textwidget(
|
bui.textwidget(
|
||||||
@ -994,13 +994,11 @@ class PrivateGatherTab(GatherTab):
|
|||||||
|
|
||||||
def save_state(self) -> None:
|
def save_state(self) -> None:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = copy.deepcopy(
|
bui.app.ui_v1.window_states[type(self)] = copy.deepcopy(self._state)
|
||||||
self._state
|
|
||||||
)
|
|
||||||
|
|
||||||
def restore_state(self) -> None:
|
def restore_state(self) -> None:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
state = bui.app.classic.ui.window_states.get(type(self))
|
state = bui.app.ui_v1.window_states.get(type(self))
|
||||||
if state is None:
|
if state is None:
|
||||||
state = State()
|
state = State()
|
||||||
assert isinstance(state, State)
|
assert isinstance(state, State)
|
||||||
|
|||||||
@ -481,7 +481,7 @@ class PublicGatherTab(GatherTab):
|
|||||||
# be enough to make things feel nice and crisp while we do a full
|
# be enough to make things feel nice and crisp while we do a full
|
||||||
# server re-query or whatnot.
|
# server re-query or whatnot.
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = State(
|
bui.app.ui_v1.window_states[type(self)] = State(
|
||||||
sub_tab=self._sub_tab,
|
sub_tab=self._sub_tab,
|
||||||
parties=[(i, copy.copy(p)) for i, p in self._parties_sorted[:40]],
|
parties=[(i, copy.copy(p)) for i, p in self._parties_sorted[:40]],
|
||||||
next_entry_index=self._next_entry_index,
|
next_entry_index=self._next_entry_index,
|
||||||
@ -492,7 +492,7 @@ class PublicGatherTab(GatherTab):
|
|||||||
|
|
||||||
def restore_state(self) -> None:
|
def restore_state(self) -> None:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
state = bui.app.classic.ui.window_states.get(type(self))
|
state = bui.app.ui_v1.window_states.get(type(self))
|
||||||
if state is None:
|
if state is None:
|
||||||
state = State()
|
state = State()
|
||||||
assert isinstance(state, State)
|
assert isinstance(state, State)
|
||||||
@ -695,7 +695,7 @@ class PublicGatherTab(GatherTab):
|
|||||||
v_align='center',
|
v_align='center',
|
||||||
maxwidth=200,
|
maxwidth=200,
|
||||||
scale=0.8,
|
scale=0.8,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
position=(210, v - 9),
|
position=(210, v - 9),
|
||||||
text=party_name_text,
|
text=party_name_text,
|
||||||
)
|
)
|
||||||
@ -722,7 +722,7 @@ class PublicGatherTab(GatherTab):
|
|||||||
v_align='center',
|
v_align='center',
|
||||||
maxwidth=200,
|
maxwidth=200,
|
||||||
scale=0.8,
|
scale=0.8,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
position=(210, v - 9),
|
position=(210, v - 9),
|
||||||
text=bui.Lstr(
|
text=bui.Lstr(
|
||||||
resource='maxPartySizeText',
|
resource='maxPartySizeText',
|
||||||
|
|||||||
@ -52,7 +52,7 @@ class GetCurrencyWindow(bui.Window):
|
|||||||
scale_origin = None
|
scale_origin = None
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 1000.0 if uiscale is bui.UIScale.SMALL else 800.0
|
self._width = 1000.0 if uiscale is bui.UIScale.SMALL else 800.0
|
||||||
x_inset = 100.0 if uiscale is bui.UIScale.SMALL else 0.0
|
x_inset = 100.0 if uiscale is bui.UIScale.SMALL else 0.0
|
||||||
self._height = 480.0
|
self._height = 480.0
|
||||||
@ -99,7 +99,7 @@ class GetCurrencyWindow(bui.Window):
|
|||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(self._width * 0.5, self._height - 55),
|
position=(self._width * 0.5, self._height - 55),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
scale=1.2,
|
scale=1.2,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -745,7 +745,7 @@ class GetCurrencyWindow(bui.Window):
|
|||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
if not self._from_modal_store:
|
if not self._from_modal_store:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(window)
|
bui.app.ui_v1.set_main_menu_window(window)
|
||||||
self._transitioning_out = True
|
self._transitioning_out = True
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@ class GetBSRemoteWindow(PopupWindow):
|
|||||||
def __init__(self) -> None:
|
def __init__(self) -> None:
|
||||||
position = (0.0, 0.0)
|
position = (0.0, 0.0)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
scale = (
|
scale = (
|
||||||
2.3
|
2.3
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class HelpWindow(bui.Window):
|
|||||||
|
|
||||||
self._main_menu = main_menu
|
self._main_menu = main_menu
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
width = 950 if uiscale is bui.UIScale.SMALL else 750
|
width = 950 if uiscale is bui.UIScale.SMALL else 750
|
||||||
x_offs = 100 if uiscale is bui.UIScale.SMALL else 0
|
x_offs = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||||
height = (
|
height = (
|
||||||
@ -75,7 +75,7 @@ class HelpWindow(bui.Window):
|
|||||||
resource=self._r + '.titleText',
|
resource=self._r + '.titleText',
|
||||||
subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))],
|
subs=[('${APP_NAME}', bui.Lstr(resource='titleText'))],
|
||||||
),
|
),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='top',
|
v_align='top',
|
||||||
)
|
)
|
||||||
@ -91,7 +91,7 @@ class HelpWindow(bui.Window):
|
|||||||
capture_arrows=True,
|
capture_arrows=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=self._scrollwidget,
|
edit=self._scrollwidget,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -102,7 +102,7 @@ class HelpWindow(bui.Window):
|
|||||||
|
|
||||||
# ugly: create this last so it gets first dibs at touch events (since
|
# ugly: create this last so it gets first dibs at touch events (since
|
||||||
# we have it close to the scroll widget)
|
# we have it close to the scroll widget)
|
||||||
if uiscale is bui.UIScale.SMALL and bui.app.classic.ui.use_toolbars:
|
if uiscale is bui.UIScale.SMALL and bui.app.ui_v1.use_toolbars:
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
edit=self._root_widget, on_cancel_call=self._close
|
edit=self._root_widget, on_cancel_call=self._close
|
||||||
)
|
)
|
||||||
@ -706,6 +706,6 @@ class HelpWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if self._main_menu:
|
if self._main_menu:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
MainMenuWindow(transition='in_left').get_root_widget()
|
MainMenuWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class IconPicker(PopupWindow):
|
|||||||
del tint_color # unused_here
|
del tint_color # unused_here
|
||||||
del tint2_color # unused here
|
del tint2_color # unused here
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
if scale is None:
|
if scale is None:
|
||||||
scale = (
|
scale = (
|
||||||
1.85
|
1.85
|
||||||
|
|||||||
@ -355,7 +355,7 @@ class KioskWindow(bui.Window):
|
|||||||
|
|
||||||
def _restore_state(self) -> None:
|
def _restore_state(self) -> None:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
sel_name = bui.app.classic.ui.window_states.get(type(self))
|
sel_name = bui.app.ui_v1.window_states.get(type(self))
|
||||||
sel: bui.Widget | None
|
sel: bui.Widget | None
|
||||||
if sel_name == 'b1':
|
if sel_name == 'b1':
|
||||||
sel = self._b1
|
sel = self._b1
|
||||||
@ -395,7 +395,7 @@ class KioskWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
sel_name = 'b1'
|
sel_name = 'b1'
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = sel_name
|
bui.app.ui_v1.window_states[type(self)] = sel_name
|
||||||
|
|
||||||
def _update(self) -> None:
|
def _update(self) -> None:
|
||||||
plus = bui.app.plus
|
plus = bui.app.plus
|
||||||
@ -506,6 +506,4 @@ class KioskWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
bui.app.classic.did_menu_intro = True # prevent delayed transition-in
|
bui.app.classic.did_menu_intro = True # prevent delayed transition-in
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(MainMenuWindow().get_root_widget())
|
||||||
MainMenuWindow().get_root_widget()
|
|
||||||
)
|
|
||||||
|
|||||||
@ -351,7 +351,7 @@ class LeagueRankButton:
|
|||||||
fallback_resource='coopSelectWindow.powerRankingText',
|
fallback_resource='coopSelectWindow.powerRankingText',
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
t_color = bui.app.classic.ui.title_color
|
t_color = bui.app.ui_v1.title_color
|
||||||
bui.textwidget(edit=self._title_text, text=txt, color=t_color)
|
bui.textwidget(edit=self._title_text, text=txt, color=t_color)
|
||||||
bui.textwidget(edit=self._value_text, text=status_text)
|
bui.textwidget(edit=self._value_text, text=status_text)
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ class LeagueRankWindow(bui.Window):
|
|||||||
scale_origin = None
|
scale_origin = None
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 1320 if uiscale is bui.UIScale.SMALL else 1120
|
self._width = 1320 if uiscale is bui.UIScale.SMALL else 1120
|
||||||
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -119,7 +119,7 @@ class LeagueRankWindow(bui.Window):
|
|||||||
fallback_resource='coopSelectWindow.powerRankingText',
|
fallback_resource='coopSelectWindow.powerRankingText',
|
||||||
),
|
),
|
||||||
h_align='center',
|
h_align='center',
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
scale=1.4,
|
scale=1.4,
|
||||||
maxwidth=600,
|
maxwidth=600,
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -1148,6 +1148,6 @@ class LeagueRankWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if not self._modal:
|
if not self._modal:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
CoopBrowserWindow(transition='in_left').get_root_widget()
|
CoopBrowserWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|||||||
@ -212,12 +212,9 @@ class MainMenuWindow(bui.Window):
|
|||||||
|
|
||||||
app = bui.app
|
app = bui.app
|
||||||
assert app.classic is not None
|
assert app.classic is not None
|
||||||
self._have_quit_button = (
|
self._have_quit_button = app.ui_v1.uiscale is bui.UIScale.LARGE or (
|
||||||
app.classic.ui.uiscale is bui.UIScale.LARGE
|
app.classic.platform == 'windows'
|
||||||
or (
|
and app.classic.subplatform == 'oculus'
|
||||||
app.classic.platform == 'windows'
|
|
||||||
and app.classic.subplatform == 'oculus'
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
self._have_store_button = not self._in_game
|
self._have_store_button = not self._in_game
|
||||||
@ -345,7 +342,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
self._store_button = store_button = sbtn.get_button()
|
self._store_button = store_button = sbtn.get_button()
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
icon_size = (
|
icon_size = (
|
||||||
55
|
55
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
@ -440,7 +437,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
b_buffer = 10.0
|
b_buffer = 10.0
|
||||||
t_scale = 0.75
|
t_scale = 0.75
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
if uiscale is bui.UIScale.SMALL:
|
if uiscale is bui.UIScale.SMALL:
|
||||||
b_size *= 0.6
|
b_size *= 0.6
|
||||||
b_buffer *= 1.0
|
b_buffer *= 1.0
|
||||||
@ -574,7 +571,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
b_count += 1
|
b_count += 1
|
||||||
if self._have_store_button:
|
if self._have_store_button:
|
||||||
b_count += 1
|
b_count += 1
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
if uiscale is bui.UIScale.SMALL:
|
if uiscale is bui.UIScale.SMALL:
|
||||||
root_widget_scale = 1.6
|
root_widget_scale = 1.6
|
||||||
play_button_width = self._button_width * 0.65
|
play_button_width = self._button_width * 0.65
|
||||||
@ -646,7 +643,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
self._demo_menu_button = None
|
self._demo_menu_button = None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
foof = (
|
foof = (
|
||||||
-1
|
-1
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
@ -890,7 +887,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
# In this case we have a leave *and* a disconnect button.
|
# In this case we have a leave *and* a disconnect button.
|
||||||
self._height += 50
|
self._height += 50
|
||||||
self._height += 50 * (len(custom_menu_entries))
|
self._height += 50 * (len(custom_menu_entries))
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
edit=self._root_widget,
|
edit=self._root_widget,
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
@ -1053,7 +1050,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
KioskWindow(transition='in_left').get_root_widget()
|
KioskWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1064,7 +1061,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
AccountSettingsWindow(
|
AccountSettingsWindow(
|
||||||
origin_widget=self._account_button
|
origin_widget=self._account_button
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -1084,7 +1081,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
StoreBrowserWindow(
|
StoreBrowserWindow(
|
||||||
origin_widget=self._store_button
|
origin_widget=self._store_button
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -1172,7 +1169,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
CreditsListWindow(
|
CreditsListWindow(
|
||||||
origin_widget=self._credits_button
|
origin_widget=self._credits_button
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -1185,7 +1182,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
HelpWindow(
|
HelpWindow(
|
||||||
main_menu=True, origin_widget=self._how_to_play_button
|
main_menu=True, origin_widget=self._how_to_play_button
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -1198,7 +1195,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
AllSettingsWindow(
|
AllSettingsWindow(
|
||||||
origin_widget=self._settings_button
|
origin_widget=self._settings_button
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -1220,7 +1217,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
if self._in_game:
|
if self._in_game:
|
||||||
return
|
return
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
ui = bui.app.classic.ui
|
ui = bui.app.ui_v1
|
||||||
sel = self._root_widget.get_selected_child()
|
sel = self._root_widget.get_selected_child()
|
||||||
if sel == self._start_button:
|
if sel == self._start_button:
|
||||||
ui.main_menu_selection = 'Start'
|
ui.main_menu_selection = 'Start'
|
||||||
@ -1253,7 +1250,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
if self._in_game:
|
if self._in_game:
|
||||||
return
|
return
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
sel_name = bui.app.classic.ui.main_menu_selection
|
sel_name = bui.app.ui_v1.main_menu_selection
|
||||||
sel: bui.Widget | None
|
sel: bui.Widget | None
|
||||||
if sel_name is None:
|
if sel_name is None:
|
||||||
sel_name = 'Start'
|
sel_name = 'Start'
|
||||||
@ -1287,7 +1284,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
GatherWindow(origin_widget=self._gather_button).get_root_widget()
|
GatherWindow(origin_widget=self._gather_button).get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1298,7 +1295,7 @@ class MainMenuWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
WatchWindow(origin_widget=self._watch_button).get_root_widget()
|
WatchWindow(origin_widget=self._watch_button).get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1310,8 +1307,8 @@ class MainMenuWindow(bui.Window):
|
|||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.selecting_private_party_playlist = False
|
bui.app.ui_v1.selecting_private_party_playlist = False
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlayWindow(origin_widget=self._start_button).get_root_widget()
|
PlayWindow(origin_widget=self._start_button).get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1320,9 +1317,9 @@ class MainMenuWindow(bui.Window):
|
|||||||
bui.app.classic.resume()
|
bui.app.classic.resume()
|
||||||
if self._root_widget:
|
if self._root_widget:
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
bui.app.classic.ui.clear_main_menu_window()
|
bui.app.ui_v1.clear_main_menu_window()
|
||||||
|
|
||||||
# If there's callbacks waiting for this window to go away, call them.
|
# If there's callbacks waiting for this window to go away, call them.
|
||||||
for call in bui.app.classic.main_menu_resume_callbacks:
|
for call in bui.app.ui_v1.main_menu_resume_callbacks:
|
||||||
call()
|
call()
|
||||||
del bui.app.classic.main_menu_resume_callbacks[:]
|
del bui.app.ui_v1.main_menu_resume_callbacks[:]
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class PartyWindow(bui.Window):
|
|||||||
self._popup_party_member_is_host: bool | None = None
|
self._popup_party_member_is_host: bool | None = None
|
||||||
self._width = 500
|
self._width = 500
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._height = (
|
self._height = (
|
||||||
365
|
365
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
@ -219,7 +219,7 @@ class PartyWindow(bui.Window):
|
|||||||
def _on_menu_button_press(self) -> None:
|
def _on_menu_button_press(self) -> None:
|
||||||
is_muted = bui.app.config.resolve('Chat Muted')
|
is_muted = bui.app.config.resolve('Chat Muted')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
PopupMenuWindow(
|
PopupMenuWindow(
|
||||||
position=self._menu_button.get_screen_space_center(),
|
position=self._menu_button.get_screen_space_center(),
|
||||||
scale=(
|
scale=(
|
||||||
@ -472,7 +472,7 @@ class PartyWindow(bui.Window):
|
|||||||
return
|
return
|
||||||
kick_str = bui.Lstr(resource='kickVoteText')
|
kick_str = bui.Lstr(resource='kickVoteText')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
PopupMenuWindow(
|
PopupMenuWindow(
|
||||||
position=widget.get_screen_space_center(),
|
position=widget.get_screen_space_center(),
|
||||||
scale=(
|
scale=(
|
||||||
|
|||||||
@ -224,7 +224,7 @@ class PartyQueueWindow(bui.Window):
|
|||||||
|
|
||||||
def __init__(self, queue_id: str, address: str, port: int):
|
def __init__(self, queue_id: str, address: str, port: int):
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.have_party_queue_window = True
|
bui.app.ui_v1.have_party_queue_window = True
|
||||||
self._address = address
|
self._address = address
|
||||||
self._port = port
|
self._port = port
|
||||||
self._queue_id = queue_id
|
self._queue_id = queue_id
|
||||||
@ -266,7 +266,7 @@ class PartyQueueWindow(bui.Window):
|
|||||||
self._line_image: bui.Widget | None = None
|
self._line_image: bui.Widget | None = None
|
||||||
self.eyes_mesh: bui.Mesh = bui.getmesh('plasticEyesTransparent')
|
self.eyes_mesh: bui.Mesh = bui.getmesh('plasticEyesTransparent')
|
||||||
self._white_tex = bui.gettexture('white')
|
self._white_tex = bui.gettexture('white')
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
@ -333,7 +333,7 @@ class PartyQueueWindow(bui.Window):
|
|||||||
assert plus is not None
|
assert plus is not None
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.have_party_queue_window = False
|
bui.app.ui_v1.have_party_queue_window = False
|
||||||
plus.add_v1_account_transaction(
|
plus.add_v1_account_transaction(
|
||||||
{'type': 'PARTY_QUEUE_REMOVE', 'q': self._queue_id}
|
{'type': 'PARTY_QUEUE_REMOVE', 'q': self._queue_id}
|
||||||
)
|
)
|
||||||
|
|||||||
@ -29,11 +29,9 @@ class PlayWindow(bui.Window):
|
|||||||
# We can currently be used either for main menu duty or for selecting
|
# We can currently be used either for main menu duty or for selecting
|
||||||
# playlists (should make this more elegant/general).
|
# playlists (should make this more elegant/general).
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
self._is_main_menu = (
|
self._is_main_menu = not bui.app.ui_v1.selecting_private_party_playlist
|
||||||
not bui.app.classic.ui.selecting_private_party_playlist
|
|
||||||
)
|
|
||||||
|
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
width = 1000 if uiscale is bui.UIScale.SMALL else 800
|
width = 1000 if uiscale is bui.UIScale.SMALL else 800
|
||||||
x_offs = 100 if uiscale is bui.UIScale.SMALL else 0
|
x_offs = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||||
height = 550
|
height = 550
|
||||||
@ -92,7 +90,7 @@ class PlayWindow(bui.Window):
|
|||||||
scale=1.7,
|
scale=1.7,
|
||||||
res_scale=2.0,
|
res_scale=2.0,
|
||||||
maxwidth=400,
|
maxwidth=400,
|
||||||
color=bui.app.classic.ui.heading_color,
|
color=bui.app.ui_v1.heading_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
@ -103,7 +101,7 @@ class PlayWindow(bui.Window):
|
|||||||
size=(60, 60),
|
size=(60, 60),
|
||||||
label=bui.charstr(bui.SpecialChar.BACK),
|
label=bui.charstr(bui.SpecialChar.BACK),
|
||||||
)
|
)
|
||||||
if bui.app.classic.ui.use_toolbars and uiscale is bui.UIScale.SMALL:
|
if bui.app.ui_v1.use_toolbars and uiscale is bui.UIScale.SMALL:
|
||||||
bui.textwidget(edit=txt, text='')
|
bui.textwidget(edit=txt, text='')
|
||||||
|
|
||||||
v = height - (110 if self._is_main_menu else 90)
|
v = height - (110 if self._is_main_menu else 90)
|
||||||
@ -112,7 +110,7 @@ class PlayWindow(bui.Window):
|
|||||||
v -= 280 if self._is_main_menu else 180
|
v -= 280 if self._is_main_menu else 180
|
||||||
v += (
|
v += (
|
||||||
30
|
30
|
||||||
if bui.app.classic.ui.use_toolbars and uiscale is bui.UIScale.SMALL
|
if bui.app.ui_v1.use_toolbars and uiscale is bui.UIScale.SMALL
|
||||||
else 0
|
else 0
|
||||||
)
|
)
|
||||||
hoffs = x_offs + 80 if self._is_main_menu else x_offs - 100
|
hoffs = x_offs + 80 if self._is_main_menu else x_offs - 100
|
||||||
@ -155,7 +153,7 @@ class PlayWindow(bui.Window):
|
|||||||
on_activate_call=self._coop,
|
on_activate_call=self._coop,
|
||||||
)
|
)
|
||||||
|
|
||||||
if bui.app.classic.ui.use_toolbars and uiscale is bui.UIScale.SMALL:
|
if bui.app.ui_v1.use_toolbars and uiscale is bui.UIScale.SMALL:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
left_widget=bui.get_special_widget('back_button'),
|
left_widget=bui.get_special_widget('back_button'),
|
||||||
@ -258,7 +256,7 @@ class PlayWindow(bui.Window):
|
|||||||
on_activate_call=self._team_tourney,
|
on_activate_call=self._team_tourney,
|
||||||
)
|
)
|
||||||
|
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
up_widget=bui.get_special_widget('tickets_plus_button'),
|
up_widget=bui.get_special_widget('tickets_plus_button'),
|
||||||
@ -491,7 +489,7 @@ class PlayWindow(bui.Window):
|
|||||||
color=clr,
|
color=clr,
|
||||||
)
|
)
|
||||||
|
|
||||||
if bui.app.classic.ui.use_toolbars and uiscale is bui.UIScale.SMALL:
|
if bui.app.ui_v1.use_toolbars and uiscale is bui.UIScale.SMALL:
|
||||||
back_button.delete()
|
back_button.delete()
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
edit=self._root_widget,
|
edit=self._root_widget,
|
||||||
@ -528,7 +526,7 @@ class PlayWindow(bui.Window):
|
|||||||
|
|
||||||
self._save_state()
|
self._save_state()
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
MainMenuWindow(transition='in_left').get_root_widget()
|
MainMenuWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
@ -539,7 +537,7 @@ class PlayWindow(bui.Window):
|
|||||||
|
|
||||||
self._save_state()
|
self._save_state()
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
GatherWindow(transition='in_left').get_root_widget()
|
GatherWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
@ -560,7 +558,7 @@ class PlayWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
CoopBrowserWindow(origin_widget=self._coop_button).get_root_widget()
|
CoopBrowserWindow(origin_widget=self._coop_button).get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -571,7 +569,7 @@ class PlayWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistBrowserWindow(
|
PlaylistBrowserWindow(
|
||||||
origin_widget=self._teams_button, sessiontype=bs.DualTeamSession
|
origin_widget=self._teams_button, sessiontype=bs.DualTeamSession
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -584,7 +582,7 @@ class PlayWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistBrowserWindow(
|
PlaylistBrowserWindow(
|
||||||
origin_widget=self._free_for_all_button,
|
origin_widget=self._free_for_all_button,
|
||||||
sessiontype=bs.FreeForAllSession,
|
sessiontype=bs.FreeForAllSession,
|
||||||
@ -723,14 +721,14 @@ class PlayWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
raise ValueError(f'unrecognized selection {sel}')
|
raise ValueError(f'unrecognized selection {sel}')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = sel_name
|
bui.app.ui_v1.window_states[type(self)] = sel_name
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception('Error saving state for %s.', self)
|
logging.exception('Error saving state for %s.', self)
|
||||||
|
|
||||||
def _restore_state(self) -> None:
|
def _restore_state(self) -> None:
|
||||||
try:
|
try:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
sel_name = bui.app.classic.ui.window_states.get(type(self))
|
sel_name = bui.app.ui_v1.window_states.get(type(self))
|
||||||
if sel_name == 'Team Games':
|
if sel_name == 'Team Games':
|
||||||
sel = self._teams_button
|
sel = self._teams_button
|
||||||
elif sel_name == 'Co-op Games' and self._coop_button is not None:
|
elif sel_name == 'Co-op Games' and self._coop_button is not None:
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class PlaylistAddGameWindow(bui.Window):
|
|||||||
self._editcontroller = editcontroller
|
self._editcontroller = editcontroller
|
||||||
self._r = 'addGameWindow'
|
self._r = 'addGameWindow'
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 750 if uiscale is bui.UIScale.SMALL else 650
|
self._width = 750 if uiscale is bui.UIScale.SMALL else 650
|
||||||
x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -74,7 +74,7 @@ class PlaylistAddGameWindow(bui.Window):
|
|||||||
on_activate_call=self._add,
|
on_activate_call=self._add,
|
||||||
)
|
)
|
||||||
|
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=select_button,
|
edit=select_button,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -87,7 +87,7 @@ class PlaylistAddGameWindow(bui.Window):
|
|||||||
scale=1.0,
|
scale=1.0,
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
h_align='center',
|
h_align='center',
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=250,
|
maxwidth=250,
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
|
|||||||
@ -39,12 +39,10 @@ class PlaylistBrowserWindow(bui.Window):
|
|||||||
|
|
||||||
# Store state for when we exit the next game.
|
# Store state for when we exit the next game.
|
||||||
if issubclass(sessiontype, bs.DualTeamSession):
|
if issubclass(sessiontype, bs.DualTeamSession):
|
||||||
bui.app.classic.ui.set_main_menu_location('Team Game Select')
|
bui.app.ui_v1.set_main_menu_location('Team Game Select')
|
||||||
bui.set_analytics_screen('Teams Window')
|
bui.set_analytics_screen('Teams Window')
|
||||||
elif issubclass(sessiontype, bs.FreeForAllSession):
|
elif issubclass(sessiontype, bs.FreeForAllSession):
|
||||||
bui.app.classic.ui.set_main_menu_location(
|
bui.app.ui_v1.set_main_menu_location('Free-for-All Game Select')
|
||||||
'Free-for-All Game Select'
|
|
||||||
)
|
|
||||||
bui.set_analytics_screen('FreeForAll Window')
|
bui.set_analytics_screen('FreeForAll Window')
|
||||||
else:
|
else:
|
||||||
raise TypeError(f'Invalid sessiontype: {sessiontype}.')
|
raise TypeError(f'Invalid sessiontype: {sessiontype}.')
|
||||||
@ -63,7 +61,7 @@ class PlaylistBrowserWindow(bui.Window):
|
|||||||
self._pvars.config_name + ' Playlist Selection'
|
self._pvars.config_name + ' Playlist Selection'
|
||||||
)
|
)
|
||||||
|
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 900.0 if uiscale is bui.UIScale.SMALL else 800.0
|
self._width = 900.0 if uiscale is bui.UIScale.SMALL else 800.0
|
||||||
x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -115,11 +113,11 @@ class PlaylistBrowserWindow(bui.Window):
|
|||||||
text=self._pvars.window_title_name,
|
text=self._pvars.window_title_name,
|
||||||
scale=1.3,
|
scale=1.3,
|
||||||
res_scale=1.5,
|
res_scale=1.5,
|
||||||
color=bui.app.classic.ui.heading_color,
|
color=bui.app.ui_v1.heading_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
if uiscale is bui.UIScale.SMALL and bui.app.classic.ui.use_toolbars:
|
if uiscale is bui.UIScale.SMALL and bui.app.ui_v1.use_toolbars:
|
||||||
bui.textwidget(edit=txt, text='')
|
bui.textwidget(edit=txt, text='')
|
||||||
|
|
||||||
bui.buttonwidget(
|
bui.buttonwidget(
|
||||||
@ -130,7 +128,7 @@ class PlaylistBrowserWindow(bui.Window):
|
|||||||
label=bui.charstr(bui.SpecialChar.BACK),
|
label=bui.charstr(bui.SpecialChar.BACK),
|
||||||
)
|
)
|
||||||
|
|
||||||
if uiscale is bui.UIScale.SMALL and bui.app.classic.ui.use_toolbars:
|
if uiscale is bui.UIScale.SMALL and bui.app.ui_v1.use_toolbars:
|
||||||
self._back_button.delete()
|
self._back_button.delete()
|
||||||
self._back_button = None
|
self._back_button = None
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
@ -142,7 +140,7 @@ class PlaylistBrowserWindow(bui.Window):
|
|||||||
self._scroll_width = self._width - (100 + 2 * x_inset)
|
self._scroll_width = self._width - (100 + 2 * x_inset)
|
||||||
self._scroll_height = self._height - (
|
self._scroll_height = self._height - (
|
||||||
146
|
146
|
||||||
if uiscale is bui.UIScale.SMALL and bui.app.classic.ui.use_toolbars
|
if uiscale is bui.UIScale.SMALL and bui.app.ui_v1.use_toolbars
|
||||||
else 136
|
else 136
|
||||||
)
|
)
|
||||||
self._scrollwidget = bui.scrollwidget(
|
self._scrollwidget = bui.scrollwidget(
|
||||||
@ -387,7 +385,7 @@ class PlaylistBrowserWindow(bui.Window):
|
|||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
scale=1.0,
|
scale=1.0,
|
||||||
maxwidth=400,
|
maxwidth=400,
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='left',
|
h_align='left',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
@ -402,7 +400,7 @@ class PlaylistBrowserWindow(bui.Window):
|
|||||||
h_offs = 225 if count == 1 else 115 if count == 2 else 0
|
h_offs = 225 if count == 1 else 115 if count == 2 else 0
|
||||||
h_offs_bottom = 0
|
h_offs_bottom = 0
|
||||||
|
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
for y in range(rows):
|
for y in range(rows):
|
||||||
for x in range(columns):
|
for x in range(columns):
|
||||||
name = items[index][0]
|
name = items[index][0]
|
||||||
@ -427,7 +425,7 @@ class PlaylistBrowserWindow(bui.Window):
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
x == 0
|
x == 0
|
||||||
and bui.app.classic.ui.use_toolbars
|
and bui.app.ui_v1.use_toolbars
|
||||||
and uiscale is bui.UIScale.SMALL
|
and uiscale is bui.UIScale.SMALL
|
||||||
):
|
):
|
||||||
bui.widget(
|
bui.widget(
|
||||||
@ -436,7 +434,7 @@ class PlaylistBrowserWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if (
|
if (
|
||||||
x == columns - 1
|
x == columns - 1
|
||||||
and bui.app.classic.ui.use_toolbars
|
and bui.app.ui_v1.use_toolbars
|
||||||
and uiscale is bui.UIScale.SMALL
|
and uiscale is bui.UIScale.SMALL
|
||||||
):
|
):
|
||||||
bui.widget(
|
bui.widget(
|
||||||
@ -690,7 +688,7 @@ class PlaylistBrowserWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistCustomizeBrowserWindow(
|
PlaylistCustomizeBrowserWindow(
|
||||||
origin_widget=self._customize_button,
|
origin_widget=self._customize_button,
|
||||||
sessiontype=self._sessiontype,
|
sessiontype=self._sessiontype,
|
||||||
@ -718,7 +716,7 @@ class PlaylistBrowserWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlayWindow(transition='in_left').get_root_widget()
|
PlayWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -737,14 +735,14 @@ class PlaylistBrowserWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
raise RuntimeError('Unrecognized selected widget.')
|
raise RuntimeError('Unrecognized selected widget.')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = sel_name
|
bui.app.ui_v1.window_states[type(self)] = sel_name
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception('Error saving state for %s.', self)
|
logging.exception('Error saving state for %s.', self)
|
||||||
|
|
||||||
def _restore_state(self) -> None:
|
def _restore_state(self) -> None:
|
||||||
try:
|
try:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
sel_name = bui.app.classic.ui.window_states.get(type(self))
|
sel_name = bui.app.ui_v1.window_states.get(type(self))
|
||||||
if sel_name == 'Back':
|
if sel_name == 'Back':
|
||||||
sel = self._back_button
|
sel = self._back_button
|
||||||
elif sel_name == 'Scroll':
|
elif sel_name == 'Scroll':
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class PlaylistCustomizeBrowserWindow(bui.Window):
|
|||||||
self._max_playlists = 30
|
self._max_playlists = 30
|
||||||
self._r = 'gameListWindow'
|
self._r = 'gameListWindow'
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 750.0 if uiscale is bui.UIScale.SMALL else 650.0
|
self._width = 750.0 if uiscale is bui.UIScale.SMALL else 650.0
|
||||||
x_inset = 50.0 if uiscale is bui.UIScale.SMALL else 0.0
|
x_inset = 50.0 if uiscale is bui.UIScale.SMALL else 0.0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -95,7 +95,7 @@ class PlaylistCustomizeBrowserWindow(bui.Window):
|
|||||||
resource=self._r + '.titleText',
|
resource=self._r + '.titleText',
|
||||||
subs=[('${TYPE}', self._pvars.window_title_name)],
|
subs=[('${TYPE}', self._pvars.window_title_name)],
|
||||||
),
|
),
|
||||||
color=bui.app.classic.ui.heading_color,
|
color=bui.app.ui_v1.heading_color,
|
||||||
maxwidth=290,
|
maxwidth=290,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -286,7 +286,7 @@ class PlaylistCustomizeBrowserWindow(bui.Window):
|
|||||||
edit=scrollwidget,
|
edit=scrollwidget,
|
||||||
left_widget=new_button,
|
left_widget=new_button,
|
||||||
right_widget=bui.get_special_widget('party_button')
|
right_widget=bui.get_special_widget('party_button')
|
||||||
if bui.app.classic.ui.use_toolbars
|
if bui.app.ui_v1.use_toolbars
|
||||||
else None,
|
else None,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ class PlaylistCustomizeBrowserWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
browser.PlaylistBrowserWindow(
|
browser.PlaylistBrowserWindow(
|
||||||
transition='in_left', sessiontype=self._sessiontype
|
transition='in_left', sessiontype=self._sessiontype
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class PlaylistEditWindow(bui.Window):
|
|||||||
prev_selection = self._editcontroller.get_edit_ui_selection()
|
prev_selection = self._editcontroller.get_edit_ui_selection()
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 770 if uiscale is bui.UIScale.SMALL else 670
|
self._width = 770 if uiscale is bui.UIScale.SMALL else 670
|
||||||
x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -78,7 +78,7 @@ class PlaylistEditWindow(bui.Window):
|
|||||||
text_scale=1.2,
|
text_scale=1.2,
|
||||||
)
|
)
|
||||||
|
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -95,7 +95,7 @@ class PlaylistEditWindow(bui.Window):
|
|||||||
position=(-10, self._height - 50),
|
position=(-10, self._height - 50),
|
||||||
size=(self._width, 25),
|
size=(self._width, 25),
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
scale=1.05,
|
scale=1.05,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -286,7 +286,7 @@ class PlaylistEditWindow(bui.Window):
|
|||||||
bui.getsound('powerdown01').play()
|
bui.getsound('powerdown01').play()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistCustomizeBrowserWindow(
|
PlaylistCustomizeBrowserWindow(
|
||||||
transition='in_left',
|
transition='in_left',
|
||||||
sessiontype=self._editcontroller.get_session_type(),
|
sessiontype=self._editcontroller.get_session_type(),
|
||||||
@ -375,7 +375,7 @@ class PlaylistEditWindow(bui.Window):
|
|||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
bui.getsound('gunCocking').play()
|
bui.getsound('gunCocking').play()
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistCustomizeBrowserWindow(
|
PlaylistCustomizeBrowserWindow(
|
||||||
transition='in_left',
|
transition='in_left',
|
||||||
sessiontype=self._editcontroller.get_session_type(),
|
sessiontype=self._editcontroller.get_session_type(),
|
||||||
|
|||||||
@ -89,7 +89,7 @@ class PlaylistEditController:
|
|||||||
self._edit_ui_selection = 'add_button'
|
self._edit_ui_selection = 'add_button'
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistEditWindow(
|
PlaylistEditWindow(
|
||||||
editcontroller=self, transition=transition
|
editcontroller=self, transition=transition
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -148,8 +148,8 @@ class PlaylistEditController:
|
|||||||
from bauiv1lib.playlist.addgame import PlaylistAddGameWindow
|
from bauiv1lib.playlist.addgame import PlaylistAddGameWindow
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.clear_main_menu_window(transition='out_left')
|
bui.app.ui_v1.clear_main_menu_window(transition='out_left')
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistAddGameWindow(editcontroller=self).get_root_widget()
|
PlaylistAddGameWindow(editcontroller=self).get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -171,8 +171,8 @@ class PlaylistEditController:
|
|||||||
from bauiv1lib.playlist.edit import PlaylistEditWindow
|
from bauiv1lib.playlist.edit import PlaylistEditWindow
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.clear_main_menu_window(transition='out_right')
|
bui.app.ui_v1.clear_main_menu_window(transition='out_right')
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistEditWindow(
|
PlaylistEditWindow(
|
||||||
editcontroller=self, transition='in_left'
|
editcontroller=self, transition='in_left'
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -201,10 +201,8 @@ class PlaylistEditController:
|
|||||||
# If we were editing, go back to our list.
|
# If we were editing, go back to our list.
|
||||||
if self._editing_game:
|
if self._editing_game:
|
||||||
bui.getsound('powerdown01').play()
|
bui.getsound('powerdown01').play()
|
||||||
bui.app.classic.ui.clear_main_menu_window(
|
bui.app.ui_v1.clear_main_menu_window(transition='out_right')
|
||||||
transition='out_right'
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
)
|
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
|
||||||
PlaylistEditWindow(
|
PlaylistEditWindow(
|
||||||
editcontroller=self, transition='in_left'
|
editcontroller=self, transition='in_left'
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -212,10 +210,8 @@ class PlaylistEditController:
|
|||||||
|
|
||||||
# Otherwise we were adding; go back to the add type choice list.
|
# Otherwise we were adding; go back to the add type choice list.
|
||||||
else:
|
else:
|
||||||
bui.app.classic.ui.clear_main_menu_window(
|
bui.app.ui_v1.clear_main_menu_window(transition='out_right')
|
||||||
transition='out_right'
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
)
|
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
|
||||||
PlaylistAddGameWindow(
|
PlaylistAddGameWindow(
|
||||||
editcontroller=self, transition='in_left'
|
editcontroller=self, transition='in_left'
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -236,8 +232,8 @@ class PlaylistEditController:
|
|||||||
self._selected_index = insert_index
|
self._selected_index = insert_index
|
||||||
|
|
||||||
bui.getsound('gunCocking').play()
|
bui.getsound('gunCocking').play()
|
||||||
bui.app.classic.ui.clear_main_menu_window(transition='out_right')
|
bui.app.ui_v1.clear_main_menu_window(transition='out_right')
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistEditWindow(
|
PlaylistEditWindow(
|
||||||
editcontroller=self, transition='in_left'
|
editcontroller=self, transition='in_left'
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
|
|||||||
@ -102,7 +102,7 @@ class PlaylistEditGameWindow(bui.Window):
|
|||||||
|
|
||||||
self._choice_selections: dict[str, int] = {}
|
self._choice_selections: dict[str, int] = {}
|
||||||
|
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
width = 720 if uiscale is bui.UIScale.SMALL else 620
|
width = 720 if uiscale is bui.UIScale.SMALL else 620
|
||||||
x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
|
||||||
height = (
|
height = (
|
||||||
@ -165,7 +165,7 @@ class PlaylistEditGameWindow(bui.Window):
|
|||||||
else bui.Lstr(resource='doneText'),
|
else bui.Lstr(resource='doneText'),
|
||||||
)
|
)
|
||||||
|
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
pbtn = bui.get_special_widget('party_button')
|
pbtn = bui.get_special_widget('party_button')
|
||||||
bui.widget(edit=add_button, right_widget=pbtn, up_widget=pbtn)
|
bui.widget(edit=add_button, right_widget=pbtn, up_widget=pbtn)
|
||||||
|
|
||||||
@ -174,7 +174,7 @@ class PlaylistEditGameWindow(bui.Window):
|
|||||||
position=(-8, height - 70 + y_extra2),
|
position=(-8, height - 70 + y_extra2),
|
||||||
size=(width, 25),
|
size=(width, 25),
|
||||||
text=gametype.get_display_string(),
|
text=gametype.get_display_string(),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=235,
|
maxwidth=235,
|
||||||
scale=1.1,
|
scale=1.1,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -517,7 +517,7 @@ class PlaylistEditGameWindow(bui.Window):
|
|||||||
# Replace ourself with the map-select UI.
|
# Replace ourself with the map-select UI.
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistMapSelectWindow(
|
PlaylistMapSelectWindow(
|
||||||
self._gametype,
|
self._gametype,
|
||||||
self._sessiontype,
|
self._sessiontype,
|
||||||
|
|||||||
@ -43,7 +43,7 @@ class PlaylistMapSelectWindow(bui.Window):
|
|||||||
self._previous_map = ''
|
self._previous_map = ''
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
width = 715 if uiscale is bui.UIScale.SMALL else 615
|
width = 715 if uiscale is bui.UIScale.SMALL else 615
|
||||||
x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 50 if uiscale is bui.UIScale.SMALL else 0
|
||||||
height = (
|
height = (
|
||||||
@ -94,7 +94,7 @@ class PlaylistMapSelectWindow(bui.Window):
|
|||||||
resource='mapSelectTitleText',
|
resource='mapSelectTitleText',
|
||||||
subs=[('${GAME}', self._gametype.get_display_string())],
|
subs=[('${GAME}', self._gametype.get_display_string())],
|
||||||
),
|
),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
@ -202,7 +202,7 @@ class PlaylistMapSelectWindow(bui.Window):
|
|||||||
bui.widget(edit=btn, left_widget=self._cancel_button)
|
bui.widget(edit=btn, left_widget=self._cancel_button)
|
||||||
if y == 0:
|
if y == 0:
|
||||||
bui.widget(edit=btn, up_widget=self._cancel_button)
|
bui.widget(edit=btn, up_widget=self._cancel_button)
|
||||||
if x == columns - 1 and bui.app.classic.ui.use_toolbars:
|
if x == columns - 1 and bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -276,7 +276,7 @@ class PlaylistMapSelectWindow(bui.Window):
|
|||||||
self._config['settings']['map'] = map_name
|
self._config['settings']['map'] = map_name
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistEditGameWindow(
|
PlaylistEditGameWindow(
|
||||||
self._gametype,
|
self._gametype,
|
||||||
self._sessiontype,
|
self._sessiontype,
|
||||||
@ -298,7 +298,7 @@ class PlaylistMapSelectWindow(bui.Window):
|
|||||||
|
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PlaylistEditGameWindow(
|
PlaylistEditGameWindow(
|
||||||
self._gametype,
|
self._gametype,
|
||||||
self._sessiontype,
|
self._sessiontype,
|
||||||
|
|||||||
@ -81,7 +81,7 @@ class SharePlaylistResultsWindow(bui.Window):
|
|||||||
self._width = 450
|
self._width = 450
|
||||||
self._height = 300
|
self._height = 300
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
@ -119,7 +119,7 @@ class SharePlaylistResultsWindow(bui.Window):
|
|||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(self._width * 0.5, self._height * 0.745),
|
position=(self._width * 0.5, self._height * 0.745),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
scale=1.0,
|
scale=1.0,
|
||||||
flatness=1.0,
|
flatness=1.0,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -134,7 +134,7 @@ class SharePlaylistResultsWindow(bui.Window):
|
|||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(self._width * 0.5, self._height * 0.645),
|
position=(self._width * 0.5, self._height * 0.645),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
scale=0.6,
|
scale=0.6,
|
||||||
flatness=1.0,
|
flatness=1.0,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
|
|||||||
@ -40,9 +40,7 @@ class PlayOptionsWindow(PopupWindow):
|
|||||||
# We behave differently if we're being used for playlist selection
|
# We behave differently if we're being used for playlist selection
|
||||||
# vs starting a game directly (should make this more elegant).
|
# vs starting a game directly (should make this more elegant).
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
self._selecting_mode = (
|
self._selecting_mode = bui.app.ui_v1.selecting_private_party_playlist
|
||||||
bui.app.classic.ui.selecting_private_party_playlist
|
|
||||||
)
|
|
||||||
|
|
||||||
self._do_randomize_val = bui.app.config.get(
|
self._do_randomize_val = bui.app.config.get(
|
||||||
self._pvars.config_name + ' Playlist Randomize', 0
|
self._pvars.config_name + ' Playlist Randomize', 0
|
||||||
@ -142,7 +140,7 @@ class PlayOptionsWindow(PopupWindow):
|
|||||||
self._height += 40
|
self._height += 40
|
||||||
|
|
||||||
# Creates our _root_widget.
|
# Creates our _root_widget.
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
scale = (
|
scale = (
|
||||||
1.69
|
1.69
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
@ -479,7 +477,7 @@ class PlayOptionsWindow(PopupWindow):
|
|||||||
cfg['Private Party Host Session Type'] = typename
|
cfg['Private Party Host Session Type'] = typename
|
||||||
bui.getsound('gunCocking').play()
|
bui.getsound('gunCocking').play()
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
GatherWindow(transition='in_right').get_root_widget()
|
GatherWindow(transition='in_right').get_root_widget()
|
||||||
)
|
)
|
||||||
self._transition_out(transition='out_left')
|
self._transition_out(transition='out_left')
|
||||||
|
|||||||
@ -310,7 +310,7 @@ class PopupMenu:
|
|||||||
if choices_display is None:
|
if choices_display is None:
|
||||||
choices_display = []
|
choices_display = []
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
if scale is None:
|
if scale is None:
|
||||||
scale = (
|
scale = (
|
||||||
2.3
|
2.3
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class ProfileBrowserWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
back_label = bui.Lstr(resource='doneText')
|
back_label = bui.Lstr(resource='doneText')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 700.0 if uiscale is bui.UIScale.SMALL else 600.0
|
self._width = 700.0 if uiscale is bui.UIScale.SMALL else 600.0
|
||||||
x_inset = 50.0 if uiscale is bui.UIScale.SMALL else 0.0
|
x_inset = 50.0 if uiscale is bui.UIScale.SMALL else 0.0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -102,7 +102,7 @@ class ProfileBrowserWindow(bui.Window):
|
|||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
maxwidth=300,
|
maxwidth=300,
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
scale=0.9,
|
scale=0.9,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -176,7 +176,7 @@ class ProfileBrowserWindow(bui.Window):
|
|||||||
position=(self._width * 0.5, self._height - 71),
|
position=(self._width * 0.5, self._height - 71),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
text=bui.Lstr(resource=self._r + '.explanationText'),
|
text=bui.Lstr(resource=self._r + '.explanationText'),
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
maxwidth=self._width * 0.83,
|
maxwidth=self._width * 0.83,
|
||||||
scale=0.6,
|
scale=0.6,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -249,7 +249,7 @@ class ProfileBrowserWindow(bui.Window):
|
|||||||
|
|
||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
EditProfileWindow(
|
EditProfileWindow(
|
||||||
existing_profile=None, in_main_menu=self._in_main_menu
|
existing_profile=None, in_main_menu=self._in_main_menu
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -310,7 +310,7 @@ class ProfileBrowserWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
EditProfileWindow(
|
EditProfileWindow(
|
||||||
self._selected_profile, in_main_menu=self._in_main_menu
|
self._selected_profile, in_main_menu=self._in_main_menu
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -332,7 +332,7 @@ class ProfileBrowserWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if self._in_main_menu:
|
if self._in_main_menu:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
AccountSettingsWindow(transition='in_left').get_root_widget()
|
AccountSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -434,14 +434,14 @@ class ProfileBrowserWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
sel_name = 'Back'
|
sel_name = 'Back'
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = sel_name
|
bui.app.ui_v1.window_states[type(self)] = sel_name
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception('Error saving state for %s.', self)
|
logging.exception('Error saving state for %s.', self)
|
||||||
|
|
||||||
def _restore_state(self) -> None:
|
def _restore_state(self) -> None:
|
||||||
try:
|
try:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
sel_name = bui.app.classic.ui.window_states.get(type(self))
|
sel_name = bui.app.ui_v1.window_states.get(type(self))
|
||||||
if sel_name == 'Scroll':
|
if sel_name == 'Scroll':
|
||||||
sel = self._scrollwidget
|
sel = self._scrollwidget
|
||||||
elif sel_name == 'New':
|
elif sel_name == 'New':
|
||||||
|
|||||||
@ -20,7 +20,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
"""Transitions out and recreates ourself."""
|
"""Transitions out and recreates ourself."""
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
EditProfileWindow(
|
EditProfileWindow(
|
||||||
self.getname(), self._in_main_menu
|
self.getname(), self._in_main_menu
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -53,7 +53,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
self._color,
|
self._color,
|
||||||
self._highlight,
|
self._highlight,
|
||||||
) = bui.app.classic.get_player_profile_colors(existing_profile)
|
) = bui.app.classic.get_player_profile_colors(existing_profile)
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = width = 780.0 if uiscale is bui.UIScale.SMALL else 680.0
|
self._width = width = 780.0 if uiscale is bui.UIScale.SMALL else 680.0
|
||||||
self._x_inset = x_inset = 50.0 if uiscale is bui.UIScale.SMALL else 0.0
|
self._x_inset = x_inset = 50.0 if uiscale is bui.UIScale.SMALL else 0.0
|
||||||
self._height = height = (
|
self._height = height = (
|
||||||
@ -112,7 +112,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
if existing_profile is None
|
if existing_profile is None
|
||||||
else bui.Lstr(resource=self._r + '.titleEditText')
|
else bui.Lstr(resource=self._r + '.titleEditText')
|
||||||
),
|
),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=290,
|
maxwidth=290,
|
||||||
scale=1.0,
|
scale=1.0,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -235,7 +235,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
position=(self._width * 0.5, v - 39),
|
position=(self._width * 0.5, v - 39),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
scale=0.6,
|
scale=0.6,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
text=txtl,
|
text=txtl,
|
||||||
maxwidth=270,
|
maxwidth=270,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -286,7 +286,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
draw_controller=btn,
|
draw_controller=btn,
|
||||||
text=bui.Lstr(resource=self._r + '.iconText'),
|
text=bui.Lstr(resource=self._r + '.iconText'),
|
||||||
scale=0.7,
|
scale=0.7,
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=120,
|
maxwidth=120,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -315,7 +315,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
position=(self._width * 0.5, v - 39),
|
position=(self._width * 0.5, v - 39),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
scale=0.6,
|
scale=0.6,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
text=txtl,
|
text=txtl,
|
||||||
maxwidth=240,
|
maxwidth=240,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -362,7 +362,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
position=(self._width * 0.5, v - 43),
|
position=(self._width * 0.5, v - 43),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
scale=0.6,
|
scale=0.6,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
text=txtl,
|
text=txtl,
|
||||||
maxwidth=270,
|
maxwidth=270,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -423,7 +423,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
draw_controller=btn,
|
draw_controller=btn,
|
||||||
text=bui.Lstr(resource=self._r + '.colorText'),
|
text=bui.Lstr(resource=self._r + '.colorText'),
|
||||||
scale=0.7,
|
scale=0.7,
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=120,
|
maxwidth=120,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -451,7 +451,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
draw_controller=btn,
|
draw_controller=btn,
|
||||||
text=bui.Lstr(resource=self._r + '.characterText'),
|
text=bui.Lstr(resource=self._r + '.characterText'),
|
||||||
scale=0.7,
|
scale=0.7,
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=130,
|
maxwidth=130,
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -493,7 +493,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
draw_controller=btn,
|
draw_controller=btn,
|
||||||
text=bui.Lstr(resource=self._r + '.highlightText'),
|
text=bui.Lstr(resource=self._r + '.highlightText'),
|
||||||
scale=0.7,
|
scale=0.7,
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=120,
|
maxwidth=120,
|
||||||
)
|
)
|
||||||
self._update_character()
|
self._update_character()
|
||||||
@ -655,7 +655,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
|
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
ProfileBrowserWindow(
|
ProfileBrowserWindow(
|
||||||
'in_left',
|
'in_left',
|
||||||
selected_profile=self._existing_profile,
|
selected_profile=self._existing_profile,
|
||||||
@ -801,7 +801,7 @@ class EditProfileWindow(bui.Window):
|
|||||||
plus.run_v1_account_transactions()
|
plus.run_v1_account_transactions()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
ProfileBrowserWindow(
|
ProfileBrowserWindow(
|
||||||
'in_left',
|
'in_left',
|
||||||
selected_profile=new_name,
|
selected_profile=new_name,
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class ProfileUpgradeWindow(bui.Window):
|
|||||||
self._width = 680
|
self._width = 680
|
||||||
self._height = 350
|
self._height = 350
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._base_scale = (
|
self._base_scale = (
|
||||||
2.05
|
2.05
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
@ -90,7 +90,7 @@ class ProfileUpgradeWindow(bui.Window):
|
|||||||
position=(self._width * 0.5, self._height - 38),
|
position=(self._width * 0.5, self._height - 38),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
text=bui.Lstr(resource=self._r + '.upgradeToGlobalProfileText'),
|
text=bui.Lstr(resource=self._r + '.upgradeToGlobalProfileText'),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=self._width * 0.45,
|
maxwidth=self._width * 0.45,
|
||||||
scale=1.0,
|
scale=1.0,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -103,7 +103,7 @@ class ProfileUpgradeWindow(bui.Window):
|
|||||||
position=(self._width * 0.5, self._height - 100),
|
position=(self._width * 0.5, self._height - 100),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
text=bui.Lstr(resource=self._r + '.upgradeProfileInfoText'),
|
text=bui.Lstr(resource=self._r + '.upgradeProfileInfoText'),
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
maxwidth=self._width * 0.8,
|
maxwidth=self._width * 0.8,
|
||||||
scale=0.7,
|
scale=0.7,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -138,7 +138,7 @@ class ProfileUpgradeWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self._tickets_text: bui.Widget | None
|
self._tickets_text: bui.Widget | None
|
||||||
if not bui.app.classic.ui.use_toolbars:
|
if not bui.app.ui_v1.use_toolbars:
|
||||||
self._tickets_text = bui.textwidget(
|
self._tickets_text = bui.textwidget(
|
||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(self._width * 0.9 - 5, self._height - 30),
|
position=(self._width * 0.9 - 5, self._height - 30),
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class PromoCodeWindow(bui.Window):
|
|||||||
self._r = 'promoCodeWindow'
|
self._r = 'promoCodeWindow'
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(width, height),
|
size=(width, height),
|
||||||
@ -113,7 +113,7 @@ class PromoCodeWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if not self._modal:
|
if not self._modal:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
AdvancedSettingsWindow(transition='in_left').get_root_widget()
|
AdvancedSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ class PromoCodeWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if not self._modal:
|
if not self._modal:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
AdvancedSettingsWindow(transition='in_left').get_root_widget()
|
AdvancedSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
plus.add_v1_account_transaction(
|
plus.add_v1_account_transaction(
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class PurchaseWindow(bui.Window):
|
|||||||
self._items = list(items)
|
self._items = list(items)
|
||||||
self._width = 580
|
self._width = 580
|
||||||
self._height = 520
|
self._height = 520
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class QRCodeWindow(PopupWindow):
|
|||||||
def __init__(self, origin_widget: bui.Widget, qr_tex: bui.Texture):
|
def __init__(self, origin_widget: bui.Widget, qr_tex: bui.Texture):
|
||||||
position = origin_widget.get_screen_space_center()
|
position = origin_widget.get_screen_space_center()
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
scale = (
|
scale = (
|
||||||
2.3
|
2.3
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
|
|||||||
@ -19,7 +19,7 @@ class ReportPlayerWindow(bui.Window):
|
|||||||
|
|
||||||
overlay_stack = bui.get_special_widget('overlay_stack')
|
overlay_stack = bui.get_special_widget('overlay_stack')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class ResourceTypeInfoWindow(PopupWindow):
|
|||||||
|
|
||||||
def __init__(self, origin_widget: bui.Widget):
|
def __init__(self, origin_widget: bui.Widget):
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
scale = (
|
scale = (
|
||||||
2.3
|
2.3
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
|
|||||||
@ -43,7 +43,7 @@ class ServerDialogWindow(bui.Window):
|
|||||||
self._width = 500
|
self._width = 500
|
||||||
self._height = 160 + min(200, txt_height)
|
self._height = 160 + min(200, txt_height)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
self._transition_out = 'out_right'
|
self._transition_out = 'out_right'
|
||||||
scale_origin = None
|
scale_origin = None
|
||||||
|
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 870.0 if uiscale is bui.UIScale.SMALL else 670.0
|
self._width = 870.0 if uiscale is bui.UIScale.SMALL else 670.0
|
||||||
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -116,7 +116,7 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
|
|
||||||
self._r = 'settingsWindowAdvanced'
|
self._r = 'settingsWindowAdvanced'
|
||||||
|
|
||||||
if app.classic.ui.use_toolbars and uiscale is bui.UIScale.SMALL:
|
if app.ui_v1.use_toolbars and uiscale is bui.UIScale.SMALL:
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
edit=self._root_widget, on_cancel_call=self._do_back
|
edit=self._root_widget, on_cancel_call=self._do_back
|
||||||
)
|
)
|
||||||
@ -141,7 +141,7 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
position=(0, self._height - 52),
|
position=(0, self._height - 52),
|
||||||
size=(self._width, 25),
|
size=(self._width, 25),
|
||||||
text=bui.Lstr(resource=f'{self._r}.titleText'),
|
text=bui.Lstr(resource=f'{self._r}.titleText'),
|
||||||
color=app.classic.ui.title_color,
|
color=app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='top',
|
v_align='top',
|
||||||
)
|
)
|
||||||
@ -307,7 +307,7 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
text=bui.Lstr(resource=f'{self._r}.languageText'),
|
text=bui.Lstr(resource=f'{self._r}.languageText'),
|
||||||
maxwidth=150,
|
maxwidth=150,
|
||||||
scale=0.95,
|
scale=0.95,
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='right',
|
h_align='right',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
@ -638,7 +638,7 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
for child in self._subcontainer.get_children():
|
for child in self._subcontainer.get_children():
|
||||||
bui.widget(edit=child, show_buffer_bottom=30, show_buffer_top=20)
|
bui.widget(edit=child, show_buffer_bottom=30, show_buffer_top=20)
|
||||||
|
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
pbtn = bui.get_special_widget('party_button')
|
pbtn = bui.get_special_widget('party_button')
|
||||||
bui.widget(edit=self._scrollwidget, right_widget=pbtn)
|
bui.widget(edit=self._scrollwidget, right_widget=pbtn)
|
||||||
if self._back_button is None:
|
if self._back_button is None:
|
||||||
@ -669,7 +669,7 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
VRTestingWindow(transition='in_right').get_root_widget()
|
VRTestingWindow(transition='in_right').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -689,7 +689,7 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
NetTestingWindow(transition='in_right').get_root_widget()
|
NetTestingWindow(transition='in_right').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -711,7 +711,7 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PluginWindow(origin_widget=self._plugins_button).get_root_widget()
|
PluginWindow(origin_widget=self._plugins_button).get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -729,7 +729,7 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PromoCodeWindow(
|
PromoCodeWindow(
|
||||||
origin_widget=self._promo_code_button
|
origin_widget=self._promo_code_button
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -741,7 +741,7 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
DebugWindow(transition='in_right').get_root_widget()
|
DebugWindow(transition='in_right').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -798,9 +798,7 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
raise ValueError(f'unrecognized selection \'{sel}\'')
|
raise ValueError(f'unrecognized selection \'{sel}\'')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = {
|
bui.app.ui_v1.window_states[type(self)] = {'sel_name': sel_name}
|
||||||
'sel_name': sel_name
|
|
||||||
}
|
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception('Error saving state for %s.', self)
|
logging.exception('Error saving state for %s.', self)
|
||||||
@ -809,7 +807,7 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
# pylint: disable=too-many-branches
|
# pylint: disable=too-many-branches
|
||||||
try:
|
try:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
sel_name = bui.app.classic.ui.window_states.get(type(self), {}).get(
|
sel_name = bui.app.ui_v1.window_states.get(type(self), {}).get(
|
||||||
'sel_name'
|
'sel_name'
|
||||||
)
|
)
|
||||||
if sel_name == 'Back':
|
if sel_name == 'Back':
|
||||||
@ -895,6 +893,6 @@ class AdvancedSettingsWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
AllSettingsWindow(transition='in_left').get_root_widget()
|
AllSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|||||||
@ -39,14 +39,14 @@ class AllSettingsWindow(bui.Window):
|
|||||||
self._transition_out = 'out_right'
|
self._transition_out = 'out_right'
|
||||||
scale_origin = None
|
scale_origin = None
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
width = 900 if uiscale is bui.UIScale.SMALL else 580
|
width = 900 if uiscale is bui.UIScale.SMALL else 580
|
||||||
x_inset = 75 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 75 if uiscale is bui.UIScale.SMALL else 0
|
||||||
height = 435
|
height = 435
|
||||||
self._r = 'settingsWindow'
|
self._r = 'settingsWindow'
|
||||||
top_extra = 20 if uiscale is bui.UIScale.SMALL else 0
|
top_extra = 20 if uiscale is bui.UIScale.SMALL else 0
|
||||||
|
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(width, height + top_extra),
|
size=(width, height + top_extra),
|
||||||
@ -66,7 +66,7 @@ class AllSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
if bui.app.classic.ui.use_toolbars and uiscale is bui.UIScale.SMALL:
|
if bui.app.ui_v1.use_toolbars and uiscale is bui.UIScale.SMALL:
|
||||||
self._back_button = None
|
self._back_button = None
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
edit=self._root_widget, on_cancel_call=self._do_back
|
edit=self._root_widget, on_cancel_call=self._do_back
|
||||||
@ -90,7 +90,7 @@ class AllSettingsWindow(bui.Window):
|
|||||||
position=(0, height - 44),
|
position=(0, height - 44),
|
||||||
size=(width, 25),
|
size=(width, 25),
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
maxwidth=130,
|
maxwidth=130,
|
||||||
@ -141,7 +141,7 @@ class AllSettingsWindow(bui.Window):
|
|||||||
label='',
|
label='',
|
||||||
on_activate_call=self._do_controllers,
|
on_activate_call=self._do_controllers,
|
||||||
)
|
)
|
||||||
if bui.app.classic.ui.use_toolbars and self._back_button is None:
|
if bui.app.ui_v1.use_toolbars and self._back_button is None:
|
||||||
bbtn = bui.get_special_widget('back_button')
|
bbtn = bui.get_special_widget('back_button')
|
||||||
bui.widget(edit=ctb, left_widget=bbtn)
|
bui.widget(edit=ctb, left_widget=bbtn)
|
||||||
_b_title(
|
_b_title(
|
||||||
@ -165,7 +165,7 @@ class AllSettingsWindow(bui.Window):
|
|||||||
label='',
|
label='',
|
||||||
on_activate_call=self._do_graphics,
|
on_activate_call=self._do_graphics,
|
||||||
)
|
)
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
pbtn = bui.get_special_widget('party_button')
|
pbtn = bui.get_special_widget('party_button')
|
||||||
bui.widget(edit=gfxb, up_widget=pbtn, right_widget=pbtn)
|
bui.widget(edit=gfxb, up_widget=pbtn, right_widget=pbtn)
|
||||||
_b_title(x_offs3, v, gfxb, bui.Lstr(resource=self._r + '.graphicsText'))
|
_b_title(x_offs3, v, gfxb, bui.Lstr(resource=self._r + '.graphicsText'))
|
||||||
@ -240,7 +240,7 @@ class AllSettingsWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
MainMenuWindow(transition='in_left').get_root_widget()
|
MainMenuWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -251,7 +251,7 @@ class AllSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
ControlsSettingsWindow(
|
ControlsSettingsWindow(
|
||||||
origin_widget=self._controllers_button
|
origin_widget=self._controllers_button
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -264,7 +264,7 @@ class AllSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
GraphicsSettingsWindow(
|
GraphicsSettingsWindow(
|
||||||
origin_widget=self._graphics_button
|
origin_widget=self._graphics_button
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -277,7 +277,7 @@ class AllSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
AudioSettingsWindow(
|
AudioSettingsWindow(
|
||||||
origin_widget=self._audio_button
|
origin_widget=self._audio_button
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -290,7 +290,7 @@ class AllSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
AdvancedSettingsWindow(
|
AdvancedSettingsWindow(
|
||||||
origin_widget=self._advanced_button
|
origin_widget=self._advanced_button
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -312,16 +312,14 @@ class AllSettingsWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
raise ValueError(f'unrecognized selection \'{sel}\'')
|
raise ValueError(f'unrecognized selection \'{sel}\'')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = {
|
bui.app.ui_v1.window_states[type(self)] = {'sel_name': sel_name}
|
||||||
'sel_name': sel_name
|
|
||||||
}
|
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception('Error saving state for %s.', self)
|
logging.exception('Error saving state for %s.', self)
|
||||||
|
|
||||||
def _restore_state(self) -> None:
|
def _restore_state(self) -> None:
|
||||||
try:
|
try:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
sel_name = bui.app.classic.ui.window_states.get(type(self), {}).get(
|
sel_name = bui.app.ui_v1.window_states.get(type(self), {}).get(
|
||||||
'sel_name'
|
'sel_name'
|
||||||
)
|
)
|
||||||
sel: bui.Widget | None
|
sel: bui.Widget | None
|
||||||
|
|||||||
@ -59,7 +59,7 @@ class AudioSettingsWindow(bui.Window):
|
|||||||
show_soundtracks = True
|
show_soundtracks = True
|
||||||
height += spacing * 2.0
|
height += spacing * 2.0
|
||||||
|
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
base_scale = (
|
base_scale = (
|
||||||
2.05
|
2.05
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
@ -100,7 +100,7 @@ class AudioSettingsWindow(bui.Window):
|
|||||||
position=(width * 0.5, height - 32),
|
position=(width * 0.5, height - 32),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=180,
|
maxwidth=180,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -123,7 +123,7 @@ class AudioSettingsWindow(bui.Window):
|
|||||||
maxval=1.0,
|
maxval=1.0,
|
||||||
increment=0.1,
|
increment=0.1,
|
||||||
)
|
)
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=svne.plusbutton,
|
edit=svne.plusbutton,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -251,7 +251,7 @@ class AudioSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
stb.SoundtrackBrowserWindow(
|
stb.SoundtrackBrowserWindow(
|
||||||
origin_widget=self._soundtrack_button
|
origin_widget=self._soundtrack_button
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -266,7 +266,7 @@ class AudioSettingsWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
allsettings.AllSettingsWindow(
|
allsettings.AllSettingsWindow(
|
||||||
transition='in_left'
|
transition='in_left'
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -292,14 +292,14 @@ class AudioSettingsWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
raise ValueError(f'unrecognized selection \'{sel}\'')
|
raise ValueError(f'unrecognized selection \'{sel}\'')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = sel_name
|
bui.app.ui_v1.window_states[type(self)] = sel_name
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception('Error saving state for %s.', self)
|
logging.exception('Error saving state for %s.', self)
|
||||||
|
|
||||||
def _restore_state(self) -> None:
|
def _restore_state(self) -> None:
|
||||||
try:
|
try:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
sel_name = bui.app.classic.ui.window_states.get(type(self))
|
sel_name = bui.app.ui_v1.window_states.get(type(self))
|
||||||
sel: bui.Widget | None
|
sel: bui.Widget | None
|
||||||
if sel_name == 'SoundMinus':
|
if sel_name == 'SoundMinus':
|
||||||
sel = self._sound_volume_numedit.minusbutton
|
sel = self._sound_volume_numedit.minusbutton
|
||||||
|
|||||||
@ -109,7 +109,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
height += spacing
|
height += spacing
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
smallscale = 1.7 if show_keyboard else 2.2
|
smallscale = 1.7 if show_keyboard else 2.2
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
@ -153,7 +153,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
position=(0, height - 49),
|
position=(0, height - 49),
|
||||||
size=(width, 25),
|
size=(width, 25),
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='top',
|
v_align='top',
|
||||||
)
|
)
|
||||||
@ -176,7 +176,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
label=bui.Lstr(resource=self._r + '.configureTouchText'),
|
label=bui.Lstr(resource=self._r + '.configureTouchText'),
|
||||||
on_activate_call=self._do_touchscreen,
|
on_activate_call=self._do_touchscreen,
|
||||||
)
|
)
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -200,7 +200,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
label=bui.Lstr(resource=self._r + '.configureControllersText'),
|
label=bui.Lstr(resource=self._r + '.configureControllersText'),
|
||||||
on_activate_call=self._do_gamepads,
|
on_activate_call=self._do_gamepads,
|
||||||
)
|
)
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -229,7 +229,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
label=bui.Lstr(resource=self._r + '.configureKeyboardText'),
|
label=bui.Lstr(resource=self._r + '.configureKeyboardText'),
|
||||||
on_activate_call=self._config_keyboard,
|
on_activate_call=self._config_keyboard,
|
||||||
)
|
)
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -264,7 +264,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
label=bui.Lstr(resource=self._r + '.configureMobileText'),
|
label=bui.Lstr(resource=self._r + '.configureMobileText'),
|
||||||
on_activate_call=self._do_mobile_devices,
|
on_activate_call=self._do_mobile_devices,
|
||||||
)
|
)
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=btn,
|
edit=btn,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -307,7 +307,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
scale=0.5,
|
scale=0.5,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
maxwidth=width * 0.8,
|
maxwidth=width * 0.8,
|
||||||
)
|
)
|
||||||
v -= spacing
|
v -= spacing
|
||||||
@ -337,7 +337,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
scale=1.0,
|
scale=1.0,
|
||||||
h_align='right',
|
h_align='right',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
maxwidth=180,
|
maxwidth=180,
|
||||||
)
|
)
|
||||||
bui.textwidget(
|
bui.textwidget(
|
||||||
@ -348,7 +348,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
scale=0.5,
|
scale=0.5,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
maxwidth=width * 0.8,
|
maxwidth=width * 0.8,
|
||||||
)
|
)
|
||||||
v -= spacing * 1.5
|
v -= spacing * 1.5
|
||||||
@ -366,7 +366,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
ConfigKeyboardWindow(
|
ConfigKeyboardWindow(
|
||||||
bs.getinputdevice('Keyboard', '#1')
|
bs.getinputdevice('Keyboard', '#1')
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -379,7 +379,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
ConfigKeyboardWindow(
|
ConfigKeyboardWindow(
|
||||||
bs.getinputdevice('Keyboard', '#2')
|
bs.getinputdevice('Keyboard', '#2')
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -392,7 +392,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
RemoteAppSettingsWindow().get_root_widget()
|
RemoteAppSettingsWindow().get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -403,7 +403,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
GamepadSelectWindow().get_root_widget()
|
GamepadSelectWindow().get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -414,7 +414,7 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
TouchscreenSettingsWindow().get_root_widget()
|
TouchscreenSettingsWindow().get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -433,11 +433,11 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
sel_name = 'Back'
|
sel_name = 'Back'
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = sel_name
|
bui.app.ui_v1.window_states[type(self)] = sel_name
|
||||||
|
|
||||||
def _restore_state(self) -> None:
|
def _restore_state(self) -> None:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
sel_name = bui.app.classic.ui.window_states.get(type(self))
|
sel_name = bui.app.ui_v1.window_states.get(type(self))
|
||||||
if sel_name == 'GamePads':
|
if sel_name == 'GamePads':
|
||||||
sel = self._gamepads_button
|
sel = self._gamepads_button
|
||||||
elif sel_name == 'Touch':
|
elif sel_name == 'Touch':
|
||||||
@ -467,6 +467,6 @@ class ControlsSettingsWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
AllSettingsWindow(transition='in_left').get_root_widget()
|
AllSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|||||||
@ -46,7 +46,7 @@ class GamepadSettingsWindow(bui.Window):
|
|||||||
self._height = 440 if self._is_secondary else 450
|
self._height = 440 if self._is_secondary else 450
|
||||||
self._spacing = 40
|
self._spacing = 40
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
@ -206,7 +206,7 @@ class GamepadSettingsWindow(bui.Window):
|
|||||||
position=(0, v + 5),
|
position=(0, v + 5),
|
||||||
size=(self._width, 25),
|
size=(self._width, 25),
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=310,
|
maxwidth=310,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -218,7 +218,7 @@ class GamepadSettingsWindow(bui.Window):
|
|||||||
position=(0, v + 3),
|
position=(0, v + 3),
|
||||||
size=(self._width, 25),
|
size=(self._width, 25),
|
||||||
text=self._name,
|
text=self._name,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
maxwidth=self._width * 0.9,
|
maxwidth=self._width * 0.9,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -245,7 +245,7 @@ class GamepadSettingsWindow(bui.Window):
|
|||||||
position=(0, v + 5),
|
position=(0, v + 5),
|
||||||
size=(self._width, 25),
|
size=(self._width, 25),
|
||||||
text=bui.Lstr(resource=self._r + '.secondaryText'),
|
text=bui.Lstr(resource=self._r + '.secondaryText'),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=300,
|
maxwidth=300,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -794,7 +794,7 @@ class GamepadSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
if self._is_main_menu:
|
if self._is_main_menu:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
ControlsSettingsWindow(transition='in_left').get_root_widget()
|
ControlsSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -845,7 +845,7 @@ class GamepadSettingsWindow(bui.Window):
|
|||||||
from bauiv1lib.settings.controls import ControlsSettingsWindow
|
from bauiv1lib.settings.controls import ControlsSettingsWindow
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
ControlsSettingsWindow(transition='in_left').get_root_widget()
|
ControlsSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -871,7 +871,7 @@ class AwaitGamepadInputWindow(bui.Window):
|
|||||||
width = 400
|
width = 400
|
||||||
height = 150
|
height = 150
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
scale=(
|
scale=(
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class GamepadAdvancedSettingsWindow(bui.Window):
|
|||||||
|
|
||||||
self._r = parent_window.get_r()
|
self._r = parent_window.get_r()
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 900 if uiscale is bui.UIScale.SMALL else 700
|
self._width = 900 if uiscale is bui.UIScale.SMALL else 700
|
||||||
self._x_inset = x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
self._x_inset = x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = 402 if uiscale is bui.UIScale.SMALL else 512
|
self._height = 402 if uiscale is bui.UIScale.SMALL else 512
|
||||||
@ -62,7 +62,7 @@ class GamepadAdvancedSettingsWindow(bui.Window):
|
|||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
text=bui.Lstr(resource=self._r + '.advancedTitleText'),
|
text=bui.Lstr(resource=self._r + '.advancedTitleText'),
|
||||||
maxwidth=320,
|
maxwidth=320,
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
|
|||||||
@ -24,7 +24,7 @@ def gamepad_configure_callback(event: dict[str, Any]) -> None:
|
|||||||
bs.release_gamepad_input()
|
bs.release_gamepad_input()
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
try:
|
try:
|
||||||
bui.app.classic.ui.clear_main_menu_window(transition='out_left')
|
bui.app.ui_v1.clear_main_menu_window(transition='out_left')
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception('Error transitioning out main_menu_window.')
|
logging.exception('Error transitioning out main_menu_window.')
|
||||||
bui.getsound('activateBeep').play()
|
bui.getsound('activateBeep').play()
|
||||||
@ -32,14 +32,14 @@ def gamepad_configure_callback(event: dict[str, Any]) -> None:
|
|||||||
inputdevice = event['input_device']
|
inputdevice = event['input_device']
|
||||||
assert isinstance(inputdevice, bs.InputDevice)
|
assert isinstance(inputdevice, bs.InputDevice)
|
||||||
if inputdevice.allows_configuring:
|
if inputdevice.allows_configuring:
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
gamepad.GamepadSettingsWindow(inputdevice).get_root_widget()
|
gamepad.GamepadSettingsWindow(inputdevice).get_root_widget()
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
width = 700
|
width = 700
|
||||||
height = 200
|
height = 200
|
||||||
button_width = 100
|
button_width = 100
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
dlg = bui.containerwidget(
|
dlg = bui.containerwidget(
|
||||||
scale=(
|
scale=(
|
||||||
1.7
|
1.7
|
||||||
@ -51,7 +51,7 @@ def gamepad_configure_callback(event: dict[str, Any]) -> None:
|
|||||||
size=(width, height),
|
size=(width, height),
|
||||||
transition='in_right',
|
transition='in_right',
|
||||||
)
|
)
|
||||||
bui.app.classic.ui.set_main_menu_window(dlg)
|
bui.app.ui_v1.set_main_menu_window(dlg)
|
||||||
device_name = inputdevice.name
|
device_name = inputdevice.name
|
||||||
if device_name == 'iDevice':
|
if device_name == 'iDevice':
|
||||||
msg = bui.Lstr(
|
msg = bui.Lstr(
|
||||||
@ -78,7 +78,7 @@ def gamepad_configure_callback(event: dict[str, Any]) -> None:
|
|||||||
|
|
||||||
bui.containerwidget(edit=dlg, transition='out_right')
|
bui.containerwidget(edit=dlg, transition='out_right')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
controls.ControlsSettingsWindow(
|
controls.ControlsSettingsWindow(
|
||||||
transition='in_left'
|
transition='in_left'
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -105,7 +105,7 @@ class GamepadSelectWindow(bui.Window):
|
|||||||
self._r = 'configGamepadSelectWindow'
|
self._r = 'configGamepadSelectWindow'
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
scale=(
|
scale=(
|
||||||
@ -142,7 +142,7 @@ class GamepadSelectWindow(bui.Window):
|
|||||||
size=(width, 25),
|
size=(width, 25),
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
maxwidth=250,
|
maxwidth=250,
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
@ -163,7 +163,7 @@ class GamepadSelectWindow(bui.Window):
|
|||||||
scale=0.8,
|
scale=0.8,
|
||||||
text=bui.Lstr(resource=self._r + '.pressAnyButtonText'),
|
text=bui.Lstr(resource=self._r + '.pressAnyButtonText'),
|
||||||
maxwidth=width * 0.95,
|
maxwidth=width * 0.95,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='top',
|
v_align='top',
|
||||||
)
|
)
|
||||||
@ -189,7 +189,7 @@ class GamepadSelectWindow(bui.Window):
|
|||||||
bs.release_gamepad_input()
|
bs.release_gamepad_input()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
controls.ControlsSettingsWindow(
|
controls.ControlsSettingsWindow(
|
||||||
transition='in_left'
|
transition='in_left'
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
|
|||||||
@ -39,7 +39,7 @@ class GraphicsSettingsWindow(bui.Window):
|
|||||||
|
|
||||||
spacing = 32
|
spacing = 32
|
||||||
self._have_selected_child = False
|
self._have_selected_child = False
|
||||||
uiscale = app.classic.ui.uiscale
|
uiscale = app.ui_v1.uiscale
|
||||||
width = 450.0
|
width = 450.0
|
||||||
height = 302.0
|
height = 302.0
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ class GraphicsSettingsWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
base_scale = (
|
base_scale = (
|
||||||
2.4
|
2.4
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
@ -110,7 +110,7 @@ class GraphicsSettingsWindow(bui.Window):
|
|||||||
position=(0, height - 44),
|
position=(0, height - 44),
|
||||||
size=(width, 25),
|
size=(width, 25),
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='top',
|
v_align='top',
|
||||||
)
|
)
|
||||||
@ -161,7 +161,7 @@ class GraphicsSettingsWindow(bui.Window):
|
|||||||
xoffset=-70,
|
xoffset=-70,
|
||||||
textscale=0.85,
|
textscale=0.85,
|
||||||
)
|
)
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=gmc.plusbutton,
|
edit=gmc.plusbutton,
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -182,7 +182,7 @@ class GraphicsSettingsWindow(bui.Window):
|
|||||||
position=(60, v),
|
position=(60, v),
|
||||||
size=(160, 25),
|
size=(160, 25),
|
||||||
text=bui.Lstr(resource=self._r + '.visualsText'),
|
text=bui.Lstr(resource=self._r + '.visualsText'),
|
||||||
color=bui.app.classic.ui.heading_color,
|
color=bui.app.ui_v1.heading_color,
|
||||||
scale=0.65,
|
scale=0.65,
|
||||||
maxwidth=150,
|
maxwidth=150,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -214,7 +214,7 @@ class GraphicsSettingsWindow(bui.Window):
|
|||||||
position=(230, v),
|
position=(230, v),
|
||||||
size=(160, 25),
|
size=(160, 25),
|
||||||
text=bui.Lstr(resource=self._r + '.texturesText'),
|
text=bui.Lstr(resource=self._r + '.texturesText'),
|
||||||
color=bui.app.classic.ui.heading_color,
|
color=bui.app.ui_v1.heading_color,
|
||||||
scale=0.65,
|
scale=0.65,
|
||||||
maxwidth=150,
|
maxwidth=150,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -235,7 +235,7 @@ class GraphicsSettingsWindow(bui.Window):
|
|||||||
current_choice=bui.app.config.resolve('Texture Quality'),
|
current_choice=bui.app.config.resolve('Texture Quality'),
|
||||||
on_value_change_call=self._set_textures,
|
on_value_change_call=self._set_textures,
|
||||||
)
|
)
|
||||||
if bui.app.classic.ui.use_toolbars:
|
if bui.app.ui_v1.use_toolbars:
|
||||||
bui.widget(
|
bui.widget(
|
||||||
edit=textures_popup.get_button(),
|
edit=textures_popup.get_button(),
|
||||||
right_widget=bui.get_special_widget('party_button'),
|
right_widget=bui.get_special_widget('party_button'),
|
||||||
@ -251,7 +251,7 @@ class GraphicsSettingsWindow(bui.Window):
|
|||||||
position=(h_offs + 60, v),
|
position=(h_offs + 60, v),
|
||||||
size=(160, 25),
|
size=(160, 25),
|
||||||
text=bui.Lstr(resource=self._r + '.resolutionText'),
|
text=bui.Lstr(resource=self._r + '.resolutionText'),
|
||||||
color=bui.app.classic.ui.heading_color,
|
color=bui.app.ui_v1.heading_color,
|
||||||
scale=0.65,
|
scale=0.65,
|
||||||
maxwidth=150,
|
maxwidth=150,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -366,7 +366,7 @@ class GraphicsSettingsWindow(bui.Window):
|
|||||||
position=(230, v),
|
position=(230, v),
|
||||||
size=(160, 25),
|
size=(160, 25),
|
||||||
text=bui.Lstr(resource=self._r + '.verticalSyncText'),
|
text=bui.Lstr(resource=self._r + '.verticalSyncText'),
|
||||||
color=bui.app.classic.ui.heading_color,
|
color=bui.app.ui_v1.heading_color,
|
||||||
scale=0.65,
|
scale=0.65,
|
||||||
maxwidth=150,
|
maxwidth=150,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
@ -433,7 +433,7 @@ class GraphicsSettingsWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
allsettings.AllSettingsWindow(
|
allsettings.AllSettingsWindow(
|
||||||
transition='in_left'
|
transition='in_left'
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
|
|||||||
@ -32,7 +32,7 @@ class ConfigKeyboardWindow(bui.Window):
|
|||||||
self._height = 375
|
self._height = 375
|
||||||
self._spacing = 40
|
self._spacing = 40
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
@ -113,7 +113,7 @@ class ConfigKeyboardWindow(bui.Window):
|
|||||||
resource=self._r + '.configuringText',
|
resource=self._r + '.configuringText',
|
||||||
subs=[('${DEVICE}', self._displayname)],
|
subs=[('${DEVICE}', self._displayname)],
|
||||||
),
|
),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
maxwidth=270,
|
maxwidth=270,
|
||||||
@ -132,7 +132,7 @@ class ConfigKeyboardWindow(bui.Window):
|
|||||||
scale=0.7,
|
scale=0.7,
|
||||||
maxwidth=self._width * 0.75,
|
maxwidth=self._width * 0.75,
|
||||||
max_height=110,
|
max_height=110,
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='top',
|
v_align='top',
|
||||||
)
|
)
|
||||||
@ -267,7 +267,7 @@ class ConfigKeyboardWindow(bui.Window):
|
|||||||
|
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
ControlsSettingsWindow(transition='in_left').get_root_widget()
|
ControlsSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -307,7 +307,7 @@ class ConfigKeyboardWindow(bui.Window):
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
bui.app.config.apply_and_commit()
|
bui.app.config.apply_and_commit()
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
ControlsSettingsWindow(transition='in_left').get_root_widget()
|
ControlsSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -323,7 +323,7 @@ class AwaitKeyboardInputWindow(bui.Window):
|
|||||||
width = 400
|
width = 400
|
||||||
height = 150
|
height = 150
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(width, height),
|
size=(width, height),
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class NetTestingWindow(bui.Window):
|
|||||||
self._height = 500
|
self._height = 500
|
||||||
self._printed_lines: list[str] = []
|
self._printed_lines: list[str] = []
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
@ -135,7 +135,7 @@ class NetTestingWindow(bui.Window):
|
|||||||
|
|
||||||
def _show_val_testing(self) -> None:
|
def _show_val_testing(self) -> None:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
NetValTestingWindow().get_root_widget()
|
NetValTestingWindow().get_root_widget()
|
||||||
)
|
)
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
@ -145,7 +145,7 @@ class NetTestingWindow(bui.Window):
|
|||||||
from bauiv1lib.settings.advanced import AdvancedSettingsWindow
|
from bauiv1lib.settings.advanced import AdvancedSettingsWindow
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
AdvancedSettingsWindow(transition='in_left').get_root_widget()
|
AdvancedSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class PluginWindow(bui.Window):
|
|||||||
scale_origin = None
|
scale_origin = None
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 870.0 if uiscale is bui.UIScale.SMALL else 670.0
|
self._width = 870.0 if uiscale is bui.UIScale.SMALL else 670.0
|
||||||
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -71,7 +71,7 @@ class PluginWindow(bui.Window):
|
|||||||
self._sub_height = 724.0
|
self._sub_height = 724.0
|
||||||
|
|
||||||
assert app.classic is not None
|
assert app.classic is not None
|
||||||
if app.classic.ui.use_toolbars and uiscale is bui.UIScale.SMALL:
|
if app.ui_v1.use_toolbars and uiscale is bui.UIScale.SMALL:
|
||||||
bui.containerwidget(
|
bui.containerwidget(
|
||||||
edit=self._root_widget, on_cancel_call=self._do_back
|
edit=self._root_widget, on_cancel_call=self._do_back
|
||||||
)
|
)
|
||||||
@ -96,7 +96,7 @@ class PluginWindow(bui.Window):
|
|||||||
position=(0, self._height - 52),
|
position=(0, self._height - 52),
|
||||||
size=(self._width, 25),
|
size=(self._width, 25),
|
||||||
text=bui.Lstr(resource='pluginsText'),
|
text=bui.Lstr(resource='pluginsText'),
|
||||||
color=app.classic.ui.title_color,
|
color=app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='top',
|
v_align='top',
|
||||||
)
|
)
|
||||||
@ -244,7 +244,7 @@ class PluginWindow(bui.Window):
|
|||||||
|
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PluginSettingsWindow(transition='in_right').get_root_widget()
|
PluginSettingsWindow(transition='in_right').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -263,6 +263,6 @@ class PluginWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
AdvancedSettingsWindow(transition='in_left').get_root_widget()
|
AdvancedSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|||||||
@ -17,7 +17,7 @@ class PluginSettingsWindow(bui.Window):
|
|||||||
scale_origin = None
|
scale_origin = None
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
width = 470.0 if uiscale is bui.UIScale.SMALL else 470.0
|
width = 470.0 if uiscale is bui.UIScale.SMALL else 470.0
|
||||||
height = (
|
height = (
|
||||||
365.0
|
365.0
|
||||||
@ -66,7 +66,7 @@ class PluginSettingsWindow(bui.Window):
|
|||||||
position=(0, height - 52),
|
position=(0, height - 52),
|
||||||
size=(width, 25),
|
size=(width, 25),
|
||||||
text=bui.Lstr(resource='pluginSettingsText'),
|
text=bui.Lstr(resource='pluginSettingsText'),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='top',
|
v_align='top',
|
||||||
)
|
)
|
||||||
@ -165,6 +165,6 @@ class PluginSettingsWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
PluginWindow(transition='in_left').get_root_widget()
|
PluginWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|||||||
@ -16,7 +16,7 @@ class RemoteAppSettingsWindow(bui.Window):
|
|||||||
height = 390
|
height = 390
|
||||||
spacing = 40
|
spacing = 40
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(width, height),
|
size=(width, height),
|
||||||
@ -52,7 +52,7 @@ class RemoteAppSettingsWindow(bui.Window):
|
|||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
maxwidth=370,
|
maxwidth=370,
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
scale=0.8,
|
scale=0.8,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -140,7 +140,7 @@ class RemoteAppSettingsWindow(bui.Window):
|
|||||||
|
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
controls.ControlsSettingsWindow(
|
controls.ControlsSettingsWindow(
|
||||||
transition='in_left'
|
transition='in_left'
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class TestingWindow(bui.Window):
|
|||||||
back_call: Callable[[], bui.Window] | None = None,
|
back_call: Callable[[], bui.Window] | None = None,
|
||||||
):
|
):
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 600
|
self._width = 600
|
||||||
self._height = 324 if uiscale is bui.UIScale.SMALL else 400
|
self._height = 324 if uiscale is bui.UIScale.SMALL else 400
|
||||||
self._entries = copy.deepcopy(entries)
|
self._entries = copy.deepcopy(entries)
|
||||||
@ -60,7 +60,7 @@ class TestingWindow(bui.Window):
|
|||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(self._width * 0.5, self._height - 35),
|
position=(self._width * 0.5, self._height - 35),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
maxwidth=245,
|
maxwidth=245,
|
||||||
@ -78,7 +78,7 @@ class TestingWindow(bui.Window):
|
|||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
position=(self._width * 0.5, self._height - 75),
|
position=(self._width * 0.5, self._height - 75),
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
color=bui.app.classic.ui.infotextcolor,
|
color=bui.app.ui_v1.infotextcolor,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
maxwidth=self._width * 0.75,
|
maxwidth=self._width * 0.75,
|
||||||
@ -224,4 +224,4 @@ class TestingWindow(bui.Window):
|
|||||||
else AdvancedSettingsWindow(transition='in_left')
|
else AdvancedSettingsWindow(transition='in_left')
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(backwin.get_root_widget())
|
bui.app.ui_v1.set_main_menu_window(backwin.get_root_widget())
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class TouchscreenSettingsWindow(bui.Window):
|
|||||||
bs.set_touchscreen_editing(True)
|
bs.set_touchscreen_editing(True)
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
super().__init__(
|
super().__init__(
|
||||||
root_widget=bui.containerwidget(
|
root_widget=bui.containerwidget(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
@ -58,7 +58,7 @@ class TouchscreenSettingsWindow(bui.Window):
|
|||||||
position=(25, self._height - 50),
|
position=(25, self._height - 50),
|
||||||
size=(self._width, 25),
|
size=(self._width, 25),
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
maxwidth=280,
|
maxwidth=280,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
@ -278,7 +278,7 @@ class TouchscreenSettingsWindow(bui.Window):
|
|||||||
|
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
controls.ControlsSettingsWindow(
|
controls.ControlsSettingsWindow(
|
||||||
transition='in_left'
|
transition='in_left'
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class SoundtrackBrowserWindow(bui.Window):
|
|||||||
|
|
||||||
self._r = 'editSoundtrackWindow'
|
self._r = 'editSoundtrackWindow'
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 800 if uiscale is bui.UIScale.SMALL else 600
|
self._width = 800 if uiscale is bui.UIScale.SMALL else 600
|
||||||
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -71,7 +71,7 @@ class SoundtrackBrowserWindow(bui.Window):
|
|||||||
)
|
)
|
||||||
|
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
if bui.app.classic.ui.use_toolbars and uiscale is bui.UIScale.SMALL:
|
if bui.app.ui_v1.use_toolbars and uiscale is bui.UIScale.SMALL:
|
||||||
self._back_button = None
|
self._back_button = None
|
||||||
else:
|
else:
|
||||||
self._back_button = bui.buttonwidget(
|
self._back_button = bui.buttonwidget(
|
||||||
@ -95,7 +95,7 @@ class SoundtrackBrowserWindow(bui.Window):
|
|||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
maxwidth=300,
|
maxwidth=300,
|
||||||
text=bui.Lstr(resource=self._r + '.titleText'),
|
text=bui.Lstr(resource=self._r + '.titleText'),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
)
|
)
|
||||||
@ -246,7 +246,7 @@ class SoundtrackBrowserWindow(bui.Window):
|
|||||||
edit=self._scrollwidget,
|
edit=self._scrollwidget,
|
||||||
left_widget=self._new_button,
|
left_widget=self._new_button,
|
||||||
right_widget=bui.get_special_widget('party_button')
|
right_widget=bui.get_special_widget('party_button')
|
||||||
if bui.app.classic.ui.use_toolbars
|
if bui.app.ui_v1.use_toolbars
|
||||||
else self._scrollwidget,
|
else self._scrollwidget,
|
||||||
)
|
)
|
||||||
self._col = bui.columnwidget(parent=scrollwidget, border=2, margin=0)
|
self._col = bui.columnwidget(parent=scrollwidget, border=2, margin=0)
|
||||||
@ -399,7 +399,7 @@ class SoundtrackBrowserWindow(bui.Window):
|
|||||||
edit=self._root_widget, transition=self._transition_out
|
edit=self._root_widget, transition=self._transition_out
|
||||||
)
|
)
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
audio.AudioSettingsWindow(transition='in_left').get_root_widget()
|
audio.AudioSettingsWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -440,7 +440,7 @@ class SoundtrackBrowserWindow(bui.Window):
|
|||||||
self._save_state()
|
self._save_state()
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
SoundtrackEditWindow(
|
SoundtrackEditWindow(
|
||||||
existing_soundtrack=self._selected_soundtrack
|
existing_soundtrack=self._selected_soundtrack
|
||||||
).get_root_widget()
|
).get_root_widget()
|
||||||
@ -567,14 +567,14 @@ class SoundtrackBrowserWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
raise ValueError(f'unrecognized selection \'{sel}\'')
|
raise ValueError(f'unrecognized selection \'{sel}\'')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
bui.app.classic.ui.window_states[type(self)] = sel_name
|
bui.app.ui_v1.window_states[type(self)] = sel_name
|
||||||
except Exception:
|
except Exception:
|
||||||
logging.exception('Error saving state for %s.', self)
|
logging.exception('Error saving state for %s.', self)
|
||||||
|
|
||||||
def _restore_state(self) -> None:
|
def _restore_state(self) -> None:
|
||||||
try:
|
try:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
sel_name = bui.app.classic.ui.window_states.get(type(self))
|
sel_name = bui.app.ui_v1.window_states.get(type(self))
|
||||||
if sel_name == 'Scroll':
|
if sel_name == 'Scroll':
|
||||||
sel = self._scrollwidget
|
sel = self._scrollwidget
|
||||||
elif sel_name == 'New':
|
elif sel_name == 'New':
|
||||||
|
|||||||
@ -29,7 +29,7 @@ class SoundtrackEditWindow(bui.Window):
|
|||||||
self._folder_tex = bui.gettexture('folder')
|
self._folder_tex = bui.gettexture('folder')
|
||||||
self._file_tex = bui.gettexture('file')
|
self._file_tex = bui.gettexture('file')
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
uiscale = bui.app.classic.ui.uiscale
|
uiscale = bui.app.ui_v1.uiscale
|
||||||
self._width = 848 if uiscale is bui.UIScale.SMALL else 648
|
self._width = 848 if uiscale is bui.UIScale.SMALL else 648
|
||||||
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
x_inset = 100 if uiscale is bui.UIScale.SMALL else 0
|
||||||
self._height = (
|
self._height = (
|
||||||
@ -87,7 +87,7 @@ class SoundtrackEditWindow(bui.Window):
|
|||||||
else '.newSoundtrackText'
|
else '.newSoundtrackText'
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
color=bui.app.classic.ui.title_color,
|
color=bui.app.ui_v1.title_color,
|
||||||
h_align='center',
|
h_align='center',
|
||||||
v_align='center',
|
v_align='center',
|
||||||
maxwidth=280,
|
maxwidth=280,
|
||||||
@ -350,7 +350,7 @@ class SoundtrackEditWindow(bui.Window):
|
|||||||
else:
|
else:
|
||||||
soundtrack[musictype] = entry
|
soundtrack[musictype] = entry
|
||||||
|
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
cls(state, transition='in_left').get_root_widget()
|
cls(state, transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -368,7 +368,7 @@ class SoundtrackEditWindow(bui.Window):
|
|||||||
'last_edited_song_type': song_type,
|
'last_edited_song_type': song_type,
|
||||||
}
|
}
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
bui.containerwidget(edit=self._root_widget, transition='out_left')
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
music.get_music_player()
|
music.get_music_player()
|
||||||
.select_entry(
|
.select_entry(
|
||||||
bui.Call(self._restore_editor, state, song_type),
|
bui.Call(self._restore_editor, state, song_type),
|
||||||
@ -428,7 +428,7 @@ class SoundtrackEditWindow(bui.Window):
|
|||||||
# Resets music back to normal.
|
# Resets music back to normal.
|
||||||
music.set_music_play_mode(bui.app.classic.MusicPlayMode.REGULAR)
|
music.set_music_play_mode(bui.app.classic.MusicPlayMode.REGULAR)
|
||||||
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
bui.containerwidget(edit=self._root_widget, transition='out_right')
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
stb.SoundtrackBrowserWindow(transition='in_left').get_root_widget()
|
stb.SoundtrackBrowserWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -482,7 +482,7 @@ class SoundtrackEditWindow(bui.Window):
|
|||||||
bui.app.classic.MusicPlayMode.REGULAR, force_restart=True
|
bui.app.classic.MusicPlayMode.REGULAR, force_restart=True
|
||||||
)
|
)
|
||||||
|
|
||||||
bui.app.classic.ui.set_main_menu_window(
|
bui.app.ui_v1.set_main_menu_window(
|
||||||
stb.SoundtrackBrowserWindow(transition='in_left').get_root_widget()
|
stb.SoundtrackBrowserWindow(transition='in_left').get_root_widget()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user