#Bevy events with macros

10 messages · Page 1 of 1 (latest)

proven sluice
#

Also I am still quite new to bevy so if I'm doing something completely wrong or if there's a way better way to do this please lemme know 🙏

hallow vessel
#

the structure's pretty weird, the vendored egui seems unnecessary, it's not even a library crate

#

couldn't even find the entrypoint for a bit

#

it feels like most of this could be done easily with generics

#

and some of these names are really bad for collisions

#

also, your EventReader run_ifs will run spuriously, since you don't clear them (each EventReader systemparam has its own cursor)

proven sluice
#

Ah yeah nah it's not a library, I am just learning bevy and rust and using them to build a software for myself and I just thought I'd share smthg I was doing for handling events and see if it's complete shit or actually not as bad for bevy. I wanted to go the generics route but wanted to try doing it with macros just for fun cause I never had a use case yet for them while writing rust. I just made the repo cz my code is private but wanted to share this specific bit with a simple example. Also bevy egui was just a leftover of me taking this bit of code out of my project, I updated it to work with 0.17-dev to test out the next release with my project. Ill probably delete this in a few days, just wanted some opinions and thoughts as I learn.

proven sluice
#

If there's a better way lemme know!

hallow vessel
#

just clear the event reader in the run_if