Skip to content

Make UIPlugin work in a headless mode #3908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 0 commits into from

Conversation

kirusfg
Copy link
Contributor

@kirusfg kirusfg commented Feb 10, 2022

Objective

Make UIPlugin usable if rendering is disabled.

Fixes #3815

Solution

Introduced a check in UIPlugin whether rendering is enabled; if not, rendering-dependent systems and resources are not added.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Feb 10, 2022
@alice-i-cecile alice-i-cecile added A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use and removed S-Needs-Triage This issue needs to be labelled labels Feb 10, 2022
@alice-i-cecile alice-i-cecile self-requested a review February 10, 2022 16:37
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :) Ideally, we'd be able to keep this systems working without actually drawing them, using #3754. This would allow us to mock out different window sizes to test layout, send mouse clicks to different regions, verify z-ordering and so on.

The ability to do this is very useful, because then these tests can be run in CI without requiring graphics (either with a GPU or CPU-driven graphics).

For now though, at least this will prevent crashes when we need the non-layout functionality of bevy_ui (which appears to just be type registration).

@kirusfg kirusfg marked this pull request as draft February 11, 2022 19:10
@kirusfg
Copy link
Contributor Author

kirusfg commented Feb 11, 2022

Will be investigating further into this!

This should have been a draft, rather than a PR ready for review, sorry.

@kirusfg kirusfg closed this Feb 11, 2022
@kirusfg kirusfg force-pushed the fix/uiplugin-headless branch from 383de2b to 9a7852d Compare February 11, 2022 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-UI Graphical user interfaces, styles, layouts, and widgets C-Usability A targeted quality-of-life change that makes Bevy easier to use
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UiPlugin cannot be used without rendering
2 participants