Skip to content

Conversation

@Peepo-Juice
Copy link
Contributor

This PR adds with_completed_system() and other related methods to allow the user to run a one-shot system when an animation or delay completes.

The main reason why I wanted to add this is to avoid polling for a single non-repeating event; using one-shot systems can be cleaner sometimes. But there are other use-cases like chaining actions or even other animations that cant be chained normally due to limitations in the library. In those cases you may think to use callbacks, but they don't allow you to easily interact with the world, which makes one-shot systems a necessity.

@Peepo-Juice
Copy link
Contributor Author

I tried my best to include some unit tests to maintain symmetry with the other "with_completed" methods, but I ran into a snag when dealing with the tick tests. I had to create some dummy values in manual_tick_component in tweenable.rs to allow it to compile, and currently there's no testing of the execution of the one-shot system itself. I could have made a test for that myself if I ignore the manual_tick_component(), but I realized that #37 exists so maybe it can be taken care of in that PR?

Oh, and I just realized I forgot to update the examples. I can get to that as soon as I get some feedback on what I managed to to commit so far :)

Copy link
Owner

@djeedai djeedai left a comment

Choose a reason for hiding this comment

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

I think the change makes sense, thanks a lot! Couple of comments on docs, and I don't know why it seems CI didn't start? I'll check that too as I expect docs won't build. Other than that looks good to me.

Copy link
Contributor Author

@Peepo-Juice Peepo-Juice left a comment

Choose a reason for hiding this comment

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

This was as a result of me trying to update my local repo and manage a conflict. I feel like I screwed up and created this ugly commit. My bad! I'm still getting the hang of Git.

Copy link
Owner

@djeedai djeedai 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 conceptually on board but there's a number of minor things to fix. Let me know if you don't have time to, I can take over and finish it. Thanks!

@djeedai djeedai added enhancement New feature or request waiting-for-author Waiting for the PR author to make some change labels Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request waiting-for-author Waiting for the PR author to make some change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants