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!: use a single BarSettings component #28

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

sparten11740
Copy link
Owner

@sparten11740 sparten11740 commented Nov 13, 2023

Use a single BarSettings component which is more ergonomic to handle.

Closes #27
Closes #18

Migration

-       BarBundle::<Health> {
-           width: BarWidth::new(mesh_width),
-           offset: BarOffset::new(mesh_height),
+       BarSettings::<Health> {
+           width: 5.,
+           offset: 2.,
            ..default()
        },

@sparten11740 sparten11740 self-assigned this Nov 13, 2023
@sparten11740
Copy link
Owner Author

@5tr1k3r is this what you had in mind with a single settings component?

Copy link
Contributor

@5tr1k3r 5tr1k3r left a comment

Choose a reason for hiding this comment

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

looks good! I do wonder: why need to use phantom data?

5tr1k3r

This comment was marked as duplicate.

@sparten11740
Copy link
Owner Author

sparten11740 commented Nov 13, 2023

why need to use phantom data?

for a generic struct it is necessary to have a field that uses that generic, without phantom data there would be none, resulting in compiler errors such as the following:

Help: consider removing T, referring to it in a field, or using a marker such as std::marker::PhantomData

@sparten11740 sparten11740 merged commit 41b77d6 into main Nov 13, 2023
1 check passed
@sparten11740 sparten11740 deleted the sparten11740/feat/single-bar-settings-component branch November 13, 2023 23:58
@sparten11740-bot
Copy link
Collaborator

🎉 This PR is included in version 3.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider having one component for all bar settings Register types
3 participants