Skip to content

Commit

Permalink
mustache
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Spaink committed Aug 22, 2023
1 parent 41d2432 commit 8d8cf04
Show file tree
Hide file tree
Showing 42 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

:crab: Try it out: <https://sspaink.github.io/rustaceanize.me/> :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)

Expand Down
Binary file added assets/facial_hair/mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/facial_hair/mustache_thumb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions image_gen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ fn main() {

merged.extend(merge(&merged, &hats));

let facial_hair: HashMap<String, DynamicImage> = load_images("facial_hair");

merged.extend(merge(&merged, &facial_hair));

for (name, image) in merged {
image.save(format!("{ROOT_DIR}/{name}.png")).unwrap();
}
Expand Down
Binary file added pregen_crabs/blue_angry_bow_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/blue_angry_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/blue_angry_top_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/blue_girl_bow_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/blue_girl_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/blue_girl_top_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/blue_happy_bow_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/blue_happy_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/blue_happy_top_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/green_angry_bow_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/green_angry_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/green_angry_top_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/green_girl_bow_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/green_girl_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/green_girl_top_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/green_happy_bow_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/green_happy_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/green_happy_top_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/orange_angry_bow_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/orange_angry_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/orange_angry_top_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/orange_girl_bow_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/orange_girl_mustache.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pregen_crabs/orange_girl_top_mustache.png
Binary file added pregen_crabs/orange_happy_bow_mustache.png
Binary file added pregen_crabs/orange_happy_mustache.png
Binary file added pregen_crabs/orange_happy_top_mustache.png
Binary file added pregen_crabs/purple_angry_bow_mustache.png
Binary file added pregen_crabs/purple_angry_mustache.png
Binary file added pregen_crabs/purple_angry_top_mustache.png
Binary file added pregen_crabs/purple_girl_bow_mustache.png
Binary file added pregen_crabs/purple_girl_mustache.png
Binary file added pregen_crabs/purple_girl_top_mustache.png
Binary file added pregen_crabs/purple_happy_bow_mustache.png
Binary file added pregen_crabs/purple_happy_mustache.png
Binary file added pregen_crabs/purple_happy_top_mustache.png
12 changes: 12 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ struct Body {
color: Option<String>,
eyes: Option<String>,
hat: Option<String>,
facial_hair: Option<String>,
}

pub struct App {
Expand All @@ -26,6 +27,7 @@ impl Default for App {
color: Some("orange".to_string()),
eyes: Some("happy".to_string()),
hat: None,
facial_hair: None,
},
}
}
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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, |_| {});
}
Expand Down
11 changes: 11 additions & 0 deletions src/assets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub struct Assets {
pub colors: HashMap<String, Image>,
pub eyes: HashMap<String, Image>,
pub hats: HashMap<String, Image>,
pub facial_hair: HashMap<String, Image>,
pub remove_thumb: RetainedImage,
}

Expand Down Expand Up @@ -73,6 +74,15 @@ impl Assets {
hats.insert(i.0, i.1);
}

let mut facial_hair: HashMap<String, Image> = 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();
Expand All @@ -88,6 +98,7 @@ impl Assets {
colors,
eyes,
hats,
facial_hair,
remove_thumb,
}
}
Expand Down

0 comments on commit 8d8cf04

Please sign in to comment.