diff --git a/assets/voxygen/background/bg_creation.png b/assets/voxygen/background/bg_creation.png deleted file mode 100644 index 5fd9d7c079..0000000000 Binary files a/assets/voxygen/background/bg_creation.png and /dev/null differ diff --git a/assets/voxygen/background/bg_selection.png b/assets/voxygen/background/bg_selection.png deleted file mode 100644 index e25763049f..0000000000 Binary files a/assets/voxygen/background/bg_selection.png and /dev/null differ diff --git a/assets/voxygen/element/frames/divider.vox b/assets/voxygen/element/frames/divider.vox new file mode 100644 index 0000000000..c3c487915f Binary files /dev/null and b/assets/voxygen/element/frames/divider.vox differ diff --git a/assets/voxygen/element/frames/mmap.png b/assets/voxygen/element/frames/mmap.png deleted file mode 100644 index e0c6bc5ca5..0000000000 Binary files a/assets/voxygen/element/frames/mmap.png and /dev/null differ diff --git a/assets/voxygen/element/frames/selection.png b/assets/voxygen/element/frames/selection.png deleted file mode 100644 index ad66a4ac7b..0000000000 Binary files a/assets/voxygen/element/frames/selection.png and /dev/null differ diff --git a/assets/voxygen/element/frames/selection.vox b/assets/voxygen/element/frames/selection.vox new file mode 100644 index 0000000000..ed9a804eda Binary files /dev/null and b/assets/voxygen/element/frames/selection.vox differ diff --git a/assets/voxygen/element/frames/selection_frame.vox b/assets/voxygen/element/frames/selection_frame.vox new file mode 100644 index 0000000000..26a7c14854 Binary files /dev/null and b/assets/voxygen/element/frames/selection_frame.vox differ diff --git a/assets/voxygen/element/frames/server_frame.vox b/assets/voxygen/element/frames/server_frame.vox new file mode 100644 index 0000000000..637cb170f0 Binary files /dev/null and b/assets/voxygen/element/frames/server_frame.vox differ diff --git a/assets/voxygen/element/frames/settings.png b/assets/voxygen/element/frames/settings.png deleted file mode 100644 index a0912eb609..0000000000 Binary files a/assets/voxygen/element/frames/settings.png and /dev/null differ diff --git a/assets/voxygen/element/frames/window.png b/assets/voxygen/element/frames/window.png deleted file mode 100644 index b779ecc912..0000000000 Binary files a/assets/voxygen/element/frames/window.png and /dev/null differ diff --git a/assets/voxygen/element/frames/window_4.vox b/assets/voxygen/element/frames/window_4.vox new file mode 100644 index 0000000000..4d3fa596ed Binary files /dev/null and b/assets/voxygen/element/frames/window_4.vox differ diff --git a/assets/voxygen/element/frames/window_map.png b/assets/voxygen/element/frames/window_map.png deleted file mode 100644 index 84b6ac0acf..0000000000 Binary files a/assets/voxygen/element/frames/window_map.png and /dev/null differ diff --git a/assets/voxygen/element/frames/window_old.png b/assets/voxygen/element/frames/window_old.png deleted file mode 100644 index 70fe0a710e..0000000000 Binary files a/assets/voxygen/element/frames/window_old.png and /dev/null differ diff --git a/assets/voxygen/voxel/belt.vox b/assets/voxygen/voxel/armor/belt/belt_dark.vox similarity index 100% rename from assets/voxygen/voxel/belt.vox rename to assets/voxygen/voxel/armor/belt/belt_dark.vox diff --git a/assets/voxygen/voxel/armor/chest/chest_blue.vox b/assets/voxygen/voxel/armor/chest/chest_blue.vox new file mode 100644 index 0000000000..1111167cb2 Binary files /dev/null and b/assets/voxygen/voxel/armor/chest/chest_blue.vox differ diff --git a/assets/voxygen/voxel/armor/chest/chest_brown.vox b/assets/voxygen/voxel/armor/chest/chest_brown.vox new file mode 100644 index 0000000000..644c416feb Binary files /dev/null and b/assets/voxygen/voxel/armor/chest/chest_brown.vox differ diff --git a/assets/voxygen/voxel/chest.vox b/assets/voxygen/voxel/armor/chest/chest_dark.vox similarity index 100% rename from assets/voxygen/voxel/chest.vox rename to assets/voxygen/voxel/armor/chest/chest_dark.vox diff --git a/assets/voxygen/voxel/armor/chest/chest_green.vox b/assets/voxygen/voxel/armor/chest/chest_green.vox new file mode 100644 index 0000000000..96648b0861 Binary files /dev/null and b/assets/voxygen/voxel/armor/chest/chest_green.vox differ diff --git a/assets/voxygen/voxel/armor/chest/chest_orange.vox b/assets/voxygen/voxel/armor/chest/chest_orange.vox new file mode 100644 index 0000000000..23764f99ca Binary files /dev/null and b/assets/voxygen/voxel/armor/chest/chest_orange.vox differ diff --git a/assets/voxygen/voxel/foot.vox b/assets/voxygen/voxel/armor/foot/foot_dark.vox similarity index 100% rename from assets/voxygen/voxel/foot.vox rename to assets/voxygen/voxel/armor/foot/foot_dark.vox diff --git a/assets/voxygen/voxel/armor/pants/pants_blue.vox b/assets/voxygen/voxel/armor/pants/pants_blue.vox new file mode 100644 index 0000000000..3aabaf756b Binary files /dev/null and b/assets/voxygen/voxel/armor/pants/pants_blue.vox differ diff --git a/assets/voxygen/voxel/armor/pants/pants_brown.vox b/assets/voxygen/voxel/armor/pants/pants_brown.vox new file mode 100644 index 0000000000..5596376ebd Binary files /dev/null and b/assets/voxygen/voxel/armor/pants/pants_brown.vox differ diff --git a/assets/voxygen/voxel/pants.vox b/assets/voxygen/voxel/armor/pants/pants_dark.vox similarity index 100% rename from assets/voxygen/voxel/pants.vox rename to assets/voxygen/voxel/armor/pants/pants_dark.vox diff --git a/assets/voxygen/voxel/armor/pants/pants_green.vox b/assets/voxygen/voxel/armor/pants/pants_green.vox new file mode 100644 index 0000000000..4f2b2a41cb Binary files /dev/null and b/assets/voxygen/voxel/armor/pants/pants_green.vox differ diff --git a/assets/voxygen/voxel/armor/pants/pants_orange.vox b/assets/voxygen/voxel/armor/pants/pants_orange.vox new file mode 100644 index 0000000000..65932c13ca Binary files /dev/null and b/assets/voxygen/voxel/armor/pants/pants_orange.vox differ diff --git a/assets/voxygen/voxel/elf/chest.vox b/assets/voxygen/voxel/armor/shoulder/shoulder_l_brown.vox similarity index 90% rename from assets/voxygen/voxel/elf/chest.vox rename to assets/voxygen/voxel/armor/shoulder/shoulder_l_brown.vox index a0d9980bb0..22633aeda2 100644 Binary files a/assets/voxygen/voxel/elf/chest.vox and b/assets/voxygen/voxel/armor/shoulder/shoulder_l_brown.vox differ diff --git a/assets/voxygen/voxel/armor/shoulder/shoulder_r_brown.vox b/assets/voxygen/voxel/armor/shoulder/shoulder_r_brown.vox new file mode 100644 index 0000000000..13a1d17d5e Binary files /dev/null and b/assets/voxygen/voxel/armor/shoulder/shoulder_r_brown.vox differ diff --git a/assets/voxygen/voxel/body.vox b/assets/voxygen/voxel/body.vox deleted file mode 100644 index d6c7aa48dc..0000000000 Binary files a/assets/voxygen/voxel/body.vox and /dev/null differ diff --git a/assets/voxygen/voxel/dragon_body.vox b/assets/voxygen/voxel/dragon_body.vox deleted file mode 100644 index c1d20584d9..0000000000 Binary files a/assets/voxygen/voxel/dragon_body.vox and /dev/null differ diff --git a/assets/voxygen/voxel/dragon_lfoot.vox b/assets/voxygen/voxel/dragon_lfoot.vox deleted file mode 100644 index 80828a7137..0000000000 Binary files a/assets/voxygen/voxel/dragon_lfoot.vox and /dev/null differ diff --git a/assets/voxygen/voxel/dragon_rfoot.vox b/assets/voxygen/voxel/dragon_rfoot.vox deleted file mode 100644 index 1e2bcfe32d..0000000000 Binary files a/assets/voxygen/voxel/dragon_rfoot.vox and /dev/null differ diff --git a/assets/voxygen/voxel/dragon_tail.vox b/assets/voxygen/voxel/dragon_tail.vox deleted file mode 100644 index 050f21c65a..0000000000 Binary files a/assets/voxygen/voxel/dragon_tail.vox and /dev/null differ diff --git a/assets/voxygen/voxel/dragon_wingL_in.vox b/assets/voxygen/voxel/dragon_wingL_in.vox deleted file mode 100644 index aa0a7eedb2..0000000000 Binary files a/assets/voxygen/voxel/dragon_wingL_in.vox and /dev/null differ diff --git a/assets/voxygen/voxel/dragon_wingL_out.vox b/assets/voxygen/voxel/dragon_wingL_out.vox deleted file mode 100644 index 879372f6d8..0000000000 Binary files a/assets/voxygen/voxel/dragon_wingL_out.vox and /dev/null differ diff --git a/assets/voxygen/voxel/dragon_wingR_in.vox b/assets/voxygen/voxel/dragon_wingR_in.vox deleted file mode 100644 index 6dd9f1cd88..0000000000 Binary files a/assets/voxygen/voxel/dragon_wingR_in.vox and /dev/null differ diff --git a/assets/voxygen/voxel/dragon_wingR_out.vox b/assets/voxygen/voxel/dragon_wingR_out.vox deleted file mode 100644 index 8774a6798a..0000000000 Binary files a/assets/voxygen/voxel/dragon_wingR_out.vox and /dev/null differ diff --git a/assets/voxygen/voxel/dragonhead.vox b/assets/voxygen/voxel/dragonhead.vox deleted file mode 100644 index 0de9789f15..0000000000 Binary files a/assets/voxygen/voxel/dragonhead.vox and /dev/null differ diff --git a/assets/voxygen/voxel/elf/belt.vox b/assets/voxygen/voxel/elf/belt.vox deleted file mode 100644 index 61c639ec67..0000000000 Binary files a/assets/voxygen/voxel/elf/belt.vox and /dev/null differ diff --git a/assets/voxygen/voxel/elf/foot.vox b/assets/voxygen/voxel/elf/foot.vox deleted file mode 100644 index 4c5d106656..0000000000 Binary files a/assets/voxygen/voxel/elf/foot.vox and /dev/null differ diff --git a/assets/voxygen/voxel/elf/hand.vox b/assets/voxygen/voxel/elf/hand.vox deleted file mode 100644 index b4dc12e5c8..0000000000 Binary files a/assets/voxygen/voxel/elf/hand.vox and /dev/null differ diff --git a/assets/voxygen/voxel/elf/head.vox b/assets/voxygen/voxel/elf/head.vox deleted file mode 100644 index 06fd5e17d2..0000000000 Binary files a/assets/voxygen/voxel/elf/head.vox and /dev/null differ diff --git a/assets/voxygen/voxel/elf/pants.vox b/assets/voxygen/voxel/elf/pants.vox deleted file mode 100644 index d407e00911..0000000000 Binary files a/assets/voxygen/voxel/elf/pants.vox and /dev/null differ diff --git a/assets/voxygen/voxel/elf/sword.vox b/assets/voxygen/voxel/elf/sword.vox deleted file mode 100644 index 87b1fb118b..0000000000 Binary files a/assets/voxygen/voxel/elf/sword.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/body/belt_female.vox b/assets/voxygen/voxel/figure/body/belt_female.vox new file mode 100644 index 0000000000..acc11b60e2 Binary files /dev/null and b/assets/voxygen/voxel/figure/body/belt_female.vox differ diff --git a/assets/voxygen/voxel/figure/body/belt_male.vox b/assets/voxygen/voxel/figure/body/belt_male.vox new file mode 100644 index 0000000000..ebb139038e Binary files /dev/null and b/assets/voxygen/voxel/figure/body/belt_male.vox differ diff --git a/assets/voxygen/voxel/figure/body/chest_female.vox b/assets/voxygen/voxel/figure/body/chest_female.vox new file mode 100644 index 0000000000..a5e83aa6d5 Binary files /dev/null and b/assets/voxygen/voxel/figure/body/chest_female.vox differ diff --git a/assets/voxygen/voxel/figure/body/chest_male.vox b/assets/voxygen/voxel/figure/body/chest_male.vox new file mode 100644 index 0000000000..c4009ba3ed Binary files /dev/null and b/assets/voxygen/voxel/figure/body/chest_male.vox differ diff --git a/assets/voxygen/voxel/sword.vox b/assets/voxygen/voxel/figure/body/foot.vox similarity index 50% rename from assets/voxygen/voxel/sword.vox rename to assets/voxygen/voxel/figure/body/foot.vox index 42e831db2e..5f4fb03594 100644 Binary files a/assets/voxygen/voxel/sword.vox and b/assets/voxygen/voxel/figure/body/foot.vox differ diff --git a/assets/voxygen/voxel/figure/body/hand.vox b/assets/voxygen/voxel/figure/body/hand.vox new file mode 100644 index 0000000000..ef54e522a6 Binary files /dev/null and b/assets/voxygen/voxel/figure/body/hand.vox differ diff --git a/assets/voxygen/voxel/figure/body/pants_female.vox b/assets/voxygen/voxel/figure/body/pants_female.vox new file mode 100644 index 0000000000..03b7463473 Binary files /dev/null and b/assets/voxygen/voxel/figure/body/pants_female.vox differ diff --git a/assets/voxygen/voxel/figure/body/pants_male.vox b/assets/voxygen/voxel/figure/body/pants_male.vox new file mode 100644 index 0000000000..7b8e092aa4 Binary files /dev/null and b/assets/voxygen/voxel/figure/body/pants_male.vox differ diff --git a/assets/voxygen/voxel/eyes.vox b/assets/voxygen/voxel/figure/eyes/eyes_female_1.vox similarity index 100% rename from assets/voxygen/voxel/eyes.vox rename to assets/voxygen/voxel/figure/eyes/eyes_female_1.vox diff --git a/assets/voxygen/voxel/figure/eyes/eyes_male_1.vox b/assets/voxygen/voxel/figure/eyes/eyes_male_1.vox new file mode 100644 index 0000000000..f91e52993d Binary files /dev/null and b/assets/voxygen/voxel/figure/eyes/eyes_male_1.vox differ diff --git a/assets/voxygen/voxel/hair.vox b/assets/voxygen/voxel/figure/hair/human/hair_human_female_1.vox similarity index 100% rename from assets/voxygen/voxel/hair.vox rename to assets/voxygen/voxel/figure/hair/human/hair_human_female_1.vox diff --git a/assets/voxygen/voxel/figure/head.vox b/assets/voxygen/voxel/figure/head.vox new file mode 100644 index 0000000000..d1e925ce60 Binary files /dev/null and b/assets/voxygen/voxel/figure/head.vox differ diff --git a/assets/voxygen/voxel/head2.vox b/assets/voxygen/voxel/figure/head/Human/head.vox similarity index 100% rename from assets/voxygen/voxel/head2.vox rename to assets/voxygen/voxel/figure/head/Human/head.vox diff --git a/assets/voxygen/voxel/head.vox b/assets/voxygen/voxel/figure/head_test1.vox similarity index 100% rename from assets/voxygen/voxel/head.vox rename to assets/voxygen/voxel/figure/head_test1.vox diff --git a/assets/voxygen/voxel/head4.vox b/assets/voxygen/voxel/figure/head_test2.vox similarity index 100% rename from assets/voxygen/voxel/head4.vox rename to assets/voxygen/voxel/figure/head_test2.vox diff --git a/assets/voxygen/voxel/fixture/selection_bg.vox b/assets/voxygen/voxel/fixture/selection_bg.vox new file mode 100644 index 0000000000..c328617096 Binary files /dev/null and b/assets/voxygen/voxel/fixture/selection_bg.vox differ diff --git a/assets/voxygen/voxel/foot_BL.vox b/assets/voxygen/voxel/foot_BL.vox deleted file mode 100644 index 90c9d7d6d9..0000000000 Binary files a/assets/voxygen/voxel/foot_BL.vox and /dev/null differ diff --git a/assets/voxygen/voxel/foot_BR.vox b/assets/voxygen/voxel/foot_BR.vox deleted file mode 100644 index 073a55c9e0..0000000000 Binary files a/assets/voxygen/voxel/foot_BR.vox and /dev/null differ diff --git a/assets/voxygen/voxel/foot_FL.vox b/assets/voxygen/voxel/foot_FL.vox deleted file mode 100644 index 23eab56821..0000000000 Binary files a/assets/voxygen/voxel/foot_FL.vox and /dev/null differ diff --git a/assets/voxygen/voxel/foot_FR.vox b/assets/voxygen/voxel/foot_FR.vox deleted file mode 100644 index 33ba935091..0000000000 Binary files a/assets/voxygen/voxel/foot_FR.vox and /dev/null differ diff --git a/assets/voxygen/voxel/hand.vox b/assets/voxygen/voxel/hand.vox deleted file mode 100644 index eb9468b18a..0000000000 Binary files a/assets/voxygen/voxel/hand.vox and /dev/null differ diff --git a/assets/voxygen/voxel/lionhead.vox b/assets/voxygen/voxel/lionhead.vox deleted file mode 100644 index 7d6727d685..0000000000 Binary files a/assets/voxygen/voxel/lionhead.vox and /dev/null differ diff --git a/assets/voxygen/voxel/pigchest.vox b/assets/voxygen/voxel/npc/pig_purple/pigchest.vox similarity index 100% rename from assets/voxygen/voxel/pigchest.vox rename to assets/voxygen/voxel/npc/pig_purple/pigchest.vox diff --git a/assets/voxygen/voxel/pighead.vox b/assets/voxygen/voxel/npc/pig_purple/pighead.vox similarity index 100% rename from assets/voxygen/voxel/pighead.vox rename to assets/voxygen/voxel/npc/pig_purple/pighead.vox diff --git a/assets/voxygen/voxel/pigleg_l.vox b/assets/voxygen/voxel/npc/pig_purple/pigleg_l.vox similarity index 100% rename from assets/voxygen/voxel/pigleg_l.vox rename to assets/voxygen/voxel/npc/pig_purple/pigleg_l.vox diff --git a/assets/voxygen/voxel/pigleg_r.vox b/assets/voxygen/voxel/npc/pig_purple/pigleg_r.vox similarity index 100% rename from assets/voxygen/voxel/pigleg_r.vox rename to assets/voxygen/voxel/npc/pig_purple/pigleg_r.vox diff --git a/assets/voxygen/voxel/glider.vox b/assets/voxygen/voxel/object/glider.vox similarity index 100% rename from assets/voxygen/voxel/glider.vox rename to assets/voxygen/voxel/object/glider.vox diff --git a/assets/voxygen/voxel/sabremale.vox b/assets/voxygen/voxel/sabremale.vox deleted file mode 100644 index 05e0ec245c..0000000000 Binary files a/assets/voxygen/voxel/sabremale.vox and /dev/null differ diff --git a/assets/voxygen/voxel/shoulder_l.vox b/assets/voxygen/voxel/shoulder_l.vox deleted file mode 100644 index 62e1930940..0000000000 Binary files a/assets/voxygen/voxel/shoulder_l.vox and /dev/null differ diff --git a/assets/voxygen/voxel/shoulder_r.vox b/assets/voxygen/voxel/shoulder_r.vox deleted file mode 100644 index ce14c0e7d3..0000000000 Binary files a/assets/voxygen/voxel/shoulder_r.vox and /dev/null differ diff --git a/assets/voxygen/voxel/shoulders.vox b/assets/voxygen/voxel/shoulders.vox deleted file mode 100644 index a70d123f24..0000000000 Binary files a/assets/voxygen/voxel/shoulders.vox and /dev/null differ diff --git a/assets/voxygen/voxel/axe.vox b/assets/voxygen/voxel/weapon/axe/axe.vox similarity index 100% rename from assets/voxygen/voxel/axe.vox rename to assets/voxygen/voxel/weapon/axe/axe.vox diff --git a/assets/voxygen/voxel/weapon/sword/sword_rusty_2h.vox b/assets/voxygen/voxel/weapon/sword/sword_rusty_2h.vox new file mode 100644 index 0000000000..83ef86199a Binary files /dev/null and b/assets/voxygen/voxel/weapon/sword/sword_rusty_2h.vox differ diff --git a/assets/voxygen/voxel/Wood Training 2h.vox b/assets/voxygen/voxel/weapon/sword/sword_wood_2h.vox similarity index 100% rename from assets/voxygen/voxel/Wood Training 2h.vox rename to assets/voxygen/voxel/weapon/sword/sword_wood_2h.vox diff --git a/common/src/comp/actor.rs b/common/src/comp/actor.rs index c951adc1e4..109c90ceb8 100644 --- a/common/src/comp/actor.rs +++ b/common/src/comp/actor.rs @@ -28,16 +28,27 @@ pub enum Head { #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Chest { Default, + Blue, + Brown, + Dark, + Green, + Orange, } #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Belt { - Default, + //Default, + Dark, } #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Pants { Default, + Blue, + Brown, + Dark, + Green, + Orange, } #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] @@ -48,6 +59,7 @@ pub enum Hand { #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Foot { Default, + Dark, } #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] @@ -90,7 +102,7 @@ pub enum PigLegR { Default, } -const ALL_RACES: [Race; 6] = [ +pub const ALL_RACES: [Race; 6] = [ Race::Danari, Race::Dwarf, Race::Elf, @@ -98,14 +110,31 @@ const ALL_RACES: [Race; 6] = [ Race::Orc, Race::Undead, ]; -const ALL_BODY_TYPES: [BodyType; 3] = [BodyType::Female, BodyType::Male, BodyType::Unspecified]; -const ALL_HEADS: [Head; 1] = [Head::Default]; -const ALL_CHESTS: [Chest; 1] = [Chest::Default]; -const ALL_BELTS: [Belt; 1] = [Belt::Default]; -const ALL_PANTS: [Pants; 1] = [Pants::Default]; -const ALL_HANDS: [Hand; 1] = [Hand::Default]; -const ALL_FEET: [Foot; 1] = [Foot::Default]; -const ALL_WEAPONS: [Weapon; 7] = [ +pub const ALL_BODY_TYPES: [BodyType; 3] = [BodyType::Female, BodyType::Male, BodyType::Unspecified]; +pub const ALL_HEADS: [Head; 1] = [Head::Default]; +pub const ALL_CHESTS: [Chest; 6] = [ + Chest::Default, + Chest::Blue, + Chest::Brown, + Chest::Dark, + Chest::Green, + Chest::Orange, +]; +pub const ALL_BELTS: [Belt; 1] = [ + //Belt::Default, + Belt::Dark, +]; +pub const ALL_PANTS: [Pants; 6] = [ + Pants::Default, + Pants::Blue, + Pants::Brown, + Pants::Dark, + Pants::Green, + Pants::Orange, +]; +pub const ALL_HANDS: [Hand; 1] = [Hand::Default]; +pub const ALL_FEET: [Foot; 2] = [Foot::Default, Foot::Dark]; +pub const ALL_WEAPONS: [Weapon; 7] = [ Weapon::Daggers, Weapon::SwordShield, Weapon::Sword, @@ -114,8 +143,8 @@ const ALL_WEAPONS: [Weapon; 7] = [ Weapon::Bow, Weapon::Staff, ]; -const ALL_SHOULDERS: [Shoulder; 1] = [Shoulder::Default]; -const ALL_DRAW: [Draw; 1] = [Draw::Default]; +pub const ALL_SHOULDERS: [Shoulder; 1] = [Shoulder::Default]; +pub const ALL_DRAW: [Draw; 1] = [Draw::Default]; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub struct HumanoidBody { diff --git a/common/src/lib.rs b/common/src/lib.rs index a0fa932242..20b92c44b4 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -4,6 +4,7 @@ trait_alias, bind_by_move_pattern_guards, option_flattening, // Converts Option> into Option TODO: Remove this once this feature becomes stable + copysign, )] #[macro_use] diff --git a/server/src/lib.rs b/server/src/lib.rs index 71e15f991f..8a818e6b2f 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -136,7 +136,6 @@ impl Server { body: comp::Body, ) { state.write_component(entity, comp::Actor::Character { name, body }); - state.write_component(entity, comp::Stats::default()); state.write_component(entity, comp::phys::Pos(Vec3::new(0.0, 0.0, 64.0))); state.write_component(entity, comp::phys::Vel(Vec3::zero())); state.write_component(entity, comp::phys::Dir(Vec3::unit_y())); diff --git a/voxygen/src/anim/fixture/mod.rs b/voxygen/src/anim/fixture/mod.rs new file mode 100644 index 0000000000..bd5579eaed --- /dev/null +++ b/voxygen/src/anim/fixture/mod.rs @@ -0,0 +1,40 @@ +// Crate +use crate::render::FigureBoneData; + +// Local +use super::{Bone, Skeleton}; + +const SCALE: f32 = 44.0; + +pub struct FixtureSkeleton; + +impl FixtureSkeleton { + pub fn new() -> Self { + Self {} + } +} + +impl Skeleton for FixtureSkeleton { + fn compute_matrices(&self) -> [FigureBoneData; 16] { + [ + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + FigureBoneData::new(vek::Mat4::identity()), + ] + } + + fn interpolate(&mut self, target: &Self) {} +} diff --git a/voxygen/src/anim/mod.rs b/voxygen/src/anim/mod.rs index ed3e0a13e7..7bbee6358b 100644 --- a/voxygen/src/anim/mod.rs +++ b/voxygen/src/anim/mod.rs @@ -1,5 +1,7 @@ pub mod character; +pub mod fixture; pub mod quadruped; + // Library use vek::*; diff --git a/voxygen/src/hud/esc_menu.rs b/voxygen/src/hud/esc_menu.rs index 55670942de..1b7db480df 100644 --- a/voxygen/src/hud/esc_menu.rs +++ b/voxygen/src/hud/esc_menu.rs @@ -111,14 +111,14 @@ impl<'a> Widget for EscMenu<'a> { .w_h(170.0, 50.0) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .label("Servers") + .label("Characters") .label_y(conrod_core::position::Relative::Scalar(2.0)) .label_color(TEXT_COLOR) .label_font_size(17) .set(state.ids.menu_button_3, ui) .was_clicked() { - // TODO: Show servers window (needed in-game?). + return Some(Event::Logout); // TODO: Open Character Selection }; // Logout if Button::image(self.imgs.button) diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index f32b405ad5..4ccd1c8d12 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -127,7 +127,6 @@ image_ids! { charwindow_gradient:"/voxygen/element/misc_bg/charwindow.png", // Spell Book Window - spellbook_bg: "/voxygen/element/misc_bg/small_bg.png", spellbook_icon: "/voxygen/element/icons/spellbook.png", // Bag @@ -138,7 +137,6 @@ image_ids! { bag_open_hover: "/voxygen/element/buttons/bag/open_hover.png", bag_open_press: "/voxygen/element/buttons/bag/open_press.png", - map_bg: "/voxygen/element/misc_bg/small_bg.png", map_icon: "/voxygen/element/icons/map.png", grid_button: "/voxygen/element/buttons/border.png", @@ -159,10 +157,6 @@ image_ids! { window_frame_2: "/voxygen/element/frames/window_2.png", - settings_bg: "/voxygen/element/frames/settings.png", - settings_icon: "/voxygen/element/icons/settings.png", - settings_button_mo: "/voxygen/element/buttons/blue_mo.png", - // Char Window charwindow: "/voxygen/element/misc_bg/charwindow.png", charwindow_icon: "/voxygen/element/icons/charwindow.png", @@ -173,17 +167,12 @@ image_ids! { progress: "/voxygen/element/misc_bg/progress.png", // Quest-Log Window - questlog_bg: "/voxygen/element/misc_bg/small_bg.png", questlog_icon: "/voxygen/element/icons/questlog.png", - button_blue_mo: "/voxygen/element/buttons/blue_mo.png", - button_blue_press: "/voxygen/element/buttons/blue_press.png", - // Window BG window_bg: "/voxygen/element/misc_bg/window_bg.png", // Social Window - social_bg: "/voxygen/element/misc_bg/small_bg.png", social_icon: "/voxygen/element/icons/social.png", diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index e01331055c..25f9c65664 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -229,8 +229,8 @@ impl Hud { new_messages: VecDeque::new(), inventory_space: 0, show: Show { - help: true, - debug: false, + help: false, + debug: true, bag: false, esc_menu: false, open_windows: Windows::None, diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index dc2331a916..fa9c51b853 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -2,6 +2,7 @@ mod scene; mod ui; use crate::{ + render::Renderer, session::SessionState, window::{Event, Window}, Direction, GlobalState, PlayState, PlayStateResult, @@ -78,7 +79,7 @@ impl PlayState for CharSelectionState { .postbox .send_message(ClientMsg::Character { name: self.char_selection_ui.character_name.clone(), - body: comp::Body::Humanoid(self.char_selection_ui.character_body), //body: comp::Body::Quadruped(comp::QuadrupedBody::random()), + body: comp::Body::Humanoid(self.char_selection_ui.character_body), }); return PlayStateResult::Switch(Box::new(SessionState::new( &mut global_state.window, @@ -93,9 +94,12 @@ impl PlayState for CharSelectionState { self.scene .maintain(global_state.window.renderer_mut(), &self.client.borrow()); - // Render the scene. - self.scene - .render(global_state.window.renderer_mut(), &self.client.borrow()); + // Render the scene + self.scene.render( + global_state.window.renderer_mut(), + &self.client.borrow(), + self.char_selection_ui.character_body, + ); // Draw the UI to the screen. self.char_selection_ui diff --git a/voxygen/src/menu/char_selection/scene.rs b/voxygen/src/menu/char_selection/scene.rs index d29a50d127..7c9af72ac6 100644 --- a/voxygen/src/menu/char_selection/scene.rs +++ b/voxygen/src/menu/char_selection/scene.rs @@ -1,6 +1,7 @@ use crate::{ anim::{ character::{CharacterSkeleton, IdleAnimation}, + fixture::FixtureSkeleton, Animation, Skeleton, }, render::{ @@ -13,6 +14,7 @@ use crate::{ }, }; use client::Client; +use common::comp::HumanoidBody; use common::{comp, figure::Segment}; use vek::*; @@ -33,7 +35,7 @@ pub struct Scene { skybox: Skybox, postprocess: PostProcess, backdrop_model: Model, - backdrop_state: FigureState, + backdrop_state: FigureState, figure_model_cache: FigureModelCache, figure_state: FigureState, @@ -61,18 +63,21 @@ impl Scene { figure_state: FigureState::new(renderer, CharacterSkeleton::new()), backdrop_model: renderer - .create_model(&FigureModelCache::load_mesh("knight.vox", Vec3::zero())) + .create_model(&FigureModelCache::load_mesh( + "fixture/selection_bg.vox", + Vec3::new(-55.0, -50.0, -1.0), + )) .unwrap(), - backdrop_state: FigureState::new(renderer, CharacterSkeleton::new()), + backdrop_state: FigureState::new(renderer, FixtureSkeleton::new()), } } pub fn maintain(&mut self, renderer: &mut Renderer, client: &Client) { - self.camera.set_focus_pos(Vec3::unit_z() * 1.75); + self.camera.set_focus_pos(Vec3::unit_z() * 2.0); self.camera.update(client.state().get_time()); - self.camera.set_distance(4.0); + self.camera.set_distance(4.2); self.camera - .set_orientation(Vec3::new(client.state().get_time() as f32 * 0.2, 0.3, 0.0)); + .set_orientation(Vec3::new(client.state().get_time() as f32 * 0.0, 0.0, 0.0)); let (view_mat, proj_mat, cam_pos) = self.camera.compute_dependents(client); @@ -107,14 +112,15 @@ impl Scene { ); } - pub fn render(&mut self, renderer: &mut Renderer, client: &Client) { + pub fn render(&mut self, renderer: &mut Renderer, client: &Client, body: HumanoidBody) { renderer.render_skybox(&self.skybox.model, &self.globals, &self.skybox.locals); let model = self.figure_model_cache.get_or_create_model( renderer, - comp::Body::Humanoid(comp::HumanoidBody::random()), + comp::Body::Humanoid(body), client.get_tick(), ); + renderer.render_figure( model, &self.globals, diff --git a/voxygen/src/menu/char_selection/ui.rs b/voxygen/src/menu/char_selection/ui.rs index cfa3efbf7b..35422ce171 100644 --- a/voxygen/src/menu/char_selection/ui.rs +++ b/voxygen/src/menu/char_selection/ui.rs @@ -3,29 +3,63 @@ use crate::{ ui::{ self, img_ids::{ImageGraphic, VoxelGraphic}, - ScaleMode, Ui, + ImageSlider, ScaleMode, Ui, }, window::Window, }; use common::comp::{ - actor::{Belt, BodyType, Chest, Foot, Hand, Head, Pants, Race, Weapon}, + actor::{Belt, BodyType, Chest, Foot, Hand, Head, Pants, Race, Weapon, ALL_CHESTS}, HumanoidBody, }; use conrod_core::{ color, color::TRANSPARENT, - widget::{text_box::Event as TextBoxEvent, Button, Image, Rectangle, Text, TextBox}, + graph, + widget::{text_box::Event as TextBoxEvent, Button, Image, Rectangle, Scrollbar, Text, TextBox}, widget_ids, Borderable, Color, Colorable, Labelable, Positionable, Sizeable, Widget, + WidgetCommon, }; use std::sync::Arc; widget_ids! { struct Ids { // Background and logo - bg_selection, - bg_creation, + charlist_bg, + charlist_frame, + charlist_alignment, + selection_scrollbar, + creation_bg, + creation_frame, + creation_alignment, + server_name_text, + change_server, + server_frame_bg, + server_frame, v_logo, version, + divider, + bodyrace_text, + facialfeatures_text, + + // REMOVE THIS AFTER IMPLEMENTATION + daggers_grey, + axe_grey, + hammer_grey, + bow_grey, + staff_grey, + + + // Characters + character_box_1, + character_name_1, + character_location_1, + character_level_1, + + character_box_2, + character_name_2, + character_location_2, + character_level_2, + // Windows selection_window, @@ -33,21 +67,10 @@ widget_ids! { char_level, creation_window, select_window_title, - race_heading, - race_description, + creation_buttons_alignment_1, + creation_buttons_alignment_2, weapon_heading, weapon_description, - races_bg, - body_type_bg, - desc_bg, - skin_eyes_window, - hair_window, - accessories_window, - skin_eyes_button, - hair_button, - accessories_button, - skin_rect, - eyes_rect, human_skin_bg, orc_skin_bg, dwarf_skin_bg, @@ -56,6 +79,22 @@ widget_ids! { danari_skin_bg, name_input_bg, + // Sliders + hairstyle_slider, + hairstyle_text, + haircolor_slider, + haircolor_text, + skin_slider, + skin_text, + eyecolor_slider, + eyecolor_text, + eyebrows_slider, + eyebrows_text, + beard_slider, + beard_slider_2, + beard_text, + accessories_slider, + accessories_text, // Buttons enter_world_button, @@ -74,20 +113,20 @@ widget_ids! { race_6, body_type_1, body_type_2, - weapon_1, - weapon_2, - weapon_3, - weapon_4, - weapon_5, - weapon_6, - weapon_7, - - //test_chars - test_char_l_button, - test_char_l_big, - help_text_bg, - help_text, + // Weapons + sword, + sword_button, + daggers, + daggers_button, + axe, + axe_button, + hammer, + hammer_button, + bow, + bow_button, + staff, + staff_button, // Char Creation // Race Icons male, @@ -98,64 +137,8 @@ widget_ids! { undead, elf, danari, - // Weapon Icons - weapon_bg, - daggers, - sword_shield, - sword, - axe, - hammer, - bow, - staff, - // Arrows - arrow_left, - arrow_right, // Body Features - window_skin_eyes, - window_skin_eyes_mid, - window_skin_eyes_bot, - window_hair, - window_hair_mid, - window_hair_bot, - window_acessories, - window_acessories_mid, - window_acessories_bot, - skin_color_picker, - skin_color_slider, - skin_color_text, - skin_color_slider_text, - eye_color_picker, - eye_color_slider, - eye_color_text, - eye_color_slider_text, - skin_color_slider_range, - skin_color_slider_indicator, - eye_color_slider_range, - eye_color_slider_indicator, - hair_color_slider_text, - // Creation Hair Contents - hair_style_text, - hair_style_arrow_l, - hair_style_arrow_r, - hair_color_picker_bg, - hair_color_text, - hair_color_slider_range, - hair_color_slider_indicator, - eyebrow_style_text, - eyebrow_arrow_l, - eyebrow_arrow_r, - beard_style_text, - beard_arrow_l, - beard_arrow_r, - // Creation Accessories Contents - warpaint_text, - warpaint_arrow_l, - warpaint_arrow_r, - warpaint_color_picker_bg, - warpaint_color_text, - warpaint_slider_indicator, - warpaint_slider_range, - warpaint_slider_text, + chest_slider, } } @@ -170,15 +153,18 @@ image_ids! { button_red_hover: "/voxygen/element/buttons/button_red_hover.vox", button_red_press: "/voxygen/element/buttons/button_red_press.vox", name_input: "/voxygen/element/misc_bg/textbox.vox", + charlist_frame: "/voxygen/element/frames/window_4.vox", + selection_frame: "/voxygen/element/frames/selection_frame.vox", + server_frame: "/voxygen/element/frames/server_frame.vox", + selection: "/voxygen/element/frames/selection.vox", + + arrow_left:"/voxygen/element/buttons/button_red_press.vox", + arrow_left_mo:"/voxygen/element/buttons/button_red_press.vox", + arrow_left_press:"/voxygen/element/buttons/button_red_press.vox", + + divider: "/voxygen/element/frames/divider.vox", - bg_selection: "/voxygen/background/bg_selection.png", - bg_creation: "/voxygen/background/bg_creation.png", - selection_window: "/voxygen/element/frames/selection.png", - test_char_l_button: "/voxygen/element/misc_bg/test_char_l.png", - test_char_l_big: "/voxygen/element/misc_bg/test_char_l_big.png", - creation_window: "/voxygen/element/frames/char_creation.png", - creation_window_body: "/voxygen/element/frames/body_creation.png", frame_closed: "/voxygen/element/buttons/frame/closed.png", frame_closed_mo: "/voxygen/element/buttons/frame/closed_mo.png", frame_closed_press: "/voxygen/element/buttons/frame/closed_press.png", @@ -193,6 +179,7 @@ image_ids! { slider_indicator: "/voxygen/element/slider/indicator.png", window_frame_2: "/voxygen/element/frames/window_2.png", + // Weapon Icons daggers: "/voxygen/element/icons/daggers.png", sword_shield: "/voxygen/element/icons/swordshield.png", @@ -216,20 +203,12 @@ image_ids! { elf_f: "/voxygen/element/icons/elf_f.png", danari_m: "/voxygen/element/icons/danari_m.png", danari_f: "/voxygen/element/icons/danari_f.png", - // Arrows - arrow_left: "/voxygen/element/buttons/arrow/left.png", - arrow_left_mo: "/voxygen/element/buttons/arrow/left_mo.png", - arrow_left_press: "/voxygen/element/buttons/arrow/left_press.png", - arrow_left_grey: "/voxygen/element/buttons/arrow/left_inactive.png", - arrow_right: "/voxygen/element/buttons/arrow/right.png", - arrow_right_mo: "/voxygen/element/buttons/arrow/right_mo.png", - arrow_right_press: "/voxygen/element/buttons/arrow/right_press.png", - arrow_right_grey: "/voxygen/element/buttons/arrow/right_inactive.png", // Icon Borders icon_border: "/voxygen/element/buttons/border.png", icon_border_mo: "/voxygen/element/buttons/border_mo.png", icon_border_press: "/voxygen/element/buttons/border_press.png", icon_border_pressed: "/voxygen/element/buttons/border_pressed.png", + nothing: "/voxygen/element/nothing.png", } } @@ -240,26 +219,13 @@ font_ids! { } } -enum CreationState { - Race, - Weapon, - Body(BodyPart), -} - -#[derive(Clone, Copy)] -enum BodyPart { - SkinEyes, - Hair, - Accessories, -} - pub enum Event { Logout, Play, } const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0); -const TEXT_BG: Color = Color::Rgba(0.0, 0.0, 0.0, 1.0); +const TEXT_COLOR_2: Color = Color::Rgba(1.0, 1.0, 1.0, 0.2); pub struct CharSelectionUi { ui: Ui, @@ -267,10 +233,10 @@ pub struct CharSelectionUi { imgs: Imgs, fonts: Fonts, character_creation: bool, - selected_char_no: Option, pub character_name: String, pub character_body: HumanoidBody, - creation_state: CreationState, + pub character_weapon: Weapon, + pub body_type: BodyType, } impl CharSelectionUi { @@ -292,10 +258,10 @@ impl CharSelectionUi { imgs, fonts, character_creation: false, - selected_char_no: None, character_name: "Character Name".to_string(), character_body: HumanoidBody::random(), - creation_state: CreationState::Race, + character_weapon: Weapon::Sword, + body_type: BodyType::Male, } } @@ -305,20 +271,74 @@ impl CharSelectionUi { let ref mut ui_widgets = self.ui.set_widgets(); let version = env!("CARGO_PKG_VERSION"); - // Character Selection - // Supposed functionality: - // 3d rendered characters have to be clicked for selection. - // Selected characters will appear in the selection window. - // The selection window is only active when there are >0 characters on the server. - // After logging into the server the character that was played last will be selected automatically. - // If >1 characters are on the server but none of them was logged in last the one that was created last will be selected. - // If the no. of characters = character_limit the "Create Character" button won't be clickable anymore. - - // Background Image + // Character Selection ///////////////// if !self.character_creation { - //Image::new(self.imgs.bg_selection) - // .middle_of(ui_widgets.window) - // .set(self.ids.bg_selection, ui_widgets); + // Background for Server Frame + Rectangle::fill_with([386.0, 95.0], color::rgba(0.0, 0.0, 0.0, 0.8)) + .top_left_with_margins_on(ui_widgets.window, 30.0, 30.0) + .set(self.ids.server_frame_bg, ui_widgets); + Image::new(self.imgs.server_frame) + .w_h(400.0, 100.0) + .middle_of(self.ids.server_frame_bg) + .set(self.ids.server_frame, ui_widgets); + + // Background for Char List + Rectangle::fill_with([386.0, 788.0], color::rgba(0.0, 0.0, 0.0, 0.8)) + .down_from(self.ids.server_frame_bg, 20.0) + .set(self.ids.charlist_bg, ui_widgets); + Image::new(self.imgs.charlist_frame) + .w_h(400.0, 800.0) + .middle_of(self.ids.charlist_bg) + .set(self.ids.charlist_frame, ui_widgets); + Rectangle::fill_with([386.0, 783.0], color::TRANSPARENT) + .middle_of(self.ids.charlist_bg) + .scroll_kids() + .scroll_kids_vertically() + .set(self.ids.charlist_alignment, ui_widgets); + Scrollbar::y_axis(self.ids.charlist_alignment) + .thickness(5.0) + .auto_hide(true) + .rgba(0.0, 0.0, 0., 0.0) + .set(self.ids.selection_scrollbar, ui_widgets); + // Server Name + Text::new("Server Name") //TODO: Add in Server Name + .mid_top_with_margin_on(self.ids.server_frame_bg, 5.0) + .font_size(24) + .font_id(self.fonts.metamorph) + .color(TEXT_COLOR) + .set(self.ids.server_name_text, ui_widgets); + //Change Server + if Button::image(self.imgs.button) + .mid_top_with_margin_on(self.ids.server_frame_bg, 45.0) + .w_h(200.0, 40.0) + .parent(self.ids.charlist_bg) + .hover_image(self.imgs.button_hover) + .press_image(self.imgs.button_press) + .label("Change Server") + .label_color(TEXT_COLOR) + .label_font_size(18) + .label_y(conrod_core::position::Relative::Scalar(3.0)) + .set(self.ids.change_server, ui_widgets) + .was_clicked() + { + events.push(Event::Logout); + } + + // Enter World Button + if Button::image(self.imgs.button) + .mid_bottom_with_margin_on(ui_widgets.window, 10.0) + .w_h(250.0, 60.0) + .hover_image(self.imgs.button_hover) + .press_image(self.imgs.button_press) + .label("Enter World") + .label_color(TEXT_COLOR) + .label_font_size(22) + .label_y(conrod_core::position::Relative::Scalar(3.0)) + .set(self.ids.enter_world_button, ui_widgets) + .was_clicked() + { + events.push(Event::Play); + } // Logout_Button if Button::image(self.imgs.button) @@ -338,7 +358,7 @@ impl CharSelectionUi { // Create Character Button. if Button::image(self.imgs.button) - .mid_bottom_with_margin_on(ui_widgets.window, 10.0) + .mid_bottom_with_margin_on(self.ids.charlist_bg, -60.0) .w_h(270.0, 50.0) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) @@ -350,106 +370,83 @@ impl CharSelectionUi { .was_clicked() { self.character_creation = true; - self.selected_char_no = None; - } - // Test Characters - if Button::image(self.imgs.test_char_l_button) - .bottom_left_with_margins_on(ui_widgets.window, 395.0, 716.0) - .w_h(95.0, 130.0) - .hover_image(self.imgs.test_char_l_button) - .press_image(self.imgs.test_char_l_button) - .set(self.ids.test_char_l_button, ui_widgets) - .was_clicked() - { - self.selected_char_no = Some(1); + self.character_body.weapon = Weapon::Sword; } - // Veloren Logo and Alpha Version - Image::new(self.imgs.v_logo) - .w_h(123.0 * 3.0, 35.0 * 3.0) - .top_left_with_margins(30.0, 30.0) - .set(self.ids.v_logo, ui_widgets); + // Alpha Version Text::new(version) - .top_left_with_margins_on(ui_widgets.window, 5.0, 5.0) + .top_right_with_margins_on(ui_widgets.window, 5.0, 5.0) .font_size(14) + .font_id(self.fonts.opensans) .color(TEXT_COLOR) .set(self.ids.version, ui_widgets); - // Click Character to Login TODO: <-- Temporary! - Image::new(self.imgs.window_frame_2) - .mid_top_with_margin_on(ui_widgets.window, 60.0) - .w_h(700.0, 70.0) - .set(self.ids.help_text_bg, ui_widgets); - Text::new("Click character to select it") - .middle_of(self.ids.help_text_bg) - .font_size(40) + + // 1st Character in Selection List + if Button::image(self.imgs.selection) + .top_left_with_margins_on(self.ids.charlist_alignment, 0.0, 2.0) + .w_h(386.0, 80.0) + .image_color(Color::Rgba(1.0, 1.0, 1.0, 0.8)) + .hover_image(self.imgs.selection) + .press_image(self.imgs.selection) + .label_y(conrod_core::position::Relative::Scalar(20.0)) + .set(self.ids.character_box_1, ui_widgets) + .was_clicked() + {} + Text::new("Human Default") + .top_left_with_margins_on(self.ids.character_box_1, 6.0, 9.0) + .font_size(19) + .font_id(self.fonts.metamorph) .color(TEXT_COLOR) - .set(self.ids.help_text, ui_widgets); + .set(self.ids.character_name_1, ui_widgets); - if let Some(no) = self.selected_char_no { - // Selection_Window - Image::new(self.imgs.selection_window) - .w_h(522.0, 722.0) - .mid_right_with_margin_on(ui_widgets.window, 10.0) - .set(self.ids.selection_window, ui_widgets); - // Character Name & Level - Text::new("Character Name") - .mid_top_with_margin_on(self.ids.selection_window, 80.0) - .font_size(30) - .color(TEXT_COLOR) - .set(self.ids.char_name, ui_widgets); - Text::new("1") - .mid_top_with_margin_on(self.ids.char_name, 40.0) - .font_size(30) - .color(TEXT_COLOR) - .set(self.ids.char_level, ui_widgets); + Text::new("Level 1") + .down_from(self.ids.character_name_1, 4.0) + .font_size(17) + .font_id(self.fonts.opensans) + .color(TEXT_COLOR) + .set(self.ids.character_level_1, ui_widgets); - // Selected Character - if no == 1 { - Image::new(self.imgs.test_char_l_big) - .w_h(522.0, 722.0) - .middle_of(self.ids.selection_window) - .set(self.ids.test_char_l_big, ui_widgets); - } + Text::new("Uncanny Valley") + .down_from(self.ids.character_level_1, 4.0) + .font_size(17) + .font_id(self.fonts.opensans) + .color(TEXT_COLOR) + .set(self.ids.character_location_1, ui_widgets); - // Enter World Button - if Button::image(self.imgs.button) - .mid_bottom_with_margin_on(self.ids.selection_window, 65.0) - .w_h(210.0, 55.0) - .hover_image(self.imgs.button_hover) - .press_image(self.imgs.button_press) - .label("Enter World") - .label_color(TEXT_COLOR) - .label_font_size(22) - .label_y(conrod_core::position::Relative::Scalar(3.0)) - .set(self.ids.enter_world_button, ui_widgets) - .was_clicked() - { - // Enter World - events.push(Event::Play); - } + // 2nd Character in List + if Button::image(self.imgs.nothing) + .down_from(self.ids.character_box_1, 5.0) + .w_h(386.0, 80.0) + .hover_image(self.imgs.selection) + .press_image(self.imgs.selection) + .image_color(Color::Rgba(1.0, 1.0, 1.0, 0.8)) + .label_y(conrod_core::position::Relative::Scalar(20.0)) + .set(self.ids.character_box_2, ui_widgets) + .was_clicked() + {} + Text::new("Example 2nd Char") + .top_left_with_margins_on(self.ids.character_box_2, 6.0, 9.0) + .font_size(19) + .font_id(self.fonts.metamorph) + .color(TEXT_COLOR) + .set(self.ids.character_name_2, ui_widgets); - // Delete Button - if Button::image(self.imgs.button_red) - .bottom_right_with_margins_on(self.ids.selection_window, -25.0, 0.0) - .w_h(100.0, 20.0) - .hover_image(self.imgs.button_red_hover) - .press_image(self.imgs.button_red_press) - .label("Delete") - .label_color(TEXT_COLOR) - .label_font_size(12) - .label_y(conrod_core::position::Relative::Scalar(3.0)) - .set(self.ids.delete_button, ui_widgets) - .was_clicked() - {} - } + Text::new("Level ??") + .down_from(self.ids.character_name_2, 4.0) + .font_size(17) + .font_id(self.fonts.opensans) + .color(TEXT_COLOR) + .set(self.ids.character_level_2, ui_widgets); + + Text::new("Plains of Uncertainty") + .down_from(self.ids.character_level_2, 4.0) + .font_size(17) + .font_id(self.fonts.opensans) + .color(TEXT_COLOR) + .set(self.ids.character_location_2, ui_widgets); } - // Character_Creation + // Character_Creation ////////////////////////////////////////////////////////////////////// else { - // Background - //Image::new(self.imgs.bg_creation) - // .middle_of(ui_widgets.window) - // .set(self.ids.bg_creation, ui_widgets); - // Back Button if Button::image(self.imgs.button) .bottom_left_with_margins_on(ui_widgets.window, 10.0, 10.0) @@ -482,10 +479,11 @@ impl CharSelectionUi { self.character_creation = false; } // Character Name Input - Rectangle::fill_with([320.0, 50.0], color::rgba(0.0, 0.0, 0.0, 0.99)) + Rectangle::fill_with([320.0, 50.0], color::rgba(0.0, 0.0, 0.0, 0.97)) .mid_bottom_with_margin_on(ui_widgets.window, 20.0) .set(self.ids.name_input_bg, ui_widgets); Button::image(self.imgs.name_input) + .image_color(Color::Rgba(1.0, 1.0, 1.0, 0.9)) .w_h(337.0, 67.0) .middle_of(self.ids.name_input_bg) .set(self.ids.name_input, ui_widgets); @@ -508,1281 +506,571 @@ impl CharSelectionUi { } } - // Window(s) - Image::new(if let CreationState::Body(_) = self.creation_state { - self.imgs.creation_window_body + // Window + + Rectangle::fill_with([386.0, 988.0], color::rgba(0.0, 0.0, 0.0, 0.8)) + .top_left_with_margins_on(ui_widgets.window, 30.0, 30.0) + .set(self.ids.creation_bg, ui_widgets); + Image::new(self.imgs.charlist_frame) + .w_h(400.0, 1000.0) + .middle_of(self.ids.creation_bg) + .set(self.ids.charlist_frame, ui_widgets); + Rectangle::fill_with([386.0, 983.0], color::TRANSPARENT) + .middle_of(self.ids.creation_bg) + .scroll_kids() + .scroll_kids_vertically() + .set(self.ids.creation_alignment, ui_widgets); + Scrollbar::y_axis(self.ids.creation_alignment) + .thickness(5.0) + .auto_hide(true) + .rgba(0.33, 0.33, 0.33, 1.0) + .set(self.ids.selection_scrollbar, ui_widgets); + + // Male/Female/Race Icons + + Text::new("Character Creation") + .mid_top_with_margin_on(self.ids.creation_alignment, 10.0) + .font_size(24) + .font_id(self.fonts.metamorph) + .color(TEXT_COLOR) + .set(self.ids.bodyrace_text, ui_widgets); + // Alignment + Rectangle::fill_with([140.0, 72.0], color::TRANSPARENT) + .mid_top_with_margin_on(self.ids.creation_alignment, 60.0) + .set(self.ids.creation_buttons_alignment_1, ui_widgets); + // Male + Image::new(self.imgs.male) + .w_h(70.0, 70.0) + .top_left_with_margins_on(self.ids.creation_buttons_alignment_1, 0.0, 0.0) + .set(self.ids.male, ui_widgets); + if Button::image(if let BodyType::Male = self.character_body.body_type { + self.imgs.icon_border_pressed } else { - self.imgs.creation_window + self.imgs.icon_border }) - .w_h(628.0, 814.0) - .top_left_with_margins_on(ui_widgets.window, 60.0, 30.0) - .set(self.ids.creation_window, ui_widgets); - - // Arrows - // TODO: Lower the resolution of the arrow images & use non decimal sizes below. - const ARROW_WH: [f64; 2] = [986.0 * 0.03, 1024.0 * 0.03]; - match self.creation_state { - CreationState::Race => { - Button::image(self.imgs.arrow_left_grey) - .wh(ARROW_WH) - .top_left_with_margins_on(self.ids.creation_window, 74.0, 55.0) - .set(self.ids.arrow_left, ui_widgets); - - if Button::image(self.imgs.arrow_right) - .wh(ARROW_WH) - .hover_image(self.imgs.arrow_right_mo) - .press_image(self.imgs.arrow_right_press) - .top_right_with_margins_on(self.ids.creation_window, 74.0, 55.0) - .set(self.ids.arrow_right, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Weapon; - } - } - CreationState::Weapon => { - if Button::image(self.imgs.arrow_left) - .wh(ARROW_WH) - .hover_image(self.imgs.arrow_left_mo) - .press_image(self.imgs.arrow_left_press) - .top_left_with_margins_on(self.ids.creation_window, 74.0, 55.0) - .set(self.ids.arrow_left, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Race; - } - - if Button::image(self.imgs.arrow_right) - .wh(ARROW_WH) - .hover_image(self.imgs.arrow_right_mo) - .press_image(self.imgs.arrow_right_press) - .top_right_with_margins_on(self.ids.creation_window, 74.0, 55.0) - .set(self.ids.arrow_right, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Body(BodyPart::SkinEyes); - } - } - CreationState::Body(_) => { - if Button::image(self.imgs.arrow_left) - .wh(ARROW_WH) - .hover_image(self.imgs.arrow_left_mo) - .press_image(self.imgs.arrow_left_press) - .top_left_with_margins_on(self.ids.creation_window, 74.0, 55.0) - .set(self.ids.arrow_left, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Weapon; - } - Button::image(self.imgs.arrow_right_grey) - .wh(ARROW_WH) - .top_right_with_margins_on(self.ids.creation_window, 74.0, 55.0) - .set(self.ids.arrow_right, ui_widgets); - } + .middle_of(self.ids.male) + .hover_image(self.imgs.icon_border_mo) + .press_image(self.imgs.icon_border_press) + .set(self.ids.body_type_1, ui_widgets) + .was_clicked() + { + self.character_body.body_type = BodyType::Male; + } + // Female + Image::new(self.imgs.female) + .w_h(70.0, 70.0) + .top_right_with_margins_on(self.ids.creation_buttons_alignment_1, 0.0, 0.0) + .set(self.ids.female, ui_widgets); + if Button::image(if let BodyType::Female = self.character_body.body_type { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .middle_of(self.ids.female) + .hover_image(self.imgs.icon_border_mo) + .press_image(self.imgs.icon_border_press) + .set(self.ids.body_type_2, ui_widgets) + .was_clicked() + { + self.character_body.body_type = BodyType::Female; } - // Races + // Alignment for Races and Weapons + Rectangle::fill_with([214.0, 304.0], color::TRANSPARENT) + .mid_bottom_with_margin_on(self.ids.creation_buttons_alignment_1, -324.0) + .set(self.ids.creation_buttons_alignment_2, ui_widgets); - // Weapon - - // Body - - // Race Selection - if let CreationState::Race = self.creation_state { - Text::new("Choose your Race") - .mid_top_with_margin_on(self.ids.creation_window, 74.0) - .font_size(28) - .color(TEXT_COLOR) - .set(self.ids.select_window_title, ui_widgets); - - // Male/Female/Race Icons - // Alignment - Rectangle::fill_with([151.0, 68.0], color::TRANSPARENT) - .mid_top_with_margin_on(self.ids.creation_window, 210.0) - .set(self.ids.body_type_bg, ui_widgets); - - // Male - Image::new(self.imgs.male) - .w_h(68.0, 68.0) - .mid_left_of(self.ids.body_type_bg) - .set(self.ids.male, ui_widgets); - if Button::image(if let BodyType::Male = self.character_body.body_type { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) - .middle_of(self.ids.male) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.body_type_1, ui_widgets) - .was_clicked() - { - self.character_body.body_type = BodyType::Male; - } - // Female - Image::new(self.imgs.female) - .w_h(68.0, 68.0) - .right_from(self.ids.male, 16.0) - .set(self.ids.female, ui_widgets); - if Button::image(if let BodyType::Female = self.character_body.body_type { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) - .middle_of(self.ids.female) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.body_type_2, ui_widgets) - .was_clicked() - { - self.character_body.body_type = BodyType::Female; - } - // Alignment - Rectangle::fill_with([458.0, 68.0], color::TRANSPARENT) - .mid_top_with_margin_on(self.ids.creation_window, 120.0) - .set(self.ids.races_bg, ui_widgets); - // TODO: If races were in some sort of array format, we could do this in a loop. - // Human - Image::new(if let BodyType::Male = self.character_body.body_type { - self.imgs.human_m - } else { - self.imgs.human_f - }) - .w_h(68.0, 68.0) - .mid_left_of(self.ids.races_bg) - .set(self.ids.human, ui_widgets); - if Button::image(if let Race::Human = self.character_body.race { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) - .middle_of(self.ids.human) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.race_1, ui_widgets) - .was_clicked() - { - self.character_body.race = Race::Human; - } - - // Orc - Image::new(if let BodyType::Male = self.character_body.body_type { - self.imgs.orc_m - } else { - self.imgs.orc_f - }) - .w_h(68.0, 68.0) - .right_from(self.ids.human, 10.0) - .set(self.ids.orc, ui_widgets); - if Button::image(if let Race::Orc = self.character_body.race { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) - .middle_of(self.ids.orc) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.race_2, ui_widgets) - .was_clicked() - { - self.character_body.race = Race::Orc; - } - // Dwarf - Image::new(if let BodyType::Male = self.character_body.body_type { - self.imgs.dwarf_m - } else { - self.imgs.dwarf_f - }) - .w_h(68.0, 68.0) - .right_from(self.ids.human, 10.0 * 2.0 + 68.0) - .set(self.ids.dwarf, ui_widgets); - if Button::image(if let Race::Dwarf = self.character_body.race { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) - .middle_of(self.ids.dwarf) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.race_3, ui_widgets) - .was_clicked() - { - self.character_body.race = Race::Dwarf; - } - // Elf - Image::new(if let BodyType::Male = self.character_body.body_type { - self.imgs.elf_m - } else { - self.imgs.elf_f - }) - .w_h(68.0, 68.0) - .right_from(self.ids.human, 10.0 * 3.0 + 68.0 * 2.0) - .set(self.ids.elf, ui_widgets); - if Button::image(if let Race::Elf = self.character_body.race { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) - .middle_of(self.ids.elf) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.race_4, ui_widgets) - .was_clicked() - { - self.character_body.race = Race::Elf; - } - // Undead - Image::new(if let BodyType::Male = self.character_body.body_type { - self.imgs.undead_m - } else { - self.imgs.undead_f - }) - .w_h(68.0, 68.0) - .right_from(self.ids.human, 10.0 * 4.0 + 68.0 * 3.0) - .set(self.ids.undead, ui_widgets); - if Button::image(if let Race::Undead = self.character_body.race { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) - .middle_of(self.ids.undead) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.race_5, ui_widgets) - .was_clicked() - { - self.character_body.race = Race::Undead; - } - // Danari - Image::new(if let BodyType::Male = self.character_body.body_type { - self.imgs.danari_m - } else { - self.imgs.danari_f - }) - .right_from(self.ids.human, 10.0 * 5.0 + 68.0 * 4.0) - .set(self.ids.danari, ui_widgets); - if Button::image(if let Race::Danari = self.character_body.race { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) - .w_h(68.0, 68.0) - .middle_of(self.ids.danari) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.race_6, ui_widgets) - .was_clicked() - { - self.character_body.race = Race::Danari; - } - - // Description Headline and Text - - // TODO: Load these from files (or from the server???). - const HUMAN_DESC: &str = - "The former nomads were only recently able to gain a foothold in the world of Veloren. \n\ - \n\ - Their greatest strengths are their adaptability and intelligence, which makes them allrounders in many fields.\n\ - \n\ - Humans are extremely diverse. \n\ - Some become wicked witches, slimy scoundrels, and members of the underworld, while others become witch-hunters, sages, and noble knights. \n\ - This diversity however creates constant conflict and antagonism between humans themselves, rather than with the other races of Veloren."; - const ORC_DESC: &str = - "They are considered brutal, rude and combative. \n\ - But once you gained their trust they will be loyal friends \n\ - that follow a strict code of honor in all of their actions. \n\ - \n\ - Their warriors are masters of melee combat, but their true power \ - comes from the magical rituals of their powerful shamans. \n\ - \n\ - They are divided into three clans. \n\ - Two of them are led by the conflicting descendants of the recently deceased High-Warlord. \n\ - The third clan was formed by a group of Shamans to prevent the bloodshed caused by the rivaling groups and to secure their source of magic: \n\ - A powerful nature crystal, stolen from the Brushwood Elves..."; - const DWARF_DESC: &str = - "Smoking chimneys, the sound of countless hammers and hoes. \ - Infinite tunnel systems to track down even the last chunk of metal in the ground. \n\ - \n\ - This race of master craftsmen and grim fighters exist almost \ - as long as the world itself.\n\ - And they don't plan to finish their reign over the undergrounds soon."; - const UNDEAD_DESC: &str = - "No one really knows the origin of these gruesome looking creatures. \n\ - Some may have been reawakened soldiers from a battleground others are said to be the result of experiments with dark magic.\n\ - \n\ - After being chased and slaughtered for years the more civilised Undead decided to form a community and negotiate a piece treaty with the other inhabitants of Veloren.\n\ - \n\ - They are known for being nefarious and silent assassins."; - const ELF_DESC: &str = - "No matter which shade of elves you encounter, they all have something in common: Magic. \n\ - They can be found in many Forms: \n\ - \n\ - Pale Elves, living in dark fortresses, executing atrocious rituals. \n\ - \n\ - Nature connected Brushwood Elves, that guard ancient powers inside the forests.\n\ - \n\ - Gold Elves that hunger for political power in their massive city states. \n\ - \n\ - Dark Elves, seeking war to brutalize their enemies, with ‘honor.’\n\ - \n\ - And many more!"; - const DANARI_DESC: &str = - "The white domes and towers of their underwater kingdom are often mistaken for coral reefs from above the water. \n\ - As a punishment those demonic creatures were banished to live detached from the rest of the world in ancient times. \n\ - \n\ - Once in a while one of them is born unaffected by this curse. Sadly this means that after reaching a certain age they won’t be able to live underwater anymore. \n\ - \n\ - Outcast communities consisting of these Blessed Danari have formed all over the land."; - - let (race_str, race_desc) = match self.character_body.race { - Race::Human => ("Humans", HUMAN_DESC), - Race::Orc => ("Orcs", ORC_DESC), - Race::Dwarf => ("Dwarves", DWARF_DESC), - Race::Undead => ("Undead", UNDEAD_DESC), - Race::Elf => ("Elves", ELF_DESC), - Race::Danari => ("Danari", DANARI_DESC), - }; - Text::new(race_str) - .mid_top_with_margin_on(self.ids.creation_window, 370.0) - .font_size(30) - .color(TEXT_COLOR) - .set(self.ids.race_heading, ui_widgets); - Text::new(race_desc) - .mid_top_with_margin_on(self.ids.creation_window, 410.0) - .w(500.0) - .font_size(20) - .font_id(self.fonts.opensans) - .color(TEXT_COLOR) - .wrap_by_word() - .set(self.ids.race_description, ui_widgets); + // Human + Image::new(if let BodyType::Male = self.character_body.body_type { + self.imgs.human_m + } else { + self.imgs.human_f + }) + .w_h(70.0, 70.0) + .top_left_with_margins_on(self.ids.creation_buttons_alignment_2, 0.0, 0.0) + .set(self.ids.human, ui_widgets); + if Button::image(if let Race::Human = self.character_body.race { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .middle_of(self.ids.human) + .hover_image(self.imgs.icon_border_mo) + .press_image(self.imgs.icon_border_press) + .set(self.ids.race_1, ui_widgets) + .was_clicked() + { + self.character_body.race = Race::Human; } - if let CreationState::Weapon = self.creation_state { - Text::new("Choose your Weapon") - .mid_top_with_margin_on(self.ids.creation_window, 74.0) - .font_size(28) - .color(TEXT_COLOR) - .set(self.ids.select_window_title, ui_widgets); - // Alignment - Rectangle::fill_with([470.0, 60.0], color::TRANSPARENT) - .mid_top_with_margin_on(self.ids.creation_window, 180.0) - .set(self.ids.weapon_bg, ui_widgets); - // Weapons Icons - // Sword and Shield - Image::new(self.imgs.sword_shield) - .w_h(60.0, 60.0) - .mid_left_of(self.ids.weapon_bg) - .set(self.ids.sword_shield, ui_widgets); - if Button::image(if let Weapon::SwordShield = self.character_body.weapon { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) - .middle_of(self.ids.sword_shield) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.weapon_1, ui_widgets) - .was_clicked() - { - self.character_body.weapon = Weapon::SwordShield; - } + // Orc + Image::new(if let BodyType::Male = self.character_body.body_type { + self.imgs.orc_m + } else { + self.imgs.orc_f + }) + .w_h(70.0, 70.0) + .right_from(self.ids.human, 2.0) + .set(self.ids.orc, ui_widgets); + if Button::image(if let Race::Orc = self.character_body.race { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .middle_of(self.ids.orc) + .hover_image(self.imgs.icon_border_mo) + .press_image(self.imgs.icon_border_press) + .set(self.ids.race_2, ui_widgets) + .was_clicked() + { + self.character_body.race = Race::Orc; + } + // Dwarf + Image::new(if let BodyType::Male = self.character_body.body_type { + self.imgs.dwarf_m + } else { + self.imgs.dwarf_f + }) + .w_h(70.0, 70.0) + .right_from(self.ids.orc, 2.0) + .set(self.ids.dwarf, ui_widgets); + if Button::image(if let Race::Dwarf = self.character_body.race { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .middle_of(self.ids.dwarf) + .hover_image(self.imgs.icon_border_mo) + .press_image(self.imgs.icon_border_press) + .set(self.ids.race_3, ui_widgets) + .was_clicked() + { + self.character_body.race = Race::Dwarf; + } + // Elf + Image::new(if let BodyType::Male = self.character_body.body_type { + self.imgs.elf_m + } else { + self.imgs.elf_f + }) + .w_h(70.0, 70.0) + .down_from(self.ids.human, 2.0) + .set(self.ids.elf, ui_widgets); + if Button::image(if let Race::Elf = self.character_body.race { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .middle_of(self.ids.elf) + .hover_image(self.imgs.icon_border_mo) + .press_image(self.imgs.icon_border_press) + .set(self.ids.race_4, ui_widgets) + .was_clicked() + { + self.character_body.race = Race::Elf; + } + // Undead + Image::new(if let BodyType::Male = self.character_body.body_type { + self.imgs.undead_m + } else { + self.imgs.undead_f + }) + .w_h(70.0, 70.0) + .right_from(self.ids.elf, 2.0) + .set(self.ids.undead, ui_widgets); + if Button::image(if let Race::Undead = self.character_body.race { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .middle_of(self.ids.undead) + .hover_image(self.imgs.icon_border_mo) + .press_image(self.imgs.icon_border_press) + .set(self.ids.race_5, ui_widgets) + .was_clicked() + { + self.character_body.race = Race::Undead; + } + // Danari + Image::new(if let BodyType::Male = self.character_body.body_type { + self.imgs.danari_m + } else { + self.imgs.danari_f + }) + .right_from(self.ids.undead, 2.0) + .set(self.ids.danari, ui_widgets); + if Button::image(if let Race::Danari = self.character_body.race { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .w_h(70.0, 70.0) + .middle_of(self.ids.danari) + .hover_image(self.imgs.icon_border_mo) + .press_image(self.imgs.icon_border_press) + .set(self.ids.race_6, ui_widgets) + .was_clicked() + { + self.character_body.race = Race::Danari; + } - // Daggers - Image::new(self.imgs.daggers) - .w_h(60.0, 60.0) - .right_from(self.ids.sword_shield, 8.0) - .set(self.ids.daggers, ui_widgets); - if Button::image(if let Weapon::Daggers = self.character_body.weapon { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) - .middle_of(self.ids.daggers) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.weapon_2, ui_widgets) - .was_clicked() - { - self.character_body.weapon = Weapon::Daggers; - } + // Hammer - // Sword - Image::new(self.imgs.sword) - .w_h(60.0, 60.0) - .right_from(self.ids.sword_shield, 8.0 * 2.0 + 60.0 * 1.0) - .set(self.ids.sword, ui_widgets); - if Button::image(if let Weapon::Sword = self.character_body.weapon { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) - .middle_of(self.ids.sword) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.weapon_3, ui_widgets) - .was_clicked() - { - self.character_body.weapon = Weapon::Sword; - } - // Axe - Image::new(self.imgs.axe) - .w_h(60.0, 60.0) - .right_from(self.ids.sword_shield, 8.0 * 3.0 + 60.0 * 2.0) - .set(self.ids.axe, ui_widgets); - if Button::image(if let Weapon::Axe = self.character_body.weapon { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) - .middle_of(self.ids.axe) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.weapon_4, ui_widgets) - .was_clicked() - { - self.character_body.weapon = Weapon::Axe; - } - // Hammer - Image::new(self.imgs.hammer) - .w_h(60.0, 60.0) - .right_from(self.ids.sword_shield, 8.0 * 4.0 + 60.0 * 3.0) - .set(self.ids.hammer, ui_widgets); - if Button::image(if let Weapon::Hammer = self.character_body.weapon { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) + Image::new(self.imgs.hammer) + .w_h(70.0, 70.0) + .bottom_left_with_margins_on(self.ids.creation_buttons_alignment_2, 0.0, 0.0) + .set(self.ids.hammer, ui_widgets); + if Button::image(if let Weapon::Hammer = self.character_body.weapon { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .middle_of(self.ids.hammer) + //.hover_image(self.imgs.icon_border_mo) + //.press_image(self.imgs.icon_border_press) + .set(self.ids.hammer_button, ui_widgets) + .was_clicked() + { + //self.character_body.weapon = Weapon::Hammer; + } + // REMOVE THIS AFTER IMPLEMENTATION + Rectangle::fill_with([67.0, 67.0], color::rgba(0.0, 0.0, 0.0, 0.8)) .middle_of(self.ids.hammer) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.weapon_5, ui_widgets) - .was_clicked() - { - self.character_body.weapon = Weapon::Hammer; - } - // Bow - Image::new(self.imgs.bow) - .w_h(60.0, 60.0) - .right_from(self.ids.sword_shield, 8.0 * 5.0 + 60.0 * 4.0) - .set(self.ids.bow, ui_widgets); - if Button::image(if let Weapon::Bow = self.character_body.weapon { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) + .set(self.ids.hammer_grey, ui_widgets); + + // Bow + + Image::new(self.imgs.bow) + .w_h(70.0, 70.0) + .right_from(self.ids.hammer, 2.0) + .set(self.ids.bow, ui_widgets); + if Button::image(if let Weapon::Bow = self.character_body.weapon { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .middle_of(self.ids.bow) + //.hover_image(self.imgs.icon_border_mo) + //.press_image(self.imgs.icon_border_press) + .set(self.ids.bow_button, ui_widgets) + .was_clicked() + { + //self.character_body.weapon = Weapon::Bow; + } + // REMOVE THIS AFTER IMPLEMENTATION + Rectangle::fill_with([67.0, 67.0], color::rgba(0.0, 0.0, 0.0, 0.8)) .middle_of(self.ids.bow) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.weapon_6, ui_widgets) - .was_clicked() - { - self.character_body.weapon = Weapon::Bow; - } - // Staff - Image::new(self.imgs.staff) - .w_h(60.0, 60.0) - .right_from(self.ids.sword_shield, 8.0 * 6.0 + 60.0 * 5.0) - .set(self.ids.staff, ui_widgets); - if Button::image(if let Weapon::Staff = self.character_body.weapon { - self.imgs.icon_border_pressed - } else { - self.imgs.icon_border - }) + .set(self.ids.bow_grey, ui_widgets); + // Staff + Image::new(self.imgs.staff) + .w_h(70.0, 70.0) + .right_from(self.ids.bow, 2.0) + .set(self.ids.staff, ui_widgets); + if Button::image(if let Weapon::Staff = self.character_body.weapon { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .middle_of(self.ids.staff) + //.hover_image(self.imgs.icon_border_mo) + //.press_image(self.imgs.icon_border_press) + .set(self.ids.staff_button, ui_widgets) + .was_clicked() + { + //self.character_body.weapon = Weapon::Staff; + } + // REMOVE THIS AFTER IMPLEMENTATION + Rectangle::fill_with([67.0, 67.0], color::rgba(0.0, 0.0, 0.0, 0.8)) .middle_of(self.ids.staff) - .hover_image(self.imgs.icon_border_mo) - .press_image(self.imgs.icon_border_press) - .set(self.ids.weapon_7, ui_widgets) - .was_clicked() + .set(self.ids.staff_grey, ui_widgets); + // Sword + Image::new(self.imgs.sword) + .w_h(70.0, 70.0) + .up_from(self.ids.hammer, 2.0) + .set(self.ids.sword, ui_widgets); + if Button::image(if let Weapon::Sword = self.character_body.weapon { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .middle_of(self.ids.sword) + .hover_image(self.imgs.icon_border_mo) + .press_image(self.imgs.icon_border_press) + .set(self.ids.sword_button, ui_widgets) + .was_clicked() + { + self.character_body.weapon = Weapon::Sword; + } + + // Daggers + Image::new(self.imgs.daggers) + .w_h(70.0, 70.0) + .right_from(self.ids.sword, 2.0) + .set(self.ids.daggers, ui_widgets); + if Button::image(if let Weapon::Daggers = self.character_body.weapon { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .middle_of(self.ids.daggers) + //.hover_image(self.imgs.icon_border_mo) + //.press_image(self.imgs.icon_border_press) + .set(self.ids.daggers_button, ui_widgets) + .was_clicked() + { + // self.character_body.weapon = Weapon::Daggers; + } // REMOVE THIS AFTER IMPLEMENTATION + Rectangle::fill_with([67.0, 67.0], color::rgba(0.0, 0.0, 0.0, 0.8)) + .middle_of(self.ids.daggers) + .set(self.ids.daggers_grey, ui_widgets); + + // Axe + Image::new(self.imgs.axe) + .w_h(70.0, 70.0) + .right_from(self.ids.daggers, 2.0) + .set(self.ids.axe, ui_widgets); + if Button::image(if let Weapon::Axe = self.character_body.weapon { + self.imgs.icon_border_pressed + } else { + self.imgs.icon_border + }) + .middle_of(self.ids.axe) + //.hover_image(self.imgs.icon_border_mo) + //.press_image(self.imgs.icon_border_press) + .set(self.ids.axe_button, ui_widgets) + .was_clicked() + { + //self.character_body.weapon = Weapon::Axe; + } + // REMOVE THIS AFTER IMPLEMENTATION + Rectangle::fill_with([67.0, 67.0], color::rgba(0.0, 0.0, 0.0, 0.8)) + .middle_of(self.ids.axe) + .set(self.ids.axe_grey, ui_widgets); + + // Sliders + + // Hair Style + Text::new("Hair Style") + .mid_bottom_with_margin_on(self.ids.creation_buttons_alignment_2, -40.0) + .font_size(18) + .font_id(self.fonts.metamorph) + .color(TEXT_COLOR) + .set(self.ids.hairstyle_text, ui_widgets); + let current_chest = self.character_body.chest; + if let Some(new_val) = ImageSlider::discrete( + ALL_CHESTS + .iter() + .position(|&c| c == current_chest) + .unwrap_or(0), + 0, + ALL_CHESTS.len() - 1, + self.imgs.slider_indicator, + self.imgs.slider_range, + ) + .w_h(208.0, 22.0) + .mid_bottom_with_margin_on(self.ids.hairstyle_text, -30.0) + .track_breadth(12.0) + .slider_length(10.0) + .pad_track((5.0, 5.0)) + .set(self.ids.hairstyle_slider, ui_widgets) + { + self.character_body.chest = ALL_CHESTS[new_val]; + } + + // Hair Color + + Text::new("Hair Color") + .mid_bottom_with_margin_on(self.ids.hairstyle_slider, -40.0) + .font_size(18) + .font_id(self.fonts.metamorph) + .color(TEXT_COLOR) + .set(self.ids.haircolor_text, ui_widgets); + let current_chest = self.character_body.chest; + if let Some(new_val) = ImageSlider::discrete( + ALL_CHESTS + .iter() + .position(|&c| c == current_chest) + .unwrap_or(0), + 0, + ALL_CHESTS.len() - 1, + self.imgs.slider_indicator, + self.imgs.slider_range, + ) + .w_h(208.0, 22.0) + .mid_bottom_with_margin_on(self.ids.haircolor_text, -30.0) + .track_breadth(12.0) + .slider_length(10.0) + .pad_track((5.0, 5.0)) + .set(self.ids.haircolor_slider, ui_widgets) + { + self.character_body.chest = ALL_CHESTS[new_val]; + } + + // Skin + + Text::new("Skin") + .mid_bottom_with_margin_on(self.ids.haircolor_slider, -40.0) + .font_size(18) + .font_id(self.fonts.metamorph) + .color(TEXT_COLOR) + .set(self.ids.skin_text, ui_widgets); + let current_chest = self.character_body.chest; + if let Some(new_val) = ImageSlider::discrete( + ALL_CHESTS + .iter() + .position(|&c| c == current_chest) + .unwrap_or(0), + 0, + ALL_CHESTS.len() - 1, + self.imgs.slider_indicator, + self.imgs.slider_range, + ) + .w_h(208.0, 22.0) + .mid_bottom_with_margin_on(self.ids.skin_text, -30.0) + .track_breadth(12.0) + .slider_length(10.0) + .pad_track((5.0, 5.0)) + .set(self.ids.skin_slider, ui_widgets) + { + self.character_body.chest = ALL_CHESTS[new_val]; + } + + // EyeBrows + Text::new("Eyebrows") + .mid_bottom_with_margin_on(self.ids.skin_slider, -40.0) + .font_size(18) + .font_id(self.fonts.metamorph) + .color(TEXT_COLOR) + .set(self.ids.eyebrows_text, ui_widgets); + let current_chest = self.character_body.chest; + if let Some(new_val) = ImageSlider::discrete( + ALL_CHESTS + .iter() + .position(|&c| c == current_chest) + .unwrap_or(0), + 0, + ALL_CHESTS.len() - 1, + self.imgs.slider_indicator, + self.imgs.slider_range, + ) + .w_h(208.0, 22.0) + .mid_bottom_with_margin_on(self.ids.eyebrows_text, -30.0) + .track_breadth(12.0) + .slider_length(10.0) + .pad_track((5.0, 5.0)) + .set(self.ids.eyebrows_slider, ui_widgets) + { + self.character_body.chest = ALL_CHESTS[new_val]; + } + + // EyeColor + Text::new("Eye Color") + .mid_bottom_with_margin_on(self.ids.eyebrows_slider, -40.0) + .font_size(18) + .font_id(self.fonts.metamorph) + .color(TEXT_COLOR) + .set(self.ids.eyecolor_text, ui_widgets); + let current_chest = self.character_body.chest; + if let Some(new_val) = ImageSlider::discrete( + ALL_CHESTS + .iter() + .position(|&c| c == current_chest) + .unwrap_or(0), + 0, + ALL_CHESTS.len() - 1, + self.imgs.slider_indicator, + self.imgs.slider_range, + ) + .w_h(208.0, 22.0) + .mid_bottom_with_margin_on(self.ids.eyecolor_text, -30.0) + .track_breadth(12.0) + .slider_length(10.0) + .pad_track((5.0, 5.0)) + .set(self.ids.eyecolor_slider, ui_widgets) + { + self.character_body.chest = ALL_CHESTS[new_val]; + } + // Accessories + Text::new("Accessories") + .mid_bottom_with_margin_on(self.ids.eyecolor_slider, -40.0) + .font_size(18) + .font_id(self.fonts.metamorph) + .color(TEXT_COLOR) + .set(self.ids.accessories_text, ui_widgets); + let current_chest = self.character_body.chest; + if let Some(new_val) = ImageSlider::discrete( + ALL_CHESTS + .iter() + .position(|&c| c == current_chest) + .unwrap_or(0), + 0, + ALL_CHESTS.len() - 1, + self.imgs.slider_indicator, + self.imgs.slider_range, + ) + .w_h(208.0, 22.0) + .mid_bottom_with_margin_on(self.ids.accessories_text, -30.0) + .track_breadth(12.0) + .slider_length(10.0) + .pad_track((5.0, 5.0)) + .set(self.ids.accessories_slider, ui_widgets) + { + self.character_body.chest = ALL_CHESTS[new_val]; + } + + // Beard + if let BodyType::Male = self.character_body.body_type { + Text::new("Beard") + .mid_bottom_with_margin_on(self.ids.accessories_slider, -40.0) + .font_size(18) + .font_id(self.fonts.metamorph) + .color(TEXT_COLOR) + .set(self.ids.beard_text, ui_widgets); + + if let Some(new_val) = ImageSlider::discrete( + ALL_CHESTS + .iter() + .position(|&c| c == current_chest) + .unwrap_or(0), + 0, + ALL_CHESTS.len() - 1, + self.imgs.slider_indicator, + 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) + .slider_length(10.0) + .pad_track((5.0, 5.0)) + .set(self.ids.beard_slider, ui_widgets) { - self.character_body.weapon = Weapon::Staff; + self.character_body.chest = ALL_CHESTS[new_val]; } - - // TODO: Load these from files (or from the server???). - const SWORDSHIELD_DESC: &str = " MISSING "; - const DAGGERS_DESC: &str = " MISSING "; - const SWORD_DESC: &str = " MISSING "; - const AXE_DESC: &str = " MISSING "; - const HAMMER_DESC: &str = " MISSING "; - const BOW_DESC: &str = " MISSING "; - const STAFF_DESC: &str = " MISSING "; - - let (weapon_str, weapon_desc) = match self.character_body.weapon { - Weapon::SwordShield => ("Sword and Shield", SWORDSHIELD_DESC), - Weapon::Daggers => ("Daggers", DAGGERS_DESC), - Weapon::Sword => ("Sword", SWORD_DESC), - Weapon::Axe => ("Axe", AXE_DESC), - Weapon::Hammer => ("Hammer", HAMMER_DESC), - Weapon::Bow => ("Bow", BOW_DESC), - Weapon::Staff => ("Staff", STAFF_DESC), - }; - Text::new(weapon_str) - .mid_top_with_margin_on(self.ids.creation_window, 370.0) - .font_size(30) - .color(TEXT_COLOR) - .set(self.ids.race_heading, ui_widgets); - Text::new(weapon_desc) - .mid_top_with_margin_on(self.ids.creation_window, 410.0) - .w(500.0) - .font_size(20) - .font_id(self.fonts.opensans) - .color(TEXT_COLOR) - .wrap_by_word() - .set(self.ids.race_description, ui_widgets); + } else { + Text::new("Beard") + .mid_bottom_with_margin_on(self.ids.accessories_slider, -40.0) + .font_size(18) + .font_id(self.fonts.metamorph) + .color(TEXT_COLOR_2) + .set(self.ids.beard_text, ui_widgets); + if let Some(val) = ImageSlider::continuous( + 5.0, + 0.0, + 10.0, + 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) + .slider_length(10.0) + .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) + {} } - // 3 states/windows: 1: Skin & Eyes 2: Hair 3: Accessories - // If one state is activated, the other ones collapse. - // The title bar is the button to unfold/collapse the windows. - // The BG Frame can be stretched to the needed size. - - // Window BG - if let CreationState::Body(state) = self.creation_state { - Text::new("Body Customization") - .mid_top_with_margin_on(self.ids.creation_window, 74.0) - .font_size(28) - .color(TEXT_COLOR) - .set(self.ids.select_window_title, ui_widgets); - - match state { - // Skin Eyes Open - BodyPart::SkinEyes => { - Image::new(self.imgs.skin_eyes_window) - .w_h(511.0, 333.0) - .mid_top_with_margin_on(self.ids.select_window_title, 60.0) - .set(self.ids.skin_eyes_window, ui_widgets); - // Open Window: Skin & Eyes - if Button::image(self.imgs.frame_open_mo) - .mid_top_with_margin_on(self.ids.skin_eyes_window, 0.0) - .w_h(511.0, 37.0) - //.hover_image(self.imgs.frame_open_mo) - //.press_image(self.imgs.frame_open_press) - .label("Skin & Eyes") - .label_color(TEXT_COLOR) - .label_y(conrod_core::position::Relative::Scalar(4.0)) - .label_font_size(16) - .set(self.ids.skin_eyes_button, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Body(BodyPart::SkinEyes); - } - // Closed: Hair - if Button::image(self.imgs.frame_closed) - .down_from(self.ids.skin_eyes_window, 5.0) - .w_h(511.0, 31.0) - .hover_image(self.imgs.frame_closed_mo) - .press_image(self.imgs.frame_closed_press) - .label("Hair") - .label_color(TEXT_COLOR) - .label_font_size(16) - .set(self.ids.hair_button, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Body(BodyPart::Hair); - } - // Closed: Accessories - if Button::image(self.imgs.frame_closed) - .down_from(self.ids.hair_button, 5.0) - .w_h(511.0, 31.0) - .hover_image(self.imgs.frame_closed_mo) - .press_image(self.imgs.frame_closed_press) - .label("Accessories") - .label_color(TEXT_COLOR) - .label_font_size(16) - .set(self.ids.accessories_button, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Body(BodyPart::Accessories); - } - } - - // Hair Open - BodyPart::Hair => { - Image::new(self.imgs.hair_window) - .w_h(511.0, 400.0) //333.0 - .down_from(self.ids.skin_eyes_button, 5.0) - .set(self.ids.hair_window, ui_widgets); - // Closed Window: Skin & Eyes - if Button::image(self.imgs.frame_closed) - .mid_top_with_margin_on(self.ids.select_window_title, 60.0) - .w_h(511.0, 31.0) - .hover_image(self.imgs.frame_closed_mo) - .press_image(self.imgs.frame_closed_press) - .label("Skin & Eyes") - .label_color(TEXT_COLOR) - .label_font_size(16) - .set(self.ids.skin_eyes_button, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Body(BodyPart::SkinEyes); - } - // Open Window: Hair - if Button::image(self.imgs.frame_open_mo) - .mid_top_with_margin_on(self.ids.hair_window, 0.0) - .w_h(511.0, 37.0) - //.hover_image(self.imgs.frame_closed_mo) - //.press_image(self.imgs.frame_closed_press) - .label("Hair") - .label_color(TEXT_COLOR) - .label_y(conrod_core::position::Relative::Scalar(4.0)) - .label_font_size(16) - .set(self.ids.hair_button, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Body(BodyPart::Hair); - } - // Closed: Accessories - if Button::image(self.imgs.frame_closed) - .down_from(self.ids.hair_window, 5.0) - .w_h(511.0, 31.0) - .hover_image(self.imgs.frame_closed_mo) - .press_image(self.imgs.frame_closed_press) - .label("Accessories") - .label_color(TEXT_COLOR) - .label_font_size(16) - .set(self.ids.accessories_button, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Body(BodyPart::Accessories); - } - } - - // Open: Accessories - BodyPart::Accessories => { - Image::new(self.imgs.hair_window) - .w_h(511.0, 333.0) - .down_from(self.ids.hair_button, 5.0) - .set(self.ids.accessories_window, ui_widgets); - // Closed Window: Skin & Eyes - if Button::image(self.imgs.frame_closed) - .mid_top_with_margin_on(self.ids.select_window_title, 60.0) - .w_h(511.0, 31.0) - .hover_image(self.imgs.frame_closed_mo) - .press_image(self.imgs.frame_closed_press) - .label("Skin & Eyes") - .label_color(TEXT_COLOR) - .label_font_size(16) - .set(self.ids.skin_eyes_button, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Body(BodyPart::SkinEyes); - } - // Closed: Hair - if Button::image(self.imgs.frame_closed) - .down_from(self.ids.skin_eyes_button, 5.0) - .w_h(511.0, 31.0) - .hover_image(self.imgs.frame_closed_mo) - .press_image(self.imgs.frame_closed_press) - .label("Hair") - .label_color(TEXT_COLOR) - .label_font_size(16) - .set(self.ids.hair_button, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Body(BodyPart::Hair); - } - // Open: Accessories - if Button::image(self.imgs.frame_open_mo) - .down_from(self.ids.hair_button, 5.0) - .w_h(511.0, 37.0) - //.hover_image(self.imgs.frame_closed_mo) - //.press_image(self.imgs.frame_closed_press) - .label("Accessories") - .label_y(conrod_core::position::Relative::Scalar(4.0)) - .label_color(TEXT_COLOR) - .label_font_size(16) - .set(self.ids.accessories_button, ui_widgets) - .was_clicked() - { - self.creation_state = CreationState::Body(BodyPart::Accessories); - } - } - } - - // Body Customization Window Contents - match state { - BodyPart::SkinEyes => { - // Skin Color: Text, Brightness Slider, Picker - Text::new("Skin Color") - .top_left_with_margins_on(self.ids.skin_rect, 0.0, -250.0) - .font_size(25) - .color(TEXT_COLOR) - .set(self.ids.skin_color_text, ui_widgets); - // TODO: Align Buttons here. - // Users set a variable to a value from 0-14. - // Depending on the race another color will be chosen. - // Only the BG image (190x114 -> 2px border!) changes depending on the race. - Rectangle::fill_with([192.0, 116.0], color::WHITE) - .top_right_with_margins_on(self.ids.skin_eyes_window, 60.0, 30.0) - .color(TEXT_COLOR) - .set(self.ids.skin_rect, ui_widgets); - - // TODO: Slider - // Sliders actually change the Alpha-Level of the main colour chosen above. - // -> They will appear "brighter", therefore the sliders are labeled "Brightness". - Image::new(self.imgs.slider_range) - .w_h(208.0, 12.0) - .bottom_left_with_margins_on(self.ids.skin_rect, 10.0, -255.0) - .set(self.ids.skin_color_slider_range, ui_widgets); - - Image::new(self.imgs.slider_indicator) - .w_h(10.0, 22.0) - .middle_of(self.ids.skin_color_slider_range) - .set(self.ids.skin_color_slider_indicator, ui_widgets); - - Text::new("Brightness") - .top_left_with_margins_on(self.ids.skin_color_slider_range, -27.0, 0.0) - .color(TEXT_COLOR) - .font_size(14) - .set(self.ids.skin_color_slider_text, ui_widgets); - - // Eye Color: Text, Brightness Slider, Picker - Text::new("Eye Color") - .top_left_with_margins_on(self.ids.eyes_rect, 0.0, -250.0) - .font_size(25) - .color(TEXT_COLOR) - .set(self.ids.eye_color_text, ui_widgets); - // TODO: Align 16 Buttons here. - // Users set a variable to a value from 0-14. - // Depending on the race another color will be chosen. - // Only the BG image (190x114 -> 2px border!) changes depending on the race. - Rectangle::fill_with([192.0, 116.0], color::WHITE) - .top_right_with_margins_on(self.ids.skin_eyes_window, 186.0, 30.0) - .color(TEXT_COLOR) - .set(self.ids.eyes_rect, ui_widgets); - - // TODO: Slider - - Image::new(self.imgs.slider_range) - .w_h(208.0, 12.0) - .bottom_left_with_margins_on(self.ids.eyes_rect, 10.0, -255.0) - .set(self.ids.eye_color_slider_range, ui_widgets); - - Image::new(self.imgs.slider_indicator) - .w_h(10.0, 22.0) - .middle_of(self.ids.eye_color_slider_range) - .set(self.ids.eye_color_slider_indicator, ui_widgets); - - Text::new("Brightness") - .top_left_with_margins_on(self.ids.eye_color_slider_range, -27.0, 0.0) - .color(TEXT_COLOR) - .font_size(14) - .set(self.ids.eye_color_slider_text, ui_widgets); - } - - // Hair - - // Hair Styles -> Arrows - // Hair Color -> Picker - // Eye Brow Style -> Arrow - // Facial Hair -> Picker (Only active for males!) - BodyPart::Hair => { - // Hair - Text::new("Hair Style") - .mid_top_with_margin_on(self.ids.hair_window, 60.0) - .color(TEXT_COLOR) - .font_size(24) - .set(self.ids.hair_style_text, ui_widgets); - if Button::image(self.imgs.arrow_right) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_right_mo) - .press_image(self.imgs.arrow_right_press) - .right_from(self.ids.hair_style_text, 15.0) - .set(self.ids.hair_style_arrow_r, ui_widgets) - .was_clicked() - {}; - if Button::image(self.imgs.arrow_left) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_left_mo) - .press_image(self.imgs.arrow_left_press) - .left_from(self.ids.hair_style_text, 15.0) - .set(self.ids.hair_style_arrow_l, ui_widgets) - .was_clicked() - {}; - - Text::new("Hair Color") - .top_left_with_margins_on(self.ids.hair_color_picker_bg, 0.0, -250.0) - .font_size(25) - .color(TEXT_COLOR) - .set(self.ids.hair_color_text, ui_widgets); - - Rectangle::fill_with([192.0, 116.0], color::WHITE) - .top_right_with_margins_on(self.ids.hair_window, 114.0, 30.0) - .color(TEXT_COLOR) - .set(self.ids.hair_color_picker_bg, ui_widgets); - - Image::new(self.imgs.slider_range) - .w_h(208.0, 12.0) - .bottom_left_with_margins_on( - self.ids.hair_color_picker_bg, - 10.0, - -255.0, - ) - .set(self.ids.hair_color_slider_range, ui_widgets); - - Image::new(self.imgs.slider_indicator) - .w_h(10.0, 22.0) - .middle_of(self.ids.hair_color_slider_range) - .set(self.ids.hair_color_slider_indicator, ui_widgets); - - Text::new("Brightness") - .top_left_with_margins_on(self.ids.hair_color_slider_range, -27.0, 0.0) - .color(TEXT_COLOR) - .font_size(14) - .set(self.ids.hair_color_slider_text, ui_widgets); - // Eyebrows - Text::new("Eyebrow Style") - .mid_top_with_margin_on(self.ids.hair_window, 280.0) - .color(TEXT_COLOR) - .font_size(24) - .set(self.ids.eyebrow_style_text, ui_widgets); - if Button::image(self.imgs.arrow_right) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_right_mo) - .press_image(self.imgs.arrow_right_press) - .right_from(self.ids.eyebrow_style_text, 15.0) - .set(self.ids.eyebrow_arrow_r, ui_widgets) - .was_clicked() - {}; - if Button::image(self.imgs.arrow_left) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_left_mo) - .press_image(self.imgs.arrow_left_press) - .left_from(self.ids.eyebrow_style_text, 15.0) - .set(self.ids.eyebrow_arrow_l, ui_widgets) - .was_clicked() - {}; - // Beard -> Only active if "male" was chosen. - if let BodyType::Male = self.character_body.body_type { - Text::new("Beard Style") - .mid_top_with_margin_on(self.ids.hair_window, 340.0) - .color(TEXT_COLOR) - .font_size(24) - .set(self.ids.beard_style_text, ui_widgets); - if Button::image(self.imgs.arrow_right) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_right_mo) - .press_image(self.imgs.arrow_right_press) - .right_from(self.ids.beard_style_text, 15.0) - .set(self.ids.beard_arrow_r, ui_widgets) - .was_clicked() - {}; - if Button::image(self.imgs.arrow_left) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_left_mo) - .press_image(self.imgs.arrow_left_press) - .left_from(self.ids.beard_style_text, 15.0) - .set(self.ids.beard_arrow_l, ui_widgets) - .was_clicked() - {}; - } - } - - // Accessories - - // Accessory Picker -> Arrows (Name changes with race!) - // Color -> Picker - // Brightness -> Slider - BodyPart::Accessories => { - match self.character_body.race { - Race::Human => { - Text::new("Head Band") - .mid_top_with_margin_on(self.ids.accessories_window, 60.0) - .color(TEXT_COLOR) - .font_size(24) - .set(self.ids.warpaint_text, ui_widgets); - if Button::image(self.imgs.arrow_right) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_right_mo) - .press_image(self.imgs.arrow_right_press) - .right_from(self.ids.warpaint_text, 15.0) - .set(self.ids.warpaint_arrow_r, ui_widgets) - .was_clicked() - {}; - if Button::image(self.imgs.arrow_left) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_left_mo) - .press_image(self.imgs.arrow_left_press) - .left_from(self.ids.warpaint_text, 15.0) - .set(self.ids.warpaint_arrow_l, ui_widgets) - .was_clicked() - {}; - - Text::new("Color") - .top_left_with_margins_on( - self.ids.warpaint_color_picker_bg, - 0.0, - -250.0, - ) - .font_size(25) - .color(TEXT_COLOR) - .set(self.ids.warpaint_color_text, ui_widgets); - - Rectangle::fill_with([192.0, 116.0], color::WHITE) - .top_right_with_margins_on( - self.ids.accessories_window, - 114.0, - 30.0, - ) - .color(TEXT_COLOR) - .set(self.ids.warpaint_color_picker_bg, ui_widgets); - - Image::new(self.imgs.slider_range) - .w_h(208.0, 12.0) - .bottom_left_with_margins_on( - self.ids.warpaint_color_picker_bg, - 10.0, - -255.0, - ) - .set(self.ids.warpaint_slider_range, ui_widgets); - - Image::new(self.imgs.slider_indicator) - .w_h(10.0, 22.0) - .middle_of(self.ids.warpaint_slider_range) - .set(self.ids.warpaint_slider_indicator, ui_widgets); - - Text::new("Brightness") - .top_left_with_margins_on( - self.ids.warpaint_slider_range, - -27.0, - 0.0, - ) - .color(TEXT_COLOR) - .font_size(14) - .set(self.ids.warpaint_slider_text, ui_widgets); - } - Race::Orc => { - Text::new("Head Band") - .mid_top_with_margin_on(self.ids.accessories_window, 60.0) - .color(TEXT_COLOR) - .font_size(24) - .set(self.ids.warpaint_text, ui_widgets); - if Button::image(self.imgs.arrow_right) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_right_mo) - .press_image(self.imgs.arrow_right_press) - .right_from(self.ids.warpaint_text, 15.0) - .set(self.ids.warpaint_arrow_r, ui_widgets) - .was_clicked() - {}; - if Button::image(self.imgs.arrow_left) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_left_mo) - .press_image(self.imgs.arrow_left_press) - .left_from(self.ids.warpaint_text, 15.0) - .set(self.ids.warpaint_arrow_l, ui_widgets) - .was_clicked() - {}; - - Text::new("Color") - .top_left_with_margins_on( - self.ids.warpaint_color_picker_bg, - 0.0, - -250.0, - ) - .font_size(25) - .color(TEXT_COLOR) - .set(self.ids.warpaint_color_text, ui_widgets); - - Rectangle::fill_with([192.0, 116.0], color::WHITE) - .top_right_with_margins_on( - self.ids.accessories_window, - 114.0, - 30.0, - ) - .color(TEXT_COLOR) - .set(self.ids.warpaint_color_picker_bg, ui_widgets); - - Image::new(self.imgs.slider_range) - .w_h(208.0, 12.0) - .bottom_left_with_margins_on( - self.ids.warpaint_color_picker_bg, - 10.0, - -255.0, - ) - .set(self.ids.warpaint_slider_range, ui_widgets); - - Image::new(self.imgs.slider_indicator) - .w_h(10.0, 22.0) - .middle_of(self.ids.warpaint_slider_range) - .set(self.ids.warpaint_slider_indicator, ui_widgets); - - Text::new("Brightness") - .top_left_with_margins_on( - self.ids.warpaint_slider_range, - -27.0, - 0.0, - ) - .color(TEXT_COLOR) - .font_size(14) - .set(self.ids.warpaint_slider_text, ui_widgets); - } - Race::Elf => { - Text::new("Tribe Markings") - .mid_top_with_margin_on(self.ids.accessories_window, 60.0) - .color(TEXT_COLOR) - .font_size(24) - .set(self.ids.warpaint_text, ui_widgets); - if Button::image(self.imgs.arrow_right) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_right_mo) - .press_image(self.imgs.arrow_right_press) - .right_from(self.ids.warpaint_text, 15.0) - .set(self.ids.warpaint_arrow_r, ui_widgets) - .was_clicked() - {}; - if Button::image(self.imgs.arrow_left) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_left_mo) - .press_image(self.imgs.arrow_left_press) - .left_from(self.ids.warpaint_text, 15.0) - .set(self.ids.warpaint_arrow_l, ui_widgets) - .was_clicked() - {}; - - Text::new("Color") - .top_left_with_margins_on( - self.ids.warpaint_color_picker_bg, - 0.0, - -250.0, - ) - .font_size(25) - .color(TEXT_COLOR) - .set(self.ids.warpaint_color_text, ui_widgets); - - Rectangle::fill_with([192.0, 116.0], color::WHITE) - .top_right_with_margins_on( - self.ids.accessories_window, - 114.0, - 30.0, - ) - .color(TEXT_COLOR) - .set(self.ids.warpaint_color_picker_bg, ui_widgets); - - Image::new(self.imgs.slider_range) - .w_h(208.0, 12.0) - .bottom_left_with_margins_on( - self.ids.warpaint_color_picker_bg, - 10.0, - -255.0, - ) - .set(self.ids.warpaint_slider_range, ui_widgets); - - Image::new(self.imgs.slider_indicator) - .w_h(10.0, 22.0) - .middle_of(self.ids.warpaint_slider_range) - .set(self.ids.warpaint_slider_indicator, ui_widgets); - - Text::new("Brightness") - .top_left_with_margins_on( - self.ids.warpaint_slider_range, - -27.0, - 0.0, - ) - .color(TEXT_COLOR) - .font_size(14) - .set(self.ids.warpaint_slider_text, ui_widgets); - } - Race::Dwarf => { - Text::new("War Paint") - .mid_top_with_margin_on(self.ids.accessories_window, 60.0) - .color(TEXT_COLOR) - .font_size(24) - .set(self.ids.warpaint_text, ui_widgets); - if Button::image(self.imgs.arrow_right) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_right_mo) - .press_image(self.imgs.arrow_right_press) - .right_from(self.ids.warpaint_text, 15.0) - .set(self.ids.warpaint_arrow_r, ui_widgets) - .was_clicked() - {}; - if Button::image(self.imgs.arrow_left) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_left_mo) - .press_image(self.imgs.arrow_left_press) - .left_from(self.ids.warpaint_text, 15.0) - .set(self.ids.warpaint_arrow_l, ui_widgets) - .was_clicked() - {}; - - Text::new("Color") - .top_left_with_margins_on( - self.ids.warpaint_color_picker_bg, - 0.0, - -250.0, - ) - .font_size(25) - .color(TEXT_COLOR) - .set(self.ids.warpaint_color_text, ui_widgets); - - Rectangle::fill_with([192.0, 116.0], color::WHITE) - .top_right_with_margins_on( - self.ids.accessories_window, - 114.0, - 30.0, - ) - .color(TEXT_COLOR) - .set(self.ids.warpaint_color_picker_bg, ui_widgets); - - Image::new(self.imgs.slider_range) - .w_h(208.0, 12.0) - .bottom_left_with_margins_on( - self.ids.warpaint_color_picker_bg, - 10.0, - -255.0, - ) - .set(self.ids.warpaint_slider_range, ui_widgets); - - Image::new(self.imgs.slider_indicator) - .w_h(10.0, 22.0) - .middle_of(self.ids.warpaint_slider_range) - .set(self.ids.warpaint_slider_indicator, ui_widgets); - - Text::new("Brightness") - .top_left_with_margins_on( - self.ids.warpaint_slider_range, - -27.0, - 0.0, - ) - .color(TEXT_COLOR) - .font_size(14) - .set(self.ids.warpaint_slider_text, ui_widgets); - } - Race::Undead => { - Text::new("Teeth") - .mid_top_with_margin_on(self.ids.accessories_window, 60.0) - .color(TEXT_COLOR) - .font_size(24) - .set(self.ids.warpaint_text, ui_widgets); - if Button::image(self.imgs.arrow_right) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_right_mo) - .press_image(self.imgs.arrow_right_press) - .right_from(self.ids.warpaint_text, 15.0) - .set(self.ids.warpaint_arrow_r, ui_widgets) - .was_clicked() - {}; - if Button::image(self.imgs.arrow_left) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_left_mo) - .press_image(self.imgs.arrow_left_press) - .left_from(self.ids.warpaint_text, 15.0) - .set(self.ids.warpaint_arrow_l, ui_widgets) - .was_clicked() - {}; - - Text::new("Color") - .top_left_with_margins_on( - self.ids.warpaint_color_picker_bg, - 0.0, - -250.0, - ) - .font_size(25) - .color(TEXT_COLOR) - .set(self.ids.warpaint_color_text, ui_widgets); - - Rectangle::fill_with([192.0, 116.0], color::WHITE) - .top_right_with_margins_on( - self.ids.accessories_window, - 114.0, - 30.0, - ) - .color(TEXT_COLOR) - .set(self.ids.warpaint_color_picker_bg, ui_widgets); - - Image::new(self.imgs.slider_range) - .w_h(208.0, 12.0) - .bottom_left_with_margins_on( - self.ids.warpaint_color_picker_bg, - 10.0, - -255.0, - ) - .set(self.ids.warpaint_slider_range, ui_widgets); - - Image::new(self.imgs.slider_indicator) - .w_h(10.0, 22.0) - .middle_of(self.ids.warpaint_slider_range) - .set(self.ids.warpaint_slider_indicator, ui_widgets); - - Text::new("Brightness") - .top_left_with_margins_on( - self.ids.warpaint_slider_range, - -27.0, - 0.0, - ) - .color(TEXT_COLOR) - .font_size(14) - .set(self.ids.warpaint_slider_text, ui_widgets); - } - Race::Danari => { - Text::new("Horns") - .mid_top_with_margin_on(self.ids.accessories_window, 60.0) - .color(TEXT_COLOR) - .font_size(24) - .set(self.ids.warpaint_text, ui_widgets); - if Button::image(self.imgs.arrow_right) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_right_mo) - .press_image(self.imgs.arrow_right_press) - .right_from(self.ids.warpaint_text, 15.0) - .set(self.ids.warpaint_arrow_r, ui_widgets) - .was_clicked() - {}; - if Button::image(self.imgs.arrow_left) - .w_h(986.0 * 0.02, 1024.0 * 0.02) - .hover_image(self.imgs.arrow_left_mo) - .press_image(self.imgs.arrow_left_press) - .left_from(self.ids.warpaint_text, 15.0) - .set(self.ids.warpaint_arrow_l, ui_widgets) - .was_clicked() - {}; - - Text::new("Color") - .top_left_with_margins_on( - self.ids.warpaint_color_picker_bg, - 0.0, - -250.0, - ) - .font_size(25) - .color(TEXT_COLOR) - .set(self.ids.warpaint_color_text, ui_widgets); - - Rectangle::fill_with([192.0, 116.0], color::WHITE) - .top_right_with_margins_on( - self.ids.accessories_window, - 114.0, - 30.0, - ) - .color(TEXT_COLOR) - .set(self.ids.warpaint_color_picker_bg, ui_widgets); - - Image::new(self.imgs.slider_range) - .w_h(208.0, 12.0) - .bottom_left_with_margins_on( - self.ids.warpaint_color_picker_bg, - 10.0, - -255.0, - ) - .set(self.ids.warpaint_slider_range, ui_widgets); - - Image::new(self.imgs.slider_indicator) - .w_h(10.0, 22.0) - .middle_of(self.ids.warpaint_slider_range) - .set(self.ids.warpaint_slider_indicator, ui_widgets); - - Text::new("Brightness") - .top_left_with_margins_on( - self.ids.warpaint_slider_range, - -27.0, - 0.0, - ) - .color(TEXT_COLOR) - .font_size(14) - .set(self.ids.warpaint_slider_text, ui_widgets); - } - } // match Race fin - } - } - } - } + } // Char Creation fin events } diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index ea57344543..76d9800b63 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -137,6 +137,7 @@ impl MainMenuUi { Text::new(version) .top_left_with_margins_on(ui_widgets.window, 5.0, 5.0) .font_size(14) + .font_id(self.fonts.opensans) .color(TEXT_COLOR) .set(self.ids.version, ui_widgets); diff --git a/voxygen/src/scene/camera.rs b/voxygen/src/scene/camera.rs index 5cf82313e8..d23638fdff 100644 --- a/voxygen/src/scene/camera.rs +++ b/voxygen/src/scene/camera.rs @@ -34,7 +34,7 @@ impl Camera { ori: Vec3::zero(), tgt_dist: 10.0, dist: 10.0, - fov: 1.3, + fov: 1.1, aspect, last_time: None, } diff --git a/voxygen/src/scene/figure.rs b/voxygen/src/scene/figure.rs index 341b4822ad..1eb8cd58fa 100644 --- a/voxygen/src/scene/figure.rs +++ b/voxygen/src/scene/figure.rs @@ -132,7 +132,7 @@ impl FigureModelCache { fn load_head(head: Head) -> Mesh { Self::load_mesh( match head { - Head::Default => "head.vox", + Head::Default => "figure/head.vox", }, Vec3::new(-7.0, -5.5, -6.0), ) @@ -141,7 +141,12 @@ impl FigureModelCache { fn load_chest(chest: Chest) -> Mesh { Self::load_mesh( match chest { - Chest::Default => "chest.vox", + Chest::Default => "figure/body/chest_male.vox", + Chest::Blue => "armor/chest/chest_blue.vox", + Chest::Brown => "armor/chest/chest_brown.vox", + Chest::Dark => "armor/chest/chest_dark.vox", + Chest::Green => "armor/chest/chest_green.vox", + Chest::Orange => "armor/chest/chest_orange.vox", }, Vec3::new(-6.0, -3.5, 0.0), ) @@ -150,7 +155,8 @@ impl FigureModelCache { fn load_belt(belt: Belt) -> Mesh { Self::load_mesh( match belt { - Belt::Default => "belt.vox", + //Belt::Default => "figure/body/belt_male.vox", + Belt::Dark => "armor/belt/belt_dark.vox", }, Vec3::new(-5.0, -3.5, 0.0), ) @@ -159,7 +165,12 @@ impl FigureModelCache { fn load_pants(pants: Pants) -> Mesh { Self::load_mesh( match pants { - Pants::Default => "pants.vox", + Pants::Default => "figure/body/pants_male.vox", + Pants::Blue => "armor/pants/pants_blue.vox", + Pants::Brown => "armor/pants/pants_brown.vox", + Pants::Dark => "armor/pants/pants_dark.vox", + Pants::Green => "armor/pants/pants_green.vox", + Pants::Orange => "armor/pants/pants_orange.vox", }, Vec3::new(-5.0, -3.5, 0.0), ) @@ -168,7 +179,7 @@ impl FigureModelCache { fn load_left_hand(hand: Hand) -> Mesh { Self::load_mesh( match hand { - Hand::Default => "hand.vox", + Hand::Default => "figure/body/hand.vox", }, Vec3::new(2.0, 0.0, -7.0), ) @@ -177,7 +188,7 @@ impl FigureModelCache { fn load_right_hand(hand: Hand) -> Mesh { Self::load_mesh( match hand { - Hand::Default => "hand.vox", + Hand::Default => "figure/body/hand.vox", }, Vec3::new(2.0, 0.0, -7.0), ) @@ -186,7 +197,8 @@ impl FigureModelCache { fn load_left_foot(foot: Foot) -> Mesh { Self::load_mesh( match foot { - Foot::Default => "foot.vox", + Foot::Default => "figure/body/foot.vox", + Foot::Dark => "armor/foot/foot_dark.vox", }, Vec3::new(2.5, -3.5, -9.0), ) @@ -195,7 +207,8 @@ impl FigureModelCache { fn load_right_foot(foot: Foot) -> Mesh { Self::load_mesh( match foot { - Foot::Default => "foot.vox", + Foot::Default => "figure/body/foot.vox", + Foot::Dark => "armor/foot/foot_dark.vox", }, Vec3::new(2.5, -3.5, -9.0), ) @@ -204,9 +217,9 @@ impl FigureModelCache { fn load_weapon(weapon: Weapon) -> Mesh { Self::load_mesh( match weapon { - Weapon::Sword => "sword.vox", - // TODO actually match against other weapons and set the right model. - _ => "sword.vox", + Weapon::Sword => "weapon/sword/sword_wood_2h.vox", + // TODO actually match against other weapons and set the right model + _ => "weapon/sword/sword_wood_2h.vox", }, Vec3::new(0.0, 0.0, -4.0), ) @@ -215,24 +228,24 @@ impl FigureModelCache { fn load_left_shoulder(shoulder: Shoulder) -> Mesh { Self::load_mesh( match shoulder { - Shoulder::Default => "shoulder_l.vox", + Shoulder::Default => "armor/shoulder/shoulder_l_brown.vox", }, - Vec3::new(2.5, 0.0, 0.0), + Vec3::new(2.5, -0.5, 0.0), ) } fn load_right_shoulder(shoulder: Shoulder) -> Mesh { Self::load_mesh( match shoulder { - Shoulder::Default => "shoulder_r.vox", + Shoulder::Default => "armor/shoulder/shoulder_r_brown.vox", }, - Vec3::new(2.5, 0.0, 0.0), + Vec3::new(2.5, -0.5, 0.0), ) } fn load_draw(draw: Draw) -> Mesh { Self::load_mesh( match draw { - Draw::Default => "glider.vox", + Draw::Default => "object/glider.vox", }, Vec3::new(-26.0, -26.0, -5.0), ) @@ -241,7 +254,7 @@ impl FigureModelCache { fn load_pig_head(pig_head: PigHead) -> Mesh { Self::load_mesh( match pig_head { - PigHead::Default => "pighead.vox", + PigHead::Default => "npc/pig_purple/pighead.vox", }, Vec3::new(-6.0, 4.5, 3.0), ) @@ -250,7 +263,7 @@ impl FigureModelCache { fn load_pig_chest(pig_chest: PigChest) -> Mesh { Self::load_mesh( match pig_chest { - PigChest::Default => "pigchest.vox", + PigChest::Default => "npc/pig_purple/pigchest.vox", }, Vec3::new(-5.0, 4.5, 0.0), ) @@ -259,7 +272,7 @@ impl FigureModelCache { fn load_pig_leg_lf(pig_leg_l: PigLegL) -> Mesh { Self::load_mesh( match pig_leg_l { - PigLegL::Default => "pigleg_l.vox", + PigLegL::Default => "npc/pig_purple/pigleg_l.vox", }, Vec3::new(0.0, -1.0, -1.5), ) @@ -268,7 +281,7 @@ impl FigureModelCache { fn load_pig_leg_rf(pig_leg_r: PigLegR) -> Mesh { Self::load_mesh( match pig_leg_r { - PigLegR::Default => "pigleg_r.vox", + PigLegR::Default => "npc/pig_purple/pigleg_r.vox", }, Vec3::new(0.0, -1.0, -1.5), ) @@ -277,7 +290,7 @@ impl FigureModelCache { fn load_pig_leg_lb(pigleg_l: PigLegL) -> Mesh { Self::load_mesh( match pigleg_l { - PigLegL::Default => "pigleg_l.vox", + PigLegL::Default => "npc/pig_purple/pigleg_l.vox", }, Vec3::new(0.0, -1.0, -1.5), ) @@ -286,7 +299,7 @@ impl FigureModelCache { fn load_pig_leg_rb(pig_leg_r: PigLegR) -> Mesh { Self::load_mesh( match pig_leg_r { - PigLegR::Default => "pigleg_r.vox", + PigLegR::Default => "npc/pig_purple/pigleg_r.vox", }, Vec3::new(0.0, -1.0, -1.5), ) diff --git a/voxygen/src/scene/figure/figure.rs b/voxygen/src/scene/figure/figure.rs index 7743a75dad..34fd22c9ac 100644 --- a/voxygen/src/scene/figure/figure.rs +++ b/voxygen/src/scene/figure/figure.rs @@ -108,7 +108,7 @@ impl FigureModelCache { fn load_head(head: Head) -> Mesh { Self::load_mesh( match head { - Head::Default => "head.vox", + Head::Default => "figure/head.vox", }, Vec3::new(-7.0, -5.5, -6.0), ) diff --git a/voxygen/src/scene/figure/figurequad.rs b/voxygen/src/scene/figure/figurequad.rs index 1d6244b789..e6d5b92f31 100644 --- a/voxygen/src/scene/figure/figurequad.rs +++ b/voxygen/src/scene/figure/figurequad.rs @@ -100,7 +100,7 @@ impl FigureModelCache { // TODO: Don't make this public. pub fn load_mesh(filename: &str, position: Vec3) -> Mesh { - let full_path: String = ["/voxygen/voxel/", filename].concat(); + let full_path: String = ["/voxygen/voxel/npc/", filename].concat(); Segment::from(assets::load_expect::(full_path.as_str()).as_ref()) .generate_mesh(position) } @@ -108,7 +108,7 @@ impl FigureModelCache { fn load_head(head: Head) -> Mesh { Self::load_mesh( match head { - Head::Default => "pighead.vox", + Head::Default => "pig_purple/pighead.vox", }, Vec3::new(0.0, 0.0, 0.0), ) @@ -117,7 +117,7 @@ impl FigureModelCache { fn load_chest(chest: Chest) -> Mesh { Self::load_mesh( match chest { - Chest::Default => "pigchest.vox", + Chest::Default => "pig_purple/pigchest.vox", }, Vec3::new(0.0, 0.0, 0.0), ) @@ -126,7 +126,7 @@ impl FigureModelCache { fn load_leg_lf(leg_l: Leg_l) -> Mesh { Self::load_mesh( match belt { - Belt::Default => "pigleg_l.vox", + Belt::Default => "pig_purple/pigleg_l.vox", }, Vec3::new(0.0, 0.0, 0.0), ) @@ -135,7 +135,7 @@ impl FigureModelCache { fn load_leg_rf(leg_r: Leg_r) -> Mesh { Self::load_mesh( match pants { - Pants::Default => "pigleg_r.vox", + Pants::Default => "pig_purple/pigleg_r.vox", }, Vec3::new(0.0, 0.0, 0.0), ) @@ -144,7 +144,7 @@ impl FigureModelCache { fn load_leg_lb(leg_l: Leg_l) -> Mesh { Self::load_mesh( match hand { - Hand::Default => "pigleg_l.vox", + Hand::Default => "pig_purple/pigleg_l.vox", }, Vec3::new(0.0, 0.0, 0.0), ) @@ -153,7 +153,7 @@ impl FigureModelCache { fn load_leg_rb(leg_r: Leg_r) -> Mesh { Self::load_mesh( match hand { - Hand::Default => "pigleg_r.vox", + Hand::Default => "pig_purple/pigleg_r.vox", }, Vec3::new(0.0, 0.0, 0.0), )