about summary refs log tree commit diff
path: root/src/main.rs
diff options
context:
space:
mode:
authorgennyble <gen@nyble.dev>2024-12-05 06:20:09 -0600
committergennyble <gen@nyble.dev>2024-12-05 06:20:09 -0600
commit547956194948c132ff7a90051438b813108d9717 (patch)
tree47199ad572b9e263c2a1ea1e48ff9dece390b84e /src/main.rs
parent142bc4cb60abcbbab996f3b3b2b2439bf0b14938 (diff)
downloadreally-etches-547956194948c132ff7a90051438b813108d9717.tar.gz
really-etches-547956194948c132ff7a90051438b813108d9717.zip
Partial save support; fix build
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs12
1 files changed, 12 insertions, 0 deletions
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(),
 					_ => (),
 				}
 			}