From 64fb7ca5bacecdb387f2a38ed29890589d49514a Mon Sep 17 00:00:00 2001 From: CrispyPin Date: Tue, 17 Dec 2024 15:40:27 +0100 Subject: [PATCH] add ui buttons for undo/redo --- README.md | 3 +++ assets/redo.png | Bin 0 -> 186 bytes assets/redo_disabled.png | Bin 0 -> 181 bytes assets/undo.png | Bin 0 -> 187 bytes assets/undo_disabled.png | Bin 0 -> 183 bytes src/editor.rs | 28 ++++++++++++++++++++++------ 6 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 assets/redo.png create mode 100644 assets/redo_disabled.png create mode 100644 assets/undo.png create mode 100644 assets/undo_disabled.png 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 0000000000000000000000000000000000000000..15d91062d98d32a6ed5537a40a3d6fe84b393d0f GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jh-%!Ar`%RC!OYPFyL{PJt8Kn z5ncEqOs>Q76l=gQ&rHEX*N^BI20!3mnH6;P$|~K%QzR}l^)Snvi27EsI!z!$Ns~cg zs%6{8+-%f54ef8g?fztcl>V%F8ZSdVj(Vky!O9M5e$89h~zVbv-%29L!% zO>I_9VG8vvZ|Rt6>iU3Fr|tVoy$0!DWpTPCtrumOBGM8*vgw?@@pRtB**jSFH2Mh6 fO8hBpf0dPo!EN^2#am_p-NE4L>gTe~DWM4f9_vE( literal 0 HcmV?d00001 diff --git a/assets/undo.png b/assets/undo.png new file mode 100644 index 0000000000000000000000000000000000000000..9ce70c148df8d00b0a8fd957b9a1a3a615bd9de3 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`O`a}}Ar`$`15ffEP~b5ZjW!6_ z_UK@kWQXO8-ynto@G$eGh@jlo6?7E@(5dnBY?zkm1R zvl;9Ymp1DLImB;Rzl~!yN0)Ov|0Iw6(ntl@gtX;TmmfUOfA(Z}FC}L;+pH;OXk;vd$@?2>@3zM-2b~ literal 0 HcmV?d00001 diff --git a/assets/undo_disabled.png b/assets/undo_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..d0b69db8115612c55158c438db5f3b79f87a94c9 GIT binary patch literal 183 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`b)GJcAr`$`10DGeC~#k>%PPZ&YXGrFk54=5kr8R+2#ogRz3M&Vs-Nj z+r)4-YXjq&183K6-7+Ef#xG@|nSa{M*tu7EMOH}Oig_`+Myx$Si@2j iHX1BuuTEOq!*0C7#d7PHO=UorFnGH9xvX 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 => {