feat(bevy_items): add proto-driven item definitions crate#7997
Merged
Conversation
Game-agnostic Bevy plugin that compiles itemdb.proto into typed Rust structs via prost and wraps them in a searchable ItemDb resource. - Proto codegen gated behind BUILD_PROTO env var (generated code committed) - ItemDb resource with lookup by ProtoItemId, slug, ULID, type_flags, rarity - All proto item types (Item, ItemBonuses, EquipmentInfo, UseEffect, etc.) derive serde for JSON serialization - BevyItemsPlugin registers an empty ItemDb; games populate at startup
Contributor
Dependency ReviewThe following issues were found:
License Issuespackages/rust/bevy/bevy_items/Cargo.toml
OpenSSF Scorecard
Scanned Files
|
Add from_json() support so any Bevy game can load items from the Astro /api/itemdb.json endpoint with automatic string-to-enum conversion. Add README documenting the data flow from proto to Astro MDX to runtime ItemDb. Fix prost enum variant naming for SkillingType and resolve all clippy warnings.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bevy_itemscrate atpackages/rust/bevy/bevy_items/itemdb.proto→ typed Rust structs via prost (codegen gated behindBUILD_PROTOenv var)ItemDbBevy resource with lookups byProtoItemId, slug, ULID, type_flags bitmask, and rarityBevyItemsPluginregisters an emptyItemDb; games populate at startup viaItemDb::from_bytes()orItemDb::from_proto()Architecture
Test plan
cargo build -p bevy_itemspassescargo clippy -p bevy_items— zero warnings