diff --git a/.efrocachemap b/.efrocachemap
index bdc22351..82f2a475 100644
--- a/.efrocachemap
+++ b/.efrocachemap
@@ -4135,16 +4135,16 @@
"assets/build/windows/x64/vc_redist.x64.exe": "https://files.ballistica.net/cache/ba1/ea/19/8b8787d81abcdce158ba608cd24f",
"assets/build/windows/x64/vcruntime140_1d.dll": "https://files.ballistica.net/cache/ba1/11/d8/ff6344b429b00c24d9a1930d4338",
"assets/build/windows/x64/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/20/33/0825e11e6518f87ece3009309933",
- "build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/66/e8/cb2aca94bb37c54803235ca19a75",
- "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/d2/da/661e79f9cbe9446a073e685f240d",
- "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/38/07/ed14ca1cdab132da23bfd1f69f5f",
- "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/c9/6a/0e233fc907a8461d7641f4740530",
- "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/b0/4b/eaed2d4f9296da8950707cf64fff",
- "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/9c/37/835be7a8730d5b1acc009823a781",
- "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/03/5e/d126371e7d1d32948e04f0c77d77",
- "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/c2/57/a7bb77e0dd051cc68d7e4c6d0bde",
- "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/bc/35/11f66fbd7cd142e40ad4cc94022b",
- "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/c9/cb/0879d2f7acbdd8165f5a7af56264",
- "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/a2/9f/e82dd87f76005a97ececdfb2a1b2",
- "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/14/ca/9de4a3803d3ac23d24591a36e49f"
+ "build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/44/c5/099debe438f2bca2c3dc8d9f048e",
+ "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/c4/7a/f92d78baa6d8137a8150e37c40a8",
+ "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/35/8b/1d44da11d466aa8e49390048bd3c",
+ "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/13/b2/6f0da477dd7d4f54fe48647ce44b",
+ "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/d9/11/e50c98eb60cfbe1c5268e33af8b8",
+ "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/3b/e5/ce291661086203e424dce2dcd692",
+ "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/70/09/d12993418eade4f88e8290d92f2e",
+ "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/93/8c/8d7097c9b662b6583a145ad34f56",
+ "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/52/d4/96f341a77b48a1f4adcbc5ca1e40",
+ "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/af/79/c1be9d5908663f693dc67a24fd5e",
+ "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/9e/e6/2cc3bc3fe700d8750387032bf43d",
+ "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/92/8f/99cddfd2549fadedbb6f483bb174"
}
\ No newline at end of file
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 167d4c29..7a4cb989 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,6 @@
+### 1.5.22 (20139)
+- Button and key names now display correctly again on Android (and are cleaned up on other platforms too).
+
### 1.5.21 (20138)
- Added a UI subsystem at ba.app.ui (containing globals/functionality that was previously directly under ba.app). And hopefully added a fix for rare state of two main menus appearing on-screen at once.
- Added options in the 'Advanced' section to disable camera shake and camera gyroscope motion.
diff --git a/assets/src/ba_data/python/_ba.py b/assets/src/ba_data/python/_ba.py
index 295c4763..ca9209ab 100644
--- a/assets/src/ba_data/python/_ba.py
+++ b/assets/src/ba_data/python/_ba.py
@@ -256,6 +256,11 @@ class InputDevice:
allows_configuring: bool
Whether the input-device can be configured.
+ has_meaningful_button_names: bool
+ Whether button names returned by this instance match labels
+ on the actual device. (Can be used to determine whether to show
+ them in controls-overlays, etc.)
+
player: Optional[ba.SessionPlayer]
The player associated with this input device.
@@ -288,6 +293,7 @@ class InputDevice:
"""
allows_configuring: bool
+ has_meaningful_button_names: bool
player: Optional[ba.SessionPlayer]
client_id: int
name: str
@@ -316,16 +322,21 @@ class InputDevice:
def get_axis_name(self, axis_id: int) -> str:
"""get_axis_name(axis_id: int) -> str
- Given an axis ID, returns the name of the axis on this device.
+ Given an axis ID, return the name of the axis on this device.
+
+ Can return an empty string if the value is not meaningful to humans.
"""
return str()
- def get_button_name(self, button_id: int) -> str:
- """get_button_name(button_id: int) -> str
+ def get_button_name(self, button_id: int) -> ba.Lstr:
+ """get_button_name(button_id: int) -> ba.Lstr
- Given a button ID, returns the name of the key/button on this device.
+ Given a button ID, return a human-readable name for that key/button.
+
+ Can return an empty string if the value is not meaningful to humans.
"""
- return str()
+ import ba # pylint: disable=cyclic-import
+ return ba.Lstr(value='')
def get_default_player_name(self) -> str:
"""get_default_player_name() -> str
diff --git a/assets/src/ba_data/python/ba/_lang.py b/assets/src/ba_data/python/ba/_lang.py
index fcef0708..7afacfbb 100644
--- a/assets/src/ba_data/python/ba/_lang.py
+++ b/assets/src/ba_data/python/ba/_lang.py
@@ -28,6 +28,7 @@ from typing import TYPE_CHECKING, overload
import _ba
if TYPE_CHECKING:
+ import ba
from typing import Any, Dict, List, Optional, Tuple, Union, Sequence
@@ -192,6 +193,13 @@ class Lstr:
def __repr__(self) -> str:
return ' This page documents the Python classes and functions in the 'ba' module,
which are the ones most relevant to modding in Ballistica. If you come across something you feel should be included here or could be better explained, please let me know. Happy modding!last updated on 2020-07-14 for Ballistica version 1.5.21 build 20138
+last updated on 2020-07-15 for Ballistica version 1.5.22 build 20140
@@ -2872,7 +2872,7 @@ Results for a completed game.
Category: Gameplay Classes
bool
@@ -2885,6 +2885,13 @@ Results for a completed game. This is only meaningful for remote client inputs; for all local devices this will be -1. +bool
+Whether button names returned by this instance match labels +on the actual device. (Can be used to determine whether to show +them in controls-overlays, etc.)
+int
@@ -2946,13 +2953,17 @@ prefs, etc.get_axis_name(axis_id: int) -> str
-Given an axis ID, returns the name of the axis on this device.
+Given an axis ID, return the name of the axis on this device.
+ +Can return an empty string if the value is not meaningful to humans.
get_button_name(button_id: int) -> str
+get_button_name(button_id: int) -> ba.Lstr
-Given a button ID, returns the name of the key/button on this device.
+Given a button ID, return a human-readable name for that key/button.
+ +Can return an empty string if the value is not meaningful to humans.
ba.Lstr(*args: Any, **keywds: Any)
@@ -3300,6 +3311,12 @@ the resource nor the fallback resource is found ('resource' mode only).You should avoid doing this as much as possible and instead pass and store Lstr values.
+from_json(json_string: str) -> ba.Lstr
+ +Given a json string, returns a ba.Lstr. Does no data validation.
+is_flat_value(self) -> bool