diff --git a/README.md b/README.md index 439e700..280a5fe 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ logic mostly like https://git.crispypin.cc/CrispyPin/marble ## todo +- accessibility + - background colour setting + - hotkeys for everything - more levels - make direct power (comparator -> machine) work, (needs storing power direction in machine tiles) - cut selections, copy to system clipboard diff --git a/assets/redo.png b/assets/redo.png new file mode 100644 index 0000000..15d9106 Binary files /dev/null and b/assets/redo.png differ diff --git a/assets/redo_disabled.png b/assets/redo_disabled.png new file mode 100644 index 0000000..d8bf186 Binary files /dev/null and b/assets/redo_disabled.png differ diff --git a/assets/undo.png b/assets/undo.png new file mode 100644 index 0000000..9ce70c1 Binary files /dev/null and b/assets/undo.png differ diff --git a/assets/undo_disabled.png b/assets/undo_disabled.png new file mode 100644 index 0000000..d0b69db Binary files /dev/null and b/assets/undo_disabled.png differ diff --git a/src/editor.rs b/src/editor.rs index 5c17ce4..754b426 100644 --- a/src/editor.rs +++ b/src/editor.rs @@ -644,11 +644,7 @@ impl Editor { if simple_button(d, 85, 5, 60, 30) { self.exit_state = ExitState::ExitAndSave; } - d.draw_text("save", 90, 10, 20, Color::WHITE); - if simple_button(d, 150, 5, 80, 30) { - self.exit_state = ExitState::ExitNoSave; - } - d.draw_text("revert", 155, 10, 20, Color::WHITE); + d.draw_text("exit", 90, 10, 20, Color::WHITE); } else { if simple_button(d, 5, 5, 75, 30) { self.exit_menu = true; @@ -660,7 +656,27 @@ impl Editor { d.draw_text("save", 90, 10, 20, Color::WHITE); } - simple_toggle_button(d, &mut self.draw_overlay, 235, 4, 20, 32, 4); + if simple_button(d, 150, 4, 32, 32) { + self.undo() + } + let undo_icon = if self.undo_index > 0 { + "undo" + } else { + "undo_disabled" + }; + draw_scaled_texture(d, textures.get(undo_icon), 150, 4, 2.); + + if simple_button(d, 186, 4, 32, 32) { + self.redo() + } + let redo_icon = if self.undo_index < self.undo_history.len() { + "redo" + } else { + "redo_disabled" + }; + draw_scaled_texture(d, textures.get(redo_icon), 186, 4, 2.); + + simple_toggle_button(d, &mut self.draw_overlay, 223, 4, 32, 32, 4); match self.sim_state { SimState::Editing => {