diff --git a/assets/voxygen/voxel/armor/chest/generic.vox b/assets/voxygen/voxel/armor/chest/grayscale.vox similarity index 99% rename from assets/voxygen/voxel/armor/chest/generic.vox rename to assets/voxygen/voxel/armor/chest/grayscale.vox index 24defa4124..73334bb496 100644 Binary files a/assets/voxygen/voxel/armor/chest/generic.vox and b/assets/voxygen/voxel/armor/chest/grayscale.vox differ diff --git a/assets/voxygen/voxel/armor/pants/pants_blue.vox b/assets/voxygen/voxel/armor/pants/grayscale.vox similarity index 95% rename from assets/voxygen/voxel/armor/pants/pants_blue.vox rename to assets/voxygen/voxel/armor/pants/grayscale.vox index 5a49c5bd83..3f0177d9d0 100644 Binary files a/assets/voxygen/voxel/armor/pants/pants_blue.vox and b/assets/voxygen/voxel/armor/pants/grayscale.vox differ diff --git a/assets/voxygen/voxel/armor/pants/pants_brown.vox b/assets/voxygen/voxel/armor/pants/pants_brown.vox deleted file mode 100644 index 5596376ebd..0000000000 Binary files a/assets/voxygen/voxel/armor/pants/pants_brown.vox and /dev/null differ diff --git a/assets/voxygen/voxel/armor/pants/pants_dark.vox b/assets/voxygen/voxel/armor/pants/pants_dark.vox deleted file mode 100644 index aa541a8ffc..0000000000 Binary files a/assets/voxygen/voxel/armor/pants/pants_dark.vox and /dev/null differ diff --git a/assets/voxygen/voxel/armor/pants/pants_green.vox b/assets/voxygen/voxel/armor/pants/pants_green.vox deleted file mode 100644 index b25827d7fb..0000000000 Binary files a/assets/voxygen/voxel/armor/pants/pants_green.vox and /dev/null differ diff --git a/assets/voxygen/voxel/armor/pants/pants_orange.vox b/assets/voxygen/voxel/armor/pants/pants_orange.vox deleted file mode 100644 index 3eabb64004..0000000000 Binary files a/assets/voxygen/voxel/armor/pants/pants_orange.vox and /dev/null differ diff --git a/common/src/figure/mod.rs b/common/src/figure/mod.rs index 7999fe1d52..eb1d2cb887 100644 --- a/common/src/figure/mod.rs +++ b/common/src/figure/mod.rs @@ -70,13 +70,13 @@ impl Segment { pub fn replace(self, old: Cell, new: Cell) -> Self { self.map(|cell| if cell == old { Some(new) } else { None }) } - /// Preserve the luminance of all the colors but set the chomaticity to match the provided color - pub fn chromify(self, chroma: Rgb) -> Self { + // Preserve the luminance of all the colors but set the chomaticity to match the provided color + /*pub fn chromify(self, chroma: Rgb) -> Self { let chroma = chroma.map(|e| e as f32 / 255.0); self.map_rgb(|rgb| { chromify_srgb(rgb.map(|e| e as f32 / 255.0), chroma).map(|e| (e * 255.0) as u8) }) - } + }*/ // Sets the chromaticity based on the provided color // Multiplies luma with luma of the provided color (might not be what we want) /*pub fn colorify(mut self, color: Rgb) -> Self { diff --git a/voxygen/src/menu/char_selection/ui.rs b/voxygen/src/menu/char_selection/ui.rs index 7d39582123..b98027c35a 100644 --- a/voxygen/src/menu/char_selection/ui.rs +++ b/voxygen/src/menu/char_selection/ui.rs @@ -86,10 +86,13 @@ widget_ids! { eyebrows_slider, eyebrows_text, beard_slider, - beard_slider_2, beard_text, accessories_slider, accessories_text, + chest_slider, + chest_text, + pants_slider, + pants_text, // Buttons enter_world_button, @@ -132,8 +135,6 @@ widget_ids! { undead, elf, danari, - // Body Features - chest_slider, } } @@ -974,7 +975,7 @@ impl CharSelectionUi { .font_id(self.fonts.metamorph) .color(TEXT_COLOR_2) .set(self.ids.beard_text, ui_widgets); - ImageSlider::continuous(5.0, 0.0, 10.0, self.imgs.nothing, self.imgs.slider_range) + ImageSlider::discrete(5, 0, 10, self.imgs.nothing, self.imgs.slider_range) .w_h(208.0, 22.0) .mid_bottom_with_margin_on(self.ids.beard_text, -30.0) .track_breadth(12.0) @@ -982,7 +983,39 @@ impl CharSelectionUi { .track_color(Color::Rgba(1.0, 1.0, 1.0, 0.2)) .slider_color(Color::Rgba(1.0, 1.0, 1.0, 0.2)) .pad_track((5.0, 5.0)) - .set(self.ids.beard_slider_2, ui_widgets); + .set(self.ids.beard_slider, ui_widgets); + } + // Chest + let current_chest = self.character_body.chest; + if let Some(new_val) = char_slider( + self.ids.beard_slider, + "Chest", + self.ids.chest_text, + humanoid::ALL_CHESTS.len() - 1, + humanoid::ALL_CHESTS + .iter() + .position(|&c| c == current_chest) + .unwrap_or(0), + self.ids.chest_slider, + ui_widgets, + ) { + self.character_body.chest = humanoid::ALL_CHESTS[new_val]; + } + // Pants + let current_pants = self.character_body.pants; + if let Some(new_val) = char_slider( + self.ids.chest_slider, + "Pants", + self.ids.pants_text, + humanoid::ALL_PANTS.len() - 1, + humanoid::ALL_PANTS + .iter() + .position(|&c| c == current_pants) + .unwrap_or(0), + self.ids.pants_slider, + ui_widgets, + ) { + self.character_body.pants = humanoid::ALL_PANTS[new_val]; } } // Char Creation fin diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index b0ed77bbfe..97fb441cdf 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -237,18 +237,21 @@ impl HumHeadSpec { pub fn mesh_chest(chest: Chest) -> Mesh { let color = match chest { - Chest::Brown => (125, 53, 0), - Chest::Dark => (0, 38, 43), - Chest::Green => (0, 255, 34), - Chest::Orange => (255, 106, 0), - Chest::Blue => (0, 38, 255), + Chest::Blue => (28, 66, 109), + Chest::Brown => (54, 30, 26), + Chest::Dark => (24, 19, 17), + Chest::Green => (49, 95, 59), + Chest::Orange => (148, 52, 33), }; - let bare_chest = load_segment("figure.body.chest"); - let chest_armor = load_segment("armor.chest.generic"); + let bare_chest = graceful_load_segment("figure.body.chest"); + let chest_armor = graceful_load_segment("armor.chest.grayscale"); let chest = DynaUnionizer::new() .add(bare_chest, Vec3::new(0, 0, 0)) - .add(chest_armor.chromify(Rgb::from(color)), Vec3::new(0, 0, 0)) + .add( + recolor_greys(chest_armor, Rgb::from(color)), + Vec3::new(0, 0, 0), + ) .unify() .0; @@ -266,16 +269,24 @@ pub fn mesh_belt(belt: Belt) -> Mesh { } pub fn mesh_pants(pants: Pants) -> Mesh { - load_mesh( - match pants { - Pants::Blue => "armor.pants.pants_blue", - Pants::Brown => "armor.pants.pants_brown", - Pants::Dark => "armor.pants.pants_dark", - Pants::Green => "armor.pants.pants_green", - Pants::Orange => "armor.pants.pants_orange", - }, + let color = match pants { + Pants::Blue => (28, 66, 109), + Pants::Brown => (54, 30, 26), + Pants::Dark => (24, 19, 17), + Pants::Green => (49, 95, 59), + Pants::Orange => (148, 52, 33), + }; + + let pants_segment = recolor_greys( + graceful_load_segment("armor.pants.grayscale"), + Rgb::from(color), + ); + + Meshable::::generate_mesh( + &pants_segment, Vec3::new(-5.0, -3.5, 0.0), ) + .0 } pub fn mesh_left_hand(hand: Hand) -> Mesh {