From 13937d47772f99fa3ec0ead281a0a24a8e086cc7 Mon Sep 17 00:00:00 2001 From: Eric Froemling Date: Sun, 21 Jun 2020 03:09:54 -0700 Subject: [PATCH] v1.5.8 --- .efrocachemap | 24 +++--- .idea/dictionaries/ericf.xml | 4 + CHANGELOG.md | 6 ++ assets/src/ba_data/python/ba/_app.py | 5 -- assets/src/ba_data/python/ba/_apputils.py | 44 +++++++---- assets/src/ba_data/python/bastd/ui/config.py | 16 ++-- assets/src/ba_data/python/bastd/ui/gather.py | 79 +++---------------- .../ba_data/python/bastd/ui/settings/audio.py | 2 +- docs/ba_module.md | 2 +- tools/batools/build.py | 4 +- 10 files changed, 74 insertions(+), 112 deletions(-) diff --git a/.efrocachemap b/.efrocachemap index 8b54820e..addd6d70 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/4f/2f/e3b29f02f19fa7e8f2fc14b1fd7b", - "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/3c/f1/514a1c22aaf3e78b13c745ad4306", - "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/b4/5b/6884ab37847e1cc7f849629dcec7", - "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/2a/1a/6503edbce03557e4dc91509578f3", - "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/c0/26/ad827bb61a7d6768092c0bcc3989", - "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/f8/5c/d21d74a56e8e06dc2f7c8ad8916c", - "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/6a/c2/4675f86966169552fa5712eaf182", - "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/ee/d1/68f419fe8daea2c7bccf07f6bae1", - "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/39/c6/fff4fe2694e30a95675f0de5bcbd", - "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/59/98/f578939a40efe49320b7768d1df7", - "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/d3/cd/a4e3ac5b10a081701c348c721d3d", - "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/36/c6/6fb17e0267c5e40d2ed6f72aa134" + "build/prefab/linux-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/48/94/a726a87b0601df96b34e457f406f", + "build/prefab/linux-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/93/f4/1de7a2a7b25e9797cdeb8fbdbd4a", + "build/prefab/linux/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/ed/6f/8d356c4b4aacb83ef227498a0c5c", + "build/prefab/linux/release/ballisticacore": "https://files.ballistica.net/cache/ba1/a8/76/4bf599bdab77331350d0da8a5714", + "build/prefab/mac-server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/3a/36/ebcc874f5b681e4fc22b0512f31b", + "build/prefab/mac-server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/b3/5f/c2b1ff67661b855f93a201fe78fd", + "build/prefab/mac/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/d6/ea/bc68af318e0100d2d4cde351591b", + "build/prefab/mac/release/ballisticacore": "https://files.ballistica.net/cache/ba1/da/08/6913f20d7c0a6f77369f3ade467a", + "build/prefab/windows-server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/36/af/73e96b1008e2a34b43a482534c04", + "build/prefab/windows-server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/19/3b/ee02640ca173b63aa1805fe3b82b", + "build/prefab/windows/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/15/d1/c79915d092932b4019ad086d93dc", + "build/prefab/windows/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/83/c1/73811083cdfbd86f7365001a0ccb" } \ No newline at end of file diff --git a/.idea/dictionaries/ericf.xml b/.idea/dictionaries/ericf.xml index a631cdc7..b97b270f 100644 --- a/.idea/dictionaries/ericf.xml +++ b/.idea/dictionaries/ericf.xml @@ -881,6 +881,7 @@ hmac hmmm hmmmm + hmph hoffs holdingflag holdingteam @@ -1622,6 +1623,7 @@ respawned respawnicon responsetype + resultstr returncode returnfuncptrs returnspc @@ -1900,6 +1902,8 @@ sysctl syslogmodule tabval + tagargs + tagversion taobao taobaomascot targ diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fdc7a93..57b0af09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### 1.5.8 (20079) +- Fixed an issue where touch controls or sound settings values could look like 0.8999999999. Please holler if you see this anywhere else. +- Fixed a potential crash when tapping the screen before the game is fully inited. +- Restored the correct error message in the 'Google Play' connection tab from 1.4 (I am actively working on a replacement) +- Other minor bug fixes. + ### 1.5.7 (20077) - Fixed an issue where co-op score screen rating could look like '3.9999999999999' - Other minor bug fixes. diff --git a/assets/src/ba_data/python/ba/_app.py b/assets/src/ba_data/python/ba/_app.py index abe571f2..184da001 100644 --- a/assets/src/ba_data/python/ba/_app.py +++ b/assets/src/ba_data/python/ba/_app.py @@ -519,11 +519,6 @@ class App: # If there's a leftover log file, attempt to upload # it to the server and/or get rid of it. _apputils.handle_leftover_log_file() - try: - _apputils.handle_leftover_log_file() - except Exception: - from ba import _error - _error.print_exception('Error handling leftover log file') # Notify the user if we're using custom system scripts. # FIXME: This no longer works since sys-scripts is an absolute path; diff --git a/assets/src/ba_data/python/ba/_apputils.py b/assets/src/ba_data/python/ba/_apputils.py index a2ae13b1..dcecd42c 100644 --- a/assets/src/ba_data/python/ba/_apputils.py +++ b/assets/src/ba_data/python/ba/_apputils.py @@ -136,26 +136,36 @@ def handle_log() -> None: def handle_leftover_log_file() -> None: """Handle an un-uploaded log from a previous run.""" - import json - from ba._netutils import serverput + try: + import json + from ba._netutils import serverput - if os.path.exists(_ba.get_log_file_path()): - with open(_ba.get_log_file_path()) as infile: - info = json.loads(infile.read()) - infile.close() - do_send = should_submit_debug_info() - if do_send: + if os.path.exists(_ba.get_log_file_path()): + with open(_ba.get_log_file_path()) as infile: + info = json.loads(infile.read()) + infile.close() + do_send = should_submit_debug_info() + if do_send: - def response(data: Any) -> None: - # Non-None response means we were successful; - # lets kill it. - if data is not None: - os.remove(_ba.get_log_file_path()) + def response(data: Any) -> None: + # Non-None response means we were successful; + # lets kill it. + if data is not None: + try: + os.remove(_ba.get_log_file_path()) + except FileNotFoundError: + # Saw this in the wild. The file just existed + # a moment ago but I suppose something could have + # killed it since. ¯\_(ツ)_/¯ + pass - serverput('bsLog', info, response) - else: - # If they don't want logs uploaded just kill it. - os.remove(_ba.get_log_file_path()) + serverput('bsLog', info, response) + else: + # If they don't want logs uploaded just kill it. + os.remove(_ba.get_log_file_path()) + except Exception: + from ba import _error + _error.print_exception('Error handling leftover log file.') def garbage_collect(session_end: bool = True) -> None: diff --git a/assets/src/ba_data/python/bastd/ui/config.py b/assets/src/ba_data/python/bastd/ui/config.py index a55c5a95..8426de77 100644 --- a/assets/src/ba_data/python/bastd/ui/config.py +++ b/assets/src/ba_data/python/bastd/ui/config.py @@ -127,23 +127,23 @@ class ConfigNumberEdit: text=displayname, maxwidth=160 + xoffset, color=(0.8, 0.8, 0.8, 1.0), - h_align="left", - v_align="center", + h_align='left', + v_align='center', scale=textscale) self.valuetext = ba.textwidget(parent=parent, position=(246 + xoffset, position[1]), size=(60, 28), editable=False, color=(0.3, 1.0, 0.3, 1.0), - h_align="right", - v_align="center", + h_align='right', + v_align='center', text=str(self._value), padding=2) self.minusbutton = ba.buttonwidget( parent=parent, position=(330 + xoffset, position[1]), size=(28, 28), - label="-", + label='-', autoselect=True, on_activate_call=ba.Call(self._down), repeat=True, @@ -152,12 +152,12 @@ class ConfigNumberEdit: position=(380 + xoffset, position[1]), size=(28, 28), - label="+", + label='+', autoselect=True, on_activate_call=ba.Call(self._up), repeat=True, enable_sound=changesound) - # complain if we outlive our widgets + # Complain if we outlive our widgets. ba.uicleanupcheck(self, self.nametext) self._update_display() @@ -177,4 +177,4 @@ class ConfigNumberEdit: ba.app.config.apply_and_commit() def _update_display(self) -> None: - ba.textwidget(edit=self.valuetext, text=str(round(self._value, 2))) + ba.textwidget(edit=self.valuetext, text=f'{self._value:.1f}') diff --git a/assets/src/ba_data/python/bastd/ui/gather.py b/assets/src/ba_data/python/bastd/ui/gather.py index 2fdc1e18..6d2da8c3 100644 --- a/assets/src/ba_data/python/bastd/ui/gather.py +++ b/assets/src/ba_data/python/bastd/ui/gather.py @@ -348,8 +348,6 @@ class GatherWindow(ba.Window): elif tab == 'google_play': c_width = self._scroll_width c_height = 380.0 - b_width = 250.0 - b_width2 = 230.0 self._tab_container = cnt = ba.containerwidget( parent=self._root_widget, position=(scroll_left, scroll_bottom + @@ -357,71 +355,17 @@ class GatherWindow(ba.Window): size=(c_width, c_height), background=False, selection_loop_to_parent=True) - img_size = 100 - v = c_height - 30 - ba.textwidget(parent=cnt, - position=(c_width * 0.5, v), - color=(0.6, 1.0, 0.6), - scale=1.3, - size=(0, 0), - maxwidth=c_width * 0.9, - h_align='center', - v_align='center', - text=ba.Lstr(resource=self._r + - '.googlePlayDescriptionText')) - v -= 35 - ba.textwidget(parent=cnt, - position=(c_width * 0.5, v), - color=(0.6, 1.0, 0.6), - scale=0.7, - size=(0, 0), - maxwidth=c_width * 0.9, - h_align='center', - v_align='center', - text=ba.Lstr(resource=self._r + - '.worksWithGooglePlayDevicesText')) - v -= 125 - btn = ba.buttonwidget( + v = c_height - 30.0 + ba.textwidget( parent=cnt, - label='', - position=(c_width * 0.5 - b_width * 0.5, v - b_width * 0.5), - size=(b_width, b_width * 0.9), - button_type='square', - on_activate_call=self._on_google_play_invite_press, - autoselect=True, - up_widget=self._tab_buttons[tab]) - ba.imagewidget(parent=cnt, - position=(c_width * 0.5 - img_size * 0.5, v - 35), - size=(img_size, img_size), - draw_controller=btn, - texture=ba.gettexture('googlePlayGamesIcon'), - color=(0, 1, 0)) - ba.textwidget(parent=cnt, - text=ba.Lstr(resource=self._r + - '.googlePlayInviteText'), - maxwidth=b_width * 0.8, - draw_controller=btn, - color=(0, 1, 0), - flatness=1.0, - position=(c_width * 0.5, v - 60), - scale=1.6, - size=(0, 0), - h_align='center', - v_align='center') - v -= 180 - ba.buttonwidget( - parent=cnt, - label=ba.Lstr(resource=self._r + '.googlePlaySeeInvitesText'), - color=(0.5, 0.5, 0.6), - textcolor=(0.75, 0.7, 0.8), - autoselect=True, - position=(c_width * 0.5 - b_width2 * 0.5, v), - size=(b_width2, 60), - on_activate_call=lambda: ba.timer( - 0.1, - self._on_google_play_show_invites_press, - timetype=ba.TimeType.REAL), - ) + position=(c_width * 0.5, v - 140.0), + color=(0.6, 1.0, 0.6), + scale=1.3, + size=(0.0, 0.0), + maxwidth=c_width * 0.9, + h_align='center', + v_align='center', + text=ba.Lstr(resource='googleMultiplayerDiscontinuedText')) elif tab == 'internet': c_width = self._scroll_width @@ -1717,6 +1661,9 @@ class GatherWindow(ba.Window): self._call, self._address, self._port, ping if accessible else None), from_other_thread=True) + except ConnectionRefusedError: + # Fine, server; sorry we pinged you. Hmph. + pass except OSError as exc: import errno diff --git a/assets/src/ba_data/python/bastd/ui/settings/audio.py b/assets/src/ba_data/python/bastd/ui/settings/audio.py index bf4c34ce..02c6b25d 100644 --- a/assets/src/ba_data/python/bastd/ui/settings/audio.py +++ b/assets/src/ba_data/python/bastd/ui/settings/audio.py @@ -206,7 +206,7 @@ class AudioSettingsWindow(ba.Window): else: self._soundtrack_button = None - # tweak a few navigation bits + # Tweak a few navigation bits. try: ba.widget(edit=back_button, down_widget=svne.minusbutton) except Exception: diff --git a/docs/ba_module.md b/docs/ba_module.md index ea629bcd..7852b68e 100644 --- a/docs/ba_module.md +++ b/docs/ba_module.md @@ -1,5 +1,5 @@ -

last updated on 2020-06-19 for Ballistica version 1.5.6 build 20076

+

last updated on 2020-06-21 for Ballistica version 1.5.8 build 20079

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!


diff --git a/tools/batools/build.py b/tools/batools/build.py index ca2abb97..a918883f 100644 --- a/tools/batools/build.py +++ b/tools/batools/build.py @@ -47,9 +47,9 @@ class PipRequirement: PIP_REQUIREMENTS = [ PipRequirement(modulename='pylint', minversion=[2, 5, 3]), - PipRequirement(modulename='mypy', minversion=[0, 780]), + PipRequirement(modulename='mypy', minversion=[0, 781]), PipRequirement(modulename='yapf', minversion=[0, 30, 0]), - PipRequirement(modulename='cpplint', minversion=[1, 5, 0]), + PipRequirement(modulename='cpplint', minversion=[1, 5, 1]), PipRequirement(modulename='typing_extensions'), PipRequirement(modulename='pytz'), PipRequirement(modulename='yaml', pipname='PyYAML'),