lang updates and controller polishing

This commit is contained in:
Eric 2023-10-21 11:30:01 -07:00
parent 92fdd4b043
commit 64032d0b26
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
14 changed files with 120 additions and 131 deletions

68
.efrocachemap generated
View File

@ -421,7 +421,7 @@
"build/assets/ba_data/audio/zoeOw.ogg": "74befe45a8417e95b6a2233c51992a26", "build/assets/ba_data/audio/zoeOw.ogg": "74befe45a8417e95b6a2233c51992a26",
"build/assets/ba_data/audio/zoePickup01.ogg": "48ab8cddfcde36a750856f3f81dd20c8", "build/assets/ba_data/audio/zoePickup01.ogg": "48ab8cddfcde36a750856f3f81dd20c8",
"build/assets/ba_data/audio/zoeScream01.ogg": "2b468aedfa8741090247f04eb9e6df55", "build/assets/ba_data/audio/zoeScream01.ogg": "2b468aedfa8741090247f04eb9e6df55",
"build/assets/ba_data/data/langdata.json": "1a960da2db069ca3926b8ee6b8f82df7", "build/assets/ba_data/data/langdata.json": "35edefb8290f4fb38c5e3e70395fc449",
"build/assets/ba_data/data/languages/arabic.json": "295c559911fa251f401f8cdcad91c226", "build/assets/ba_data/data/languages/arabic.json": "295c559911fa251f401f8cdcad91c226",
"build/assets/ba_data/data/languages/belarussian.json": "e151808b6b4f6dc159cf55ee62adad3c", "build/assets/ba_data/data/languages/belarussian.json": "e151808b6b4f6dc159cf55ee62adad3c",
"build/assets/ba_data/data/languages/chinese.json": "b0d4e874ba8d22c8fd0d7a0eaaf96ac9", "build/assets/ba_data/data/languages/chinese.json": "b0d4e874ba8d22c8fd0d7a0eaaf96ac9",
@ -430,12 +430,12 @@
"build/assets/ba_data/data/languages/czech.json": "93c5fe0d884d95435da6c675f64e30e0", "build/assets/ba_data/data/languages/czech.json": "93c5fe0d884d95435da6c675f64e30e0",
"build/assets/ba_data/data/languages/danish.json": "3fd69080783d5c9dcc0af737f02b6f1e", "build/assets/ba_data/data/languages/danish.json": "3fd69080783d5c9dcc0af737f02b6f1e",
"build/assets/ba_data/data/languages/dutch.json": "22b44a33bf81142ba2befad14eb5746e", "build/assets/ba_data/data/languages/dutch.json": "22b44a33bf81142ba2befad14eb5746e",
"build/assets/ba_data/data/languages/english.json": "550aecdf2530832a8c095c2bda9ea8f0", "build/assets/ba_data/data/languages/english.json": "6fb6ec37e79064edb4b8864eabdd024d",
"build/assets/ba_data/data/languages/esperanto.json": "0e397cfa5f3fb8cef5f4a64f21cda880", "build/assets/ba_data/data/languages/esperanto.json": "0e397cfa5f3fb8cef5f4a64f21cda880",
"build/assets/ba_data/data/languages/filipino.json": "347f38524816691170d266708fe25894", "build/assets/ba_data/data/languages/filipino.json": "347f38524816691170d266708fe25894",
"build/assets/ba_data/data/languages/french.json": "4e218dcd488fa63e7db5b4da2261b9e1", "build/assets/ba_data/data/languages/french.json": "4e218dcd488fa63e7db5b4da2261b9e1",
"build/assets/ba_data/data/languages/german.json": "450fa41ae264f29a5d1af22143d0d0ad", "build/assets/ba_data/data/languages/german.json": "450fa41ae264f29a5d1af22143d0d0ad",
"build/assets/ba_data/data/languages/gibberish.json": "517e9c79ce8242af82366bbdaaf678a4", "build/assets/ba_data/data/languages/gibberish.json": "63c6212c774622346f3ad0d87ff31e80",
"build/assets/ba_data/data/languages/greek.json": "287c0ec437b38772284ef9d3e4fb2fc3", "build/assets/ba_data/data/languages/greek.json": "287c0ec437b38772284ef9d3e4fb2fc3",
"build/assets/ba_data/data/languages/hindi.json": "8ea0c58a44a24edb131d0e53b074d1f6", "build/assets/ba_data/data/languages/hindi.json": "8ea0c58a44a24edb131d0e53b074d1f6",
"build/assets/ba_data/data/languages/hungarian.json": "796a290a8c44a1e7635208c2ff5fdc6e", "build/assets/ba_data/data/languages/hungarian.json": "796a290a8c44a1e7635208c2ff5fdc6e",
@ -445,12 +445,12 @@
"build/assets/ba_data/data/languages/malay.json": "832562ce997fc70704b9234c95fb2e38", "build/assets/ba_data/data/languages/malay.json": "832562ce997fc70704b9234c95fb2e38",
"build/assets/ba_data/data/languages/persian.json": "a391d80ff58ea22926499e4b19d2c0d0", "build/assets/ba_data/data/languages/persian.json": "a391d80ff58ea22926499e4b19d2c0d0",
"build/assets/ba_data/data/languages/polish.json": "e1a1a801851924748ad38fa68216439a", "build/assets/ba_data/data/languages/polish.json": "e1a1a801851924748ad38fa68216439a",
"build/assets/ba_data/data/languages/portuguese.json": "9fcd6b4da9e5d0dc0e337ab00b5debe2", "build/assets/ba_data/data/languages/portuguese.json": "51e362956f89da3eec980f587c092253",
"build/assets/ba_data/data/languages/romanian.json": "aeebdd54f65939c2facc6ac50c117826", "build/assets/ba_data/data/languages/romanian.json": "aeebdd54f65939c2facc6ac50c117826",
"build/assets/ba_data/data/languages/russian.json": "70f79c606ccc5ec7bd6ce0303fdece70", "build/assets/ba_data/data/languages/russian.json": "561504cca28eb3204ac194950029e565",
"build/assets/ba_data/data/languages/serbian.json": "d7452dd72ac0e51680cb39b5ebaa1c69", "build/assets/ba_data/data/languages/serbian.json": "d7452dd72ac0e51680cb39b5ebaa1c69",
"build/assets/ba_data/data/languages/slovak.json": "27962d53dc3f7dd4e877cd40faafeeef", "build/assets/ba_data/data/languages/slovak.json": "27962d53dc3f7dd4e877cd40faafeeef",
"build/assets/ba_data/data/languages/spanish.json": "e72e394f94b99d3e838c1b81a9d17615", "build/assets/ba_data/data/languages/spanish.json": "5a4dbd505060dd02d634bd4de4d5faab",
"build/assets/ba_data/data/languages/swedish.json": "77d671f10613291ebf9c71da66f18a18", "build/assets/ba_data/data/languages/swedish.json": "77d671f10613291ebf9c71da66f18a18",
"build/assets/ba_data/data/languages/tamil.json": "65ab7798d637fa62a703750179eeb723", "build/assets/ba_data/data/languages/tamil.json": "65ab7798d637fa62a703750179eeb723",
"build/assets/ba_data/data/languages/thai.json": "33f63753c9af9a5b238d229a0bf23fbc", "build/assets/ba_data/data/languages/thai.json": "33f63753c9af9a5b238d229a0bf23fbc",
@ -4056,26 +4056,26 @@
"build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1", "build/assets/windows/Win32/ucrtbased.dll": "2def5335207d41b21b9823f6805997f1",
"build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae", "build/assets/windows/Win32/vc_redist.x86.exe": "b08a55e2e77623fe657bea24f223a3ae",
"build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599", "build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "f029c0682da29f46e5c9782bd2567f82", "build/prefab/full/linux_arm64_gui/debug/ballisticakit": "8944236c082e32b7efc83fdd1d2bb430",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "d2fe151ab5836d1f60b85bdc7d7880b1", "build/prefab/full/linux_arm64_gui/release/ballisticakit": "7d78e977704b352be09dc49ae159c0ac",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "ca6b96c7c6f77ab6ca93698da0022cb6", "build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "1c587e1330b55458dfc200f08bf6e6fc",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "5342b4e44c8f414b34582ceec0ef0c8d", "build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "b9f429f8cbc3961dde9bae4344ec74f5",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "67e06b38ba6e5fa44fcb0b196618dda7", "build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "91876ba2b9041ac6b6fbfcdc058342dd",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "5a1a366e4458f48230a8856a04e3d15a", "build/prefab/full/linux_x86_64_gui/release/ballisticakit": "8c2dd693f97a910a70e82efdeff1b9d4",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "c1f9b4a7e4d8aef89de664fd19178b17", "build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "590edd47cf70f08866b9ced6c46751f1",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "7608557c57d636c81213afe0a68cd921", "build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "e0ddb169dce06925d6b3fbde8a2cda45",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "31465c3f4b869d6d2a4a004bcf43c058", "build/prefab/full/mac_arm64_gui/debug/ballisticakit": "8bc979f113254f1329d0219809bca9f1",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "4092f2c09d4717cbe22a9847733458ea", "build/prefab/full/mac_arm64_gui/release/ballisticakit": "674d3495c9b3483d712673219383888d",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "a98776c44ceae70a5582fa3a31894f42", "build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "c219bdcb9d0897650b72708ba3a17e5e",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "107c108da827cc647d26ea8e20e5a02a", "build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "c2a9c82807644a4676dae69630ff8237",
"build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "d4e3d6b79648d478003282e20b583cf3", "build/prefab/full/mac_x86_64_gui/debug/ballisticakit": "aa12830328b2c64b8d4970197ba5c49f",
"build/prefab/full/mac_x86_64_gui/release/ballisticakit": "396f882b13a97bec718222d14be7a825", "build/prefab/full/mac_x86_64_gui/release/ballisticakit": "8569f2c15b113f206846152a49dbcd6d",
"build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "118e5039eb06c8d641baa3a94c511a20", "build/prefab/full/mac_x86_64_server/debug/dist/ballisticakit_headless": "49b7f50beed3e8c5abfd7f6faa4d7b90",
"build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "2c4b12f038ad8eb9838860b8cce2f491", "build/prefab/full/mac_x86_64_server/release/dist/ballisticakit_headless": "78fbc9b9503b30231b9effd281322829",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "650b1181dda309c492abe2a26cedfd9a", "build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "c88f1beb143dd3306b556b5490e8b381",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "32ac6359eb0296a319ddfcba3fcd04bc", "build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "110bf4b9e5c99d4b354ace22272e902e",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "731540517a251db7332d0f841d686d01", "build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "9d62f0c0fed46365b203728079580085",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "a19df9a09272d486666a4cb28702cf2b", "build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "c2ccf9cec0af9b12620eb74237647583",
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "473e7e6c0cf90b9e6ac653552b18f68d", "build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "473e7e6c0cf90b9e6ac653552b18f68d",
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "4e11b895cbf2e1339cf34bc06c54a4ea", "build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "4e11b895cbf2e1339cf34bc06c54a4ea",
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "473e7e6c0cf90b9e6ac653552b18f68d", "build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "473e7e6c0cf90b9e6ac653552b18f68d",
@ -4092,14 +4092,14 @@
"build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "48c4873dae2344c1d4092a1d85dab424", "build/prefab/lib/mac_x86_64_gui/release/libballisticaplus.a": "48c4873dae2344c1d4092a1d85dab424",
"build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "abcede4e60fa8877f18e66e086fb7387", "build/prefab/lib/mac_x86_64_server/debug/libballisticaplus.a": "abcede4e60fa8877f18e66e086fb7387",
"build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "48c4873dae2344c1d4092a1d85dab424", "build/prefab/lib/mac_x86_64_server/release/libballisticaplus.a": "48c4873dae2344c1d4092a1d85dab424",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "13615b9d10736d72e3b3bec605518645", "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "235ff7a30762e89fce4142e4150d46a4",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "99369ccd4edfe5cc2d54b18aa77ca1cb", "build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "e13e823133fcdcf8409ee8978892162b",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "33a19e9eb9bd9b655cbe70d8e250425b", "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "0388a3c7a202c13466d20d2e45d7645e",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "021114e14a72c621dc6fb7d4b3e41b5f", "build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "a1fb2d14a0876f5759dc825c10723b17",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "cff4a800e4ea1cdb7690d088a4db0abb", "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "5eb03f1247c6cd2e0bc75a4e459712f6",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "107e289fb15a0d3177ed16aa8f076041", "build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "4d49ef90fbde5813d4b9dd22f0f8c55b",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "4d031e12072278cf78570b64a2f7e533", "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "2782be4d66289e98fa93076e953d4488",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "d7e631f313c7b99d92c41efaf6305b65", "build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "f3b6ea4d34a50620e26f6d4ef6ddad17",
"src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c", "src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c",
"src/assets/ba_data/python/babase/_mgen/enums.py": "28323912b56ec07701eda3d41a6a4101", "src/assets/ba_data/python/babase/_mgen/enums.py": "28323912b56ec07701eda3d41a6a4101",
"src/ballistica/base/mgen/pyembed/binding_base.inc": "6df0f34207346d89a72924249ddd4706", "src/ballistica/base/mgen/pyembed/binding_base.inc": "6df0f34207346d89a72924249ddd4706",

View File

@ -1,4 +1,4 @@
### 1.7.28 (build 21488, api 8, 2023-10-20) ### 1.7.28 (build 21489, api 8, 2023-10-21)
- Massively cleaned up code related to rendering and window systems (OpenGL, - Massively cleaned up code related to rendering and window systems (OpenGL,
SDL, etc). This code had been growing into a nasty tangle for 15 years SDL, etc). This code had been growing into a nasty tangle for 15 years

View File

@ -52,7 +52,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 = 21488 TARGET_BALLISTICA_BUILD = 21489
TARGET_BALLISTICA_VERSION = '1.7.28' TARGET_BALLISTICA_VERSION = '1.7.28'

View File

@ -29,16 +29,16 @@ def gamepad_configure_callback(event: dict[str, Any]) -> None:
logging.exception('Error transitioning out main_menu_window.') logging.exception('Error transitioning out main_menu_window.')
bui.getsound('activateBeep').play() bui.getsound('activateBeep').play()
bui.getsound('swish').play() bui.getsound('swish').play()
inputdevice = event['input_device'] device = event['input_device']
assert isinstance(inputdevice, bs.InputDevice) assert isinstance(device, bs.InputDevice)
if inputdevice.allows_configuring: if device.allows_configuring:
bui.app.ui_v1.set_main_menu_window( bui.app.ui_v1.set_main_menu_window(
gamepad.GamepadSettingsWindow(inputdevice).get_root_widget() gamepad.GamepadSettingsWindow(device).get_root_widget()
) )
else: else:
width = 700 width = 700
height = 200 height = 200
button_width = 100 button_width = 80
uiscale = bui.app.ui_v1.uiscale uiscale = bui.app.ui_v1.uiscale
dlg = bui.containerwidget( dlg = bui.containerwidget(
scale=( scale=(
@ -52,8 +52,13 @@ def gamepad_configure_callback(event: dict[str, Any]) -> None:
transition='in_right', transition='in_right',
) )
bui.app.ui_v1.set_main_menu_window(dlg) bui.app.ui_v1.set_main_menu_window(dlg)
device_name = inputdevice.name
if device_name == 'iDevice': if device.allows_configuring_in_system_settings:
msg = bui.Lstr(
resource='configureDeviceInSystemSettingsText',
subs=[('${DEVICE}', device.name)],
)
elif device.is_controller_app:
msg = bui.Lstr( msg = bui.Lstr(
resource='bsRemoteConfigureInAppText', resource='bsRemoteConfigureInAppText',
subs=[('${REMOTE_APP_NAME}', bui.get_remote_app_name())], subs=[('${REMOTE_APP_NAME}', bui.get_remote_app_name())],
@ -61,7 +66,7 @@ def gamepad_configure_callback(event: dict[str, Any]) -> None:
else: else:
msg = bui.Lstr( msg = bui.Lstr(
resource='cantConfigureDeviceText', resource='cantConfigureDeviceText',
subs=[('${DEVICE}', device_name)], subs=[('${DEVICE}', device.name)],
) )
bui.textwidget( bui.textwidget(
parent=dlg, parent=dlg,

View File

@ -1521,10 +1521,10 @@ void Graphics::DoDrawFade(FrameDef* frame_def, float amt) {
void Graphics::DrawCursor(FrameDef* frame_def) { void Graphics::DrawCursor(FrameDef* frame_def) {
assert(g_base->InLogicThread()); assert(g_base->InLogicThread());
millisecs_t app_time_millisecs = frame_def->app_time_millisecs(); auto app_time = frame_def->app_time();
bool can_show_cursor = g_base->app_adapter->ShouldUseCursor(); auto can_show_cursor = g_base->app_adapter->ShouldUseCursor();
bool should_show_cursor = auto should_show_cursor =
camera_->manual() || g_base->input->IsCursorVisible(); camera_->manual() || g_base->input->IsCursorVisible();
if (g_base->app_adapter->HasHardwareCursor()) { if (g_base->app_adapter->HasHardwareCursor()) {
@ -1538,9 +1538,9 @@ void Graphics::DrawCursor(FrameDef* frame_def) {
// Ship this state when it changes and also every now and then just in // Ship this state when it changes and also every now and then just in
// case things go wonky. // case things go wonky.
if (new_cursor_visibility != hardware_cursor_visible_ if (new_cursor_visibility != hardware_cursor_visible_
|| app_time_millisecs - last_cursor_visibility_event_time_ > 2000) { || app_time - last_cursor_visibility_event_time_ > 2.137) {
hardware_cursor_visible_ = new_cursor_visibility; hardware_cursor_visible_ = new_cursor_visibility;
last_cursor_visibility_event_time_ = app_time_millisecs; last_cursor_visibility_event_time_ = app_time;
g_base->app_adapter->PushMainThreadCall([this] { g_base->app_adapter->PushMainThreadCall([this] {
assert(g_core && g_core->InMainThread()); assert(g_core && g_core->InMainThread());
g_base->app_adapter->SetHardwareCursorVisible(hardware_cursor_visible_); g_base->app_adapter->SetHardwareCursorVisible(hardware_cursor_visible_);

View File

@ -485,7 +485,7 @@ class Graphics {
millisecs_t last_progress_bar_draw_time_{}; millisecs_t last_progress_bar_draw_time_{};
millisecs_t last_progress_bar_start_time_{}; millisecs_t last_progress_bar_start_time_{};
microsecs_t last_suppress_gyro_time_{}; microsecs_t last_suppress_gyro_time_{};
millisecs_t last_cursor_visibility_event_time_{}; seconds_t last_cursor_visibility_event_time_{};
microsecs_t next_frame_number_filtered_increment_time_{}; microsecs_t next_frame_number_filtered_increment_time_{};
microsecs_t last_create_frame_def_time_microsecs_{}; microsecs_t last_create_frame_def_time_microsecs_{};
millisecs_t last_create_frame_def_time_millisecs_{}; millisecs_t last_create_frame_def_time_millisecs_{};

View File

@ -44,8 +44,8 @@ class FrameDef {
return app_time_microsecs_ / 1000; return app_time_microsecs_ / 1000;
} }
auto app_time_microsecs() const -> microsecs_t { return app_time_microsecs_; } auto app_time_microsecs() const -> microsecs_t { return app_time_microsecs_; }
auto app_time() const -> double { auto app_time() const {
return static_cast<double>(app_time_microsecs_) / 1000000.0; return static_cast<seconds_t>(app_time_microsecs_) / 1000000.0;
} }
// A number incremented for each frame renderered. Note that graphics code // A number incremented for each frame renderered. Note that graphics code

View File

@ -1297,7 +1297,7 @@ void Input::HandleSmoothMouseScroll_(const Vector2f& velocity, bool momentum) {
WidgetMessage(WidgetMessage::Type::kMouseWheelVelocityH, nullptr, WidgetMessage(WidgetMessage::Type::kMouseWheelVelocityH, nullptr,
cursor_pos_x_, cursor_pos_y_, velocity.x, momentum)); cursor_pos_x_, cursor_pos_y_, velocity.x, momentum));
last_mouse_move_time_ = g_core->GetAppTimeMillisecs(); last_mouse_move_time_ = g_core->GetAppTimeSeconds();
mouse_move_count_++; mouse_move_count_++;
Camera* camera = g_base->graphics->camera(); Camera* camera = g_base->graphics->camera();
@ -1333,7 +1333,7 @@ void Input::HandleMouseMotion_(const Vector2f& position) {
cursor_pos_y_ = g_base->graphics->PixelToVirtualY( cursor_pos_y_ = g_base->graphics->PixelToVirtualY(
position.y * g_base->graphics->screen_pixel_height()); position.y * g_base->graphics->screen_pixel_height());
last_mouse_move_time_ = g_core->GetAppTimeMillisecs(); last_mouse_move_time_ = g_core->GetAppTimeSeconds();
mouse_move_count_++; mouse_move_count_++;
// If we have a touch-input in editing mode, pass along events to it. // If we have a touch-input in editing mode, pass along events to it.
@ -1374,7 +1374,7 @@ void Input::HandleMouseDown_(int button, const Vector2f& position) {
return; return;
} }
last_mouse_move_time_ = g_core->GetAppTimeMillisecs(); last_mouse_move_time_ = g_core->GetAppTimeSeconds();
mouse_move_count_++; mouse_move_count_++;
// Convert normalized view coords to our virtual ones. // Convert normalized view coords to our virtual ones.
@ -1439,8 +1439,8 @@ void Input::HandleMouseUp_(int button, const Vector2f& position) {
position.y * g_base->graphics->screen_pixel_height()); position.y * g_base->graphics->screen_pixel_height());
// If we have a touch-input in editing mode, pass along events to it. // If we have a touch-input in editing mode, pass along events to it.
// (it usually handles its own events but here we want it to play nice // It usually handles its own events but here we want it to play nice
// with stuff under it by blocking touches, etc) // with stuff under it by blocking touches, etc.
if (touch_input_ && touch_input_->editing()) { if (touch_input_ && touch_input_->editing()) {
touch_input_->HandleTouchUp(reinterpret_cast<void*>(1), cursor_pos_x_, touch_input_->HandleTouchUp(reinterpret_cast<void*>(1), cursor_pos_x_,
cursor_pos_y_); cursor_pos_y_);
@ -1481,9 +1481,6 @@ void Input::HandleTouchEvent_(const TouchEvent& e) {
MarkInputActive(); MarkInputActive();
// float x = e.x;
// float y = e.y;
if (g_buildconfig.ostype_ios_tvos()) { if (g_buildconfig.ostype_ios_tvos()) {
printf("FIXME: update touch handling\n"); printf("FIXME: update touch handling\n");
} }
@ -1513,8 +1510,8 @@ void Input::HandleTouchEvent_(const TouchEvent& e) {
} }
} }
// We keep track of one 'single' touch which we pass along as // We keep track of one 'single' touch which we pass along as mouse events
// mouse events which covers most UI stuff. // which covers most UI stuff.
if (e.type == TouchEvent::Type::kDown && single_touch_ == nullptr) { if (e.type == TouchEvent::Type::kDown && single_touch_ == nullptr) {
single_touch_ = e.touch; single_touch_ = e.touch;
HandleMouseDown_(SDL_BUTTON_LEFT, Vector2f(e.x, e.y)); HandleMouseDown_(SDL_BUTTON_LEFT, Vector2f(e.x, e.y));
@ -1524,8 +1521,8 @@ void Input::HandleTouchEvent_(const TouchEvent& e) {
HandleMouseMotion_(Vector2f(e.x, e.y)); HandleMouseMotion_(Vector2f(e.x, e.y));
} }
// Currently just applying touch-cancel the same as touch-up here; // Currently just applying touch-cancel the same as touch-up here; perhaps
// perhaps should be smarter in the future. // should be smarter in the future.
if ((e.type == TouchEvent::Type::kUp || e.type == TouchEvent::Type::kCanceled) if ((e.type == TouchEvent::Type::kUp || e.type == TouchEvent::Type::kCanceled)
&& (e.touch == single_touch_ || e.overall)) { && (e.touch == single_touch_ || e.overall)) {
single_touch_ = nullptr; single_touch_ = nullptr;
@ -1579,13 +1576,9 @@ auto Input::IsCursorVisible() const -> bool {
} }
bool val; bool val;
// Show our cursor if any dialogs/windows are up or else if its been moved // Show our cursor only if its been moved recently.
// very recently. val = (g_core->GetAppTimeSeconds() - last_mouse_move_time_ < 2.071);
if (g_base->ui->MainMenuVisible()) {
val = (g_core->GetAppTimeMillisecs() - last_mouse_move_time_ < 5000);
} else {
val = (g_core->GetAppTimeMillisecs() - last_mouse_move_time_ < 1000);
}
return val; return val;
} }

View File

@ -11,6 +11,7 @@
#include "ballistica/base/base.h" #include "ballistica/base/base.h"
#include "ballistica/shared/foundation/object.h" #include "ballistica/shared/foundation/object.h"
#include "ballistica/shared/foundation/types.h"
namespace ballistica::base { namespace ballistica::base {
@ -179,49 +180,49 @@ class Input {
void DestroyKeyboardInputDevices_(); void DestroyKeyboardInputDevices_();
void AddFakeMods_(SDL_Keysym* sym); void AddFakeMods_(SDL_Keysym* sym);
HandleKeyPressCall* keyboard_input_capture_press_{};
HandleKeyReleaseCall* keyboard_input_capture_release_{};
HandleJoystickEventCall* joystick_input_capture_{};
bool input_active_{};
millisecs_t input_idle_time_{};
int local_active_input_device_count_{};
millisecs_t last_get_local_active_input_device_count_check_time_{};
std::unordered_map<std::string, std::unordered_map<std::string, int> >
reserved_identifiers_;
int max_controller_count_so_far_{};
std::list<std::string> newly_connected_controllers_;
std::list<std::string> newly_disconnected_controllers_;
int connect_print_timer_id_{}; int connect_print_timer_id_{};
int disconnect_print_timer_id_{}; int disconnect_print_timer_id_{};
bool have_button_using_inputs_{}; int max_controller_count_so_far_{};
bool have_start_activated_default_button_inputs_{}; int local_active_input_device_count_{};
bool have_non_touch_inputs_{}; int mouse_move_count_{};
int input_lock_count_temp_{};
int input_lock_count_permanent_{};
bool input_active_ : 1 {};
bool have_button_using_inputs_ : 1 {};
bool have_start_activated_default_button_inputs_ : 1 {};
bool have_non_touch_inputs_ : 1 {};
bool ignore_mfi_controllers_ : 1 {};
bool ignore_sdl_controllers_ : 1 {};
millisecs_t input_idle_time_{};
millisecs_t last_get_local_active_input_device_count_check_time_{};
float cursor_pos_x_{}; float cursor_pos_x_{};
float cursor_pos_y_{}; float cursor_pos_y_{};
millisecs_t last_click_time_{}; millisecs_t last_click_time_{};
millisecs_t double_click_time_{200}; millisecs_t double_click_time_{200};
millisecs_t last_mouse_move_time_{}; seconds_t last_mouse_move_time_{};
int mouse_move_count_{};
std::vector<Object::Ref<InputDevice> > input_devices_;
KeyboardInput* keyboard_input_{};
KeyboardInput* keyboard_input_2_{};
TouchInput* touch_input_{};
int input_lock_count_temp_{};
int input_lock_count_permanent_{};
std::list<std::string> input_lock_temp_labels_; std::list<std::string> input_lock_temp_labels_;
std::list<std::string> input_unlock_temp_labels_; std::list<std::string> input_unlock_temp_labels_;
std::list<std::string> input_lock_permanent_labels_; std::list<std::string> input_lock_permanent_labels_;
std::list<std::string> input_unlock_permanent_labels_; std::list<std::string> input_unlock_permanent_labels_;
std::list<std::string> recent_input_locks_unlocks_; std::list<std::string> recent_input_locks_unlocks_;
std::list<TestInput*> test_inputs_;
std::list<std::string> newly_connected_controllers_;
std::list<std::string> newly_disconnected_controllers_;
std::unordered_map<std::string, std::unordered_map<std::string, int> >
reserved_identifiers_;
std::vector<Object::Ref<InputDevice> > input_devices_;
std::set<int> keys_held_; std::set<int> keys_held_;
millisecs_t last_input_device_count_update_time_{}; millisecs_t last_input_device_count_update_time_{};
millisecs_t last_input_temp_lock_time_{}; millisecs_t last_input_temp_lock_time_{};
bool ignore_mfi_controllers_{};
bool ignore_sdl_controllers_{};
std::list<TestInput*> test_inputs_;
millisecs_t stress_test_time_{}; millisecs_t stress_test_time_{};
millisecs_t stress_test_last_leave_time_{}; millisecs_t stress_test_last_leave_time_{};
void* single_touch_{}; void* single_touch_{};
KeyboardInput* keyboard_input_{};
KeyboardInput* keyboard_input_2_{};
TouchInput* touch_input_{};
HandleKeyPressCall* keyboard_input_capture_press_{};
HandleKeyReleaseCall* keyboard_input_capture_release_{};
HandleJoystickEventCall* joystick_input_capture_{};
}; };
} // namespace ballistica::base } // namespace ballistica::base

View File

@ -5,9 +5,7 @@
#if BA_XCODE_BUILD #if BA_XCODE_BUILD
#include <BallisticaKit-Swift.h> #include <BallisticaKit-Swift.h>
#include <unistd.h>
#endif #endif
#include <uuid/uuid.h>
#if BA_XCODE_BUILD #if BA_XCODE_BUILD
#include "ballistica/base/platform/apple/apple_utils.h" #include "ballistica/base/platform/apple/apple_utils.h"
@ -15,12 +13,7 @@
namespace ballistica::base { namespace ballistica::base {
#if BA_OSTYPE_MACOS && BA_XCODE_BUILD && BA_SDL_BUILD BasePlatformApple::BasePlatformApple() {
extern void DoSetCursor(bool show);
#endif
BasePlatformApple::BasePlatformApple() { // NOLINT: trivial constructor false
// positive
// On iOS, keep the device from falling asleep in our app // On iOS, keep the device from falling asleep in our app
#if BA_OSTYPE_IOS_TVOS #if BA_OSTYPE_IOS_TVOS
AppleUtils::DisableIdleTimer(); AppleUtils::DisableIdleTimer();
@ -58,25 +51,13 @@ void BasePlatformApple::DoOpenURL(const std::string& url) {
BallisticaKit::CocoaFromCppOpenURL(url); BallisticaKit::CocoaFromCppOpenURL(url);
#else #else
BallisticaKit::UIKitFromCppOpenURL(url); BallisticaKit::UIKitFromCppOpenURL(url);
#endif #endif // BA_OSTYPE_MACOS
// Go ahead and do this ourself. Though perhaps the default
// Python path would be fine.
// AppleUtils::OpenURL(url.c_str());
#else
// Otherwise go with the default (Python webbrowser module).
BasePlatform::DoOpenURL(url);
#endif
}
// void BasePlatformApple::SetHardwareCursorVisible(bool visible) { #else
// // Set our nifty custom hardware cursor on mac; // For non-xcode builds, go with the default (Python webbrowser module).
// // otherwise fall back to default. BasePlatform::DoOpenURL(url);
// #if BA_OSTYPE_MACOS && BA_XCODE_BUILD && !BA_HEADLESS_BUILD && BA_SDL_BUILD #endif // BA_XCODE_BUILD
// base::DoSetCursor(visible); }
// #else
// return BasePlatform::SetHardwareCursorVisible(visible);
// #endif
// }
} // namespace ballistica::base } // namespace ballistica::base

View File

@ -11,15 +11,11 @@ namespace ballistica::base {
class BasePlatformApple : public BasePlatform { class BasePlatformApple : public BasePlatform {
public: public:
BasePlatformApple(); BasePlatformApple();
void DoPurchase(const std::string& item) override; void DoPurchase(const std::string& item) override;
void RestorePurchases() override; void RestorePurchases() override;
void PurchaseAck(const std::string& purchase, void PurchaseAck(const std::string& purchase,
const std::string& order_id) override; const std::string& order_id) override;
void DoOpenURL(const std::string& url) override; void DoOpenURL(const std::string& url) override;
private:
}; };
} // namespace ballistica::base } // namespace ballistica::base

View File

@ -311,8 +311,6 @@ void FlagNode::Draw(base::FrameDef* frame_def) {
c.SetTexture(g_base->assets->SysTexture(base::SysTextureID::kShadow)); c.SetTexture(g_base->assets->SysTexture(base::SysTextureID::kShadow));
c.SetTransparent(true); c.SetTransparent(true);
FullShadowSet* full_shadows = full_shadow_set_.Get();
// Update our shadow objects. // Update our shadow objects.
if (!g_core->HeadlessMode()) { if (!g_core->HeadlessMode()) {
dBodyID b = body_->body(); dBodyID b = body_->body();

View File

@ -32,7 +32,12 @@ void PythonClassInputDevice::SetupType(PyTypeObject* cls) {
"Attributes:\n" "Attributes:\n"
"\n" "\n"
" allows_configuring (bool):\n" " allows_configuring (bool):\n"
" Whether the input-device can be configured.\n" " Whether the input-device can be configured in the app.\n"
"\n"
" allows_configuring_in_system_settings (bool):\n"
" Whether the input-device can be configured in the system.\n"
" setings app. This can be used to redirect the user to go there\n"
" if they attempt to configure the device.\n"
"\n" "\n"
" has_meaningful_button_names (bool):\n" " has_meaningful_button_names (bool):\n"
" Whether button names returned by this instance match labels\n" " Whether button names returned by this instance match labels\n"
@ -189,6 +194,16 @@ auto PythonClassInputDevice::tp_getattro(PythonClassInputDevice* self,
} else { } else {
Py_RETURN_FALSE; Py_RETURN_FALSE;
} }
} else if (!strcmp(s, "allows_configuring_in_system_settings")) {
auto* d = self->input_device_delegate_->Get();
if (!d) {
throw Exception(PyExcType::kInputDeviceNotFound);
}
if (d->input_device().IsMFiController()) {
Py_RETURN_TRUE;
} else {
Py_RETURN_FALSE;
}
} else if (!strcmp(s, "has_meaningful_button_names")) { } else if (!strcmp(s, "has_meaningful_button_names")) {
auto* d = self->input_device_delegate_->Get(); auto* d = self->input_device_delegate_->Get();
if (!d) { if (!d) {

View File

@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int {
namespace ballistica { namespace ballistica {
// These are set automatically via script; don't modify them here. // These are set automatically via script; don't modify them here.
const int kEngineBuildNumber = 21488; const int kEngineBuildNumber = 21489;
const char* kEngineVersion = "1.7.28"; const char* kEngineVersion = "1.7.28";
const int kEngineApiVersion = 8; const int kEngineApiVersion = 8;