Skip to content

Commit

Permalink
ui polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
efroemling committed Jan 23, 2025
1 parent 6e8d64d commit 447d7df
Show file tree
Hide file tree
Showing 8 changed files with 78 additions and 63 deletions.
48 changes: 24 additions & 24 deletions .efrocachemap

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### 1.7.37 (build 22242, api 9, 2025-01-23)
### 1.7.37 (build 22243, api 9, 2025-01-23)
- 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.
Expand Down
2 changes: 1 addition & 1 deletion src/assets/ba_data/python/baenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

# Build number and version of the ballistica binary we expect to be
# using.
TARGET_BALLISTICA_BUILD = 22242
TARGET_BALLISTICA_BUILD = 22243
TARGET_BALLISTICA_VERSION = '1.7.37'


Expand Down
81 changes: 48 additions & 33 deletions src/assets/ba_data/python/bauiv1lib/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,44 +22,59 @@ def __init__(

assert bui.app.classic is not None
uiscale = bui.app.ui_v1.uiscale
width = 1050 if uiscale is bui.UIScale.SMALL else 750
height = (
500
self._width = 1400 if uiscale is bui.UIScale.SMALL else 750
self._height = (
1200
if uiscale is bui.UIScale.SMALL
else 530 if uiscale is bui.UIScale.MEDIUM else 600
)
xoffs = 70 if uiscale is bui.UIScale.SMALL else 0
yoffs = -45 if uiscale is bui.UIScale.SMALL else 0
# xoffs = 70 if uiscale is bui.UIScale.SMALL else 0
# yoffs = -45 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. This lets us fit to the exact
# screen shape at small ui scale.
screensize = bui.get_virtual_screen_size()
scale = (
1.55
if uiscale is bui.UIScale.SMALL
else 1.15 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] / scale)
target_height = min(self._height - 100, screensize[1] / scale)

# 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

super().__init__(
root_widget=bui.containerwidget(
size=(width, height),
size=(self._width, self._height),
toolbar_visibility=(
'menu_minimal'
if uiscale is bui.UIScale.SMALL
else 'menu_full'
),
scale=(
1.55
if uiscale is bui.UIScale.SMALL
else 1.15 if uiscale is bui.UIScale.MEDIUM else 1.0
),
stack_offset=(
(0, 0)
if uiscale is bui.UIScale.SMALL
else (0, 15) if uiscale is bui.UIScale.MEDIUM else (0, 0)
'menu_full' if uiscale is bui.UIScale.SMALL else 'menu_full'
),
scale=scale,
),
transition=transition,
origin_widget=origin_widget,
# We're affected by screen size only at small ui-scale.
refresh_on_screen_size_changes=uiscale is bui.UIScale.SMALL,
)

bui.textwidget(
parent=self._root_widget,
position=(0, height - 45 + yoffs),
size=(width, 25),
position=(
self._width * 0.5,
yoffs - (50 if uiscale is bui.UIScale.SMALL else 30),
),
size=(0, 0),
text=bui.Lstr(resource='inventoryText'),
color=bui.app.ui_v1.title_color,
scale=0.9 if uiscale is bui.UIScale.SMALL else 1.0,
maxwidth=(130 if uiscale is bui.UIScale.SMALL else 200),
h_align='center',
v_align='center',
)
Expand All @@ -71,7 +86,7 @@ def __init__(
else:
btn = bui.buttonwidget(
parent=self._root_widget,
position=(xoffs + 50, height - 55 + yoffs),
position=(50, yoffs - 50),
size=(60, 55),
scale=0.8,
label=bui.charstr(bui.SpecialChar.BACK),
Expand All @@ -82,20 +97,10 @@ def __init__(
)
bui.containerwidget(edit=self._root_widget, cancel_button=btn)

bui.textwidget(
parent=self._root_widget,
position=(0, height - 120 + yoffs),
size=(width, 25),
text='(under construction)',
scale=0.7,
h_align='center',
v_align='center',
)

button_width = 300
self._player_profiles_button = btn = bui.buttonwidget(
parent=self._root_widget,
position=((width - button_width) * 0.5, height - 200 + yoffs),
position=(self._width * 0.5 - button_width * 0.5, yoffs - 200),
autoselect=True,
size=(button_width, 60),
label=bui.Lstr(resource='playerProfilesWindow.titleText'),
Expand All @@ -104,6 +109,16 @@ def __init__(
textcolor=(0.75, 0.7, 0.8),
on_activate_call=self._player_profiles_press,
)
bui.textwidget(
parent=self._root_widget,
position=(self._width * 0.5, yoffs - 250),
size=(0, 0),
text=bui.Lstr(resource='moreSoonText'),
scale=0.7,
maxwidth=self._width * 0.9,
h_align='center',
v_align='center',
)

def _player_profiles_press(self) -> None:
# pylint: disable=cyclic-import
Expand Down
2 changes: 1 addition & 1 deletion src/assets/ba_data/python/bauiv1lib/profile/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(
else 'menu_full'
),
scale=(
2.0
2.5
if uiscale is bui.UIScale.SMALL
else 1.5 if uiscale is bui.UIScale.MEDIUM else 1.0
),
Expand Down
2 changes: 1 addition & 1 deletion src/assets/ba_data/python/bauiv1lib/profile/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def __init__(
yoffs = -42 if uiscale is bui.UIScale.SMALL else 0
spacing = 40
self._base_scale = (
1.6
2.0
if uiscale is bui.UIScale.SMALL
else 1.35 if uiscale is bui.UIScale.MEDIUM else 1.0
)
Expand Down
2 changes: 1 addition & 1 deletion src/assets/ba_data/python/bauiv1lib/profile/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(
self._height = 450 if uiscale is bui.UIScale.SMALL else 350
assert bui.app.classic is not None
self._base_scale = (
1.9
1.92
if uiscale is bui.UIScale.SMALL
else 1.5 if uiscale is bui.UIScale.MEDIUM else 1.2
)
Expand Down
2 changes: 1 addition & 1 deletion src/ballistica/shared/ballistica.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 22242;
const int kEngineBuildNumber = 22243;
const char* kEngineVersion = "1.7.37";
const int kEngineApiVersion = 9;

Expand Down

0 comments on commit 447d7df

Please sign in to comment.