Skip to content

Commit

Permalink
more ui work
Browse files Browse the repository at this point in the history
  • Loading branch information
efroemling committed Dec 31, 2024
1 parent 88e2aff commit 690da5a
Show file tree
Hide file tree
Showing 28 changed files with 231 additions and 164 deletions.
56 changes: 28 additions & 28 deletions .efrocachemap

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

7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### 1.7.37 (build 22152, api 9, 2024-12-30)
### 1.7.37 (build 22155, api 9, 2024-12-31)
- 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 Expand Up @@ -171,6 +171,11 @@
See 'Getter/Setter Function Names' in
https://github.com/efroemling/ballistica/wiki/Coding-Style-Guide for more
info.
- Removed support for tab key navigation. This has been largely ignored for
years and behaved in a mostly broken way in all recent UIs. Keyboard users
should use arrow keys for navigation. To update any old UI code, search for
and remove any 'claims_tab' arguments to UI calls since that argument no
longer exists.

### 1.7.36 (build 21944, api 8, 2024-07-26)
- Wired up Tokens, BombSquad's new purchasable currency. The first thing these
Expand Down
22 changes: 22 additions & 0 deletions src/assets/ba_data/python/baclassic/_appmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ def _update_for_primary_account(
chest_1_appearance='',
chest_2_appearance='',
chest_3_appearance='',
chest_0_unlock_time=-1.0,
chest_1_unlock_time=-1.0,
chest_2_unlock_time=-1.0,
chest_3_unlock_time=-1.0,
chest_0_ad_allow_time=-1.0,
chest_1_ad_allow_time=-1.0,
chest_2_ad_allow_time=-1.0,
chest_3_ad_allow_time=-1.0,
)
self._have_account_values = False
self._update_ui_live_state()
Expand Down Expand Up @@ -281,6 +289,20 @@ def _on_classic_account_data_change(
chest_3_appearance=(
'' if chest3 is None else chest3.appearance.value
),
chest_0_unlock_time=(
-1.0 if chest0 is None else chest0.unlock_time.timestamp()
),
chest_1_unlock_time=-1.0,
chest_2_unlock_time=-1.0,
chest_3_unlock_time=-1.0,
chest_0_ad_allow_time=(
-1.0
if chest0 is None or chest0.ad_allow_time is None
else chest0.ad_allow_time.timestamp()
),
chest_1_ad_allow_time=-1.0,
chest_2_ad_allow_time=-1.0,
chest_3_ad_allow_time=-1.0,
)

# Note that we have values and updated faded state accordingly.
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 = 22152
TARGET_BALLISTICA_BUILD = 22155
TARGET_BALLISTICA_VERSION = '1.7.37'


Expand Down
2 changes: 0 additions & 2 deletions src/assets/ba_data/python/bauiv1lib/account/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ def __init__(
),
size=(self._scroll_width, self._scroll_height),
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)
self._subcontainer: bui.Widget | None = None
Expand Down Expand Up @@ -452,7 +451,6 @@ def _refresh(self) -> None:
size=(self._sub_width, self._sub_height),
background=False,
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)

Expand Down
2 changes: 0 additions & 2 deletions src/assets/ba_data/python/bauiv1lib/coop/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,6 @@ def __init__(
size=(self._scroll_width, self._scroll_height),
simple_culling_v=10.0,
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)
self._subcontainer: bui.Widget | None = None
Expand Down Expand Up @@ -717,7 +716,6 @@ def _refresh(self) -> None:
size=(self._subcontainerwidth, self._subcontainerheight),
background=False,
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)

Expand Down
3 changes: 1 addition & 2 deletions src/assets/ba_data/python/bauiv1lib/credits.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from __future__ import annotations

import os
import json
import logging
from typing import TYPE_CHECKING, override

Expand All @@ -24,7 +25,6 @@ def __init__(
):
# pylint: disable=too-many-locals
# pylint: disable=too-many-statements
import json

bui.set_analytics_screen('Credits Window')

Expand Down Expand Up @@ -332,7 +332,6 @@ def _format_names(names2: Sequence[str], inset: float) -> str:
size=(self._sub_width, self._sub_height),
background=False,
claims_left_right=False,
claims_tab=False,
)

voffs = 0
Expand Down
2 changes: 0 additions & 2 deletions src/assets/ba_data/python/bauiv1lib/fileselector.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,10 @@ def _refresh(self, file_names: list[str], error: str | None) -> None:
bui.containerwidget(
edit=self._scrollwidget,
claims_left_right=False,
claims_tab=False,
)
bui.containerwidget(
edit=self._subcontainer,
claims_left_right=False,
claims_tab=False,
selection_loops=False,
print_list_exit_instructions=False,
)
Expand Down
1 change: 0 additions & 1 deletion src/assets/ba_data/python/bauiv1lib/help.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ def __init__(
size=(self._sub_width, self._sub_height),
background=False,
claims_left_right=False,
claims_tab=False,
)

spacing = 1.0
Expand Down
2 changes: 0 additions & 2 deletions src/assets/ba_data/python/bauiv1lib/playlist/editgame.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,13 @@ def __init__(
),
highlight=False,
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)
self._subcontainer = bui.containerwidget(
parent=self._scrollwidget,
size=(scroll_width, scroll_height),
background=False,
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,13 @@ def __init__(self, parent_window: GamepadSettingsWindow):
),
size=(self._scroll_width, self._scroll_height),
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)
self._subcontainer = bui.containerwidget(
parent=self._scrollwidget,
size=(self._sub_width, self._sub_height),
background=False,
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)
bui.containerwidget(
Expand Down
2 changes: 0 additions & 2 deletions src/assets/ba_data/python/bauiv1lib/settings/touchscreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,13 @@ def __init__(
),
size=(self._scroll_width, self._scroll_height),
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)
self._subcontainer = bui.containerwidget(
parent=self._scrollwidget,
size=(self._sub_width, self._sub_height),
background=False,
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)
self._build_gui()
Expand Down
3 changes: 0 additions & 3 deletions src/assets/ba_data/python/bauiv1lib/soundtrack/edit.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,12 @@ def __init__(
size=(self._width - (80 + 2 * x_inset), scroll_height),
simple_culling_v=10,
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)
bui.widget(edit=self._text_field, down_widget=self._scrollwidget)
self._col = bui.columnwidget(
parent=scrollwidget,
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)

Expand Down Expand Up @@ -256,7 +254,6 @@ def _refresh(self) -> None:
parent=self._col,
size=(self._width - 40, 40),
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)
type_name = type_names_translated.get(song_type, song_type)
Expand Down
2 changes: 0 additions & 2 deletions src/assets/ba_data/python/bauiv1lib/soundtrack/macmusicapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,11 @@ def __init__(
parent=self._root_widget,
position=(40, v - 340),
size=(self._width - 80, 400),
claims_tab=True,
selection_loops_to_parent=True,
)
bui.widget(edit=self._scrollwidget, right_widget=self._scrollwidget)
self._column = bui.columnwidget(
parent=self._scrollwidget,
claims_tab=True,
selection_loops_to_parent=True,
)

Expand Down
3 changes: 0 additions & 3 deletions src/assets/ba_data/python/bauiv1lib/store/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,6 @@ def _set_tab(self, tab_id: TabID) -> None:
),
size=(self._scroll_width, self._scroll_height),
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)

Expand Down Expand Up @@ -904,7 +903,6 @@ def instantiate(
size=(self._width, self._height),
background=False,
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)
v = self._height - 20
Expand Down Expand Up @@ -1142,7 +1140,6 @@ def instantiate(
size=(self._scroll_width, self._scroll_height * 0.95),
background=False,
claims_left_right=True,
claims_tab=True,
selection_loops_to_parent=True,
)
self._status_textwidget = bui.textwidget(
Expand Down
10 changes: 5 additions & 5 deletions src/ballistica/base/input/device/keyboard_input.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ auto KeyboardInput::HandleKey(const SDL_Keysym* keysym, bool down) -> bool {
if (down) {
switch (keysym->sym) {
case SDLK_TAB:
if (keysym->mod & KMOD_SHIFT) { // NOLINT (signed bitwise)
c = WidgetMessage::Type::kTabPrev;
} else {
c = WidgetMessage::Type::kTabNext;
}
// if (keysym->mod & KMOD_SHIFT) { // NOLINT (signed bitwise)
// c = WidgetMessage::Type::kTabPrev;
// } else {
// c = WidgetMessage::Type::kTabNext;
// }
pass = true;
break;
case SDLK_LEFT:
Expand Down
4 changes: 2 additions & 2 deletions src/ballistica/base/ui/widget_message.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ struct WidgetMessage {
// In order to work in all-joystick environments,
// don't rely on the following to be available (they're just a luxury).
kKey,
kTabNext,
kTabPrev,
// kTabNext,
// kTabPrev,
kMouseDown,
kMouseUp,
kMouseWheel,
Expand Down
Loading

0 comments on commit 690da5a

Please sign in to comment.