From f1ba22170d6f11d39d98b1f25ca24998d7e46e2a Mon Sep 17 00:00:00 2001 From: Eric Date: Sat, 3 Jun 2023 22:04:25 -0700 Subject: [PATCH] oops --- .efrocachemap | 88 +++++++++++------------ CHANGELOG.md | 2 +- src/assets/ba_data/python/babase/_app.py | 23 +++--- src/assets/ba_data/python/baenv.py | 2 +- src/ballistica/shared/ballistica.cc | 2 +- src/ballistica/shared/foundation/inline.h | 13 ++++ src/ballistica/shared/foundation/macros.h | 42 ++++++----- tools/batools/appmodule.py | 24 +++++-- 8 files changed, 116 insertions(+), 80 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index 430f7a4b..53136d71 100644 --- a/.efrocachemap +++ b/.efrocachemap @@ -4072,50 +4072,50 @@ "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/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/91/55/d613e7b8f4c46014c348d0ed9c51", - "build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/2b/a9/e56c7defaf9131a15723393670f2", - "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/2a/93/b541f7371ae7aa9c2b6df54e0a3c", - "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/f9/54/6e50c747a802a688700e3570e1da", - "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/01/06/dbd917364037462ef11f47d053fb", - "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/2a/57/9df425e36c1462d3987df2416df9", - "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/8b/70/a50ce6901458a7343b34ea3e9fde", - "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/e6/87/d655f427d8191fde17c1c642b6d5", - "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/7d/97/1987d3c17870049d0b96864fd8b8", - "build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/55/8e/6637c52fd4cb296d2fea01cb5c56", - "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/dc/28/d47732690963cc3cc2d0424ea944", - "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/85/3c/0bac934332bcef62ebe133280150", - "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/cd/83/361d69461f3cc129666897dd348a", - "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/62/9b/66fad8addd5c3ac0a94292651e37", - "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/0c/f3/ea8ba8a2e73fd677e3f654e67184", - "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/d3/3e/e2515e5356429fa3984fa8b464e0", - "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/6b/cc/7e1168c16d21e839639697004da3", - "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/45/a7/e3f4df84afe580d16f9f2d2ae6ae", - "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/db/f8/a2a99ce1869390e5c1c3bc7f7fa0", - "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/71/ea/5f168531d49dd779e87db5374b57", - "build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/d4/6a/dd303a200b98a56ba3b100277057", - "build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/fc/2c/2996c558fb408a548fdd37398c9a", - "build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/ed/28/b7a72be7ae1bd2b58dda4b6902a0", - "build/prefab/lib/linux_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/9a/c1/7d453af7505f0da4f811c463e20b", - "build/prefab/lib/linux_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/69/8f/f8d2a4a001faff21d6583fc548e5", - "build/prefab/lib/linux_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/de/c4/c40f356300a03ee787de3b7a2e9e", - "build/prefab/lib/linux_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/59/88/6c03f3f277caf5f549422a3dfe46", - "build/prefab/lib/linux_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/c7/d3/029366a92c45727c9b2e4517027d", - "build/prefab/lib/mac_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/4e/12/3194fc2a754634006cd74b0236dd", - "build/prefab/lib/mac_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/4b/75/688be5b92c30b4b9121badee151c", - "build/prefab/lib/mac_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/76/ae/475cdfca344fa3034d013045ddef", - "build/prefab/lib/mac_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/d8/a3/7cdd584948ce51caed019495773e", - "build/prefab/lib/mac_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/08/8a/a873b8c8f181721e17c083e9101e", - "build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/71/f6/691482915ad58ea1e953cc23d74c", - "build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/b8/2b/6ec8c78980a62e3e0ee4b36ece04", - "build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/4e/56/a95c987b2a371759896b037fea86", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/24/fa/1099213d4278a9c07e7cc78422fe", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/98/2e/e9da72e9abcb19402f4f3f598124", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/51/46/b443a8e48e20a89bf7d5dfda08c1", - "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/fa/1a/a665cd357a0c47b5476ca0695b56", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/10/c5/6174658d59b884a77c5320a00b75", - "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/0f/e9/428ffa2a51f71dce52db4aa72a88", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/ab/77/7ae81a54808309eb040a8cf6d442", - "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/f7/0e/c267592aa4c5fe2a07f36a5aaa20", + "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/d2/f1/c7ecb66769e793ea1ae2427ec540", + "build/prefab/full/linux_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/89/4f/99fb1371ff083d135f3c8251ead1", + "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/4a/5c/076d47a516a1b9e5d3b7e7930a30", + "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/ab/63/caf01d35edabba0359e0444bf898", + "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/25/25/e0a9d955037c5375558b5bef7736", + "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/b8/6d/ef564300e7189964e133be1c6d7f", + "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/b4/50/9e1fcab11d5e329750ef64f38a94", + "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/a6/62/3ae503b2027dad675a8a4dae8d75", + "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/4c/8b/44c018a2bf5ff79951d28525d230", + "build/prefab/full/mac_arm64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/67/d9/1f49882d9f50051e5a77c8b37856", + "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/2f/26/01c0bb3750c49e8b27032e3506b4", + "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/c7/90/48bccd35318bbf7693417a50c96d", + "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "https://files.ballistica.net/cache/ba1/13/92/949362dd74ca933d11b8081c366b", + "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "https://files.ballistica.net/cache/ba1/20/a0/6f048f2a3b9d64851420de719d3a", + "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/3a/f8/bca8437e4ac8403d46efdd9b0173", + "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "https://files.ballistica.net/cache/ba1/d9/3d/5ac299f7f2e7acfdea2a297e1c57", + "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/82/ff/41b875d2048dee0d47ca5173f8e6", + "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "https://files.ballistica.net/cache/ba1/18/45/1b8328009e7e7aaf4d840170427a", + "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/f5/63/2b15e84c989a0f58c8ea6c78c379", + "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "https://files.ballistica.net/cache/ba1/1f/7f/ed15584c8a49e20a4f081622214f", + "build/prefab/lib/linux_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/de/fd/21a635bb0a73e252885acb7f6628", + "build/prefab/lib/linux_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/8c/0c/209d7fef648785021b2442b92a37", + "build/prefab/lib/linux_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/3e/d6/f3e8c02c82379d78d15bb1bb9d41", + "build/prefab/lib/linux_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/db/d6/42e603000c13737e60f693336d4e", + "build/prefab/lib/linux_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/dd/e3/c1b35888db082abde395c7197d79", + "build/prefab/lib/linux_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/64/40/f06fe4f0d7537e50b6e880c6590c", + "build/prefab/lib/linux_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/b2/fe/09cba839bcfdc19b29f6acf4c129", + "build/prefab/lib/linux_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/54/10/a2c3d3a1076eb1b9812b736ca34b", + "build/prefab/lib/mac_arm64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/08/40/aaa523c2752e7128368dcbb9746c", + "build/prefab/lib/mac_arm64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/89/cd/db7719b6851e28d7969d807be3d8", + "build/prefab/lib/mac_arm64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/78/c0/3c8e4b03e3d92675a4c255242ccb", + "build/prefab/lib/mac_arm64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/5b/cb/4be9adf2aa44aae442bda6f39112", + "build/prefab/lib/mac_x86_64_gui/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/7d/4d/e6f90dbe842358db16b060fd3187", + "build/prefab/lib/mac_x86_64_gui/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/8a/34/5d1b029d1a393139890f600ff91d", + "build/prefab/lib/mac_x86_64_server/debug/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/f6/a3/753d976d43b45062184414098306", + "build/prefab/lib/mac_x86_64_server/release/libballistica_plus.a": "https://files.ballistica.net/cache/ba1/ba/f0/c7dcdd6472a348663d104d490e77", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/94/a1/3eed726b9bf0dac2e44cca23c1ba", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/09/47/a0d5f2088c43798bc60f72204ba5", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/5f/9a/542f9cb3ddfb702f81756047e7dc", + "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/c9/57/641e99496162ed453e6a1a8aea2e", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "https://files.ballistica.net/cache/ba1/0c/8b/37e6fdd08cb1dc1df818d550f7a3", + "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "https://files.ballistica.net/cache/ba1/68/82/a261d09580d572c25982b15efaa2", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "https://files.ballistica.net/cache/ba1/b9/91/34ee2461cf291fd765e9ab1cb09e", + "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "https://files.ballistica.net/cache/ba1/8f/00/84bd3b34227305d59202195c2032", "src/assets/ba_data/python/babase/_mgen/__init__.py": "https://files.ballistica.net/cache/ba1/52/c6/c11130af7b10d6c0321add5518fa", "src/assets/ba_data/python/babase/_mgen/enums.py": "https://files.ballistica.net/cache/ba1/38/c3/1dedd5e74f2508efc5974c8815a1", "src/ballistica/base/mgen/pyembed/binding_base.inc": "https://files.ballistica.net/cache/ba1/d5/4a/0e480a855ce83709bd7f6761107d", diff --git a/CHANGELOG.md b/CHANGELOG.md index 370036d9..ec099d94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -### 1.7.20 (build 21044, api 8, 2023-06-03) +### 1.7.20 (build 21045, api 8, 2023-06-03) - 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 diff --git a/src/assets/ba_data/python/babase/_app.py b/src/assets/ba_data/python/babase/_app.py index e0881fee..95bde14d 100644 --- a/src/assets/ba_data/python/babase/_app.py +++ b/src/assets/ba_data/python/babase/_app.py @@ -544,25 +544,32 @@ class App: The behavior here is generated by the project updater based on the set of feature-sets in the project. Spinoff projects can - also inject their own behavior by replacing the - __ADD_CUSTOM_SPINOFF_LOGIC_HERE__ comment with their own code + also inject their own behavior by replacing the text + '__GOOD_PLACE_FOR_CUSTOM_SPINOFF_LOGIC__' with their own code through spinoff filtering. - Note that it is also possible to modify mode selection behavior - by writing a custom AppModeSelector class and replacing - app.mode_selector with an instance of it. This is a good way to - go if you are wanting to modify app behavior with a plugin. + It is also possible to modify mode selection behavior by writing + a custom AppModeSelector class and replacing app.mode_selector + with an instance of it. This is a good way to go if you are + modifying app behavior with a plugin instead of in a spinoff + project. """ def app_mode_for_intent(self, intent: AppIntent) -> type[AppMode]: - # __ADD_CUSTOM_SPINOFF_LOGIC_HERE__ + # __GOOD_PLACE_FOR_CUSTOM_SPINOFF_LOGIC__ # __DEFAULT_APP_MODE_SELECTION_BEGIN__ # This section generated by batools.appmodule; do not edit. + # Hmm; need to think about how we auto-construct this; how + # do we determine which app modes to check and in what + # order? import bascenev1 - return bascenev1.SceneV1AppMode + if bascenev1.SceneV1AppMode.supports_intent(intent): + return bascenev1.SceneV1AppMode + + raise RuntimeError(f'No handler found for intent {type(intent)}.') # __DEFAULT_APP_MODE_SELECTION_END__ diff --git a/src/assets/ba_data/python/baenv.py b/src/assets/ba_data/python/baenv.py index 833d8544..ed9b29be 100644 --- a/src/assets/ba_data/python/baenv.py +++ b/src/assets/ba_data/python/baenv.py @@ -30,7 +30,7 @@ if TYPE_CHECKING: # Build number and version of the ballistica binary we expect to be # using. -TARGET_BALLISTICA_BUILD = 21044 +TARGET_BALLISTICA_BUILD = 21045 TARGET_BALLISTICA_VERSION = '1.7.20' _g_env_config: EnvConfig | None = None diff --git a/src/ballistica/shared/ballistica.cc b/src/ballistica/shared/ballistica.cc index cd5613af..bb666c62 100644 --- a/src/ballistica/shared/ballistica.cc +++ b/src/ballistica/shared/ballistica.cc @@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int { namespace ballistica { // These are set automatically via script; don't modify them here. -const int kEngineBuildNumber = 21044; +const int kEngineBuildNumber = 21045; const char* kEngineVersion = "1.7.20"; auto MonolithicMain(const core::CoreConfig& core_config) -> int { diff --git a/src/ballistica/shared/foundation/inline.h b/src/ballistica/shared/foundation/inline.h index a49a7a10..db9d8e1d 100644 --- a/src/ballistica/shared/foundation/inline.h +++ b/src/ballistica/shared/foundation/inline.h @@ -94,6 +94,19 @@ auto static_cast_check_type(IN_TYPE in) -> OUT_TYPE { return out_static; } +/// Given a path, returns the basename as a constexpr. +/// Handy for less verbose __FILE__ usage without adding runtime overhead. +constexpr const char* cxpr_base_name(const char* path) { + const char* file = path; + while (*path) { + const char* cur = path++; + if (*cur == '/' || *cur == '\\') { + file = path; + } + } + return file; +} + // This stuff hijacks compile-type pretty-function-printing functionality // to give human-readable strings for arbitrary types. Note that these // will not be consistent across platforms and should only be used for diff --git a/src/ballistica/shared/foundation/macros.h b/src/ballistica/shared/foundation/macros.h index 2e8fcf09..0859ab43 100644 --- a/src/ballistica/shared/foundation/macros.h +++ b/src/ballistica/shared/foundation/macros.h @@ -114,32 +114,38 @@ /// Test a condition and throw an exception if it fails (on both debug and /// release builds) -#define BA_PRECONDITION(b) \ - { \ - if (!(b)) { \ - throw ::ballistica::Exception("Precondition failed: " #b); \ - } \ - } \ +#define BA_PRECONDITION(b) \ + { \ + if (!(b)) { \ + throw ::ballistica::Exception(std::string("Precondition failed @ ") \ + + cxpr_base_name(__FILE__) \ + + ":" BA_TOSTRING(__LINE__) ": " #b); \ + } \ + } \ ((void)0) // (see 'Trailing-semicolon note' at top) /// Test a condition and simply print a log message if it fails (on both debug /// and release builds) -#define BA_PRECONDITION_LOG(b) \ - { \ - if (!(b)) { \ - Log(LogLevel::kError, "Precondition failed: " #b); \ - } \ - } \ +#define BA_PRECONDITION_LOG(b) \ + { \ + if (!(b)) { \ + Log(LogLevel::kError, std::string("Precondition failed @ ") \ + + cxpr_base_name(__FILE__) \ + + ":" BA_TOSTRING(__LINE__) ": " #b); \ + } \ + } \ ((void)0) // (see 'Trailing-semicolon note' at top) /// Test a condition and abort the program if it fails (on both debug /// and release builds) -#define BA_PRECONDITION_FATAL(b) \ - { \ - if (!(b)) { \ - FatalError("Precondition failed: " #b); \ - } \ - } \ +#define BA_PRECONDITION_FATAL(b) \ + { \ + if (!(b)) { \ + FatalError(std::string("Precondition failed @ ") \ + + cxpr_base_name(__FILE__) \ + + ":" BA_TOSTRING(__LINE__) ": " #b); \ + } \ + } \ ((void)0) // (see 'Trailing-semicolon note' at top) #ifdef __cplusplus diff --git a/tools/batools/appmodule.py b/tools/batools/appmodule.py index 437082d9..70d7c80b 100755 --- a/tools/batools/appmodule.py +++ b/tools/batools/appmodule.py @@ -116,12 +116,22 @@ def generate_app_module( ) # Set default app-mode-selection logic. - - # TEMP - fill this out with proper logic/options. + contents = ( + '# Hmm; need to think about how we auto-construct this; how\n' + '# do we determine which app modes to check and in what\n' + '# order?\n' + ) if 'scene_v1' in fsets: - contents = 'import bascenev1\n\nreturn bascenev1.SceneV1AppMode\n' - else: - contents = "raise RuntimeError('FIXME: unimplemented.')\n" + contents += ( + 'import bascenev1\n' + '\n' + 'if bascenev1.SceneV1AppMode.supports_intent(intent):\n' + ' return bascenev1.SceneV1AppMode\n\n' + ) + contents += ( + "raise RuntimeError(f'No handler found for" + " intent {type(intent)}.')\n" + ) indent = ' ' out = replace_section( @@ -135,6 +145,6 @@ def generate_app_module( # Note: we *should* format this string, but because this code # runs with every project update I'm just gonna try to keep the # formatting correct manually for now to save a bit of time. - # (project update time jumps from 0.3 to 0.5 seconds if I format - # thie one file). + # (project update time jumps from 0.3 to 0.5 seconds if I enable + # formatting here for just this one file). return out