mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-01-19 13:25:31 +08:00
updated inbox window to use full available screen area
This commit is contained in:
parent
ab62e1994f
commit
9524133c4d
58
.efrocachemap
generated
58
.efrocachemap
generated
@ -432,7 +432,7 @@
|
||||
"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": "4295c4d16e5ac2853572e363ad20434c",
|
||||
"build/assets/ba_data/data/langdata.json": "04c3a9025032c947139a40e83c2625c3",
|
||||
"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": "5363a79f843e6be7ef47a840f47cc17d",
|
||||
@ -441,12 +441,12 @@
|
||||
"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": "8e4940f0ee5af3e32701391a9c0ba14c",
|
||||
"build/assets/ba_data/data/languages/english.json": "f076808bad5fb60e9c47604ab9f35eff",
|
||||
"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": "df28ac4b33ba8fee62c26cff05aa6b13",
|
||||
"build/assets/ba_data/data/languages/gibberish.json": "b54fc8fc0ce51416adccfb14876dc402",
|
||||
"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,13 +462,13 @@
|
||||
"build/assets/ba_data/data/languages/russian.json": "70cd57440e4cbb49f2fa0c79dedcafbe",
|
||||
"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": "6bd5b7461bd9f5c3d51cbae4a7b629bc",
|
||||
"build/assets/ba_data/data/languages/spanish.json": "dbd5c1550b08ee77c0d6947cba759e7e",
|
||||
"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": "8a406f0fd91b55e3f8e57cd92aea5a52",
|
||||
"build/assets/ba_data/data/languages/ukrainian.json": "0db55824759119aca74d2ee8ffe6daae",
|
||||
"build/assets/ba_data/data/languages/venetian.json": "c7facf9fe1d6d9d4a4130d7e5caa3ee7",
|
||||
"build/assets/ba_data/data/languages/venetian.json": "acea003316bef657925d776dd460e713",
|
||||
"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",
|
||||
@ -4174,22 +4174,22 @@
|
||||
"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": "b9e84b8bbb7b0a18e13bb77ecf2badf5",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "aad705b76936e969e16ac655b39741fb",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "962bdb3f45a3ab26802ae5197f706f7a",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "76a018c645116fa7bced0f036272b4f9",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "2e0df651d38aafbf4978cd3d3da4f3f5",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "eb6abd114cf782987639aca6178f19e9",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "2fdc6c30924860abe46db3bc6151c9e6",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "2109ef88ea6b1c90fe6ed5000c245826",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "dd7a5d15cc9f22953ca28cbd747768a5",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "5594e0bc8b12ba148ac4c0828254f6c8",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "fce6180332211d56df0c1042f43490da",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "da6bd64d89ee7160503ba94451f12842",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "5b74bfad2153b5f76ee95c7817ac87a8",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "0ba1bd838f8f078e819078f16cfaabcb",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "85b30746328af3b85f6e33658add7587",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "0740d2c2ea2002615a75fade5c73d406",
|
||||
"build/prefab/full/linux_arm64_gui/debug/ballisticakit": "47dce4282bd85185702105b6c9e6d66c",
|
||||
"build/prefab/full/linux_arm64_gui/release/ballisticakit": "1d70bb3e52b11c5c88587b2c39a2dae2",
|
||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticakit_headless": "747d4776790eae4da628446d1175ff69",
|
||||
"build/prefab/full/linux_arm64_server/release/dist/ballisticakit_headless": "d4967cdeefb8a56712d9e18b62c94c08",
|
||||
"build/prefab/full/linux_x86_64_gui/debug/ballisticakit": "af062034e6763f3035657aca63a7c874",
|
||||
"build/prefab/full/linux_x86_64_gui/release/ballisticakit": "f45d96bc415a266f984bb47a594567c5",
|
||||
"build/prefab/full/linux_x86_64_server/debug/dist/ballisticakit_headless": "439935ffddb7d208fb7fb9ead59c73e5",
|
||||
"build/prefab/full/linux_x86_64_server/release/dist/ballisticakit_headless": "d92468754fc64ffa7b4d57483af236cb",
|
||||
"build/prefab/full/mac_arm64_gui/debug/ballisticakit": "edf32783eb512f79f0bac9d413376a85",
|
||||
"build/prefab/full/mac_arm64_gui/release/ballisticakit": "55cd0e2c5d80d6cfc9a651a3d41073ab",
|
||||
"build/prefab/full/mac_arm64_server/debug/dist/ballisticakit_headless": "86732412756279e9c23c1a12e991a18b",
|
||||
"build/prefab/full/mac_arm64_server/release/dist/ballisticakit_headless": "e1158323ae584a0a7928ca1097e8a0d0",
|
||||
"build/prefab/full/windows_x86_gui/debug/BallisticaKit.exe": "71bfa5e4753d001874772fb4dd5a1387",
|
||||
"build/prefab/full/windows_x86_gui/release/BallisticaKit.exe": "af55c2b0e2280bb3ce6e1a644ef930d6",
|
||||
"build/prefab/full/windows_x86_server/debug/dist/BallisticaKitHeadless.exe": "591a1876549631688a2f3ca0f041b58f",
|
||||
"build/prefab/full/windows_x86_server/release/dist/BallisticaKitHeadless.exe": "60ad4dbb97c4328928bbf46e749d1277",
|
||||
"build/prefab/lib/linux_arm64_gui/debug/libballisticaplus.a": "7497894d2943b75b6ac830cdba8481af",
|
||||
"build/prefab/lib/linux_arm64_gui/release/libballisticaplus.a": "273a6f64cac5a233694223b85cd0f22b",
|
||||
"build/prefab/lib/linux_arm64_server/debug/libballisticaplus.a": "7497894d2943b75b6ac830cdba8481af",
|
||||
@ -4202,14 +4202,14 @@
|
||||
"build/prefab/lib/mac_arm64_gui/release/libballisticaplus.a": "7e071962108a8d1727525fb331b70ee4",
|
||||
"build/prefab/lib/mac_arm64_server/debug/libballisticaplus.a": "55a2b0c2d1db4d70627c901471d05fc7",
|
||||
"build/prefab/lib/mac_arm64_server/release/libballisticaplus.a": "7e071962108a8d1727525fb331b70ee4",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "02bc17952ad62734a95641a8f1714777",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "aacdc0153fc5698ea20b0cc02555a002",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "6c36b05ef61b3508a555bb9d47ff8331",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "cbcad50064e76b09962f5220f1c5f4d6",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "4b86041719e2f263e8567f1847738964",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "d8bfaf6093aa96533f1ba13bee227b0a",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "5c9bc97e877b7c37783bb94f293a8ac0",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "edc49d5f30f4e941e15317ed9d0c1cee",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.lib": "43aab77eeb77b76cd19752fbd6521fd9",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitGenericPlus.pdb": "b204155fe71d1d8ff4d3f38f1cb4a8ee",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.lib": "0815ef679d8ccb3f47f26b9fef376d1f",
|
||||
"build/prefab/lib/windows/Debug_Win32/BallisticaKitHeadlessPlus.pdb": "578eae1a2d5fb290622ba1bcddd868c7",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.lib": "06d1b085f03ce2d03e9275a1f37ee978",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitGenericPlus.pdb": "e499f716df19157deb34f5271e363cad",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.lib": "fabd9821aff07665c9f8caffa847da50",
|
||||
"build/prefab/lib/windows/Release_Win32/BallisticaKitHeadlessPlus.pdb": "aa7cbe82afd0c4994d9a59880658fab6",
|
||||
"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",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
### 1.7.37 (build 22218, api 9, 2025-01-20)
|
||||
### 1.7.37 (build 22219, api 9, 2025-01-20)
|
||||
- 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.
|
||||
|
||||
@ -60,6 +60,7 @@ from _babase import (
|
||||
get_string_width,
|
||||
get_ui_scale,
|
||||
get_v1_cloud_log_file_path,
|
||||
get_virtual_screen_size,
|
||||
getsimplesound,
|
||||
has_user_run_commands,
|
||||
have_chars,
|
||||
@ -270,6 +271,7 @@ __all__ = [
|
||||
'get_string_width',
|
||||
'get_type_name',
|
||||
'get_ui_scale',
|
||||
'get_virtual_screen_size',
|
||||
'get_v1_cloud_log_file_path',
|
||||
'getclass',
|
||||
'getsimplesound',
|
||||
|
||||
@ -53,7 +53,7 @@ if TYPE_CHECKING:
|
||||
|
||||
# Build number and version of the ballistica binary we expect to be
|
||||
# using.
|
||||
TARGET_BALLISTICA_BUILD = 22218
|
||||
TARGET_BALLISTICA_BUILD = 22219
|
||||
TARGET_BALLISTICA_VERSION = '1.7.37'
|
||||
|
||||
|
||||
|
||||
@ -58,6 +58,7 @@ from babase import (
|
||||
get_string_height,
|
||||
get_string_width,
|
||||
get_type_name,
|
||||
get_virtual_screen_size,
|
||||
getclass,
|
||||
have_permission,
|
||||
in_logic_thread,
|
||||
@ -187,6 +188,7 @@ __all__ = [
|
||||
'get_string_height',
|
||||
'get_string_width',
|
||||
'get_type_name',
|
||||
'get_virtual_screen_size',
|
||||
'getclass',
|
||||
'getmesh',
|
||||
'getsound',
|
||||
|
||||
@ -86,7 +86,10 @@ class ChestWindow(bui.MainWindow):
|
||||
parent=self._root_widget,
|
||||
position=(0, self._height - 50 + self._yoffs),
|
||||
size=(self._width, 25),
|
||||
text=f'Chest Slot {self._index + 1}',
|
||||
text=bui.Lstr(
|
||||
resource='chests.slotText',
|
||||
subs=[('${NUM}', str(index + 1))],
|
||||
),
|
||||
color=bui.app.ui_v1.title_color,
|
||||
maxwidth=150.0,
|
||||
h_align='center',
|
||||
@ -796,13 +799,11 @@ class ChestWindow(bui.MainWindow):
|
||||
return
|
||||
|
||||
self._reset()
|
||||
msg = (
|
||||
'This slot can hold a treasure chest.\n\n'
|
||||
'Earn chests by playing campaign levels,\n'
|
||||
'placing in tournaments, and completing\n'
|
||||
'achievements.'
|
||||
bui.textwidget(
|
||||
edit=self._infotext,
|
||||
text=bui.Lstr(resource='chests.slotDescriptionText'),
|
||||
color=(1, 1, 1),
|
||||
)
|
||||
bui.textwidget(edit=self._infotext, text=msg, color=(1, 1, 1))
|
||||
|
||||
def _show_chest_contents(
|
||||
self, response: bacommon.bs.ChestActionResponse
|
||||
|
||||
@ -319,13 +319,37 @@ class InboxWindow(bui.MainWindow):
|
||||
|
||||
self._entry_displays: list[_EntryDisplay] = []
|
||||
|
||||
self._width = 800 if uiscale is bui.UIScale.SMALL else 500
|
||||
self._width = 900 if uiscale is bui.UIScale.SMALL else 500
|
||||
self._height = (
|
||||
485
|
||||
600
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else 370 if uiscale is bui.UIScale.MEDIUM else 450
|
||||
else 460 if uiscale is bui.UIScale.MEDIUM else 600
|
||||
)
|
||||
yoffs = -42 if uiscale is bui.UIScale.SMALL else 0
|
||||
|
||||
# Do some fancy math to fill all available screen area up to the
|
||||
# size of our backing container.
|
||||
#
|
||||
# TODO: We need an auto-refresh mechanism for cases where screen
|
||||
# size changes under us. Currently one must navigate out and
|
||||
# back in to properly reflect such changes.
|
||||
screensize = bui.get_virtual_screen_size()
|
||||
smallscale = (
|
||||
1.74
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else 1.3 if uiscale is bui.UIScale.MEDIUM else 1.0
|
||||
)
|
||||
# Calc screen size in our local container space and clamp to a
|
||||
# bit smaller than our container size.
|
||||
target_width = min(self._width - 60, screensize[0] / smallscale)
|
||||
target_height = min(self._height - 70, screensize[1] / smallscale)
|
||||
|
||||
# To get top/left coords, go to the center of our window and offset
|
||||
# by half the width/height of our target area.
|
||||
yoffs = 0.5 * self._height + 0.5 * target_height + 30.0
|
||||
|
||||
scroll_width = target_width
|
||||
scroll_height = target_height - 31
|
||||
scroll_y = yoffs - 59 - scroll_height
|
||||
|
||||
super().__init__(
|
||||
root_widget=bui.containerwidget(
|
||||
@ -333,16 +357,7 @@ class InboxWindow(bui.MainWindow):
|
||||
toolbar_visibility=(
|
||||
'menu_full' if uiscale is bui.UIScale.SMALL else 'menu_full'
|
||||
),
|
||||
scale=(
|
||||
1.74
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else 1.5 if uiscale is bui.UIScale.MEDIUM else 1.15
|
||||
),
|
||||
stack_offset=(
|
||||
(0, 0)
|
||||
if uiscale is bui.UIScale.SMALL
|
||||
else (0, 0) if uiscale is bui.UIScale.MEDIUM else (0, 0)
|
||||
),
|
||||
scale=smallscale,
|
||||
),
|
||||
transition=transition,
|
||||
origin_widget=origin_widget,
|
||||
@ -357,7 +372,7 @@ class InboxWindow(bui.MainWindow):
|
||||
self._back_button = bui.buttonwidget(
|
||||
parent=self._root_widget,
|
||||
autoselect=True,
|
||||
position=(50, self._height - 38 + yoffs),
|
||||
position=(50, yoffs - 48),
|
||||
size=(60, 60),
|
||||
scale=0.6,
|
||||
label=bui.charstr(bui.SpecialChar.BACK),
|
||||
@ -372,9 +387,7 @@ class InboxWindow(bui.MainWindow):
|
||||
parent=self._root_widget,
|
||||
position=(
|
||||
self._width * 0.5,
|
||||
self._height
|
||||
- (45 if uiscale is bui.UIScale.SMALL else 20)
|
||||
+ yoffs,
|
||||
yoffs - (45 if uiscale is bui.UIScale.SMALL else 30),
|
||||
),
|
||||
size=(0, 0),
|
||||
h_align='center',
|
||||
@ -407,14 +420,8 @@ class InboxWindow(bui.MainWindow):
|
||||
)
|
||||
self._scrollwidget = bui.scrollwidget(
|
||||
parent=self._root_widget,
|
||||
size=(
|
||||
self._width - 60,
|
||||
self._height - (170 if uiscale is bui.UIScale.SMALL else 80),
|
||||
),
|
||||
position=(
|
||||
30,
|
||||
(110 if uiscale is bui.UIScale.SMALL else 34) + yoffs,
|
||||
),
|
||||
size=(scroll_width, scroll_height),
|
||||
position=(self._width * 0.5 - scroll_width * 0.5, scroll_y),
|
||||
capture_arrows=True,
|
||||
simple_culling_v=200,
|
||||
claims_left_right=True,
|
||||
|
||||
@ -986,6 +986,31 @@ static PyMethodDef PySetUIAccountStateDef = {
|
||||
"\n"
|
||||
"(internal)\n",
|
||||
};
|
||||
|
||||
// ------------------------ get_virtual_screen_size ----------------------------
|
||||
|
||||
static auto PyGetVirtualScreenSize(PyObject* self) -> PyObject* {
|
||||
BA_PYTHON_TRY;
|
||||
BA_PRECONDITION(g_base->InLogicThread());
|
||||
|
||||
float x{g_base->graphics->screen_virtual_width()};
|
||||
float y{g_base->graphics->screen_virtual_height()};
|
||||
return Py_BuildValue("(ff)", x, y);
|
||||
BA_PYTHON_CATCH;
|
||||
}
|
||||
|
||||
static PyMethodDef PyGetVirtualScreenSizeDef = {
|
||||
"get_virtual_screen_size", // name
|
||||
(PyCFunction)PyGetVirtualScreenSize, // method
|
||||
METH_NOARGS, // flags
|
||||
|
||||
"get_virtual_screen_size() -> tuple[float, float]\n"
|
||||
"\n"
|
||||
"(internal)\n"
|
||||
"\n"
|
||||
"Return the current virtual size of the display.",
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
auto PythonMethodsBase2::GetMethods() -> std::vector<PyMethodDef> {
|
||||
@ -1021,6 +1046,7 @@ auto PythonMethodsBase2::GetMethods() -> std::vector<PyMethodDef> {
|
||||
PyFullscreenControlGetDef,
|
||||
PyFullscreenControlSetDef,
|
||||
PySetUIAccountStateDef,
|
||||
PyGetVirtualScreenSizeDef,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -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 = 22218;
|
||||
const int kEngineBuildNumber = 22219;
|
||||
const char* kEngineVersion = "1.7.37";
|
||||
const int kEngineApiVersion = 9;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user