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

feat: add #[default] attribute to LdtkEntity and LdtkIntCell derive macros #306

Merged
merged 3 commits into from
Jul 9, 2024

Conversation

neocturne
Copy link
Contributor

Add an attribute that initializes fields using individual field Default implementations, allowing to use the derive macros again without requiring the whole struct to implement Default (when some fields should be default-initialized and others use initialization attributes like #[from_entity_instance]).

Fixes #305

Copy link
Owner

@Trouv Trouv left a comment

Choose a reason for hiding this comment

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

I'm suddenly remembering why I originally made the plugin use the field's Default instead of the bundle's. I think this is a great compromise, thanks for your work/design on it. I only have a few docs-related suggestions

src/app/ldtk_entity.rs Outdated Show resolved Hide resolved
src/app/ldtk_entity.rs Outdated Show resolved Hide resolved
src/app/ldtk_int_cell.rs Outdated Show resolved Hide resolved
@neocturne
Copy link
Contributor Author

Is this PR still missing anything?

@neocturne
Copy link
Contributor Author

Friendly ping, I'd love to see my change in the next release!

@Trouv
Copy link
Owner

Trouv commented Jul 6, 2024

Sorry for being unresponsive on this. I'd like to see it in the next release too.

I think the only thing that was missing in my mind was a similar change to the example code in ldtk_int_cell.rs that I suggested for ldtk_entity.rs here. I'll make this change myself tomorrow unless you beat me to it. I appreciate the patience on this and will take responsibility to implement any remaining changes to make up for my absence

Trouv added a commit that referenced this pull request Jul 8, 2024
…a git branch patch (#326)

Closes #321

Currently, we're using a patch to depend on `bevy_ecs_tilemap`. This
places a burden on the user to use a similar patch in their own
`Cargo.toml`. We're also using the `main` branch of `bevy_ecs_tilemap`
in this patch. This can lead to issues when updates occur to that branch
of the `bevy_ecs_tilemap` repository, as new users and `cargo update`rs
will pull in any new changes to that repo, even breaking ones. This is
currently affecting our CI.

This PR's changes will ultimately be overwritten soon by an update to
bevy 0.14 (#325), but merging this sooner will help set the standard for
development of this project inbetween `bevy_ecs_tilemap` releases in the
future, and also unblock other PRs whose CI checks are affected (#306).
neocturne and others added 3 commits July 8, 2024 21:38
…acros

Add an attribute that initializes fields using individual field Default
implementations, allowing to use the derive macros again without
requiring the whole struct to implement Default (when some fields should
be default-initialized and others use initialization attributes
like #[from_entity_instance]).

Fixes Trouv#305
@Trouv Trouv merged commit 416a46e into Trouv:main Jul 9, 2024
5 checks passed
@Trouv Trouv mentioned this pull request Jul 8, 2024
Trouv added a commit that referenced this pull request Jul 20, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.10.0](v0.9.0...v0.10.0)
(2024-07-20)


### ⚠ BREAKING CHANGES

* upgrade to bevy and bevy_ecs_ldtk 0.14
([#325](#325))
* upgrade to bevy 0.13
([#302](#302))

### Features

* add #[default] attribute to LdtkEntity and LdtkIntCell derive macros
([#306](#306))
([416a46e](416a46e))
* upgrade to bevy 0.13
([#302](#302))
([2ee602f](2ee602f)),
closes [#301](#301)
* upgrade to bevy and bevy_ecs_ldtk 0.14
([#325](#325))
([d888535](d888535))


### Documentation Changes

* remove unused AssetServer param in *Game logic integration* chapter
([#318](#318))
([617b108](617b108))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

#[ldtk_int_cell], #[from_entity_instance] etc. should not require a Default impl
2 participants