android polishing

This commit is contained in:
Eric Froemling 2022-07-08 15:59:23 -07:00
parent fa3db1e3ca
commit 84c9f1f787
No known key found for this signature in database
GPG Key ID: 89C93F0F8D6D5A98
7 changed files with 647 additions and 634 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1835,6 +1835,7 @@
<w>plugkey</w>
<w>plugkeys</w>
<w>pluglist</w>
<w>plugnames</w>
<w>plugstate</w>
<w>plugstates</w>
<w>plusbutton</w>
@ -2057,6 +2058,7 @@
<w>recv</w>
<w>redist</w>
<w>redistributables</w>
<w>reenabled</w>
<w>regionid</w>
<w>registerexecutionpolicyexception</w>
<w>registerwithlaunchservices</w>

View File

@ -1,9 +1,12 @@
### 1.7.4 (20641, 2022-07-08)
### 1.7.4 (20644, 2022-07-08)
- Fixed the trophies list showing an incorrect total (Thanks itsre3!)
- ba.app.meta.metascan is now ba.app.meta.scanresults
- Cleaned up co-op ui code a bit
- Added a utility function to add custom co-op games in the practice section: `ba.app.add_coop_practice_level`. Also added new workspace template script which uses it to define a new co-op game type.
- Removed some spammy debug timing logging I added for tracking down a recent bug (can be reenabled by setting env var `BA_DEBUG_TIMING=1`)
- Android user scripts dir is now called 'mods' instead of 'BombSquad'. The name 'BombSquad' made sense when it was located in a truly shared area of storage but now that it is in the app-specific area (something like Android/data/net.froemling.bombsquad/files) it makes sense to just use 'mods' like other platforms.
- Updated the 'Show Mods Folder' to properly show the path to the mods folder. Before it would unhelpfully show something like `<External Storage>/mods` but now it should be something more useful like `Android/data/net.froemling.bombsquad/files/mods`.
- Updated the Modding Guide button in advanced settings to point to the new ballistica wiki stuff instead of the old out-of-date 1.4 modding docs.
### 1.7.3 (20634, 2022-07-06)
- Fixed an issue with King of the Hill flag regions not working when players entered them (Thanks itsre3!)

View File

@ -17,22 +17,29 @@ def get_human_readable_user_scripts_path() -> str:
This is NOT a valid filesystem path; may be something like "(SD Card)".
"""
from ba import _language
app = _ba.app
path: str | None = app.python_directory_user
if path is None:
return '<Not Available>'
# On newer versions of android, the user's external storage dir is probably
# only visible to the user's processes and thus not really useful printed
# in its entirety; lets print it as <External Storage>/myfilepath.
# These days, on Android, we use getExternalFilesDir() as the base of our
# app's user-scripts dir, which gives us paths like:
# /storage/emulated/0/Android/data/net.froemling.bombsquad/files
# Userspace apps tend to show that as:
# Android/data/net.froemling.bombsquad/files
# We'd like to display it that way, but I'm not sure if there's a clean
# way to get the root of the external storage area (/storage/emulated/0)
# so that we could strip it off. There is
# Environment.getExternalStorageDirectory() but that is deprecated.
# So for now let's just be conservative and trim off recognized prefixes
# and show the whole ugly path as a fallback.
# Note that we used to use externalStorageText resource but gonna try
# without it for now. (simply 'foo' instead of <External Storage>/foo).
if app.platform == 'android':
ext_storage_path: str | None = (_ba.android_get_external_files_dir())
if (ext_storage_path is not None
and app.python_directory_user.startswith(ext_storage_path)):
path = ('<' +
_language.Lstr(resource='externalStorageText').evaluate() +
'>' + app.python_directory_user[len(ext_storage_path):])
for pre in ['/storage/emulated/0/']:
if path.startswith(pre):
path = path.removeprefix(pre)
break
return path

View File

@ -424,29 +424,6 @@ class AdvancedSettingsWindow(ba.Window):
v -= self._spacing * 2.1
this_button_width = 410
self._show_user_mods_button = ba.buttonwidget(
parent=self._subcontainer,
position=(self._sub_width / 2 - this_button_width / 2, v - 10),
size=(this_button_width, 60),
autoselect=True,
label=ba.Lstr(resource=self._r + '.showUserModsText'),
text_scale=1.0,
on_activate_call=show_user_scripts)
if self._show_always_use_internal_keyboard:
assert self._always_use_internal_keyboard_check_box is not None
ba.widget(edit=self._always_use_internal_keyboard_check_box.widget,
down_widget=self._show_user_mods_button)
ba.widget(
edit=self._show_user_mods_button,
up_widget=self._always_use_internal_keyboard_check_box.widget)
else:
ba.widget(edit=self._show_user_mods_button,
up_widget=self._kick_idle_players_check_box.widget)
ba.widget(edit=self._kick_idle_players_check_box.widget,
down_widget=self._show_user_mods_button)
v -= self._spacing * 2.0
self._modding_guide_button = ba.buttonwidget(
parent=self._subcontainer,
position=(self._sub_width / 2 - this_button_width / 2, v - 10),
@ -455,8 +432,30 @@ class AdvancedSettingsWindow(ba.Window):
label=ba.Lstr(resource=self._r + '.moddingGuideText'),
text_scale=1.0,
on_activate_call=ba.Call(
ba.open_url,
'http://www.froemling.net/docs/bombsquad-modding-guide'))
ba.open_url, 'http://ballistica.net/wiki/modding-guide'))
if self._show_always_use_internal_keyboard:
assert self._always_use_internal_keyboard_check_box is not None
ba.widget(edit=self._always_use_internal_keyboard_check_box.widget,
down_widget=self._modding_guide_button)
ba.widget(
edit=self._modding_guide_button,
up_widget=self._always_use_internal_keyboard_check_box.widget)
else:
ba.widget(edit=self._modding_guide_button,
up_widget=self._kick_idle_players_check_box.widget)
ba.widget(edit=self._kick_idle_players_check_box.widget,
down_widget=self._modding_guide_button)
v -= self._spacing * 2.0
self._show_user_mods_button = ba.buttonwidget(
parent=self._subcontainer,
position=(self._sub_width / 2 - this_button_width / 2, v - 10),
size=(this_button_width, 60),
autoselect=True,
label=ba.Lstr(resource=self._r + '.showUserModsText'),
text_scale=1.0,
on_activate_call=show_user_scripts)
v -= self._spacing * 2.0

View File

@ -940,6 +940,7 @@
<w>playpause</w>
<w>playsound</w>
<w>plen</w>
<w>plugnames</w>
<w>pname</w>
<w>podcast</w>
<w>podcasts</w>
@ -1047,6 +1048,7 @@
<w>recv</w>
<w>recvfrom</w>
<w>redundants</w>
<w>reenabled</w>
<w>refcounted</w>
<w>refl</w>
<w>regionid</w>

View File

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