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
PkvStore Resource fix #16
Conversation
my attempt at fixing PkvStore not being a resource
fix gramma in a comment
Thanks for the PR! I wonder if it'd be possible to make bevy an optional dependency? Something like: #[derive(Debug)]
#[cfg_attr(feature = "bevy", derive(Resource))]
struct PkvStore { Also, not sure what the practical difference is between importing bevy_ecs vs. importing |
I am not sure what feature(s) is(are) enough to make #[derive(Resource)] work. |
Now I use features to limit the Resource use, used cargo clippy to make linting good, also updated table — in 0.9 one has to at the very least create new struct with Resource to have PkvStore inside of a resource which is a hassle, this should solve that issue. P. S. I think adding bevy with no features as a dependency might be enough for it to work but I suspect |
Nice, this was exactly what I had in mind. Just a small error in the version table. |
Co-authored-by: Johan Klokkhammer Helsing <johanhelsing@gmail.com>
I merged the version table fix. Also confirmed that the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from fixing the linting error. with cfg attributes, I find it cleaner to just fully qualify types
My attempt at fixing PkvStore not being a resource. Not sure if it is possible to add something smaller than bevy_ecs to dependencies. The error is
PkvStore: bevy::prelude::Resource is not satisfied
forRes<PkvStore>
,ResMut<PkvStore>
, ect.