kgv / bevy_fluent

Bevy plugin for localization using Fluent.
Apache License 2.0
127 stars 17 forks source link

Construct ResourceAsset and BundleAsset by hand #33

Open aleqdev opened 1 year ago

aleqdev commented 1 year ago

Is there any reason for fields of these wrappers being pub(crate)? If there is, perhaps ResourceAsset::new(...) and BundleAsset::new(...) could still be added?

termisaal commented 1 year ago

skill issue as always

kgv commented 1 year ago

Is there any reason for fields of these wrappers being pub(crate)? If there is, perhaps ResourceAsset::new(...) and BundleAsset::new(...) could still be added?

They're marked pub(crate) because it's not obvious to me when the end user of the library might need them. What's your use case that public modifiers were needed? Of course it is possible to add public constructors.

aleqdev commented 1 year ago

I have a custom asset loading system which is independent of AssetServer. But the only possible way to construct ResourceAsset and BundleAsset is implemented in this function: https://github.com/kgv/bevy_fluent/blob/64f90c7c84d357c7a4781e778b1533690a7f8378/src/assets/bundle.rs#L21 which uses LoadContext and also is private