Skip to content

Commit

Permalink
Clean up phrasing
Browse files Browse the repository at this point in the history
  • Loading branch information
NickAcPT committed Aug 11, 2024
1 parent e621000 commit e621000
Showing 1 changed file with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl<M: ArmorMaterial, I: ModelProjectImageIO> ModelGenerationProject<M, I> {
do_ears_processing,
)?;
}

if let Some(cape) = alfalfa.get_data(AlfalfaDataKey::Cape) {
self.load_texture(
PlayerPartEarsTextureType::Cape.into(),
Expand All @@ -142,22 +142,28 @@ impl<M: ArmorMaterial, I: ModelProjectImageIO> ModelGenerationProject<M, I> {
}

let features = EarsParser::parse(&texture)?;

if let (Some(features), Ok(None)) = (features, alfalfa) {
let wings_enabled = features.wing.is_some();
let cape_enabled = features.cape_enabled;

if wings_enabled {
self.insert_empty_texture(PlayerPartEarsTextureType::Wings.into())?;
self.warnings.push("Wings are enabled but no wings texture was found.".to_string());
self.warnings.push(
"Wings are enabled but no wings texture was found.\n\
Please make sure you didn't paint over any semi-transparent pixels in your image editor.\n\n\
If you haven't drawn your Wings yet, make sure to do so, then use the Ears Manipulator to set it up on your skin.".to_string());
}

if cape_enabled {
self.insert_empty_texture(PlayerPartEarsTextureType::Cape.into())?;
self.warnings.push("Cape is enabled but no cape texture was found.".to_string());
self.warnings.push(
"Cape is enabled but no cape texture was found.\n\
Please make sure you didn't paint over any semi-transparent pixels in your image editor.\n\n\
If you haven't drawn your Cape yet, make sure to do so, then use the Ears Manipulator to set it up on your skin.".to_string());
}
}

self.part_context.ears_features = features;

ears_rs::utils::process_erase_regions(&mut texture)?;
Expand All @@ -184,12 +190,12 @@ impl<M: ArmorMaterial, I: ModelProjectImageIO> ModelGenerationProject<M, I> {
fn insert_empty_texture(&mut self, texture_type: PlayerPartTextureType) -> Result<()> {

Check warning on line 190 in utils/nmsr-rendering-blockbench-model-generator-experiment/src/generator.rs

View workflow job for this annotation

GitHub Actions / build

method `insert_empty_texture` is never used

Check warning on line 190 in utils/nmsr-rendering-blockbench-model-generator-experiment/src/generator.rs

View workflow job for this annotation

GitHub Actions / build

method `insert_empty_texture` is never used
let (width, height) = texture_type.get_texture_size();
let texture = RgbaImage::new(width, height);

self.add_texture(texture_type, texture, false)?;

Ok(())
}

fn recompute_max_resolution(&mut self) {
let max_resolution = self
.textures
Expand Down Expand Up @@ -302,7 +308,7 @@ impl<M: ArmorMaterial, I: ModelProjectImageIO> ModelGenerationProject<M, I> {
pub(crate) fn filter_textures(&mut self, keys: &[PlayerPartTextureType]) {
self.textures.retain(|k, _| keys.contains(k));
}

pub fn warnings(&self) -> &[String] {
&self.warnings
}
Expand Down

0 comments on commit e621000

Please sign in to comment.