Skip to content
This repository has been archived by the owner on Apr 18, 2022. It is now read-only.

Support targeting multiple entities with UiEvents generated by the MouseUiSystem #2138

Merged
merged 3 commits into from
Feb 17, 2020
Merged

Support targeting multiple entities with UiEvents generated by the MouseUiSystem #2138

merged 3 commits into from
Feb 17, 2020

Conversation

bonsairobo
Copy link
Contributor

Description

Support targeting multiple entities with UiEvents generated by the MouseUiSystem

Additions

  • Add the transparent_target: bool field to UiTransform and UiTransformData.

Modifications

  • Use the field in ui::events::targeted to support the desired behavior.

PR Checklist

By placing an x in the boxes I certify that I have:

  • Updated the content of the book if this PR would make the book outdated.
  • Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment.
  • Added unit tests for new code added in this PR.
  • Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme.

If this modified or created any rs files:

  • Ran cargo +stable fmt --all
  • Ran cargo clippy --all --features "empty"
  • Ran cargo test --all --features "empty"

…upport targeting multiple entities with UiEvents generated by the MouseUiSystem
@codecov
Copy link

codecov bot commented Feb 15, 2020

Codecov Report

Merging #2138 into master will decrease coverage by 0.48%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2138      +/-   ##
==========================================
- Coverage    83.9%   83.41%   -0.49%     
==========================================
  Files          74       74              
  Lines        5994     5994              
==========================================
- Hits         5029     5000      -29     
- Misses        965      994      +29
Impacted Files Coverage Δ
amethyst_ui/src/transform.rs 68% <ø> (-32%) ⬇️
amethyst_gltf/src/format/mesh.rs 74.28% <0%> (-18.58%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 45536af...3cddb70. Read the comment docs.

});

let mut first_opaque = None;
for (i, (_e, t)) in entity_transforms.iter().enumerate() {
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps this is clearer:

let first_opaque = entity_transforms.iter().position(|(_e, t)| t.opaque);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely better, thanks!

@bonsairobo
Copy link
Contributor Author

bonsairobo commented Feb 17, 2020

Oops. I think I made a git noob mistake. Not sure why I have duplicate commits. I rebased to amend the first commit. Then I pulled and had to merge. I probably should have just made a new commit.

Copy link
Member

@azriel91 azriel91 left a comment

Choose a reason for hiding this comment

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

Thanks!

@azriel91
Copy link
Member

bors r+

bors bot added a commit that referenced this pull request Feb 17, 2020
2138: Support targeting multiple entities with UiEvents generated by the MouseUiSystem r=azriel91 a=bonsairobo

## Description

Support targeting multiple entities with UiEvents generated by the MouseUiSystem

## Additions

- Add the `transparent_target: bool` field to `UiTransform` and `UiTransformData`.

## Modifications

- Use the field in `ui::events::targeted` to support the desired behavior.

## PR Checklist

By placing an x in the boxes I certify that I have:

- [ ] Updated the content of the book if this PR would make the book outdated.
- [x] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment.
- [ ] Added unit tests for new code added in this PR.
- [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme.

If this modified or created any rs files:

- [x] Ran `cargo +stable fmt --all`
- [x] Ran `cargo clippy --all --features "empty"`
- [x] Ran `cargo test --all --features "empty"`


Co-authored-by: Duncan <bonsairobo@gmail.com>
@bors
Copy link
Contributor

bors bot commented Feb 17, 2020

Build failed

@azriel91
Copy link
Member

bors retry

bors bot added a commit that referenced this pull request Feb 17, 2020
2138: Support targeting multiple entities with UiEvents generated by the MouseUiSystem r=azriel91 a=bonsairobo

## Description

Support targeting multiple entities with UiEvents generated by the MouseUiSystem

## Additions

- Add the `transparent_target: bool` field to `UiTransform` and `UiTransformData`.

## Modifications

- Use the field in `ui::events::targeted` to support the desired behavior.

## PR Checklist

By placing an x in the boxes I certify that I have:

- [ ] Updated the content of the book if this PR would make the book outdated.
- [x] Added a changelog entry if this will impact users, or modified more than 5 lines of Rust that wasn't a doc comment.
- [ ] Added unit tests for new code added in this PR.
- [x] Acknowledged that by making this pull request I release this code under an MIT/Apache 2.0 dual licensing scheme.

If this modified or created any rs files:

- [x] Ran `cargo +stable fmt --all`
- [x] Ran `cargo clippy --all --features "empty"`
- [x] Ran `cargo test --all --features "empty"`


Co-authored-by: Duncan <bonsairobo@gmail.com>
@bors
Copy link
Contributor

bors bot commented Feb 17, 2020

Build succeeded

@bors bors bot merged commit 3cddb70 into amethyst:master Feb 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants