From 42687cfeef7e39ee19db090e364eb9b1b79bec91 Mon Sep 17 00:00:00 2001
From: Eric Froemling
Date: Sat, 7 Nov 2020 15:50:34 -0800
Subject: [PATCH] Disabled old friend scores functionality and cleaned up a bit
---
.efrocachemap | 32 +++++++++----------
.idea/dictionaries/ericf.xml | 1 +
CHANGELOG.md | 1 +
assets/src/ba_data/python/ba/_general.py | 8 -----
assets/src/ba_data/python/ba/ui/__init__.py | 5 +--
.../python/bastd/activity/coopscore.py | 8 +++--
.../src/ba_data/python/bastd/ui/feedback.py | 4 +++
.../python/bastd/ui/gather/publictab.py | 6 ++--
.../bastd/ui/soundtrack/entrytypeselect.py | 31 +++++++++++-------
.../.idea/dictionaries/ericf.xml | 1 +
docs/ba_module.md | 4 +--
src/ballistica/ballistica.cc | 2 +-
12 files changed, 58 insertions(+), 45 deletions(-)
diff --git a/.efrocachemap b/.efrocachemap
index ebc2c63c..cb38fcc7 100644
--- a/.efrocachemap
+++ b/.efrocachemap
@@ -3932,24 +3932,24 @@
"assets/build/windows/Win32/ucrtbased.dll": "https://files.ballistica.net/cache/ba1/b5/85/f8b6d0558ddb87267f34254b1450",
"assets/build/windows/Win32/vc_redist.x86.exe": "https://files.ballistica.net/cache/ba1/1c/e1/4a1a2eddda2f4aebd5f8b64ab08e",
"assets/build/windows/Win32/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/50/8d/bc2600ac9491f1b14d659709451f",
- "build/prefab/full/linux_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/cd/51/3d1c5e13f0cb6035a3d4a8106231",
- "build/prefab/full/linux_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/05/b4/d527fcc8fe53c60a0bbc76083eef",
- "build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/4c/92/d17f56c69c7aa80a47b55a44df8b",
- "build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/09/4f/73ac4884969f83fcc18c88d34675",
- "build/prefab/full/mac_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/a3/18/a7b638e474a248a08bfecf1b151a",
- "build/prefab/full/mac_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/20/15/82b7b054396d70f3ef51d8bf525a",
- "build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/f3/e1/4545a85cc86be1b5049a8ac51102",
- "build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/1f/ab/40bffe1f994caf1e0b19d45f2784",
- "build/prefab/full/windows_x86/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/cc/f8/0c1587462b04588fba9f2f9b7f76",
- "build/prefab/full/windows_x86/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/9b/9f/60617e5848ffae2742db7d1a288e",
- "build/prefab/full/windows_x86_server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/a7/c0/b6e232e2192f2ea9e5b9b57e67c1",
- "build/prefab/full/windows_x86_server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/0d/f0/5ef106a9d14b267b91f6e1c4bc2d",
+ "build/prefab/full/linux_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/53/40/cbee58e7d45a7d9c0cc4d8e73af7",
+ "build/prefab/full/linux_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/53/61/3c1fd5bcf066700d53cb3c2604bf",
+ "build/prefab/full/linux_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/39/86/bf63943222c68cdac3b10d14ffb6",
+ "build/prefab/full/linux_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/a0/39/294f153480513c340df642579705",
+ "build/prefab/full/mac_x86_64/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/00/6c/ba358228cef5a8be1696b932db3a",
+ "build/prefab/full/mac_x86_64/release/ballisticacore": "https://files.ballistica.net/cache/ba1/d4/87/ab452ac272230fbcb200e3b0a043",
+ "build/prefab/full/mac_x86_64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/8f/a4/8eeaa72109a1a22ea9d895747806",
+ "build/prefab/full/mac_x86_64_server/release/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/29/80/3ac39c9bf7ea44cd442aaa3a33e1",
+ "build/prefab/full/windows_x86/debug/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/f1/26/7f6cbcbeee73b50278b6ae4f89d8",
+ "build/prefab/full/windows_x86/release/BallisticaCore.exe": "https://files.ballistica.net/cache/ba1/ca/25/773a1fecd8954f68dc7826df2cc2",
+ "build/prefab/full/windows_x86_server/debug/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/ba/b6/e0cc7b382e2414b752ba6b4c544b",
+ "build/prefab/full/windows_x86_server/release/dist/ballisticacore_headless.exe": "https://files.ballistica.net/cache/ba1/54/95/c7414eaf8c2f40c24a1b4505d368",
"build/prefab/lib/linux_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/c3/d7/627d518a92951cf7fe9fc0b9b3a0",
"build/prefab/lib/linux_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/de/49/2cfc34ac856737d903954db5571b",
"build/prefab/lib/linux_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/e8/9a/67cf9ece361ca2f5d338009bdbfc",
"build/prefab/lib/linux_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/86/de/7d9c9a2b7bba34c630130ed759c9",
- "build/prefab/lib/mac_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/1b/cc/995e13831e0a99cfe04b45a58e4e",
- "build/prefab/lib/mac_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/3e/67/c6d0cd2428d94243e0f8954d0f71",
- "build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/b2/bc/fc4d9ccae2fe3199375481a9a3d6",
- "build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/9e/33/70f3dd7b087627cc69520cc31402"
+ "build/prefab/lib/mac_x86_64/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/3a/e7/5bf767d10d0a55704bbd13b017ae",
+ "build/prefab/lib/mac_x86_64/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/56/95/755810fc5d57e143f2fb07f99557",
+ "build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/01/e7/9dc3184c7a148f3c2981813a47f1",
+ "build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/6c/a5/9732d23dd2c31e01fd2a8b7b7775"
}
\ No newline at end of file
diff --git a/.idea/dictionaries/ericf.xml b/.idea/dictionaries/ericf.xml
index 94a8a102..c6395454 100644
--- a/.idea/dictionaries/ericf.xml
+++ b/.idea/dictionaries/ericf.xml
@@ -330,6 +330,7 @@
classnames
cleancheck
cleanlist
+ cleanupcheck
cleanupchecks
clientid
clientlist
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 69fb7e19..e6a9b6b2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
### 1.5.28 (20239)
- Simplified ba.enum_by_value()
+- Score screens no longer show friend scores (this was available only on specific platforms). This may return (in a universal way) once the game has its own friend system.
### 1.5.27 (20238)
- Language functionality has been consolidated into a LanguageSubsystem object at ba.app.lang
diff --git a/assets/src/ba_data/python/ba/_general.py b/assets/src/ba_data/python/ba/_general.py
index a0bdfeec..21cfc361 100644
--- a/assets/src/ba_data/python/ba/_general.py
+++ b/assets/src/ba_data/python/ba/_general.py
@@ -401,14 +401,6 @@ def storagename(suffix: str = None) -> str:
return fullpath.replace('.', '_')
-def _gut_exception(exc: Exception) -> None:
- assert exc.__traceback__ is not None
- frame: Optional[FrameType] = exc.__traceback__.tb_frame
- while frame is not None:
- frame.clear()
- frame = frame.f_back
-
-
def enum_by_value(cls: Type[ET], value: Any) -> ET:
"""Create an enum from a value.
diff --git a/assets/src/ba_data/python/ba/ui/__init__.py b/assets/src/ba_data/python/ba/ui/__init__.py
index 2d5461be..830af4e9 100644
--- a/assets/src/ba_data/python/ba/ui/__init__.py
+++ b/assets/src/ba_data/python/ba/ui/__init__.py
@@ -30,11 +30,12 @@ class Window:
Category: User Interface Classes
"""
- def __init__(self, root_widget: ba.Widget):
+ def __init__(self, root_widget: ba.Widget, cleanupcheck: bool = True):
self._root_widget = root_widget
# Complain if we outlive our root widget.
- uicleanupcheck(self, root_widget)
+ if cleanupcheck:
+ uicleanupcheck(self, root_widget)
def get_root_widget(self) -> ba.Widget:
"""Return the root widget."""
diff --git a/assets/src/ba_data/python/bastd/activity/coopscore.py b/assets/src/ba_data/python/bastd/activity/coopscore.py
index b8678cd0..7dda4f0c 100644
--- a/assets/src/ba_data/python/bastd/activity/coopscore.py
+++ b/assets/src/ba_data/python/bastd/activity/coopscore.py
@@ -160,8 +160,12 @@ class CoopScoreScreen(ba.Activity[ba.Player, ba.Team]):
# If game-center/etc scores are available we show our friends'
# scores. Otherwise we show our local high scores.
- self._show_friend_scores = _ba.game_service_has_leaderboard(
- self._game_name_str, self._game_config_str)
+ # self._show_friend_scores = _ba.game_service_has_leaderboard(
+ # self._game_name_str, self._game_config_str)
+
+ # Disabling friend scores everywhere for now; can hopefully bring
+ # this back once we've fully implemented our own friends system.
+ self._show_friend_scores = False
try:
self._old_best_rank = self._campaign.getlevel(
diff --git a/assets/src/ba_data/python/bastd/ui/feedback.py b/assets/src/ba_data/python/bastd/ui/feedback.py
index 4b688147..7d4db7c2 100644
--- a/assets/src/ba_data/python/bastd/ui/feedback.py
+++ b/assets/src/ba_data/python/bastd/ui/feedback.py
@@ -17,6 +17,10 @@ def ask_for_rating() -> Optional[ba.Widget]:
app = ba.app
platform = app.platform
subplatform = app.subplatform
+
+ # FIXME: should whitelist platforms we *do* want this for.
+ if ba.app.test_build:
+ return None
if not (platform == 'mac' or (platform == 'android'
and subplatform in ['google', 'cardboard'])):
return None
diff --git a/assets/src/ba_data/python/bastd/ui/gather/publictab.py b/assets/src/ba_data/python/bastd/ui/gather/publictab.py
index c77c73a5..6868be62 100644
--- a/assets/src/ba_data/python/bastd/ui/gather/publictab.py
+++ b/assets/src/ba_data/python/bastd/ui/gather/publictab.py
@@ -679,6 +679,8 @@ class PublicGatherTab(GatherTab):
columnwidget = self._join_list_column
first = True
assert columnwidget
+ ping_good = _ba.get_account_misc_read_val('pingGood', 100)
+ ping_med = _ba.get_account_misc_read_val('pingMed', 500)
for i, party in enumerate(ordered_parties):
hpos = 20
vpos = sub_scroll_height - lineheight * i - 50
@@ -766,8 +768,6 @@ class PublicGatherTab(GatherTab):
text='-',
color=(0.5, 0.5, 0.5))
else:
- ping_good = _ba.get_account_misc_read_val('pingGood', 100)
- ping_med = _ba.get_account_misc_read_val('pingMed', 500)
ba.textwidget(edit=party.ping_widget,
text=str(party.ping),
color=(0, 1, 0) if party.ping <= ping_good else
@@ -776,6 +776,7 @@ class PublicGatherTab(GatherTab):
def _on_public_party_query_result(
self, result: Optional[Dict[str, Any]]) -> None:
+ # starttime = time.time()
with ba.Context('ui'):
# Any time we get any result at all, kill our loading status.
status_text = self._join_status_text
@@ -847,6 +848,7 @@ class PublicGatherTab(GatherTab):
self._server_list_dirty = True
self._update_server_list()
+ # print('updated in {time.time()-starttime:.3f}')
def _update(self) -> None:
"""Periodic updating."""
diff --git a/assets/src/ba_data/python/bastd/ui/soundtrack/entrytypeselect.py b/assets/src/ba_data/python/bastd/ui/soundtrack/entrytypeselect.py
index 53355ab1..142a6bc4 100644
--- a/assets/src/ba_data/python/bastd/ui/soundtrack/entrytypeselect.py
+++ b/assets/src/ba_data/python/bastd/ui/soundtrack/entrytypeselect.py
@@ -47,11 +47,18 @@ class SoundtrackEntryTypeSelectWindow(ba.Window):
self._height += spacing
uiscale = ba.app.ui.uiscale
+
+ # NOTE: When something is selected, we close our UI and kick off
+ # another window which then calls us back when its done, so the
+ # standard UI-cleanup-check complains that something is holding on
+ # to our instance after its ui is gone. Should restructure in a
+ # cleaner way, but just disabling that check for now.
super().__init__(root_widget=ba.containerwidget(
size=(self._width, self._height),
transition=transition,
scale=(1.7 if uiscale is ba.UIScale.SMALL else
- 1.4 if uiscale is ba.UIScale.MEDIUM else 1.0)))
+ 1.4 if uiscale is ba.UIScale.MEDIUM else 1.0)),
+ cleanupcheck=False)
btn = ba.buttonwidget(parent=self._root_widget,
position=(35, self._height - 65),
size=(160, 60),
@@ -133,7 +140,8 @@ class SoundtrackEntryTypeSelectWindow(ba.Window):
def _on_mac_music_app_playlist_press(self) -> None:
music = ba.app.music
- from bastd.ui.soundtrack import macmusicapp
+ from bastd.ui.soundtrack.macmusicapp import (
+ MacMusicAppPlaylistSelectWindow)
ba.containerwidget(edit=self._root_widget, transition='out_left')
current_playlist_entry: Optional[str]
@@ -144,17 +152,17 @@ class SoundtrackEntryTypeSelectWindow(ba.Window):
else:
current_playlist_entry = None
ba.app.ui.set_main_menu_window(
- macmusicapp.MacMusicAppPlaylistSelectWindow(
+ MacMusicAppPlaylistSelectWindow(
self._callback, current_playlist_entry,
self._current_entry).get_root_widget())
def _on_music_file_press(self) -> None:
from ba.osmusic import OSMusicPlayer
- from bastd.ui import fileselector
+ from bastd.ui.fileselector import FileSelectorWindow
ba.containerwidget(edit=self._root_widget, transition='out_left')
base_path = _ba.android_get_external_storage_path()
ba.app.ui.set_main_menu_window(
- fileselector.FileSelectorWindow(
+ FileSelectorWindow(
base_path,
callback=self._music_file_selector_cb,
show_base_path=False,
@@ -163,16 +171,15 @@ class SoundtrackEntryTypeSelectWindow(ba.Window):
allow_folders=False).get_root_widget())
def _on_music_folder_press(self) -> None:
- from bastd.ui import fileselector
+ from bastd.ui.fileselector import FileSelectorWindow
ba.containerwidget(edit=self._root_widget, transition='out_left')
base_path = _ba.android_get_external_storage_path()
ba.app.ui.set_main_menu_window(
- fileselector.FileSelectorWindow(
- base_path,
- callback=self._music_folder_selector_cb,
- show_base_path=False,
- valid_file_extensions=[],
- allow_folders=True).get_root_widget())
+ FileSelectorWindow(base_path,
+ callback=self._music_folder_selector_cb,
+ show_base_path=False,
+ valid_file_extensions=[],
+ allow_folders=True).get_root_widget())
def _music_file_selector_cb(self, result: Optional[str]) -> None:
if result is None:
diff --git a/ballisticacore-cmake/.idea/dictionaries/ericf.xml b/ballisticacore-cmake/.idea/dictionaries/ericf.xml
index de0b1de7..67714432 100644
--- a/ballisticacore-cmake/.idea/dictionaries/ericf.xml
+++ b/ballisticacore-cmake/.idea/dictionaries/ericf.xml
@@ -141,6 +141,7 @@
chrono
cjief
classdict
+ cleanupcheck
clientid
clientinfo
cmath
diff --git a/docs/ba_module.md b/docs/ba_module.md
index 75b83f4a..cd6022f5 100644
--- a/docs/ba_module.md
+++ b/docs/ba_module.md
@@ -1,5 +1,5 @@
-last updated on 2020-11-06 for Ballistica version 1.5.28 build 20239
+last updated on 2020-11-07 for Ballistica version 1.5.28 build 20241
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!
@@ -6328,7 +6328,7 @@ widgets.
-
-
ba.Window(root_widget: ba.Widget)
+ba.Window(root_widget: ba.Widget, cleanupcheck: bool = True)
-
diff --git a/src/ballistica/ballistica.cc b/src/ballistica/ballistica.cc
index e6c7b029..7c432f44 100644
--- a/src/ballistica/ballistica.cc
+++ b/src/ballistica/ballistica.cc
@@ -21,7 +21,7 @@
namespace ballistica {
// These are set automatically via script; don't change here.
-const int kAppBuildNumber = 20240;
+const int kAppBuildNumber = 20242;
const char* kAppVersion = "1.5.28";
// Our standalone globals.