diff --git a/README.md b/README.md index 3eabf32..c977b10 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ :crab: Try it out: :crab: -Make your own personal [Rust mascot](https://rustacean.net/)! +Make your own custom [Rust mascot](https://rustacean.net/)! ![logo](pregen_crabs/orange_happy_top.png) diff --git a/assets/facial_hair/mustache.png b/assets/facial_hair/mustache.png new file mode 100644 index 0000000..5c68d9f Binary files /dev/null and b/assets/facial_hair/mustache.png differ diff --git a/assets/facial_hair/mustache_thumb.png b/assets/facial_hair/mustache_thumb.png new file mode 100644 index 0000000..ab146f2 Binary files /dev/null and b/assets/facial_hair/mustache_thumb.png differ diff --git a/image_gen/src/main.rs b/image_gen/src/main.rs index 6a9fae9..e83fb41 100644 --- a/image_gen/src/main.rs +++ b/image_gen/src/main.rs @@ -53,6 +53,10 @@ fn main() { merged.extend(merge(&merged, &hats)); + let facial_hair: HashMap = load_images("facial_hair"); + + merged.extend(merge(&merged, &facial_hair)); + for (name, image) in merged { image.save(format!("{ROOT_DIR}/{name}.png")).unwrap(); } diff --git a/pregen_crabs/blue_angry_bow_mustache.png b/pregen_crabs/blue_angry_bow_mustache.png new file mode 100644 index 0000000..2f19141 Binary files /dev/null and b/pregen_crabs/blue_angry_bow_mustache.png differ diff --git a/pregen_crabs/blue_angry_mustache.png b/pregen_crabs/blue_angry_mustache.png new file mode 100644 index 0000000..b9bebf2 Binary files /dev/null and b/pregen_crabs/blue_angry_mustache.png differ diff --git a/pregen_crabs/blue_angry_top_mustache.png b/pregen_crabs/blue_angry_top_mustache.png new file mode 100644 index 0000000..f917513 Binary files /dev/null and b/pregen_crabs/blue_angry_top_mustache.png differ diff --git a/pregen_crabs/blue_girl_bow_mustache.png b/pregen_crabs/blue_girl_bow_mustache.png new file mode 100644 index 0000000..9b6fadf Binary files /dev/null and b/pregen_crabs/blue_girl_bow_mustache.png differ diff --git a/pregen_crabs/blue_girl_mustache.png b/pregen_crabs/blue_girl_mustache.png new file mode 100644 index 0000000..af9a5d8 Binary files /dev/null and b/pregen_crabs/blue_girl_mustache.png differ diff --git a/pregen_crabs/blue_girl_top_mustache.png b/pregen_crabs/blue_girl_top_mustache.png new file mode 100644 index 0000000..5c8778e Binary files /dev/null and b/pregen_crabs/blue_girl_top_mustache.png differ diff --git a/pregen_crabs/blue_happy_bow_mustache.png b/pregen_crabs/blue_happy_bow_mustache.png new file mode 100644 index 0000000..581219a Binary files /dev/null and b/pregen_crabs/blue_happy_bow_mustache.png differ diff --git a/pregen_crabs/blue_happy_mustache.png b/pregen_crabs/blue_happy_mustache.png new file mode 100644 index 0000000..ed87f1a Binary files /dev/null and b/pregen_crabs/blue_happy_mustache.png differ diff --git a/pregen_crabs/blue_happy_top_mustache.png b/pregen_crabs/blue_happy_top_mustache.png new file mode 100644 index 0000000..ef5bbce Binary files /dev/null and b/pregen_crabs/blue_happy_top_mustache.png differ diff --git a/pregen_crabs/green_angry_bow_mustache.png b/pregen_crabs/green_angry_bow_mustache.png new file mode 100644 index 0000000..f81e2ab Binary files /dev/null and b/pregen_crabs/green_angry_bow_mustache.png differ diff --git a/pregen_crabs/green_angry_mustache.png b/pregen_crabs/green_angry_mustache.png new file mode 100644 index 0000000..07069c6 Binary files /dev/null and b/pregen_crabs/green_angry_mustache.png differ diff --git a/pregen_crabs/green_angry_top_mustache.png b/pregen_crabs/green_angry_top_mustache.png new file mode 100644 index 0000000..7276e5f Binary files /dev/null and b/pregen_crabs/green_angry_top_mustache.png differ diff --git a/pregen_crabs/green_girl_bow_mustache.png b/pregen_crabs/green_girl_bow_mustache.png new file mode 100644 index 0000000..c41429b Binary files /dev/null and b/pregen_crabs/green_girl_bow_mustache.png differ diff --git a/pregen_crabs/green_girl_mustache.png b/pregen_crabs/green_girl_mustache.png new file mode 100644 index 0000000..cb448c5 Binary files /dev/null and b/pregen_crabs/green_girl_mustache.png differ diff --git a/pregen_crabs/green_girl_top_mustache.png b/pregen_crabs/green_girl_top_mustache.png new file mode 100644 index 0000000..7e102f7 Binary files /dev/null and b/pregen_crabs/green_girl_top_mustache.png differ diff --git a/pregen_crabs/green_happy_bow_mustache.png b/pregen_crabs/green_happy_bow_mustache.png new file mode 100644 index 0000000..90ddead Binary files /dev/null and b/pregen_crabs/green_happy_bow_mustache.png differ diff --git a/pregen_crabs/green_happy_mustache.png b/pregen_crabs/green_happy_mustache.png new file mode 100644 index 0000000..5507800 Binary files /dev/null and b/pregen_crabs/green_happy_mustache.png differ diff --git a/pregen_crabs/green_happy_top_mustache.png b/pregen_crabs/green_happy_top_mustache.png new file mode 100644 index 0000000..734cd0d Binary files /dev/null and b/pregen_crabs/green_happy_top_mustache.png differ diff --git a/pregen_crabs/orange_angry_bow_mustache.png b/pregen_crabs/orange_angry_bow_mustache.png new file mode 100644 index 0000000..a600939 Binary files /dev/null and b/pregen_crabs/orange_angry_bow_mustache.png differ diff --git a/pregen_crabs/orange_angry_mustache.png b/pregen_crabs/orange_angry_mustache.png new file mode 100644 index 0000000..0448a0b Binary files /dev/null and b/pregen_crabs/orange_angry_mustache.png differ diff --git a/pregen_crabs/orange_angry_top_mustache.png b/pregen_crabs/orange_angry_top_mustache.png new file mode 100644 index 0000000..2252450 Binary files /dev/null and b/pregen_crabs/orange_angry_top_mustache.png differ diff --git a/pregen_crabs/orange_girl_bow_mustache.png b/pregen_crabs/orange_girl_bow_mustache.png new file mode 100644 index 0000000..61ff6fc Binary files /dev/null and b/pregen_crabs/orange_girl_bow_mustache.png differ diff --git a/pregen_crabs/orange_girl_mustache.png b/pregen_crabs/orange_girl_mustache.png new file mode 100644 index 0000000..99df33f Binary files /dev/null and b/pregen_crabs/orange_girl_mustache.png differ diff --git a/pregen_crabs/orange_girl_top_mustache.png b/pregen_crabs/orange_girl_top_mustache.png new file mode 100644 index 0000000..6323a7b Binary files /dev/null and b/pregen_crabs/orange_girl_top_mustache.png differ diff --git a/pregen_crabs/orange_happy_bow_mustache.png b/pregen_crabs/orange_happy_bow_mustache.png new file mode 100644 index 0000000..90e4c3d Binary files /dev/null and b/pregen_crabs/orange_happy_bow_mustache.png differ diff --git a/pregen_crabs/orange_happy_mustache.png b/pregen_crabs/orange_happy_mustache.png new file mode 100644 index 0000000..1524920 Binary files /dev/null and b/pregen_crabs/orange_happy_mustache.png differ diff --git a/pregen_crabs/orange_happy_top_mustache.png b/pregen_crabs/orange_happy_top_mustache.png new file mode 100644 index 0000000..40110b6 Binary files /dev/null and b/pregen_crabs/orange_happy_top_mustache.png differ diff --git a/pregen_crabs/purple_angry_bow_mustache.png b/pregen_crabs/purple_angry_bow_mustache.png new file mode 100644 index 0000000..8e8bbff Binary files /dev/null and b/pregen_crabs/purple_angry_bow_mustache.png differ diff --git a/pregen_crabs/purple_angry_mustache.png b/pregen_crabs/purple_angry_mustache.png new file mode 100644 index 0000000..094d0f0 Binary files /dev/null and b/pregen_crabs/purple_angry_mustache.png differ diff --git a/pregen_crabs/purple_angry_top_mustache.png b/pregen_crabs/purple_angry_top_mustache.png new file mode 100644 index 0000000..ebc7b29 Binary files /dev/null and b/pregen_crabs/purple_angry_top_mustache.png differ diff --git a/pregen_crabs/purple_girl_bow_mustache.png b/pregen_crabs/purple_girl_bow_mustache.png new file mode 100644 index 0000000..5d5020d Binary files /dev/null and b/pregen_crabs/purple_girl_bow_mustache.png differ diff --git a/pregen_crabs/purple_girl_mustache.png b/pregen_crabs/purple_girl_mustache.png new file mode 100644 index 0000000..82f7c19 Binary files /dev/null and b/pregen_crabs/purple_girl_mustache.png differ diff --git a/pregen_crabs/purple_girl_top_mustache.png b/pregen_crabs/purple_girl_top_mustache.png new file mode 100644 index 0000000..4972005 Binary files /dev/null and b/pregen_crabs/purple_girl_top_mustache.png differ diff --git a/pregen_crabs/purple_happy_bow_mustache.png b/pregen_crabs/purple_happy_bow_mustache.png new file mode 100644 index 0000000..cdcd497 Binary files /dev/null and b/pregen_crabs/purple_happy_bow_mustache.png differ diff --git a/pregen_crabs/purple_happy_mustache.png b/pregen_crabs/purple_happy_mustache.png new file mode 100644 index 0000000..c7f6fad Binary files /dev/null and b/pregen_crabs/purple_happy_mustache.png differ diff --git a/pregen_crabs/purple_happy_top_mustache.png b/pregen_crabs/purple_happy_top_mustache.png new file mode 100644 index 0000000..e253ba9 Binary files /dev/null and b/pregen_crabs/purple_happy_top_mustache.png differ diff --git a/src/app.rs b/src/app.rs index ebda4a3..92a71ff 100644 --- a/src/app.rs +++ b/src/app.rs @@ -11,6 +11,7 @@ struct Body { color: Option, eyes: Option, hat: Option, + facial_hair: Option, } pub struct App { @@ -26,6 +27,7 @@ impl Default for App { color: Some("orange".to_string()), eyes: Some("happy".to_string()), hat: None, + facial_hair: None, }, } } @@ -75,6 +77,15 @@ impl eframe::App for App { true, &assets.remove_thumb, ); + display_thumbnails( + "Facial Hair", + &mut ferris.facial_hair, + ctx, + ui, + &assets.facial_hair, + true, + &assets.remove_thumb, + ); ui.vertical_centered_justified(|ui| { if ui.button(RichText::new("save").size(30.0)).clicked() { @@ -127,6 +138,7 @@ impl eframe::App for App { display_bodyparts(ctx, &mut ferris.color, &assets.colors); display_bodyparts(ctx, &mut ferris.eyes, &assets.eyes); display_bodyparts(ctx, &mut ferris.hat, &assets.hats); + display_bodyparts(ctx, &mut ferris.facial_hair, &assets.facial_hair); egui::CentralPanel::default().show(ctx, |_| {}); } diff --git a/src/assets.rs b/src/assets.rs index 02f6069..66c75b0 100644 --- a/src/assets.rs +++ b/src/assets.rs @@ -11,6 +11,7 @@ pub struct Assets { pub colors: HashMap, pub eyes: HashMap, pub hats: HashMap, + pub facial_hair: HashMap, pub remove_thumb: RetainedImage, } @@ -73,6 +74,15 @@ impl Assets { hats.insert(i.0, i.1); } + let mut facial_hair: HashMap = HashMap::new(); + + let images = [load_image!("facial_hair", "mustache")]; + category_count.push(images.len() + 1); + + for i in images { + facial_hair.insert(i.0, i.1); + } + let remove_thumb = RetainedImage::from_image_bytes("remove", include_bytes!("../assets/remove_thumb.png")) .unwrap(); @@ -88,6 +98,7 @@ impl Assets { colors, eyes, hats, + facial_hair, remove_thumb, } }