fix(engine): help panel scrollable via touch on Android
Register touch_scroll_panel::<HelpScrollable> so the Controls overlay can be scrolled by swipe on Android. Without it, the Mode Launcher and Overlays sections (rows 2–19) were unreachable via touch. Also add 96px bottom padding to HelpScrollable — same fix applied to settings_plugin — so the last row clears the scroll-container edge. Register TouchInput message so existing headless tests continue to pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -44,13 +44,19 @@ pub struct HelpPlugin;
|
|||||||
impl Plugin for HelpPlugin {
|
impl Plugin for HelpPlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
app.add_message::<HelpRequestEvent>()
|
app.add_message::<HelpRequestEvent>()
|
||||||
// `MouseWheel` is emitted by Bevy's input plugin under
|
// `MouseWheel` and `TouchInput` are emitted by Bevy's input
|
||||||
// `DefaultPlugins`; register it explicitly so the help-scroll
|
// plugin under `DefaultPlugins`; register them explicitly so
|
||||||
// system also runs cleanly under `MinimalPlugins` in tests.
|
// scroll systems run cleanly under `MinimalPlugins` in tests.
|
||||||
.add_message::<MouseWheel>()
|
.add_message::<MouseWheel>()
|
||||||
|
.add_message::<bevy::input::touch::TouchInput>()
|
||||||
.add_systems(
|
.add_systems(
|
||||||
Update,
|
Update,
|
||||||
(toggle_help_screen, handle_help_close_button, scroll_help_panel),
|
(
|
||||||
|
toggle_help_screen,
|
||||||
|
handle_help_close_button,
|
||||||
|
scroll_help_panel,
|
||||||
|
crate::ui_modal::touch_scroll_panel::<HelpScrollable>,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -229,6 +235,7 @@ fn spawn_help_screen(commands: &mut Commands, font_res: Option<&FontResource>) {
|
|||||||
row_gap: VAL_SPACE_2,
|
row_gap: VAL_SPACE_2,
|
||||||
max_height: Val::Vh(70.0),
|
max_height: Val::Vh(70.0),
|
||||||
overflow: Overflow::scroll_y(),
|
overflow: Overflow::scroll_y(),
|
||||||
|
padding: UiRect::bottom(Val::Px(96.0)),
|
||||||
..default()
|
..default()
|
||||||
},
|
},
|
||||||
))
|
))
|
||||||
|
|||||||
Reference in New Issue
Block a user