mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-06 07:23:37 +08:00
added get-tokens button to token desc window
This commit is contained in:
parent
3a826deba5
commit
d92a665398
48
.efrocachemap
generated
48
.efrocachemap
generated
@ -4174,22 +4174,22 @@
|
|||||||
"build/assets/windows/Win32/ucrtbased.dll": "bfd1180c269d3950b76f35a63655e9e1",
|
"build/assets/windows/Win32/ucrtbased.dll": "bfd1180c269d3950b76f35a63655e9e1",
|
||||||
"build/assets/windows/Win32/vc_redist.x86.exe": "15a5f1f876503885adbdf5b3989b3718",
|
"build/assets/windows/Win32/vc_redist.x86.exe": "15a5f1f876503885adbdf5b3989b3718",
|
||||||
"build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599",
|
"build/assets/windows/Win32/vcruntime140d.dll": "865b2af4d1e26a1a8073c89acb06e599",
|
||||||
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "7d70aab272d19d3a8259c73c42303286",
|
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "58555279ef155ef08469b947dedff151",
|
||||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "8e96faf2c718a22288d21c507d91a874",
|
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "81c0cd7183ff6ef61eb9e905b4a4ad1b",
|
||||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "e30e0a48d5443ed14814e20e4bad6c39",
|
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "5cd672a5ac7f36dd081dc31855599240",
|
||||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "b83a92b2f728cf8c31c3ccbcb75ae4b2",
|
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "0e6477355f829cecf1a11cdc5ea03c36",
|
||||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "dd9165e1b15a2bf0e9f031ba4eba04ce",
|
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "493143b41303596b01d8408eb5f5abd8",
|
||||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "0b4b8e2f4be2e1a32548d68ec1ea6352",
|
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "4de9ba79e3ee63cbc4ade231aad47436",
|
||||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "94c46cf4c4e83d4b0607423178ef10af",
|
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "57e3b03e8b2d8e554a5ccf344e3a0346",
|
||||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "5e97089d59c6be9335e97ecf89a40dd3",
|
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "db9a19303a7488fd9567e9afa82d9b32",
|
||||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "deb25286e7fef3ccbba59f08904cf2dc",
|
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "6be26eac367f64772b3e25d01b5186a7",
|
||||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "2f6bc04a3096848f7dead32652d3a480",
|
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "f0d23e8ad6070abfc817f368439c1504",
|
||||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "4cb9e6580c9bb91279f056c75372b20d",
|
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "1df1651f4ee70a1c13a541ff339a4e84",
|
||||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "cd056265bf7aca9ebc935728cfffce6d",
|
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "32ae2768e445c302d492ea7a82ed675a",
|
||||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "422a860bedaebf7240f050d00f3c79a0",
|
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "a2ebb1c973f4053f61b53b5e0d168941",
|
||||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "f48b89b6c00d87506dc4ca0964a34d91",
|
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "c9d7937a16b5796134878744d2d97817",
|
||||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "a28f80a38883e36348e0217ff53b3a01",
|
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "40073949b69d00dbb4cabcc19912de91",
|
||||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "f97ae2df50bda5cca5da76cf7748817b",
|
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "6680c4cedd8b8fe7afacf04d99cbb7dc",
|
||||||
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "b261c8140179fdaa56deeaff30b12e04",
|
"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_gui/release/libballisticaplus.a": "72f521386bbf1ddfdd22b77b75a177fa",
|
||||||
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "b261c8140179fdaa56deeaff30b12e04",
|
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "b261c8140179fdaa56deeaff30b12e04",
|
||||||
@ -4202,14 +4202,14 @@
|
|||||||
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "ccb9b1af334e1594265fa9f68ae31937",
|
"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/debug/libballisticaplus.a": "b8c4ecf1d17b2831f0eb8ff7d9ed496c",
|
||||||
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "ccb9b1af334e1594265fa9f68ae31937",
|
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "ccb9b1af334e1594265fa9f68ae31937",
|
||||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "4d0b8f6cdbcee100387c62aae0dcd093",
|
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "6cfee84ef3844d8ddb2f7cd59dda281f",
|
||||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "7a5206fbbbd4d3e85de0d1a9483cc31e",
|
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "978e9b9049eec68ad97e8caf02d35ce4",
|
||||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "c42ee5ce8e148b995b44674d61933f2b",
|
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "b6c1bcc9c185e1678e6ec7dd71b03da8",
|
||||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "645eca74f460337e64a8a3a75ff3a03d",
|
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "ea274b3238460f61374aac61bbced2b0",
|
||||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "1fadf426f508a0ff0572703ed8ca31b6",
|
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "f24d22c9b329b3ceef25c08ec8d51345",
|
||||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "3e4f2c1bc9f6211bfe2c2f89e9d63923",
|
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "a02b4c513a724d79a1bbc12f2a1071da",
|
||||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "1d2bc6f3110b3ebc45fb25fca14364ab",
|
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "73c6fca1f12ab73775167aaa80b9694d",
|
||||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "c581aff5b64824f635278219ae94455d",
|
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "cc9b51c63c706da56ba8080cc28078e9",
|
||||||
"src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c",
|
"src/assets/ba_data/python/babase/_mgen/__init__.py": "f885fed7f2ed98ff2ba271f9dbe3391c",
|
||||||
"src/assets/ba_data/python/babase/_mgen/enums.py": "794d258d59fd17a61752843a9a0551ad",
|
"src/assets/ba_data/python/babase/_mgen/enums.py": "794d258d59fd17a61752843a9a0551ad",
|
||||||
"src/ballistica/base/mgen/pyembed/binding_base.inc": "06042d31df0ff9af96b99477162e2a91",
|
"src/ballistica/base/mgen/pyembed/binding_base.inc": "06042d31df0ff9af96b99477162e2a91",
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
### 1.7.37 (build 22196, api 9, 2025-01-17)
|
### 1.7.37 (build 22197, api 9, 2025-01-17)
|
||||||
- Bumping api version to 9. As you'll see below, there's some UI changes that
|
- 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
|
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.
|
touch UI stuff at all you can simply bump your api version and call it a day.
|
||||||
|
|||||||
@ -63,7 +63,7 @@ def existing(obj: ExistableT | None) -> ExistableT | None:
|
|||||||
For more info, see notes on 'existables' here:
|
For more info, see notes on 'existables' here:
|
||||||
https://ballistica.net/wiki/Coding-Style-Guide
|
https://ballistica.net/wiki/Coding-Style-Guide
|
||||||
"""
|
"""
|
||||||
assert obj is None or hasattr(obj, 'exists'), f'No "exists" on {obj}'
|
assert obj is None or hasattr(obj, 'exists'), f'No "exists" attr on {obj}.'
|
||||||
return obj if obj is not None and obj.exists() else None
|
return obj if obj is not None and obj.exists() else None
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -53,7 +53,7 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
# Build number and version of the ballistica binary we expect to be
|
# Build number and version of the ballistica binary we expect to be
|
||||||
# using.
|
# using.
|
||||||
TARGET_BALLISTICA_BUILD = 22196
|
TARGET_BALLISTICA_BUILD = 22197
|
||||||
TARGET_BALLISTICA_VERSION = '1.7.37'
|
TARGET_BALLISTICA_VERSION = '1.7.37'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -46,6 +46,7 @@ from babase import (
|
|||||||
displaytimer,
|
displaytimer,
|
||||||
DisplayTimer,
|
DisplayTimer,
|
||||||
do_once,
|
do_once,
|
||||||
|
existing,
|
||||||
fade_screen,
|
fade_screen,
|
||||||
get_display_resolution,
|
get_display_resolution,
|
||||||
get_input_idle_time,
|
get_input_idle_time,
|
||||||
@ -172,6 +173,7 @@ __all__ = [
|
|||||||
'displaytimer',
|
'displaytimer',
|
||||||
'DisplayTimer',
|
'DisplayTimer',
|
||||||
'do_once',
|
'do_once',
|
||||||
|
'existing',
|
||||||
'fade_screen',
|
'fade_screen',
|
||||||
'get_display_resolution',
|
'get_display_resolution',
|
||||||
'get_input_idle_time',
|
'get_input_idle_time',
|
||||||
|
|||||||
@ -863,7 +863,7 @@ def show_get_tokens_prompt() -> None:
|
|||||||
if bool(True):
|
if bool(True):
|
||||||
ConfirmWindow(
|
ConfirmWindow(
|
||||||
bui.Lstr(resource='tokens.notEnoughTokensText'),
|
bui.Lstr(resource='tokens.notEnoughTokensText'),
|
||||||
_show_get_tokens,
|
show_get_tokens_window,
|
||||||
ok_text=bui.Lstr(resource='tokens.getTokensText'),
|
ok_text=bui.Lstr(resource='tokens.getTokensText'),
|
||||||
width=460,
|
width=460,
|
||||||
height=130,
|
height=130,
|
||||||
@ -877,7 +877,8 @@ def show_get_tokens_prompt() -> None:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def _show_get_tokens() -> None:
|
def show_get_tokens_window(origin_widget: bui.Widget | None = None) -> None:
|
||||||
|
"""Show the window allowing token purchases."""
|
||||||
|
|
||||||
# NOTE TO USERS: The code below is not the proper way to do things;
|
# NOTE TO USERS: The code below is not the proper way to do things;
|
||||||
# whenever possible one should use a MainWindow's
|
# whenever possible one should use a MainWindow's
|
||||||
@ -893,7 +894,7 @@ def _show_get_tokens() -> None:
|
|||||||
|
|
||||||
# Set our new main window.
|
# Set our new main window.
|
||||||
bui.app.ui_v1.set_main_window(
|
bui.app.ui_v1.set_main_window(
|
||||||
GetTokensWindow(),
|
GetTokensWindow(origin_widget=origin_widget),
|
||||||
from_window=False,
|
from_window=False,
|
||||||
is_auxiliary=True,
|
is_auxiliary=True,
|
||||||
suppress_warning=True,
|
suppress_warning=True,
|
||||||
|
|||||||
@ -31,6 +31,7 @@ class ResourceTypeInfoWindow(PopupWindow):
|
|||||||
self._transitioning_out = False
|
self._transitioning_out = False
|
||||||
self._width = 570
|
self._width = 570
|
||||||
self._height = 400
|
self._height = 400
|
||||||
|
self._get_tokens_button: bui.Widget | None = None
|
||||||
bg_color = (0.5, 0.4, 0.6)
|
bg_color = (0.5, 0.4, 0.6)
|
||||||
super().__init__(
|
super().__init__(
|
||||||
size=(self._width, self._height),
|
size=(self._width, self._height),
|
||||||
@ -55,6 +56,8 @@ class ResourceTypeInfoWindow(PopupWindow):
|
|||||||
|
|
||||||
yoffs = self._height - 145
|
yoffs = self._height - 145
|
||||||
|
|
||||||
|
max_rdesc_height = 160
|
||||||
|
|
||||||
if resource_type == 'tickets':
|
if resource_type == 'tickets':
|
||||||
yoffs -= 20
|
yoffs -= 20
|
||||||
rdesc = (
|
rdesc = (
|
||||||
@ -75,6 +78,23 @@ class ResourceTypeInfoWindow(PopupWindow):
|
|||||||
'tokens and never hear about them again.'
|
'tokens and never hear about them again.'
|
||||||
)
|
)
|
||||||
texname = 'coin'
|
texname = 'coin'
|
||||||
|
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),
|
||||||
|
)
|
||||||
|
|
||||||
elif resource_type == 'trophies':
|
elif resource_type == 'trophies':
|
||||||
rdesc = 'TODO: Will show trophies & league rankings.'
|
rdesc = 'TODO: Will show trophies & league rankings.'
|
||||||
texname = 'crossOut'
|
texname = 'crossOut'
|
||||||
@ -98,11 +118,20 @@ class ResourceTypeInfoWindow(PopupWindow):
|
|||||||
v_align='top',
|
v_align='top',
|
||||||
size=(0, 0),
|
size=(0, 0),
|
||||||
maxwidth=self._width * 0.8,
|
maxwidth=self._width * 0.8,
|
||||||
|
max_height=max_rdesc_height,
|
||||||
position=(self._width * 0.5, yoffs - 5.0),
|
position=(self._width * 0.5, yoffs - 5.0),
|
||||||
text=rdesc,
|
text=rdesc,
|
||||||
scale=0.8,
|
scale=0.8,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def _on_get_tokens_press(self) -> None:
|
||||||
|
from bauiv1lib.gettokens import show_get_tokens_window
|
||||||
|
|
||||||
|
self._transition_out()
|
||||||
|
show_get_tokens_window(
|
||||||
|
origin_widget=bui.existing(self._get_tokens_button)
|
||||||
|
)
|
||||||
|
|
||||||
def _on_cancel_press(self) -> None:
|
def _on_cancel_press(self) -> None:
|
||||||
self._transition_out()
|
self._transition_out()
|
||||||
|
|
||||||
|
|||||||
@ -39,7 +39,7 @@ auto main(int argc, char** argv) -> int {
|
|||||||
namespace ballistica {
|
namespace ballistica {
|
||||||
|
|
||||||
// These are set automatically via script; don't modify them here.
|
// These are set automatically via script; don't modify them here.
|
||||||
const int kEngineBuildNumber = 22196;
|
const int kEngineBuildNumber = 22197;
|
||||||
const char* kEngineVersion = "1.7.37";
|
const char* kEngineVersion = "1.7.37";
|
||||||
const int kEngineApiVersion = 9;
|
const int kEngineApiVersion = 9;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user