Skip to content
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

Fix recreation of EguiContext on startup #162

Merged
merged 1 commit into from
Mar 12, 2023
Merged

Fix recreation of EguiContext on startup #162

merged 1 commit into from
Mar 12, 2023

Conversation

encounter
Copy link
Contributor

@encounter encounter commented Mar 10, 2023

setup_new_windows_system is added as both a PreStartup system and a PreUpdate system, and the Query will return the same Added<Window> for both. For window(s) created on startup, it will run again on the first frame and recreate the components, so any egui setup done with a startup system is lost.

One solution is to have the query omit any entities that already have an EguiContext.

Fixes #160

Copy link
Contributor

@johanhelsing johanhelsing left a comment

Choose a reason for hiding this comment

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

Not the maintainer, but looks good to me :)

Fixes the regressions in my game with theme/font setup after upgrading from bevy 0.9 and beyv_egui 0.19.

@mvlabat
Copy link
Owner

mvlabat commented Mar 12, 2023

Great catch! Thank you for the fix

@mvlabat mvlabat merged commit e739d78 into mvlabat:main Mar 12, 2023
@encounter encounter deleted the fix_startup branch November 22, 2023 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FontDefinitions being overwritten
3 participants