all token pack purchases disable ads

This commit is contained in:
Eric Froemling 2025-01-17 20:41:45 -08:00
parent ba5b2bb8a6
commit 4dbe0be487
No known key found for this signature in database
12 changed files with 153 additions and 262 deletions

90
.efrocachemap generated
View File

@ -432,21 +432,21 @@
"build/assets/ba_data/audio/zoeOw.ogg": "b2d705c31c9dcc1efdc71394764c3beb",
"build/assets/ba_data/audio/zoePickup01.ogg": "e9366dc2d2b8ab8b0c4e2c14c02d0789",
"build/assets/ba_data/audio/zoeScream01.ogg": "903e0e45ee9b3373e9d9ce20c814374e",
"build/assets/ba_data/data/langdata.json": "4c8242df36a1b589035beb4711cbf772",
"build/assets/ba_data/data/languages/arabic.json": "397dfd469ef7c744cbb472cd19b73f1f",
"build/assets/ba_data/data/languages/belarussian.json": "0b60a9d4496d1213c2d0b647d346ce30",
"build/assets/ba_data/data/langdata.json": "d0cd6dc622b1270b296722fad38dd229",
"build/assets/ba_data/data/languages/arabic.json": "32b9849fb8389b8c7798f0b744620318",
"build/assets/ba_data/data/languages/belarussian.json": "009b452aa308bf2b2f7e92d9b78ba5ff",
"build/assets/ba_data/data/languages/chinese.json": "168b529f2d55d714886be57f162f6842",
"build/assets/ba_data/data/languages/chinesetraditional.json": "32f53581b80ce723edbe8aa7956e6727",
"build/assets/ba_data/data/languages/croatian.json": "e131a87cf5783e0fbb3d211a927efe1a",
"build/assets/ba_data/data/languages/croatian.json": "66be7ada024c5d5cf813a07b75217e48",
"build/assets/ba_data/data/languages/czech.json": "3418bee44e69be13b7f72996abe96921",
"build/assets/ba_data/data/languages/danish.json": "8e57db30c5250df2abff14a822f83ea7",
"build/assets/ba_data/data/languages/dutch.json": "4ba5bbcc0fecddd0aac6ee2c165d1e40",
"build/assets/ba_data/data/languages/english.json": "527d106870b0690cc39a80b88e60ab7a",
"build/assets/ba_data/data/languages/english.json": "3fadacf666ee8578454b32f0cca4b90d",
"build/assets/ba_data/data/languages/esperanto.json": "0e397cfa5f3fb8cef5f4a64f21cda880",
"build/assets/ba_data/data/languages/filipino.json": "1894fc331dcad7ce9cf4c180843f548f",
"build/assets/ba_data/data/languages/french.json": "6d20655730b1017ef187fd828b91d43c",
"build/assets/ba_data/data/languages/german.json": "bc656f1ada467161c23546f48d0dacc5",
"build/assets/ba_data/data/languages/gibberish.json": "2569fe1b2f686670f825e2faaa8c5dc3",
"build/assets/ba_data/data/languages/gibberish.json": "640231f8f1eb01e4d617889abf3c25e4",
"build/assets/ba_data/data/languages/greek.json": "d28d1092fbb00ed857cbd53124c0dc78",
"build/assets/ba_data/data/languages/hindi.json": "567e6976b3c72f891431ad7fcc62ab16",
"build/assets/ba_data/data/languages/hungarian.json": "af801baffb2c06460635dfb04c34bb3e",
@ -462,14 +462,14 @@
"build/assets/ba_data/data/languages/russian.json": "eca8fe1ef8343aee559e49c49805b850",
"build/assets/ba_data/data/languages/serbian.json": "623fa4129a1154c2f32ed7867e56ff6a",
"build/assets/ba_data/data/languages/slovak.json": "c11c29708b3742cdc2a92b4fa0d6d29f",
"build/assets/ba_data/data/languages/spanish.json": "f8ab976d219e579546bb98b6d7fd12ce",
"build/assets/ba_data/data/languages/spanish.json": "fc68307ff25bb8ef93cf168ac4524e19",
"build/assets/ba_data/data/languages/swedish.json": "3b179e7333183c70adb0811246b09959",
"build/assets/ba_data/data/languages/tamil.json": "ead39b864228696a9b0d19344bc4b5ec",
"build/assets/ba_data/data/languages/thai.json": "383540a1e9c7c131ac579f51afc87471",
"build/assets/ba_data/data/languages/turkish.json": "1415bdb746551f0a24f0e675304dfe07",
"build/assets/ba_data/data/languages/ukrainian.json": "6063d27c9d6ed013b2b64ff452433621",
"build/assets/ba_data/data/languages/ukrainian.json": "0db55824759119aca74d2ee8ffe6daae",
"build/assets/ba_data/data/languages/venetian.json": "e0666c6a1db1792d895fcb250e59861b",
"build/assets/ba_data/data/languages/vietnamese.json": "59f6686890ceac2b0ac92597751a18ca",
"build/assets/ba_data/data/languages/vietnamese.json": "017d8aa346d0c23a229a8a9acccf79a1",
"build/assets/ba_data/data/maps/big_g.json": "1dd301d490643088a435ce75df971054",
"build/assets/ba_data/data/maps/bridgit.json": "6aea74805f4880cc11237c5734a24422",
"build/assets/ba_data/data/maps/courtyard.json": "4b836554c8949bcd2ae382f5e3c1a9cc",
@ -4174,42 +4174,42 @@
"build/assets/windows/Win32/ucrtbased.dll": "bfd1180c269d3950b76f35a63655e9e1",
"build/assets/windows/Win32/vc_redist.x86.exe": "15a5f1f876503885adbdf5b3989b3718",
"build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "cbc3b41cdc03a5ea477ca025087951f3",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "c04260638a82ecc1a1c24308de1447a6",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "e2a148fd04337c64310bff6bf458e4d5",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "ae85400edb0f4ed74e4ff984594df42e",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "813cdf1e5773fc376bb0a275a9dd3584",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "4fd874c5c3102c84f2ea951829be2b31",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "b0a75cc7b7941e23254c42de6b1c68ef",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "e98954ee8676031983d30e12ec800a01",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "4718e53a8e831c7f1f55bd828b747e8e",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "1789ce6e59d6e15c7e8ba857a3ad6d7e",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "348e2cb791e5e5a76a536d53dfe1a09b",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "1bfecc981df6fe4f9780a31c45049096",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "8581b9f97a2e4c4c4c64a5dd2db59f20",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "88f5af63ea44c416a3e7c5da5cab8a57",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "099f0e4d327dcf301fbb6c016913dec5",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "ce37d95901baf24c70d12a283b8f5b04",
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "b261c8140179fdaa56deeaff30b12e04",
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "72f521386bbf1ddfdd22b77b75a177fa",
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "b261c8140179fdaa56deeaff30b12e04",
"build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "72f521386bbf1ddfdd22b77b75a177fa",
"build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "6099ef66a7b84ee1e2e88ad13d58c642",
"build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "98ed0b5b161a2306d1d83a38dd65e2f5",
"build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "6099ef66a7b84ee1e2e88ad13d58c642",
"build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "98ed0b5b161a2306d1d83a38dd65e2f5",
"build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "b8c4ecf1d17b2831f0eb8ff7d9ed496c",
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "ccb9b1af334e1594265fa9f68ae31937",
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "b8c4ecf1d17b2831f0eb8ff7d9ed496c",
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "ccb9b1af334e1594265fa9f68ae31937",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "6cfee84ef3844d8ddb2f7cd59dda281f",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "978e9b9049eec68ad97e8caf02d35ce4",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "b6c1bcc9c185e1678e6ec7dd71b03da8",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "ea274b3238460f61374aac61bbced2b0",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "f24d22c9b329b3ceef25c08ec8d51345",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "a02b4c513a724d79a1bbc12f2a1071da",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "73c6fca1f12ab73775167aaa80b9694d",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "cc9b51c63c706da56ba8080cc28078e9",
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "6f882d6748b3e5c92eb099f3b0b29837",
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "0579a815f9f582dbf69e73da3e51500d",
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "aa04b11644160c8338052938ffbb7d8e",
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "9086d02dd9c39a9d95139b49d2f404a1",
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "14229b8337f1a4b9bf65f55a54a88937",
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "eac49802c4b77d1e341ee5dfe052663c",
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "916b96eb3ccd5f44e77e052559fe6e32",
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "06d13234688c95918472888b6778dbd4",
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "caaad53329bad3d2b16d109cc5b2e37e",
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "70b4672871efd3d57b6f2d15ff1341bc",
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "f0afdeee1f22d35e942a54ae86a1dd74",
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "78019c91c31e36752bc2cb2bcf482f1e",
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "93343b1e04752845eef31900d618e380",
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "6b3c2f6d1d59ff8af390a99795fbcc7e",
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "9e7c2c5f38fb94211af69bce5e4ea1de",
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "84c841a74a457ac69ec654363084a248",
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "cbacac5a846cf8a0f6db760aaddcd13a",
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "3d16bac10d8f15bac7fe20e3a927b275",
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "cbacac5a846cf8a0f6db760aaddcd13a",
"build/prefab/lib/linux_arm64_server/release/libballisticaplus.a": "3d16bac10d8f15bac7fe20e3a927b275",
"build/prefab/lib/linux_x86_64_gui/debug/libballisticaplus.a": "88251dd5c8428482c55e7c109a600ad8",
"build/prefab/lib/linux_x86_64_gui/release/libballisticaplus.a": "7f7c396ca028d265bc3eae4433a1a102",
"build/prefab/lib/linux_x86_64_server/debug/libballisticaplus.a": "88251dd5c8428482c55e7c109a600ad8",
"build/prefab/lib/linux_x86_64_server/release/libballisticaplus.a": "7f7c396ca028d265bc3eae4433a1a102",
"build/prefab/lib/mac_arm64_gui/debug/libballisticaplus.a": "6121591b94d920ee541194b65d93958a",
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "7dd182733a34da0ca5f5c97e5cb0b7f0",
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "6121591b94d920ee541194b65d93958a",
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "7dd182733a34da0ca5f5c97e5cb0b7f0",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "15fe85e4facbf3799b234098d8f51534",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "bf5ff0b1826dac5bb9af5731805a1b0b",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "142b2b2069ffa72525e8151fb7e4a695",
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "183266996ae2a53c9d555d8e1e9aaabe",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "ffa58d5514f78d47b749aa62378244a3",
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "78dbe3b34535192fb2c9fbd70a61466b",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "4af3444c3917b7a2e5f937a639af9782",
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "669f40763a85163af67e460c393ddb6a",
"src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c",
"src/assets/ba_data/python/babase/_mgen/enums.py": "794d258d59fd17a61752843a9a0551ad",
"src/ballistica/base/mgen/pyembed/binding_base.inc": "06042d31df0ff9af96b99477162e2a91",

View File

@ -1,4 +1,4 @@
### 1.7.37 (build 22198, api 9, 2025-01-17)
### 1.7.37 (build 22200, api 9, 2025-01-17)
- Bumping api version to 9. As you'll see below, there's some UI changes that
will require a bit of work for any UI mods to adapt to. If your mods don't
touch UI stuff at all you can simply bump your api version and call it a day.

View File

@ -249,10 +249,9 @@ class AccountV1Subsystem:
if plus is None:
return False
# We expose pro options if the server tells us to
# (which is generally just when we own pro),
# or also if we've been grandfathered in
# or are using ballistica-core builds.
# We expose pro options if the server tells us to (which is
# generally just when we own pro), or also if we've been
# grandfathered in.
return self.have_pro() or bool(
plus.get_v1_account_misc_read_val_2('proOptionsUnlocked', False)
or babase.app.config.get('lc14292', 0) > 1

View File

@ -48,19 +48,7 @@ class AdsSubsystem:
1.0,
lambda: babase.screenmessage(
babase.Lstr(
resource='removeInGameAdsText',
subs=[
(
'${PRO}',
babase.Lstr(
resource='store.bombSquadProNameText'
),
),
(
'${APP_NAME}',
babase.Lstr(resource='titleText'),
),
],
resource='removeInGameAdsTokenPurchaseText'
),
color=(1, 1, 0),
),
@ -100,8 +88,14 @@ class AdsSubsystem:
# No ads without net-connections, etc.
if not plus.can_show_ad():
show = False
if classic.accounts.have_pro():
show = False # Pro disables interstitials.
# Pro or other upgrades disable interstitials.
if (
classic.accounts.have_pro()
or classic.gold_pass
or classic.remove_ads
):
show = False
try:
session = bascenev1.get_foreground_host_session()
assert session is not None

View File

@ -177,6 +177,9 @@ class ClassicAppMode(babase.AppMode):
assert plus is not None
classic = babase.app.classic
assert classic is not None
if account is not None:
babase.set_ui_account_state(True, account.tag)
else:
@ -195,6 +198,8 @@ class ClassicAppMode(babase.AppMode):
self._test_sub = None
if account is None:
classic.gold_pass = False
classic.remove_ads = False
self._account_data_sub = None
_baclassic.set_root_ui_account_values(
tickets=-1,
@ -263,6 +268,13 @@ class ClassicAppMode(babase.AppMode):
chest2 = val.chests.get('2')
chest3 = val.chests.get('3')
# Keep a few handy values on classic updated with the latest
# data.
classic = babase.app.classic
assert classic is not None
classic.remove_ads = val.remove_ads
classic.gold_pass = val.gold_pass
_baclassic.set_root_ui_account_values(
tickets=val.tickets,
tokens=val.tokens,

View File

@ -72,10 +72,13 @@ class ClassicAppSubsystem(babase.AppSubsystem):
self.stress_test_update_timer: babase.AppTimer | None = None
self.stress_test_update_timer_2: babase.AppTimer | None = None
self.value_test_defaults: dict = {}
self.special_offer: dict | None = None
self.ping_thread_count = 0
self.allow_ticket_purchases: bool = True
# Classic-specific account state.
self.remove_ads = False
self.gold_pass = False
# Main Menu.
self.main_menu_did_initial_transition = False
self.main_menu_last_news_fetch_time: float | None = None

View File

@ -53,7 +53,7 @@ if TYPE_CHECKING:
# Build number and version of the ballistica binary we expect to be
# using.
TARGET_BALLISTICA_BUILD = 22198
TARGET_BALLISTICA_BUILD = 22200
TARGET_BALLISTICA_VERSION = '1.7.37'

View File

@ -69,7 +69,6 @@ class GetTokensWindow(bui.MainWindow):
self,
transition: str | None = 'in_right',
origin_widget: bui.Widget | None = None,
# restore_previous_call: Callable[[bui.Widget], None] | None = None,
):
bwidthstd = 170
bwidthwide = 300
@ -302,7 +301,6 @@ class GetTokensWindow(bui.MainWindow):
]
self._transitioning_out = False
# self._restore_previous_call = restore_previous_call
self._textcolor = (0.92, 0.92, 2.0)
self._query_in_flight = False
@ -311,39 +309,26 @@ class GetTokensWindow(bui.MainWindow):
None
)
# If they provided an origin-widget, scale up from that.
# scale_origin: tuple[float, float] | None
# if origin_widget is not None:
# self._transition_out = 'out_scale'
# scale_origin = origin_widget.get_screen_space_center()
# transition = 'in_scale'
# else:
# self._transition_out = 'out_right'
# scale_origin = None
uiscale = bui.app.ui_v1.uiscale
self._width = 1000.0 if uiscale is bui.UIScale.SMALL else 800.0
self._width = 1000.0 if uiscale is bui.UIScale.SMALL else 1070.0
self._x_inset = 25.0 if uiscale is bui.UIScale.SMALL else 0.0
self._height = 550 if uiscale is bui.UIScale.SMALL else 480.0
self._y_offset = -60 if uiscale is bui.UIScale.SMALL else 0
self._height = 550 if uiscale is bui.UIScale.SMALL else 520.0
self._y_offset = -60 if uiscale is bui.UIScale.SMALL else -30
self._r = 'getTokensWindow'
super().__init__(
root_widget=bui.containerwidget(
size=(self._width, self._height),
# transition=transition,
# scale_origin_stack_offset=scale_origin,
color=(0.3, 0.23, 0.36),
scale=(
1.5
if uiscale is bui.UIScale.SMALL
else 1.2 if uiscale is bui.UIScale.MEDIUM else 1.0
else 1.1 if uiscale is bui.UIScale.MEDIUM else 0.95
),
stack_offset=(
(0, -3) if uiscale is bui.UIScale.SMALL else (0, 0)
),
# toolbar_visibility='menu_minimal',
toolbar_visibility=(
'get_tokens'
if uiscale is bui.UIScale.SMALL
@ -366,33 +351,13 @@ class GetTokensWindow(bui.MainWindow):
55 + self._x_inset,
self._height - 80 + self._y_offset,
),
size=(
# (140, 60)
# if self._restore_previous_call is None
# else
(60, 60)
),
size=((60, 60)),
scale=1.0,
autoselect=True,
label=(
# bui.Lstr(resource='doneText')
# if self._restore_previous_call is None
# else
bui.charstr(bui.SpecialChar.BACK)
),
button_type=(
# 'regular'
# if self._restore_previous_call is None
# else
'backSmall'
),
label=(bui.charstr(bui.SpecialChar.BACK)),
button_type=('backSmall'),
on_activate_call=self.main_window_back,
)
# if uiscale is bui.UIScale.SMALL:
# bui.widget(
# edit=self._back_button,
# up_widget=bui.get_special_widget('tokens_meter'),
# )
bui.containerwidget(
edit=self._root_widget, cancel_button=self._back_button
)
@ -428,13 +393,6 @@ class GetTokensWindow(bui.MainWindow):
self._status_text,
]
# self._token_count_widget: bui.Widget | None = None
# self._smooth_update_timer: bui.AppTimer | None = None
# self._smooth_token_count: float | None = None
# self._token_count: int = 0
# self._smooth_increase_speed = 1.0
# self._ticking_sound: bui.Sound | None = None
# Get all textures used by our buttons preloading so hopefully
# they'll be in place by the time we show them.
for bdef in self._buttondefs:
@ -448,11 +406,6 @@ class GetTokensWindow(bui.MainWindow):
)
self._update()
# def __del__(self) -> None:
# if self._ticking_sound is not None:
# self._ticking_sound.stop()
# self._ticking_sound = None
@override
def get_main_window_state(self) -> bui.MainWindowState:
# Support recreating our window for back/refresh purposes.
@ -561,6 +514,7 @@ class GetTokensWindow(bui.MainWindow):
) -> None:
# pylint: disable=too-many-locals
plus = bui.app.plus
classic = bui.app.classic
uiscale = bui.app.ui_v1.uiscale
@ -578,6 +532,7 @@ class GetTokensWindow(bui.MainWindow):
assert self._buttondefs
sidepad = 10.0
xfudge = 6.0
total_button_width = (
sum(b.width + b.prepad for b in self._buttondefs)
+ buttonpadding * (len(self._buttondefs) - 1)
@ -593,22 +548,24 @@ class GetTokensWindow(bui.MainWindow):
),
claims_left_right=True,
highlight=False,
border_opacity=0.3 if uiscale is bui.UIScale.SMALL else 1.0,
border_opacity=0.4,
center_small_content=True,
)
subcontainer = bui.containerwidget(
parent=h_scroll,
background=False,
size=(max(total_button_width, scrollwidth), scrollheight),
size=(total_button_width, scrollheight),
)
tinfobtn = bui.buttonwidget(
parent=self._root_widget,
autoselect=True,
label=bui.Lstr(resource='learnMoreText'),
text_scale=0.7,
position=(
self._width * 0.5 - 75,
self._height - 125 + self._y_offset,
self._height - 100 + self._y_offset,
),
size=(180, 43),
size=(180, 40),
scale=0.8,
color=(0.4, 0.25, 0.5),
textcolor=self._textcolor,
@ -628,7 +585,7 @@ class GetTokensWindow(bui.MainWindow):
right_widget=bui.get_special_widget('tokens_meter'),
)
x = sidepad
x = sidepad + xfudge
bwidgets: list[bui.Widget] = []
for i, buttondef in enumerate(self._buttondefs):
@ -704,46 +661,43 @@ class GetTokensWindow(bui.MainWindow):
x += buttondef.width + buttonpadding
bui.containerwidget(edit=subcontainer, visible_child=bwidgets[0])
_tinfotxt = bui.textwidget(
parent=self._root_widget,
position=(self._width * 0.5, self._height - 70 + self._y_offset),
color=self._textcolor,
shadow=1.0,
scale=0.7,
size=(0, 0),
h_align='center',
v_align='center',
text=bui.Lstr(resource='tokens.shinyNewCurrencyText'),
)
# self._token_count_widget = bui.textwidget(
# parent=self._root_widget,
# position=(
# self._width - self._x_inset - 120.0,
# self._height - 48 + self._y_offset,
# ),
# color=(2.0, 0.7, 0.0),
# shadow=1.0,
# flatness=0.0,
# size=(0, 0),
# h_align='left',
# v_align='center',
# text='',
# )
# self._token_count = response.tokens
# self._smooth_token_count = float(self._token_count)
# self._smooth_update() # will set the text widget.
if bool(False):
_tinfotxt = bui.textwidget(
parent=self._root_widget,
position=(
self._width * 0.5,
self._height - 70 + self._y_offset,
),
color=self._textcolor,
shadow=1.0,
scale=0.7,
size=(0, 0),
h_align='center',
v_align='center',
text=bui.Lstr(resource='tokens.shinyNewCurrencyText'),
)
# _tlabeltxt = bui.textwidget(
# parent=self._root_widget,
# position=(
# self._width - self._x_inset - 123.0,
# self._height - 48 + self._y_offset,
# ),
# size=(0, 0),
# h_align='right',
# v_align='center',
# text=bui.charstr(bui.SpecialChar.TOKEN),
# )
has_removed_ads = classic is not None and (
classic.gold_pass
or classic.remove_ads
or classic.accounts.have_pro()
)
if plus is not None and plus.has_video_ads() and not has_removed_ads:
_tinfotxt = bui.textwidget(
parent=self._root_widget,
position=(
self._width * 0.5,
self._height - 120 + self._y_offset,
),
color=(0.4, 1.0, 0.4),
shadow=1.0,
scale=0.5,
size=(0, 0),
h_align='center',
v_align='center',
maxwidth=scrollwidth * 0.9,
text=bui.Lstr(resource='removeInGameAdsTokenPurchaseText'),
)
def _purchase_press(self, itemid: str) -> None:
plus = bui.app.plus
@ -767,84 +721,8 @@ class GetTokensWindow(bui.MainWindow):
def _update_store_state(self) -> None:
"""Called to make minor updates to an already shown store."""
# assert self._token_count_widget is not None
assert self._last_query_response is not None
# self._token_count = self._last_query_response.tokens
# Kick off new smooth update if need be.
# assert self._smooth_token_count is not None
# if (
# self._token_count != int(self._smooth_token_count)
# and self._smooth_update_timer is None
# ):
# self._smooth_update_timer = bui.AppTimer(
# 0.05, bui.WeakCall(self._smooth_update), repeat=True
# )
# diff = abs(float(self._token_count) - self._smooth_token_count)
# self._smooth_increase_speed = (
# diff / 100.0
# if diff >= 5000
# else (
# diff / 50.0
# if diff >= 1500
# else diff / 30.0 if diff >= 500 else diff / 15.0
# )
# )
# def _smooth_update(self) -> None:
# # Stop if the count widget disappears.
# if not self._token_count_widget:
# self._smooth_update_timer = None
# return
# finished = False
# # If we're going down, do it immediately.
# assert self._smooth_token_count is not None
# if int(self._smooth_token_count) >= self._token_count:
# self._smooth_token_count = float(self._token_count)
# finished = True
# else:
# # We're going up; start a sound if need be.
# self._smooth_token_count = min(
# self._smooth_token_count + 1.0 * self._smooth_increase_speed,
# self._token_count,
# )
# if int(self._smooth_token_count) >= self._token_count:
# finished = True
# self._smooth_token_count = float(self._token_count)
# elif self._ticking_sound is None:
# self._ticking_sound = bui.getsound('scoreIncrease')
# self._ticking_sound.play()
# bui.textwidget(
# edit=self._token_count_widget,
# text=str(int(self._smooth_token_count)),
# )
# # If we've reached the target, kill the timer/sound/etc.
# if finished:
# self._smooth_update_timer = None
# if self._ticking_sound is not None:
# self._ticking_sound.stop()
# self._ticking_sound = None
# bui.getsound('cashRegister2').play()
# def _back(self) -> None:
# self.main_
# No-op if our underlying widget is dead or on its way out.
# if not self._root_widget or self._root_widget.transitioning_out:
# return
# bui.containerwidget(
# edit=self._root_widget, transition=self._transition_out
# )
# if self._restore_previous_call is not None:
# self._restore_previous_call(self._root_widget)
def _on_learn_more_press(self, url: str) -> None:
bui.open_url(url)
@ -878,17 +756,16 @@ def show_get_tokens_prompt() -> None:
def show_get_tokens_window(origin_widget: bui.Widget | None = None) -> None:
"""Show the window allowing token purchases."""
"""Transition to the get-tokens main-window from anywhere."""
# NOTE TO USERS: The code below is not the proper way to do things;
# whenever possible one should use a MainWindow's
# main_window_replace() or main_window_back() methods. We just need
# to do things a bit more manually in this case.
# to do things a bit more manually in this particular case.
prev_main_window = bui.app.ui_v1.get_main_window()
# Special-case: If it seems we're already in the account window, do
# nothing.
# Special-case: If it seems we're already in the window, do nothing.
if isinstance(prev_main_window, GetTokensWindow):
return

View File

@ -26,7 +26,7 @@ class ResourceTypeInfoWindow(PopupWindow):
scale = (
2.0
if uiscale is bui.UIScale.SMALL
else 1.3 if uiscale is bui.UIScale.MEDIUM else 0.7
else 1.4 if uiscale is bui.UIScale.MEDIUM else 0.8
)
self._transitioning_out = False
self._width = 570
@ -81,19 +81,23 @@ class ResourceTypeInfoWindow(PopupWindow):
bwidth = 200
bheight = 50
self._get_tokens_button = bui.buttonwidget(
parent=self.root_widget,
position=(
self._width * 0.5 - bwidth * 0.5,
yoffs - 15.0 - bheight - max_rdesc_height,
),
color=bg_color,
textcolor=(0.8, 0.8, 0.8),
label=bui.Lstr(resource='tokens.getTokensText'),
size=(bwidth, bheight),
autoselect=True,
on_activate_call=bui.WeakCall(self._on_get_tokens_press),
)
# Show 'Get Tokens' button if we don't have a gold pass
# (in case a user doesn't notice the '+' button or we have
# it disabled for some reason).
if not bui.app.classic.gold_pass:
self._get_tokens_button = bui.buttonwidget(
parent=self.root_widget,
position=(
self._width * 0.5 - bwidth * 0.5,
yoffs - 15.0 - bheight - max_rdesc_height,
),
color=bg_color,
textcolor=(0.8, 0.8, 0.8),
label=bui.Lstr(resource='tokens.getTokensText'),
size=(bwidth, bheight),
autoselect=True,
on_activate_call=bui.WeakCall(self._on_get_tokens_press),
)
elif resource_type == 'trophies':
rdesc = 'TODO: Will show trophies & league rankings.'

View File

@ -839,8 +839,9 @@ class BaseFeatureSet : public FeatureSetNativeComponent,
auto app_active() -> bool const { return app_active_; }
/// Reset the engine to a default state. App-modes generally call this
/// when activating.
/// Reset the engine to a default state. Should only be called by the
/// active app-mode. App-modes generally call this when first activating,
/// but may opt to call it at other times.
void Reset();
private:

View File

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

View File

@ -79,6 +79,7 @@ class ClassicAccountLiveData:
tokens: Annotated[int, IOAttrs('to')]
gold_pass: Annotated[bool, IOAttrs('g')]
remove_ads: Annotated[bool, IOAttrs('r')]
achievements: Annotated[int, IOAttrs('a')]
achievements_total: Annotated[int, IOAttrs('at')]