mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-06 23:59:18 +08:00
Latest public/internal sync.
This commit is contained in:
parent
be7eb36ba5
commit
896aa9c663
@ -19,6 +19,7 @@ if TYPE_CHECKING:
|
|||||||
|
|
||||||
class GamepadSettingsWindow(bui.Window):
|
class GamepadSettingsWindow(bui.Window):
|
||||||
"""Window for configuring a gamepad."""
|
"""Window for configuring a gamepad."""
|
||||||
|
|
||||||
# pylint: disable=too-many-public-methods
|
# pylint: disable=too-many-public-methods
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
@ -824,6 +825,7 @@ class GamepadSettingsWindow(bui.Window):
|
|||||||
def _do_reset(self) -> None:
|
def _do_reset(self) -> None:
|
||||||
"""Resets the input's mapping settings."""
|
"""Resets the input's mapping settings."""
|
||||||
from babase import InputDeviceNotFoundError
|
from babase import InputDeviceNotFoundError
|
||||||
|
|
||||||
self._settings = {}
|
self._settings = {}
|
||||||
# Unplugging the controller while performing a
|
# Unplugging the controller while performing a
|
||||||
# mapping reset makes things go bonkers a little.
|
# mapping reset makes things go bonkers a little.
|
||||||
@ -839,8 +841,8 @@ class GamepadSettingsWindow(bui.Window):
|
|||||||
"""Show a burger menu with extra settings."""
|
"""Show a burger menu with extra settings."""
|
||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
choices: list[str] = [
|
choices: list[str] = [
|
||||||
'advanced',
|
'advanced',
|
||||||
'reset',
|
'reset',
|
||||||
]
|
]
|
||||||
choices_display: list[bui.Lstr] = [
|
choices_display: list[bui.Lstr] = [
|
||||||
bui.Lstr(resource=self._r + '.advancedText'),
|
bui.Lstr(resource=self._r + '.advancedText'),
|
||||||
@ -853,9 +855,7 @@ class GamepadSettingsWindow(bui.Window):
|
|||||||
scale=(
|
scale=(
|
||||||
2.3
|
2.3
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
else 1.65
|
else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23
|
||||||
if uiscale is bui.UIScale.MEDIUM
|
|
||||||
else 1.23
|
|
||||||
),
|
),
|
||||||
width=150,
|
width=150,
|
||||||
choices=choices,
|
choices=choices,
|
||||||
|
|||||||
@ -67,10 +67,10 @@ class ConfigKeyboardWindow(bui.Window):
|
|||||||
'buttonRight',
|
'buttonRight',
|
||||||
]:
|
]:
|
||||||
assert bui.app.classic is not None
|
assert bui.app.classic is not None
|
||||||
self._settings[
|
self._settings[button] = (
|
||||||
button
|
bui.app.classic.get_input_device_mapped_value(
|
||||||
] = bui.app.classic.get_input_device_mapped_value(
|
self._input, button, default
|
||||||
self._input, button, default
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def _rebuild_ui(self, is_reset: bool = False) -> None:
|
def _rebuild_ui(self, is_reset: bool = False) -> None:
|
||||||
@ -79,7 +79,7 @@ class ConfigKeyboardWindow(bui.Window):
|
|||||||
for widget in self._root_widget.get_children():
|
for widget in self._root_widget.get_children():
|
||||||
widget.delete()
|
widget.delete()
|
||||||
|
|
||||||
#b_off = 0 if self._unique_id != '#1' else 9
|
# b_off = 0 if self._unique_id != '#1' else 9
|
||||||
cancel_button = bui.buttonwidget(
|
cancel_button = bui.buttonwidget(
|
||||||
parent=self._root_widget,
|
parent=self._root_widget,
|
||||||
autoselect=True,
|
autoselect=True,
|
||||||
@ -324,7 +324,7 @@ class ConfigKeyboardWindow(bui.Window):
|
|||||||
"""Show a burger menu with extra settings."""
|
"""Show a burger menu with extra settings."""
|
||||||
# pylint: disable=cyclic-import
|
# pylint: disable=cyclic-import
|
||||||
choices: list[str] = [
|
choices: list[str] = [
|
||||||
'reset',
|
'reset',
|
||||||
]
|
]
|
||||||
choices_display: list[bui.Lstr] = [
|
choices_display: list[bui.Lstr] = [
|
||||||
bui.Lstr(resource='settingsWindowAdvanced.resetText'),
|
bui.Lstr(resource='settingsWindowAdvanced.resetText'),
|
||||||
@ -336,9 +336,7 @@ class ConfigKeyboardWindow(bui.Window):
|
|||||||
scale=(
|
scale=(
|
||||||
2.3
|
2.3
|
||||||
if uiscale is bui.UIScale.SMALL
|
if uiscale is bui.UIScale.SMALL
|
||||||
else 1.65
|
else 1.65 if uiscale is bui.UIScale.MEDIUM else 1.23
|
||||||
if uiscale is bui.UIScale.MEDIUM
|
|
||||||
else 1.23
|
|
||||||
),
|
),
|
||||||
width=150,
|
width=150,
|
||||||
choices=choices,
|
choices=choices,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user