Skip to content

Commit

Permalink
:reset_cam
Browse files Browse the repository at this point in the history
  • Loading branch information
tomara-x committed Aug 5, 2024
1 parent e55fc7c commit dd0e9b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ notes:

- `:nl` set the maximum number of nodes a connective op (`+`, `*`, `>>`, etc) will allow (default 500) (saved in scene file)
- `:reset_bloom` if you change bloom settings to the point where you can't see what's happening, reset them
- `:reset_cam` in case you took it too far with the `cam` op (might need to set everything to order 0 first)
- `:dv {float}` set default number of vertices of drawn circles
- `:dc {float} [float] [float] float]` set default color of drawn circles (h s l a)
- `:ht {id}` toggle open a white hole (by id)
Expand Down
6 changes: 6 additions & 0 deletions src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ pub fn command_parser(
Res<PasteChannel>,
Query<&mut BloomSettings, With<Camera>>,
),
(mut ortho, cam): (Query<&mut OrthographicProjection>, Query<Entity, With<Camera>>),
) {
let clt = &mut command_line_text.single_mut();
if key_event.is_empty() && !clt.is_changed() && !keyboard_input.just_released(KeyCode::KeyT) {
Expand Down Expand Up @@ -856,6 +857,11 @@ pub fn command_parser(
..default()
};
}
Some(":reset_cam") => {
*trans_query.get_mut(cam.single()).unwrap() =
Transform::from_translation(Vec3::Z * 200.);
ortho.single_mut().scale = 1.;
}
_ => {}
}
// open all white holes reading whatever changed
Expand Down

0 comments on commit dd0e9b8

Please sign in to comment.