Finished persistance prototype

This commit is contained in:
rewin
2024-01-25 23:34:25 +03:00
parent 68833f0785
commit 4318496d58
9 changed files with 222 additions and 262 deletions
+8 -2
View File
@@ -320,12 +320,18 @@ fn read_mouse_delta(
// TODO: Make it configurable
fn send_undo_event(mut events: EventWriter<UndoRedo>, keyboard: Res<Input<KeyCode>>) {
if keyboard.pressed(KeyCode::ControlLeft) && keyboard.just_pressed(KeyCode::Z) && !keyboard.pressed(KeyCode::ShiftLeft) {
if keyboard.pressed(KeyCode::ControlLeft)
&& keyboard.just_pressed(KeyCode::Z)
&& !keyboard.pressed(KeyCode::ShiftLeft)
{
events.send(UndoRedo::Undo);
info!("Undo event sent");
}
if keyboard.pressed(KeyCode::ControlLeft) && keyboard.just_pressed(KeyCode::Z) && keyboard.pressed(KeyCode::ShiftLeft) {
if keyboard.pressed(KeyCode::ControlLeft)
&& keyboard.just_pressed(KeyCode::Z)
&& keyboard.pressed(KeyCode::ShiftLeft)
{
events.send(UndoRedo::Redo);
info!("Redo event sent");
}