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

Fix TouchSticks with parents in the hierarchy #6

Merged

Conversation

Hellzbellz123
Copy link
Contributor

@Hellzbellz123 Hellzbellz123 commented Nov 23, 2023

Transform is relative too the parent ui node
this fixes it

@Hellzbellz123
Copy link
Contributor Author

Hellzbellz123 commented Nov 23, 2023

Pretty sure we can just ignore Transform and always grab data from GlobalTransform.

GlobalTransform and Transform are ALWAYS equal if the entity does not have parents?
is this assumption correct?

edit
this also fixes the stupid clippy type_complexity "issue"

Comment on lines +137 to +140
mut interaction_areas: Query<
(&mut TouchStick<S>, &GlobalTransform, &Node),
With<TouchStickInteractionArea>,
>,
Copy link
Owner

@johanhelsing johanhelsing Nov 24, 2023

Choose a reason for hiding this comment

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

This change forces the interaction area and stick to be on the same entity. The idea was that you should be able to have multiple interactable zones for the same stick to block out other ui etc. And also other ways of defining the interactable zone (e.g. entire screen) But the feature is only half done.

With this change, the marker TouchStickInteractionArea serves no purpose and could be removed.

However, this does kind of solve the issue with multiple sticks, so maybe it's ok for now.

@johanhelsing johanhelsing changed the title fix TouchSticks with parents in the heirarchy Fix TouchSticks with parents in the hierarchy Nov 24, 2023
Copy link
Owner

@johanhelsing johanhelsing left a comment

Choose a reason for hiding this comment

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

In this case it would probably have been better to not merge main into the pr (since it wasn't needed to fix the issue? and there were not conflicts?)

@johanhelsing johanhelsing merged commit 3b1f97f into johanhelsing:main Nov 24, 2023
3 checks passed
@Hellzbellz123 Hellzbellz123 deleted the fix_parented_touchsticks branch November 25, 2023 03:48
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.

2 participants