Skip to content

Commit

Permalink
deselect, and select targets
Browse files Browse the repository at this point in the history
  • Loading branch information
tomara-x committed May 18, 2024
1 parent 27eed8e commit 4508b0a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,15 @@ note: using the [std constants](https://doc.rust-lang.org/std/f32/consts/index.h
<p>

- `sa` select all
- `sA` deselect all
- `sc` select all circles
- `sC` deselect circles
- `sh` select all holes
- `sH` deselect holes
- `sv` select visible entities (in view)
- `sV` deselect visible entities
- `sg` select holes of the selected circles
- `st` select targets of the selected circles
- `<delete>` delete selected entities
- `yy` copy selection to clipboard
- `p` paste copied
Expand Down
17 changes: 17 additions & 0 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1173,6 +1173,12 @@ pub fn command_parser(
}
text.clear();
}
Some("sA") => {
for e in access.selected_query.iter() {
commands.entity(e).remove::<Selected>();
}
text.clear();
}
Some("sc") => {
for e in circle_query.iter() {
if access.order_query.contains(e) {
Expand Down Expand Up @@ -1218,6 +1224,17 @@ pub fn command_parser(
}
text.clear();
}
Some("st") => {
for e in access.selected_query.iter() {
if let Ok(targets) = access.targets_query.get(e) {
for t in &targets.0 {
commands.entity(*t).insert(Selected);
}
commands.entity(e).remove::<Selected>();
}
}
text.clear();
}
Some("sv") => {
for e in access.selected_query.iter() {
commands.entity(e).remove::<Selected>();
Expand Down

0 comments on commit 4508b0a

Please sign in to comment.