From 547956194948c132ff7a90051438b813108d9717 Mon Sep 17 00:00:00 2001 From: gennyble Date: Thu, 5 Dec 2024 06:20:09 -0600 Subject: Partial save support; fix build --- src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 0f679b8..b1f22ab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -117,6 +117,16 @@ impl Etch { pub fn clear_pressed(&mut self) { self.img.fill(BACKGROUND_COLOUR.into()); } + + pub fn save(&self) { + let location = rfd::FileDialog::new() + .add_filter("gif", &["gif"]) + .add_filter("png", &["png"]) + .set_file_name("etch.gif") + .save_file(); + + if let Some(path) = location {} + } } // Why are my consts HERE of all places @@ -180,6 +190,8 @@ impl ApplicationHandler for Etch { Key::Character(";") => self.gallop_y.push(3), Key::Named(NamedKey::Backspace) => self.clear_pressed(), + + Key::Character("p") => self.save(), _ => (), } } -- cgit 1.4.1-3-g733a5