diff --git a/Cargo.toml b/Cargo.toml index 435991041f..26718f0286 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,6 @@ opt-level = 2 overflow-checks = false [profile.release] -debug = true +debug = false codegen-units = 1 lto = true diff --git a/assets/common/npc_names.json b/assets/common/npc_names.json index a78a16af92..e8bdc06b71 100644 --- a/assets/common/npc_names.json +++ b/assets/common/npc_names.json @@ -1,5 +1,5 @@ { - "humanoid" : [ + "humanoid": [ "Adon", "Agro", "Arlo", @@ -62,6 +62,7 @@ "Lydan", "Mavrek", "Moki", + "Monty", "Nazim", "Nesso", "Ophni", @@ -80,6 +81,7 @@ "Roux", "Ryven", "Sarkin", + "Sturp", "Straus", "Syrin", "Talon", @@ -196,6 +198,7 @@ "Ubba", "Ulva", "Valor", + "Vechro", "Wolf", "Wolfgang", "Yara", diff --git a/assets/voxygen/element/buttons/x_red.vox b/assets/voxygen/element/buttons/x_red.vox new file mode 100644 index 0000000000..19ec8922f7 Binary files /dev/null and b/assets/voxygen/element/buttons/x_red.vox differ diff --git a/assets/voxygen/element/buttons/x_red_hover.vox b/assets/voxygen/element/buttons/x_red_hover.vox new file mode 100644 index 0000000000..59608cc7eb Binary files /dev/null and b/assets/voxygen/element/buttons/x_red_hover.vox differ diff --git a/assets/voxygen/element/buttons/x_red_press.vox b/assets/voxygen/element/buttons/x_red_press.vox new file mode 100644 index 0000000000..609ba072c5 Binary files /dev/null and b/assets/voxygen/element/buttons/x_red_press.vox differ diff --git a/assets/voxygen/element/frames/tt_test_corner_tr.vox b/assets/voxygen/element/frames/tt_test_corner_tr.vox index 6deaf56bff..056d258ec1 100644 Binary files a/assets/voxygen/element/frames/tt_test_corner_tr.vox and b/assets/voxygen/element/frames/tt_test_corner_tr.vox differ diff --git a/assets/voxygen/element/frames/tt_test_edge.vox b/assets/voxygen/element/frames/tt_test_edge.vox index 16baef1ca3..05d628bd46 100644 Binary files a/assets/voxygen/element/frames/tt_test_edge.vox and b/assets/voxygen/element/frames/tt_test_edge.vox differ diff --git a/assets/voxygen/voxel/armor/foot/foot_dark.vox b/assets/voxygen/voxel/armor/foot/dark-0.vox similarity index 100% rename from assets/voxygen/voxel/armor/foot/foot_dark.vox rename to assets/voxygen/voxel/armor/foot/dark-0.vox diff --git a/assets/voxygen/voxel/armor/hand/dark-0.vox b/assets/voxygen/voxel/armor/hand/dark-0.vox new file mode 100644 index 0000000000..b55604b617 Binary files /dev/null and b/assets/voxygen/voxel/armor/hand/dark-0.vox differ diff --git a/assets/voxygen/voxel/armor/shoulder/shoulder_l_chain.vox b/assets/voxygen/voxel/armor/shoulder/shoulder_l_chain.vox new file mode 100644 index 0000000000..c7d2505d91 Binary files /dev/null and b/assets/voxygen/voxel/armor/shoulder/shoulder_l_chain.vox differ diff --git a/assets/voxygen/voxel/armor/shoulder/shoulder_r_chain.vox b/assets/voxygen/voxel/armor/shoulder/shoulder_r_chain.vox new file mode 100644 index 0000000000..388979f82f Binary files /dev/null and b/assets/voxygen/voxel/armor/shoulder/shoulder_r_chain.vox differ diff --git a/assets/voxygen/voxel/figure/accessory/orc/warpaint-female-0.vox b/assets/voxygen/voxel/figure/accessory/orc/warpaint-female-0.vox new file mode 100644 index 0000000000..416c565e93 Binary files /dev/null and b/assets/voxygen/voxel/figure/accessory/orc/warpaint-female-0.vox differ diff --git a/assets/voxygen/voxel/figure/accessory/orc/warpaint-male-0.vox b/assets/voxygen/voxel/figure/accessory/orc/warpaint-male-0.vox new file mode 100644 index 0000000000..394ea9121f Binary files /dev/null and b/assets/voxygen/voxel/figure/accessory/orc/warpaint-male-0.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/1.vox b/assets/voxygen/voxel/figure/beard/dwarf/1.vox deleted file mode 100644 index acce14a409..0000000000 Binary files a/assets/voxygen/voxel/figure/beard/dwarf/1.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-0.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-0.vox new file mode 100644 index 0000000000..7908eebc4d Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-0.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-1.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-1.vox new file mode 100644 index 0000000000..ae2efe6d32 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-1.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-10.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-10.vox new file mode 100644 index 0000000000..d3d638c576 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-10.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-11.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-11.vox new file mode 100644 index 0000000000..b9330153d1 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-11.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-12.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-12.vox new file mode 100644 index 0000000000..523dc2cc8d Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-12.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-13.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-13.vox new file mode 100644 index 0000000000..1ec11c9d9a Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-13.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-14.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-14.vox new file mode 100644 index 0000000000..4e0e6bf412 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-14.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-15.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-15.vox new file mode 100644 index 0000000000..d136ea62e0 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-15.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-16.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-16.vox new file mode 100644 index 0000000000..8f5fee27c7 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-16.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-17.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-17.vox new file mode 100644 index 0000000000..fe6aadfba5 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-17.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/undead/female.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-18.vox similarity index 97% rename from assets/voxygen/voxel/figure/eyes/undead/female.vox rename to assets/voxygen/voxel/figure/beard/dwarf/dwarf-18.vox index 1d76cde362..37a7e8106c 100644 Binary files a/assets/voxygen/voxel/figure/eyes/undead/female.vox and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-18.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-19.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-19.vox new file mode 100644 index 0000000000..6ee1de013e Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-19.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-2.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-2.vox new file mode 100644 index 0000000000..cfe8751125 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-2.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-20.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-20.vox new file mode 100644 index 0000000000..beeb76853d Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-20.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-3.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-3.vox new file mode 100644 index 0000000000..dd661a5db2 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-3.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-4.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-4.vox new file mode 100644 index 0000000000..95c4fbe270 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-4.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-5.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-5.vox new file mode 100644 index 0000000000..f593d1cc0a Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-5.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-6.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-6.vox new file mode 100644 index 0000000000..1a7e06ea98 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-6.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-7.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-7.vox new file mode 100644 index 0000000000..dad8fda228 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-7.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-8.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-8.vox new file mode 100644 index 0000000000..00e2142206 Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-8.vox differ diff --git a/assets/voxygen/voxel/figure/beard/dwarf/dwarf-9.vox b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-9.vox new file mode 100644 index 0000000000..19d57f310f Binary files /dev/null and b/assets/voxygen/voxel/figure/beard/dwarf/dwarf-9.vox differ diff --git a/assets/voxygen/voxel/figure/body/foot.vox b/assets/voxygen/voxel/figure/body/foot.vox index 5f4fb03594..df2644ee17 100644 Binary files a/assets/voxygen/voxel/figure/body/foot.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 index 9d09475a4b..a2814d3eda 100644 Binary files a/assets/voxygen/voxel/figure/body/hand.vox and b/assets/voxygen/voxel/figure/body/hand.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/danari/female.vox b/assets/voxygen/voxel/figure/eyes/danari/female-0.vox similarity index 100% rename from assets/voxygen/voxel/figure/eyes/danari/female.vox rename to assets/voxygen/voxel/figure/eyes/danari/female-0.vox diff --git a/assets/voxygen/voxel/figure/eyes/dwarf/male.vox b/assets/voxygen/voxel/figure/eyes/danari/male-0.vox similarity index 99% rename from assets/voxygen/voxel/figure/eyes/dwarf/male.vox rename to assets/voxygen/voxel/figure/eyes/danari/male-0.vox index ef13bcde9b..aa388818f4 100644 Binary files a/assets/voxygen/voxel/figure/eyes/dwarf/male.vox and b/assets/voxygen/voxel/figure/eyes/danari/male-0.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/danari/male-1.vox b/assets/voxygen/voxel/figure/eyes/danari/male-1.vox new file mode 100644 index 0000000000..463c31d0f8 Binary files /dev/null and b/assets/voxygen/voxel/figure/eyes/danari/male-1.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/danari/male.vox b/assets/voxygen/voxel/figure/eyes/danari/male.vox deleted file mode 100644 index 506fe67dd6..0000000000 Binary files a/assets/voxygen/voxel/figure/eyes/danari/male.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/eyes/dwarf/female.vox b/assets/voxygen/voxel/figure/eyes/dwarf/female-0.vox similarity index 100% rename from assets/voxygen/voxel/figure/eyes/dwarf/female.vox rename to assets/voxygen/voxel/figure/eyes/dwarf/female-0.vox diff --git a/assets/voxygen/voxel/figure/eyes/dwarf/male-0.vox b/assets/voxygen/voxel/figure/eyes/dwarf/male-0.vox new file mode 100644 index 0000000000..aa388818f4 Binary files /dev/null and b/assets/voxygen/voxel/figure/eyes/dwarf/male-0.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/elf/female-0.vox b/assets/voxygen/voxel/figure/eyes/elf/female-0.vox new file mode 100644 index 0000000000..0527bfeab8 Binary files /dev/null and b/assets/voxygen/voxel/figure/eyes/elf/female-0.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/elf/female.vox b/assets/voxygen/voxel/figure/eyes/elf/female.vox deleted file mode 100644 index ee6458c274..0000000000 Binary files a/assets/voxygen/voxel/figure/eyes/elf/female.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/eyes/elf/male-0.vox b/assets/voxygen/voxel/figure/eyes/elf/male-0.vox new file mode 100644 index 0000000000..463c31d0f8 Binary files /dev/null and b/assets/voxygen/voxel/figure/eyes/elf/male-0.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/elf/male.vox b/assets/voxygen/voxel/figure/eyes/elf/male.vox deleted file mode 100644 index 33d7d38228..0000000000 Binary files a/assets/voxygen/voxel/figure/eyes/elf/male.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/eyes/human/female.vox b/assets/voxygen/voxel/figure/eyes/human/female-0.vox similarity index 100% rename from assets/voxygen/voxel/figure/eyes/human/female.vox rename to assets/voxygen/voxel/figure/eyes/human/female-0.vox diff --git a/assets/voxygen/voxel/figure/eyes/human/female_1 (unused).vox b/assets/voxygen/voxel/figure/eyes/human/female_1 (unused).vox deleted file mode 100644 index b5e8a8a327..0000000000 Binary files a/assets/voxygen/voxel/figure/eyes/human/female_1 (unused).vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/eyes/human/male-0.vox b/assets/voxygen/voxel/figure/eyes/human/male-0.vox new file mode 100644 index 0000000000..463c31d0f8 Binary files /dev/null and b/assets/voxygen/voxel/figure/eyes/human/male-0.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/human/male-1.vox b/assets/voxygen/voxel/figure/eyes/human/male-1.vox new file mode 100644 index 0000000000..aa388818f4 Binary files /dev/null and b/assets/voxygen/voxel/figure/eyes/human/male-1.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/human/male.vox b/assets/voxygen/voxel/figure/eyes/human/male.vox deleted file mode 100644 index 1f5954236d..0000000000 Binary files a/assets/voxygen/voxel/figure/eyes/human/male.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/eyes/human/male_1 (unused).vox b/assets/voxygen/voxel/figure/eyes/human/male_1 (unused).vox deleted file mode 100644 index f91e52993d..0000000000 Binary files a/assets/voxygen/voxel/figure/eyes/human/male_1 (unused).vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/eyes/orc/female-0.vox b/assets/voxygen/voxel/figure/eyes/orc/female-0.vox new file mode 100644 index 0000000000..7bbefa712c Binary files /dev/null and b/assets/voxygen/voxel/figure/eyes/orc/female-0.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/orc/female.vox b/assets/voxygen/voxel/figure/eyes/orc/female.vox deleted file mode 100644 index 5da2e679f5..0000000000 Binary files a/assets/voxygen/voxel/figure/eyes/orc/female.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/eyes/orc/male-0.vox b/assets/voxygen/voxel/figure/eyes/orc/male-0.vox new file mode 100644 index 0000000000..bbd3612575 Binary files /dev/null and b/assets/voxygen/voxel/figure/eyes/orc/male-0.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/orc/male.vox b/assets/voxygen/voxel/figure/eyes/orc/male.vox deleted file mode 100644 index 8e481a5b27..0000000000 Binary files a/assets/voxygen/voxel/figure/eyes/orc/male.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/eyes/undead/female-0.vox b/assets/voxygen/voxel/figure/eyes/undead/female-0.vox new file mode 100644 index 0000000000..b1083b7c60 Binary files /dev/null and b/assets/voxygen/voxel/figure/eyes/undead/female-0.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/undead/male-0.vox b/assets/voxygen/voxel/figure/eyes/undead/male-0.vox new file mode 100644 index 0000000000..51e463a2f7 Binary files /dev/null and b/assets/voxygen/voxel/figure/eyes/undead/male-0.vox differ diff --git a/assets/voxygen/voxel/figure/eyes/undead/male.vox b/assets/voxygen/voxel/figure/eyes/undead/male.vox deleted file mode 100644 index 17215562d5..0000000000 Binary files a/assets/voxygen/voxel/figure/eyes/undead/male.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/hair/dwarf/bald.vox b/assets/voxygen/voxel/figure/hair/dwarf/bald.vox new file mode 100644 index 0000000000..e600734510 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/dwarf/bald.vox differ diff --git a/assets/voxygen/voxel/figure/hair/dwarf/female.vox b/assets/voxygen/voxel/figure/hair/dwarf/female-0.vox similarity index 100% rename from assets/voxygen/voxel/figure/hair/dwarf/female.vox rename to assets/voxygen/voxel/figure/hair/dwarf/female-0.vox diff --git a/assets/voxygen/voxel/figure/hair/dwarf/male-0.vox b/assets/voxygen/voxel/figure/hair/dwarf/male-0.vox new file mode 100644 index 0000000000..0c11b03db9 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/dwarf/male-0.vox differ diff --git a/assets/voxygen/voxel/figure/hair/dwarf/male-1.vox b/assets/voxygen/voxel/figure/hair/dwarf/male-1.vox new file mode 100644 index 0000000000..d78677481a Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/dwarf/male-1.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-0.vox b/assets/voxygen/voxel/figure/hair/elf/female-0.vox new file mode 100644 index 0000000000..5e6ea080da Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-0.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-1.vox b/assets/voxygen/voxel/figure/hair/elf/female-1.vox new file mode 100644 index 0000000000..b2c12e2cc3 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-1.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-10.vox b/assets/voxygen/voxel/figure/hair/elf/female-10.vox new file mode 100644 index 0000000000..b4d58318ea Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-10.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-11.vox b/assets/voxygen/voxel/figure/hair/elf/female-11.vox new file mode 100644 index 0000000000..28ab0682e9 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-11.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-12.vox b/assets/voxygen/voxel/figure/hair/elf/female-12.vox new file mode 100644 index 0000000000..4da3b77de7 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-12.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-13.vox b/assets/voxygen/voxel/figure/hair/elf/female-13.vox new file mode 100644 index 0000000000..a2c8e658e4 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-13.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-14.vox b/assets/voxygen/voxel/figure/hair/elf/female-14.vox new file mode 100644 index 0000000000..23ee7583ec Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-14.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-15.vox b/assets/voxygen/voxel/figure/hair/elf/female-15.vox new file mode 100644 index 0000000000..6f0eba125d Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-15.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-16.vox b/assets/voxygen/voxel/figure/hair/elf/female-16.vox new file mode 100644 index 0000000000..dae68db911 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-16.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-17.vox b/assets/voxygen/voxel/figure/hair/elf/female-17.vox new file mode 100644 index 0000000000..5df36834ee Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-17.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female_1.vox b/assets/voxygen/voxel/figure/hair/elf/female-18.vox similarity index 100% rename from assets/voxygen/voxel/figure/hair/human/female_1.vox rename to assets/voxygen/voxel/figure/hair/elf/female-18.vox diff --git a/assets/voxygen/voxel/figure/hair/elf/female.vox b/assets/voxygen/voxel/figure/hair/elf/female-19.vox similarity index 100% rename from assets/voxygen/voxel/figure/hair/elf/female.vox rename to assets/voxygen/voxel/figure/hair/elf/female-19.vox diff --git a/assets/voxygen/voxel/figure/hair/elf/female-2.vox b/assets/voxygen/voxel/figure/hair/elf/female-2.vox new file mode 100644 index 0000000000..e14aa169be Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-2.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-20.vox b/assets/voxygen/voxel/figure/hair/elf/female-20.vox new file mode 100644 index 0000000000..d7f7a67d71 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-20.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-3.vox b/assets/voxygen/voxel/figure/hair/elf/female-3.vox new file mode 100644 index 0000000000..24e262d763 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-3.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-4.vox b/assets/voxygen/voxel/figure/hair/elf/female-4.vox new file mode 100644 index 0000000000..95cdfc5e43 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-4.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-5.vox b/assets/voxygen/voxel/figure/hair/elf/female-5.vox new file mode 100644 index 0000000000..247d55c06b Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-5.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-6.vox b/assets/voxygen/voxel/figure/hair/elf/female-6.vox new file mode 100644 index 0000000000..fc537a9a68 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-6.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-7.vox b/assets/voxygen/voxel/figure/hair/elf/female-7.vox new file mode 100644 index 0000000000..a8378d824c Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-7.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-8.vox b/assets/voxygen/voxel/figure/hair/elf/female-8.vox new file mode 100644 index 0000000000..0b51216fd3 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-8.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/female-9.vox b/assets/voxygen/voxel/figure/hair/elf/female-9.vox new file mode 100644 index 0000000000..7c18cac9b7 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/elf/female-9.vox differ diff --git a/assets/voxygen/voxel/figure/hair/elf/male.vox b/assets/voxygen/voxel/figure/hair/elf/male-0.vox similarity index 100% rename from assets/voxygen/voxel/figure/hair/elf/male.vox rename to assets/voxygen/voxel/figure/hair/elf/male-0.vox diff --git a/assets/voxygen/voxel/figure/hair/human/female-0.vox b/assets/voxygen/voxel/figure/hair/human/female-0.vox new file mode 100644 index 0000000000..5e6ea080da Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-0.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-1.vox b/assets/voxygen/voxel/figure/hair/human/female-1.vox new file mode 100644 index 0000000000..b2c12e2cc3 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-1.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-10.vox b/assets/voxygen/voxel/figure/hair/human/female-10.vox new file mode 100644 index 0000000000..b4d58318ea Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-10.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-11.vox b/assets/voxygen/voxel/figure/hair/human/female-11.vox new file mode 100644 index 0000000000..420c28df2b Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-11.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-12.vox b/assets/voxygen/voxel/figure/hair/human/female-12.vox new file mode 100644 index 0000000000..4da3b77de7 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-12.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-13.vox b/assets/voxygen/voxel/figure/hair/human/female-13.vox new file mode 100644 index 0000000000..a2c8e658e4 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-13.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-14.vox b/assets/voxygen/voxel/figure/hair/human/female-14.vox new file mode 100644 index 0000000000..8109d34792 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-14.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-15.vox b/assets/voxygen/voxel/figure/hair/human/female-15.vox new file mode 100644 index 0000000000..540b38c094 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-15.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-16.vox b/assets/voxygen/voxel/figure/hair/human/female-16.vox new file mode 100644 index 0000000000..dc07b06341 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-16.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-17.vox b/assets/voxygen/voxel/figure/hair/human/female-17.vox new file mode 100644 index 0000000000..5df36834ee Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-17.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-18.vox b/assets/voxygen/voxel/figure/hair/human/female-18.vox new file mode 100644 index 0000000000..90959f17dc Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-18.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-2.vox b/assets/voxygen/voxel/figure/hair/human/female-2.vox new file mode 100644 index 0000000000..e14aa169be Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-2.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-3.vox b/assets/voxygen/voxel/figure/hair/human/female-3.vox new file mode 100644 index 0000000000..24e262d763 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-3.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-4.vox b/assets/voxygen/voxel/figure/hair/human/female-4.vox new file mode 100644 index 0000000000..95cdfc5e43 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-4.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-5.vox b/assets/voxygen/voxel/figure/hair/human/female-5.vox new file mode 100644 index 0000000000..2290a07e57 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-5.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-6.vox b/assets/voxygen/voxel/figure/hair/human/female-6.vox new file mode 100644 index 0000000000..fc537a9a68 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-6.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-7.vox b/assets/voxygen/voxel/figure/hair/human/female-7.vox new file mode 100644 index 0000000000..84d8f5ad71 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-7.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-8.vox b/assets/voxygen/voxel/figure/hair/human/female-8.vox new file mode 100644 index 0000000000..0b51216fd3 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-8.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female-9.vox b/assets/voxygen/voxel/figure/hair/human/female-9.vox new file mode 100644 index 0000000000..946cd0c212 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/female-9.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/female_2.vox b/assets/voxygen/voxel/figure/hair/human/female_2.vox deleted file mode 100644 index 89a6e8714b..0000000000 Binary files a/assets/voxygen/voxel/figure/hair/human/female_2.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/hair/human/male.vox b/assets/voxygen/voxel/figure/hair/human/male-0.vox similarity index 100% rename from assets/voxygen/voxel/figure/hair/human/male.vox rename to assets/voxygen/voxel/figure/hair/human/male-0.vox diff --git a/assets/voxygen/voxel/figure/hair/human/male-1.vox b/assets/voxygen/voxel/figure/hair/human/male-1.vox new file mode 100644 index 0000000000..807e008c88 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/male-1.vox differ diff --git a/assets/voxygen/voxel/figure/hair/human/male-2.vox b/assets/voxygen/voxel/figure/hair/human/male-2.vox new file mode 100644 index 0000000000..eb5bddd9fb Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/human/male-2.vox differ diff --git a/assets/voxygen/voxel/figure/hair/orc/male.vox b/assets/voxygen/voxel/figure/hair/orc/male.vox index c53af33802..dd1a7e01f8 100644 Binary files a/assets/voxygen/voxel/figure/hair/orc/male.vox and b/assets/voxygen/voxel/figure/hair/orc/male.vox differ diff --git a/assets/voxygen/voxel/figure/hair/undead/female.vox b/assets/voxygen/voxel/figure/hair/undead/female-0.vox similarity index 100% rename from assets/voxygen/voxel/figure/hair/undead/female.vox rename to assets/voxygen/voxel/figure/hair/undead/female-0.vox diff --git a/assets/voxygen/voxel/figure/hair/undead/female-1.vox b/assets/voxygen/voxel/figure/hair/undead/female-1.vox new file mode 100644 index 0000000000..b107191cbd Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/undead/female-1.vox differ diff --git a/assets/voxygen/voxel/figure/hair/undead/female-2.vox b/assets/voxygen/voxel/figure/hair/undead/female-2.vox new file mode 100644 index 0000000000..87d3f62bfc Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/undead/female-2.vox differ diff --git a/assets/voxygen/voxel/figure/hair/undead/female-3.vox b/assets/voxygen/voxel/figure/hair/undead/female-3.vox new file mode 100644 index 0000000000..053874df13 Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/undead/female-3.vox differ diff --git a/assets/voxygen/voxel/figure/hair/undead/male.vox b/assets/voxygen/voxel/figure/hair/undead/male-0.vox similarity index 100% rename from assets/voxygen/voxel/figure/hair/undead/male.vox rename to assets/voxygen/voxel/figure/hair/undead/male-0.vox diff --git a/assets/voxygen/voxel/figure/hair/undead/male-1.vox b/assets/voxygen/voxel/figure/hair/undead/male-1.vox new file mode 100644 index 0000000000..fa62f5aa2f Binary files /dev/null and b/assets/voxygen/voxel/figure/hair/undead/male-1.vox differ diff --git a/assets/voxygen/voxel/figure/head/dwarf/female.vox b/assets/voxygen/voxel/figure/head/dwarf/female.vox index fac237a924..d5d1ba3e1f 100644 Binary files a/assets/voxygen/voxel/figure/head/dwarf/female.vox and b/assets/voxygen/voxel/figure/head/dwarf/female.vox differ diff --git a/assets/voxygen/voxel/figure/head/dwarf/male.vox b/assets/voxygen/voxel/figure/head/dwarf/male.vox index aa458fd73f..c15952a249 100644 Binary files a/assets/voxygen/voxel/figure/head/dwarf/male.vox and b/assets/voxygen/voxel/figure/head/dwarf/male.vox differ diff --git a/assets/voxygen/voxel/figure/head/elf/female.vox b/assets/voxygen/voxel/figure/head/elf/female.vox index e5857daed0..3db9b37179 100644 Binary files a/assets/voxygen/voxel/figure/head/elf/female.vox and b/assets/voxygen/voxel/figure/head/elf/female.vox differ diff --git a/assets/voxygen/voxel/figure/head/elf/male.vox b/assets/voxygen/voxel/figure/head/elf/male.vox index 489fda9589..8d2f080607 100644 Binary files a/assets/voxygen/voxel/figure/head/elf/male.vox and b/assets/voxygen/voxel/figure/head/elf/male.vox differ diff --git a/assets/voxygen/voxel/figure/head/head_dwarf_female.vox b/assets/voxygen/voxel/figure/head/head_dwarf_female.vox deleted file mode 100644 index 8a79862563..0000000000 Binary files a/assets/voxygen/voxel/figure/head/head_dwarf_female.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/head/head_undead_female.vox b/assets/voxygen/voxel/figure/head/head_undead_female.vox deleted file mode 100644 index 9cc210d62d..0000000000 Binary files a/assets/voxygen/voxel/figure/head/head_undead_female.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/head/head_undead_male.vox b/assets/voxygen/voxel/figure/head/head_undead_male.vox deleted file mode 100644 index 3af3a411aa..0000000000 Binary files a/assets/voxygen/voxel/figure/head/head_undead_male.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/head/human/1.vox b/assets/voxygen/voxel/figure/head/human/1.vox deleted file mode 100644 index 517617452c..0000000000 Binary files a/assets/voxygen/voxel/figure/head/human/1.vox and /dev/null differ diff --git a/assets/voxygen/voxel/figure/head/human/female.vox b/assets/voxygen/voxel/figure/head/human/female.vox index cf50ee0995..20fc5b9415 100644 Binary files a/assets/voxygen/voxel/figure/head/human/female.vox and b/assets/voxygen/voxel/figure/head/human/female.vox differ diff --git a/assets/voxygen/voxel/figure/head/orc/female.vox b/assets/voxygen/voxel/figure/head/orc/female.vox index f75c0e2e4b..29e2ff5534 100644 Binary files a/assets/voxygen/voxel/figure/head/orc/female.vox and b/assets/voxygen/voxel/figure/head/orc/female.vox differ diff --git a/assets/voxygen/voxel/figure/head/orc/male.vox b/assets/voxygen/voxel/figure/head/orc/male.vox index 1f724acb4c..72bc07b475 100644 Binary files a/assets/voxygen/voxel/figure/head/orc/male.vox and b/assets/voxygen/voxel/figure/head/orc/male.vox differ diff --git a/assets/voxygen/voxel/fixture/selection_bg - Kopie.vox b/assets/voxygen/voxel/fixture/selection_bg - Kopie.vox new file mode 100644 index 0000000000..9fafd7c12f Binary files /dev/null and b/assets/voxygen/voxel/fixture/selection_bg - Kopie.vox differ diff --git a/assets/voxygen/voxel/fixture/selection_bg.vox b/assets/voxygen/voxel/fixture/selection_bg.vox index fc1bb387d2..b8fada9705 100644 Binary files a/assets/voxygen/voxel/fixture/selection_bg.vox and b/assets/voxygen/voxel/fixture/selection_bg.vox differ diff --git a/assets/voxygen/voxel/humanoid_head_manifest.ron b/assets/voxygen/voxel/humanoid_head_manifest.ron index 7be1de3fca..75fab8c72f 100644 --- a/assets/voxygen/voxel/humanoid_head_manifest.ron +++ b/assets/voxygen/voxel/humanoid_head_manifest.ron @@ -1,195 +1,220 @@ ({ (Human, Male): ( - offset: (-7.0, -5.0, -2.25), + offset: (-7.0, -4.5, -2.25), head: ("figure.head.human.male", (0, 1, 0)), - eyes: ("figure.eyes.human.male", (3, 8, 2)), - hair: { - Temp1: Some(("figure.hair.human.male", (1, 0, 1))), - }, - beard: { - None: None, - Some: Some(("figure.beard.human.1", (4, 5, -2))), - }, - accessory: { - Nothing: None, - Something: None, - }, + eyes: ("figure.eyes.human.male-0", (3, 8, 2)), + hair: [ + Some(("figure.hair.human.male-0", (1, 0, 1))), + Some(("figure.hair.human.male-1", (1, 0, 1))), + Some(("figure.hair.human.male-2", (0, -2, 0))), + ], + beard: [ + None, + Some(("figure.beard.human.1", (4, 5, -2))), + ], + accessory: [ + None] ), (Human, Female): ( offset: (-7.0, -7.5, -3.25), head: ("figure.head.human.female", (0, 5, 2)), - eyes: ("figure.eyes.human.female", (2, 12, 4)), - hair: { - Temp1: Some(("figure.hair.human.female_1", (1, 2, -5))), - Temp2: Some(("figure.hair.human.female_2", (1, 0, 0))), - }, - beard: { - None: None, - Some: None, - }, - accessory: { - Nothing: None, - Something: None, - }, + eyes: ("figure.eyes.human.female-0", (2, 12, 4)), + hair: [ + Some(("figure.hair.human.female-0", (-1, 1, 2))), + Some(("figure.hair.human.female-1", (1, 4, 1))), + Some(("figure.hair.human.female-2", (1, 4, 1))), + Some(("figure.hair.human.female-3", (1, 3, -5))), + Some(("figure.hair.human.female-4", (2, 3, 1))), + Some(("figure.hair.human.female-5", (1, 4, 2))), + Some(("figure.hair.human.female-6", (1, 2, -5))), + Some(("figure.hair.human.female-7", (-1, 2, 0))), + Some(("figure.hair.human.female-8", (1, 4, 1))), + Some(("figure.hair.human.female-9", (0, 4, 1))), + Some(("figure.hair.human.female-10", (-1, 1, 2))), + Some(("figure.hair.human.female-11", (1, 4, 2))), + Some(("figure.hair.human.female-12", (1, 1, 2))), + Some(("figure.hair.human.female-13", (1, 0, 1))), + Some(("figure.hair.human.female-14", (1, 4, 2))), + Some(("figure.hair.human.female-15", (0, 3, -4))), + Some(("figure.hair.human.female-16", (1, 3, 2))), + Some(("figure.hair.human.female-17", (1, 0, 0))), + Some(("figure.hair.human.female-18", (1, 2, -5))), + ], + beard: [None], + accessory: [ + None] ), (Orc, Male): ( - offset: (-8.0, -5.0, -2.25), - head: ("figure.head.orc.male", (0, 1, 1)), - eyes: ("figure.eyes.orc.male", (0, 2, 4)), - hair: { - Temp1: Some(("figure.hair.orc.male", (4, 0, 1))), - }, - beard: { - None: None, - Some: Some(("figure.beard.orc.1", (7, 9, 1))), - }, - accessory: { - Nothing: None, - Something: None, - }, + offset: (-8.0, -4.0, -2.8), + head: ("figure.head.orc.male", (0, 0, 1)), + eyes: ("figure.eyes.orc.male-0", (5, 7, 7)), + hair: [ + Some(("figure.hair.dwarf.bald", (0, 0, 0))), + Some(("figure.hair.orc.male", (4, -1, 1))), + ], + beard: [ + None, + Some(("figure.beard.orc.1", (7, 8, 1))), + ], + accessory: [ + None, + Some(("figure.accessory.orc.earring", (3, 4, 4))), + Some(("figure.accessory.orc.warpaint-male-0", (0, 1, 5))), + ], ), (Orc, Female): ( - offset: (-8.0, -8.0, -2), + offset: (-8.0, -7.5, -1.5), head: ("figure.head.orc.female", (0, 0, -2)), - eyes: ("figure.eyes.orc.female", (3, 9, -1)), - hair: { - Temp1: Some(("figure.hair.orc.female", (5, 1, -2))), - }, - beard: { - None: None, - Some: None, - }, - accessory: { - Nothing: None, - Something: None, - }, + eyes: ("figure.eyes.orc.female-0", (3, 13, 0)), + hair: [ + Some(("figure.hair.orc.female", (5, 1, -2))), + ], + beard: [None], + accessory: [ + None, + Some(("figure.accessory.orc.earring", (0, 9, 0))), + Some(("figure.accessory.orc.warpaint-female-0", (3, 9, -1))), + ], ), (Elf, Male): ( - offset: (-8.0, -5.0, -2.25), + offset: (-8.0, -5.5, -2.25), head: ("figure.head.elf.male", (0, 2, 0)), - eyes: ("figure.eyes.elf.male", (4, 9, 2)), - hair: { - Temp1: Some(("figure.hair.elf.male", (2, 1, 1))), - }, - beard: { - None: None, - Some: None, - }, - accessory: { - Nothing: None, - Something: None, - }, + eyes: ("figure.eyes.elf.male-0", (4, 9, 2)), + hair: [ + Some(("figure.hair.elf.male-0", (2, 1, 1))), + ], + beard: [None], + accessory: [ + None] ), (Elf, Female): ( - offset: (-8.0, -5.5, -2.0), + offset: (-8.0, -6.0, -2.0), head: ("figure.head.elf.female", (0, 3, 1)), - eyes: ("figure.eyes.elf.female", (3, 10, 2)), - hair: { - Temp1: Some(("figure.hair.elf.female", (2, 1, -1))), - }, - beard: { - None: None, - Some: None, - }, - accessory: { - Nothing: None, - Something: None, - }, + eyes: ("figure.eyes.elf.female-0", (3, 10, 3)), + hair: [ + Some(("figure.hair.elf.female-19", (2, 1, -1))), + Some(("figure.hair.elf.female-20", (1, -2, 1))), + Some(("figure.hair.elf.female-0", (0, -1, 1))), + Some(("figure.hair.elf.female-1", (2, 2, 0))), + Some(("figure.hair.elf.female-2", (2, 2, 0))), + Some(("figure.hair.elf.female-3", (2, 1, -6))), + Some(("figure.hair.elf.female-4", (3, 1, 0))), + Some(("figure.hair.elf.female-5", (2, 2, 1))), + Some(("figure.hair.elf.female-6", (2, 0, -6))), + Some(("figure.hair.elf.female-7", (0, 0, 0))), + Some(("figure.hair.elf.female-8", (2, 2, 0))), + Some(("figure.hair.elf.female-9", (1, 2, 0))), + Some(("figure.hair.elf.female-10", (0, -1, 1))), + Some(("figure.hair.elf.female-11", (2, 1, 1))), + Some(("figure.hair.elf.female-12", (2, -1, 1))), + Some(("figure.hair.elf.female-13", (2, -2, 0))), + Some(("figure.hair.elf.female-14", (2, 2, 1))), + Some(("figure.hair.elf.female-15", (1, 1, -5))), + Some(("figure.hair.elf.female-16", (2, 1, 1))), + Some(("figure.hair.elf.female-17", (2, -2, -1))), + Some(("figure.hair.elf.female-18", (2, 0, -6))), + ], + beard: [None], + accessory: [ + None] ), (Dwarf, Male): ( - offset: (-6.0, -5.0, -2), + offset: (-6.0, -5.5, -2), head: ("figure.head.dwarf.male", (0, 0, -1)), - eyes: ("figure.eyes.dwarf.male", (2, 7, 1)), - hair: { - }, - beard: { - None: None, - Some: Some(("figure.beard.dwarf.1", (1, 3, -10))), - }, - accessory: { - Nothing: None, - Something: None, - }, + eyes: ("figure.eyes.dwarf.male-0", (2, 7, 1)), + hair: [ + Some(("figure.hair.dwarf.bald", (0, 0, 0))), + Some(("figure.hair.dwarf.male-0", (1, -2, -4))), + Some(("figure.hair.dwarf.male-1", (4, -3, 0))), + ], + beard: [ + Some(("figure.beard.dwarf.dwarf-0", (4, 6, -3))), + Some(("figure.beard.dwarf.dwarf-1", (1, 4, -9))), + //Some(("figure.beard.dwarf.dwarf-2", (4, 7, -2))), + Some(("figure.beard.dwarf.dwarf-3", (0, 5, -2))), + Some(("figure.beard.dwarf.dwarf-4", (4, 6, -5))), + Some(("figure.beard.dwarf.dwarf-5", (0, 4, -6))), + Some(("figure.beard.dwarf.dwarf-6", (0, 3, -6))), + Some(("figure.beard.dwarf.dwarf-7", (1, 7, -2))), + Some(("figure.beard.dwarf.dwarf-8", (1, 4, -2))), + Some(("figure.beard.dwarf.dwarf-9", (1, 4, -2))), + Some(("figure.beard.dwarf.dwarf-10", (1, 4, -4))), + Some(("figure.beard.dwarf.dwarf-11", (4, 8, -1))), + Some(("figure.beard.dwarf.dwarf-12", (1, 4, -3))), + Some(("figure.beard.dwarf.dwarf-13", (1, 6, -5))), + Some(("figure.beard.dwarf.dwarf-14", (1, 4, -6))), + Some(("figure.beard.dwarf.dwarf-15", (1, 5, -9))), + Some(("figure.beard.dwarf.dwarf-16", (1, 4, -11))), + Some(("figure.beard.dwarf.dwarf-17", (1, 4, -6))), + Some(("figure.beard.dwarf.dwarf-18", (2, 5, -5))), + Some(("figure.beard.dwarf.dwarf-19", (1, 4, -9))), + Some(("figure.beard.dwarf.dwarf-20", (1, 4,-5))), + ], + accessory: [ + None] ), (Dwarf, Female): ( - offset: (-6.0, -6.0, -2), + offset: (-6.0, -6.5, -1.8), head: ("figure.head.dwarf.female", (0, 3, 0)), - eyes: ("figure.eyes.dwarf.female", (1, 10, 2)), - hair: { - Temp1: Some(("figure.hair.dwarf.female", (1 , 0, -7))), - }, - beard: { - None: None, - Some: None, - }, - accessory: { - Nothing: None, - Something: None, - }, + eyes: ("figure.eyes.dwarf.female-0", (1, 10, 2)), + hair: [ + Some(("figure.hair.dwarf.female-0", (1, 0, -7))), + Some(("figure.hair.dwarf.female-0", (1, 0, -7))), + ], + beard: [None], + accessory: [ + None] ), (Undead, Male): ( - offset: (-5.5, -5.0, -2.25), + offset: (-5.5, -5.5, -2.25), head: ("figure.head.undead.male", (1, 1, -1)), - eyes: ("figure.eyes.undead.male", (3, 7, 3)), - hair: { - Temp1: Some(("figure.hair.undead.male", (0, 0, 0))), - }, - beard: { - None: None, - Some: None, - }, - accessory: { - Nothing: None, - Something: None, - }, + eyes: ("figure.eyes.undead.male-0", (3, 7, 3)), + hair: [ + Some(("figure.hair.dwarf.bald", (0, 0, 0))), + Some(("figure.hair.undead.male-0", (0, 0, 0))), + Some(("figure.hair.undead.male-1", (4, -3, -1))), + ], + beard: [None], + accessory: [ + None] ), (Undead, Female): ( - offset: (-6.0, -5.0, -2.5), + offset: (-6.0, -5.5, -2.5), head: ("figure.head.undead.female", (1, 1, -1)), - eyes: ("figure.eyes.undead.female", (3, 7, 2)), - hair: { - Temp1: Some(("figure.hair.undead.female", (1, 0, -1))), - }, - beard: { - None: None, - Some: None, - }, - accessory: { - Nothing: None, - Something: None, - }, + eyes: ("figure.eyes.undead.female-0", (3, 7, 2)), + hair: [ + Some(("figure.hair.undead.female-0", (1, 0, -1))), + Some(("figure.hair.undead.female-1", (-1, 0, -2))), + Some(("figure.hair.undead.female-2", (3, 0, 0))), + Some(("figure.hair.undead.female-3", (1, -4, -1))), + ], + beard: [None], + accessory: [ + None] ), (Danari, Male): ( - offset: (-9.0, -5.0, -2.75), + offset: (-9.0, -4.60, -2.75), head: ("figure.head.danari.male", (0, 1, -1)), - eyes: ("figure.eyes.danari.male", (5, 8, 1)), - hair: { - Temp1: Some(("figure.hair.danari.male", (3, 0, -1))), - }, - beard: { - None: None, - Some: None, - }, - accessory: { - Nothing: None, - Something: None, - }, + eyes: ("figure.eyes.danari.male-0", (5, 8, 1)), + hair: [ + Some(("figure.hair.danari.male", (3, 0, -1))), + Some(("figure.hair.danari.male", (3, 0, -1))), + ], + beard: [None], + accessory: [ + None] ), (Danari, Female): ( offset: (-9.0, -7.5, -2.25), head: ("figure.head.danari.female", (0, 7, 0)), - eyes: ("figure.eyes.danari.female", (4, 14, 2)), - hair: { - Temp1: Some(("figure.hair.danari.female", (3, 1, -1))), - }, - beard: { - None: None, - Some: None, - }, - accessory: { - Nothing: None, - Something: None, - }, + eyes: ("figure.eyes.danari.female-0", (4, 14, 2)), + hair: [ + Some(("figure.hair.danari.female", (3, 1, -1))), + Some(("figure.hair.danari.female", (3, 1, -1))), + ], + beard: [None], + accessory: [ + None] ), // More here }) \ No newline at end of file diff --git a/assets/voxygen/voxel/sprite/flowers/flower_pink_4.vox b/assets/voxygen/voxel/sprite/flowers/flower_pink_4.vox index 02af3de2bc..194fe1883d 100644 Binary files a/assets/voxygen/voxel/sprite/flowers/flower_pink_4.vox and b/assets/voxygen/voxel/sprite/flowers/flower_pink_4.vox differ diff --git a/common/src/comp/body/humanoid.rs b/common/src/comp/body/humanoid.rs index 6efb9b393f..03a57ef752 100644 --- a/common/src/comp/body/humanoid.rs +++ b/common/src/comp/body/humanoid.rs @@ -11,10 +11,10 @@ pub struct Body { pub hand: Hand, pub foot: Foot, pub shoulder: Shoulder, - pub hair_style: HairStyle, - pub beard: Beard, + pub hair_style: u8, + pub beard: u8, pub eyebrows: Eyebrows, - pub accessory: Accessory, + pub accessory: u8, pub hair_color: u8, pub skin: u8, pub eye_color: u8, @@ -24,24 +24,38 @@ impl Body { pub fn random() -> Self { let mut rng = thread_rng(); let race = *(&ALL_RACES).choose(&mut rng).unwrap(); + let body_type = *(&ALL_BODY_TYPES).choose(&mut rng).unwrap(); Self { race, - body_type: *(&ALL_BODY_TYPES).choose(&mut rng).unwrap(), + body_type, chest: *(&ALL_CHESTS).choose(&mut rng).unwrap(), belt: *(&ALL_BELTS).choose(&mut rng).unwrap(), pants: *(&ALL_PANTS).choose(&mut rng).unwrap(), hand: *(&ALL_HANDS).choose(&mut rng).unwrap(), foot: *(&ALL_FEET).choose(&mut rng).unwrap(), shoulder: *(&ALL_SHOULDERS).choose(&mut rng).unwrap(), - hair_style: *(&ALL_HAIR_STYLES).choose(&mut rng).unwrap(), - beard: *(&ALL_BEARDS).choose(&mut rng).unwrap(), + hair_style: rng.gen_range(0, race.num_hair_styles(body_type)), + beard: rng.gen_range(0, race.num_beards(body_type)), eyebrows: *(&ALL_EYEBROWS).choose(&mut rng).unwrap(), - accessory: *(&ALL_ACCESSORIES).choose(&mut rng).unwrap(), + accessory: rng.gen_range(0, race.num_accessories(body_type)), hair_color: rng.gen_range(0, race.num_hair_colors()) as u8, skin: rng.gen_range(0, race.num_skin_colors()) as u8, eye_color: rng.gen_range(0, race.num_eye_colors()) as u8, } } + + pub fn validate(&mut self) { + self.hair_style = self + .hair_style + .min(self.race.num_hair_styles(self.body_type) - 1); + self.beard = self.beard.min(self.race.num_beards(self.body_type) - 1); + self.hair_color = self.hair_color.min(self.race.num_hair_colors() - 1); + self.skin = self.skin.min(self.race.num_skin_colors() - 1); + self.eye_color = self.hair_style.min(self.race.num_eye_colors() - 1); + self.accessory = self + .accessory + .min(self.race.num_accessories(self.body_type) - 1); + } } #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] @@ -63,80 +77,210 @@ pub const ALL_RACES: [Race; 6] = [ ]; // Hair Colors -pub const DANARI_HAIR_COLORS: [(u8, u8, u8); 4] = [ - (198, 169, 113), - (146, 32, 32), - (199, 131, 58), - (107, 32, 60), +pub const DANARI_HAIR_COLORS: [(u8, u8, u8); 17] = [ + (198, 169, 113), // Philosopher's Grey + (245, 232, 175), // Cream Blonde + (228, 208, 147), // Gold Blonde + (228, 223, 141), // Platinum Blonde + (199, 131, 58), // Summer Blonde + (107, 76, 51), // Oak Brown + (203, 154, 98), // Light Brown + (64, 32, 18), // Chocolate Brown + (86, 72, 71), // Ash Brown + (57, 56, 61), // Raven Black + (101, 83, 95), // Matte Purple + (101, 57, 90), // Witch Purple + (107, 32, 60), // Grape Purple + (168, 45, 47), // Lobster Red + (135, 38, 39), // Dark Red + (88, 26, 29), // Wine Red + (146, 32, 32), // Autumn Red +]; +pub const DWARF_HAIR_COLORS: [(u8, u8, u8); 21] = [ + (245, 232, 175), // Cream Blonde + (228, 208, 147), // Gold Blonde + (228, 223, 141), // Platinum Blonde + (199, 131, 58), // Summer Blonde + (107, 76, 51), // Oak Brown + (203, 154, 98), // Light Brown + (64, 32, 18), // Chocolate Brown + (86, 72, 71), // Ash Brown + (57, 56, 61), // Raven Black + (101, 83, 95), // Matte Purple + (101, 57, 90), // Witch Purple + (168, 45, 47), // Lobster Red + (135, 38, 39), // Dark Red + (88, 26, 29), // Wine Red + (191, 228, 254), // Ice NobleBlue + (92, 80, 144), // Kingfisher Blue + (146, 198, 238), // Lagoon Blue + (174, 148, 161), // Matte Pink + (163, 186, 192), // Matte Green + (84, 139, 107), // Grass Green + (48, 61, 52), // Dark Green +]; +pub const ELF_HAIR_COLORS: [(u8, u8, u8); 24] = [ + (66, 83, 113), // Mysterious Blue + (13, 76, 41), // Rainforest Green + (245, 232, 175), // Cream Blonde + (228, 208, 147), // Gold Blonde + (228, 223, 141), // Platinum Blonde + (199, 131, 58), // Summer Blonde + (107, 76, 51), // Oak Brown + (203, 154, 98), // Light Brown + (64, 32, 18), // Chocolate Brown + (86, 72, 71), // Ash Brown + (57, 56, 61), // Raven Black + (101, 83, 95), // Matte Purple + (101, 57, 90), // Witch Purple + (168, 45, 47), // Lobster Red + (135, 38, 39), // Dark Red + (88, 26, 29), // Wine Red + (191, 228, 254), // Ice Blue + (92, 80, 144), // Kingfisher Blue + (146, 198, 238), // Lagoon Blue + (224, 182, 184), // Candy Pink + (174, 148, 161), // Matte Pink + (163, 186, 192), // Matte Green + (84, 139, 107), // Grass Green + (48, 61, 52), // Dark Green +]; +pub const HUMAN_HAIR_COLORS: [(u8, u8, u8); 22] = [ + (245, 232, 175), // Cream Blonde + (228, 208, 147), // Gold Blonde + (228, 223, 141), // Platinum Blonde + (199, 131, 58), // Summer Blonde + (107, 76, 51), // Oak Brown + (203, 154, 98), // Light Brown + (64, 32, 18), // Chocolate Brown + (86, 72, 71), // Ash Brown + (57, 56, 61), // Raven Black + (101, 83, 95), // Matte Purple + (101, 57, 90), // Witch Purple + (168, 45, 47), // Lobster Red + (135, 38, 39), // Dark Red + (88, 26, 29), // Wine Red + (191, 228, 254), // Ice Blue + (92, 80, 144), // Kingfisher Blue + (146, 198, 238), // Lagoon Blue + (224, 182, 184), // Candy Pink + (174, 148, 161), // Matte Pink + (163, 186, 192), // Matte Green + (84, 139, 107), // Grass Green + (48, 61, 52), // Dark Green +]; +pub const ORC_HAIR_COLORS: [(u8, u8, u8); 15] = [ + (66, 66, 59), // Wise Grey + (125, 111, 51), // Muddy Blonde + (199, 131, 58), // Summer Blonde + (107, 76, 51), // Oak Brown + (203, 154, 98), // Light Brown + (64, 32, 18), // Chocolate Brown + (54, 30, 26), // Dark Chocolate + (86, 72, 71), // Ash Brown + (57, 56, 61), // Raven Black + (101, 83, 95), // Matte Purple + (101, 57, 90), // Witch Purple + (168, 45, 47), // Lobster Red + (135, 38, 39), // Dark Red + (88, 26, 29), // Wine Red + (66, 83, 113), // Mysterious Blue +]; +pub const UNDEAD_HAIR_COLORS: [(u8, u8, u8); 25] = [ + (245, 232, 175), // Cream Blonde + (228, 208, 147), // Gold Blonde + (228, 223, 141), // Platinum Blonde + (199, 131, 58), // Summer Blonde + (107, 76, 51), // Oak Brown + (203, 154, 98), // Light Brown + (64, 32, 18), // Chocolate Brown + (86, 72, 71), // Ash Brown + (57, 56, 61), // Raven Black + (101, 83, 95), // Matte Purple + (101, 57, 90), // Witch Purple + (111, 54, 117), // Punky Purple + (168, 45, 47), // Lobster Red + (135, 38, 39), // Dark Red + (88, 26, 29), // Wine Red + (191, 228, 254), // Ice Blue + (92, 80, 144), // Kingfisher Blue + (146, 198, 238), // Lagoon Blue + (66, 66, 59), // Decayed Grey + (224, 182, 184), // Candy Pink + (174, 148, 161), // Matte Pink + (0, 131, 122), // Rotten Green + (163, 186, 192), // Matte Green + (84, 139, 107), // Grass Green + (48, 61, 52), // Dark Green ]; -pub const DWARF_HAIR_COLORS: [(u8, u8, u8); 3] = [(126, 26, 26), (54, 46, 38), (99, 75, 49)]; -pub const ELF_HAIR_COLORS: [(u8, u8, u8); 3] = [(66, 83, 113), (13, 76, 41), (189, 185, 126)]; -pub const HUMAN_HAIR_COLORS: [(u8, u8, u8); 3] = [(107, 76, 51), (161, 63, 18), (64, 32, 18)]; -pub const ORC_HAIR_COLORS: [(u8, u8, u8); 3] = [(66, 66, 59), (54, 30, 26), (125, 111, 51)]; -pub const UNDEAD_HAIR_COLORS: [(u8, u8, u8); 3] = [(0, 131, 122), (66, 66, 59), (111, 54, 117)]; // Skin colors -pub const DANARI_SKIN_COLORS: [(u8, u8, u8); 4] = [ - (104, 168, 196), - (30, 149, 201), - (57, 120, 148), - (40, 85, 105), +pub const DANARI_SKIN_COLORS: [Skin; 4] = [ + Skin::DanariOne, + Skin::DanariTwo, + Skin::DanariThree, + Skin::DanariFour, ]; -pub const DWARF_SKIN_COLORS: [(u8, u8, u8); 3] = [(215, 175, 123), (191, 125, 94), (212, 128, 89)]; -pub const ELF_SKIN_COLORS: [(u8, u8, u8); 3] = [(176, 161, 181), (132, 139, 161), (138, 119, 201)]; -pub const HUMAN_SKIN_COLORS: [(u8, u8, u8); 3] = [(255, 200, 159), (186, 140, 104), (87, 57, 34)]; -pub const ORC_SKIN_COLORS: [(u8, u8, u8); 3] = [(77, 150, 51), (82, 117, 36), (71, 94, 42)]; -pub const UNDEAD_SKIN_COLORS: [(u8, u8, u8); 3] = - [(255, 255, 255), (178, 178, 178), (145, 135, 121)]; +pub const DWARF_SKIN_COLORS: [Skin; 7] = [ + Skin::White, + Skin::Tanned, + Skin::Brown, + Skin::TannedBrown, + Skin::TannedDarkBrown, + Skin::Iron, + Skin::Steel, +]; +pub const ELF_SKIN_COLORS: [Skin; 7] = [ + Skin::ElfOne, + Skin::ElfTwo, + Skin::ElfThree, + Skin::White, + Skin::Tanned, + Skin::Brown, + Skin::TannedBrown, +]; +pub const HUMAN_SKIN_COLORS: [Skin; 9] = [ + Skin::Pale, + Skin::White, + Skin::Tanned, + Skin::Brown, + Skin::TannedBrown, + Skin::TannedDarkBrown, + Skin::Black, + Skin::Blacker, + Skin::TannedBlack, +]; +pub const ORC_SKIN_COLORS: [Skin; 3] = [Skin::OrcOne, Skin::OrcTwo, Skin::OrcThree]; +pub const UNDEAD_SKIN_COLORS: [Skin; 3] = [Skin::UndeadOne, Skin::UndeadTwo, Skin::UndeadThree]; // Eye colors -pub const DANARI_EYE_COLORS: [EyeColor; 6] = [ - EyeColor::Black, - EyeColor::Blue, - EyeColor::Green, - EyeColor::Brown, - EyeColor::Red, - EyeColor::Orange, +pub const DANARI_EYE_COLORS: [EyeColor; 3] = [ + EyeColor::CuriousGreen, + EyeColor::LoyalBrown, + EyeColor::ViciousRed, ]; -pub const DWARF_EYE_COLORS: [EyeColor; 6] = [ - EyeColor::Black, - EyeColor::Blue, - EyeColor::Green, - EyeColor::Brown, - EyeColor::Red, - EyeColor::Orange, +pub const DWARF_EYE_COLORS: [EyeColor; 3] = [ + EyeColor::CuriousGreen, + EyeColor::LoyalBrown, + EyeColor::NobleBlue, ]; -pub const ELF_EYE_COLORS: [EyeColor; 6] = [ - EyeColor::Black, - EyeColor::Blue, - EyeColor::Green, - EyeColor::Brown, - EyeColor::Red, - EyeColor::Orange, +pub const ELF_EYE_COLORS: [EyeColor; 3] = [ + EyeColor::NobleBlue, + EyeColor::CuriousGreen, + EyeColor::LoyalBrown, ]; -pub const HUMAN_EYE_COLORS: [EyeColor; 6] = [ - EyeColor::Black, - EyeColor::Blue, - EyeColor::Green, - EyeColor::Brown, - EyeColor::Red, - EyeColor::Orange, +pub const HUMAN_EYE_COLORS: [EyeColor; 3] = [ + EyeColor::NobleBlue, + EyeColor::CuriousGreen, + EyeColor::LoyalBrown, ]; -pub const ORC_EYE_COLORS: [EyeColor; 6] = [ - EyeColor::Black, - EyeColor::Blue, - EyeColor::Green, - EyeColor::Brown, - EyeColor::Red, - EyeColor::Orange, -]; -pub const UNDEAD_EYE_COLORS: [EyeColor; 6] = [ - EyeColor::Black, - EyeColor::Blue, - EyeColor::Green, - EyeColor::Brown, - EyeColor::Red, - EyeColor::Orange, +pub const ORC_EYE_COLORS: [EyeColor; 2] = [EyeColor::LoyalBrown, EyeColor::ViciousRed]; +pub const UNDEAD_EYE_COLORS: [EyeColor; 5] = [ + EyeColor::ViciousRed, + EyeColor::PumpkinOrange, + EyeColor::GhastlyYellow, + EyeColor::MagicPurple, + EyeColor::ToxicGreen, ]; impl Race { @@ -150,7 +294,7 @@ impl Race { Race::Undead => &UNDEAD_HAIR_COLORS, } } - fn skin_colors(self) -> &'static [(u8, u8, u8)] { + fn skin_colors(self) -> &'static [Skin] { match self { Race::Danari => &DANARI_SKIN_COLORS, Race::Dwarf => &DWARF_SKIN_COLORS, @@ -177,27 +321,74 @@ impl Race { .unwrap_or((0, 0, 0)) .into() } - pub fn num_hair_colors(self) -> usize { - self.hair_colors().len() + pub fn num_hair_colors(self) -> u8 { + self.hair_colors().len() as u8 } - pub fn skin_color(self, val: u8) -> Rgb { + pub fn skin_color(self, val: u8) -> Skin { self.skin_colors() .get(val as usize) .copied() - .unwrap_or((0, 0, 0)) - .into() + .unwrap_or(Skin::Tanned) } - pub fn num_skin_colors(self) -> usize { - self.skin_colors().len() + pub fn num_skin_colors(self) -> u8 { + self.skin_colors().len() as u8 } pub fn eye_color(self, val: u8) -> EyeColor { self.eye_colors() .get(val as usize) .copied() - .unwrap_or(EyeColor::Blue) + .unwrap_or(EyeColor::NobleBlue) } - pub fn num_eye_colors(self) -> usize { - self.eye_colors().len() + pub fn num_eye_colors(self) -> u8 { + self.eye_colors().len() as u8 + } + pub fn num_hair_styles(self, body_type: BodyType) -> u8 { + match (self, body_type) { + (Race::Danari, BodyType::Female) => 2, + (Race::Danari, BodyType::Male) => 2, + (Race::Dwarf, BodyType::Female) => 2, + (Race::Dwarf, BodyType::Male) => 3, + (Race::Elf, BodyType::Female) => 21, + (Race::Elf, BodyType::Male) => 1, + (Race::Human, BodyType::Female) => 19, + (Race::Human, BodyType::Male) => 3, + (Race::Orc, BodyType::Female) => 1, + (Race::Orc, BodyType::Male) => 2, + (Race::Undead, BodyType::Female) => 4, + (Race::Undead, BodyType::Male) => 3, + } + } + pub fn num_accessories(self, body_type: BodyType) -> u8 { + match (self, body_type) { + (Race::Danari, BodyType::Female) => 1, + (Race::Danari, BodyType::Male) => 1, + (Race::Dwarf, BodyType::Female) => 1, + (Race::Dwarf, BodyType::Male) => 1, + (Race::Elf, BodyType::Female) => 1, + (Race::Elf, BodyType::Male) => 1, + (Race::Human, BodyType::Female) => 1, + (Race::Human, BodyType::Male) => 1, + (Race::Orc, BodyType::Female) => 3, + (Race::Orc, BodyType::Male) => 3, + (Race::Undead, BodyType::Female) => 1, + (Race::Undead, BodyType::Male) => 1, + } + } + pub fn num_beards(self, body_type: BodyType) -> u8 { + match (self, body_type) { + (Race::Danari, BodyType::Female) => 1, + (Race::Danari, BodyType::Male) => 1, + (Race::Dwarf, BodyType::Female) => 1, + (Race::Dwarf, BodyType::Male) => 20, + (Race::Elf, BodyType::Female) => 1, + (Race::Elf, BodyType::Male) => 1, + (Race::Human, BodyType::Female) => 1, + (Race::Human, BodyType::Male) => 2, + (Race::Orc, BodyType::Female) => 1, + (Race::Orc, BodyType::Male) => 2, + (Race::Undead, BodyType::Female) => 1, + (Race::Undead, BodyType::Male) => 1, + } } } @@ -251,15 +442,17 @@ pub const ALL_PANTS: [Pants; 5] = [ #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Hand { - Default, + Bare, + Dark, } -pub const ALL_HANDS: [Hand; 1] = [Hand::Default]; +pub const ALL_HANDS: [Hand; 2] = [Hand::Bare, Hand::Dark]; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Foot { + Bare, Dark, } -pub const ALL_FEET: [Foot; 1] = [Foot::Dark]; +pub const ALL_FEET: [Foot; 2] = [Foot::Bare, Foot::Dark]; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Shoulder { @@ -268,13 +461,6 @@ pub enum Shoulder { } pub const ALL_SHOULDERS: [Shoulder; 2] = [Shoulder::None, Shoulder::Brown1]; -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -pub enum HairStyle { - Temp1, - Temp2, -} -pub const ALL_HAIR_STYLES: [HairStyle; 2] = [HairStyle::Temp1, HairStyle::Temp2]; - #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Eyebrows { Yup, @@ -283,32 +469,41 @@ pub const ALL_EYEBROWS: [Eyebrows; 1] = [Eyebrows::Yup]; #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum EyeColor { - Black, - Blue, - Green, - Brown, - Red, - Orange, + VigorousBlack, + NobleBlue, + CuriousGreen, + LoyalBrown, + ViciousRed, + PumpkinOrange, + GhastlyYellow, + MagicPurple, + ToxicGreen, } impl EyeColor { pub fn light_rgb(self) -> Rgb { match self { - EyeColor::Black => Rgb::new(71, 59, 49), - EyeColor::Blue => Rgb::new(75, 158, 191), - EyeColor::Green => Rgb::new(110, 167, 113), - EyeColor::Brown => Rgb::new(73, 42, 36), - EyeColor::Red => Rgb::new(182, 0, 0), - EyeColor::Orange => Rgb::new(161, 69, 0), + EyeColor::VigorousBlack => Rgb::new(71, 59, 49), + EyeColor::NobleBlue => Rgb::new(75, 158, 191), + EyeColor::CuriousGreen => Rgb::new(110, 167, 113), + EyeColor::LoyalBrown => Rgb::new(73, 42, 36), + EyeColor::ViciousRed => Rgb::new(182, 0, 0), + EyeColor::PumpkinOrange => Rgb::new(220, 156, 19), + EyeColor::GhastlyYellow => Rgb::new(221, 225, 31), + EyeColor::MagicPurple => Rgb::new(137, 4, 177), + EyeColor::ToxicGreen => Rgb::new(1, 223, 1), } } pub fn dark_rgb(self) -> Rgb { match self { - EyeColor::Black => Rgb::new(32, 32, 32), - EyeColor::Blue => Rgb::new(62, 130, 159), - EyeColor::Green => Rgb::new(81, 124, 84), - EyeColor::Brown => Rgb::new(54, 30, 26), - EyeColor::Red => Rgb::new(148, 0, 0), - EyeColor::Orange => Rgb::new(148, 64, 0), + EyeColor::VigorousBlack => Rgb::new(32, 32, 32), + EyeColor::NobleBlue => Rgb::new(62, 130, 159), + EyeColor::CuriousGreen => Rgb::new(81, 124, 84), + EyeColor::LoyalBrown => Rgb::new(54, 30, 26), + EyeColor::ViciousRed => Rgb::new(148, 0, 0), + EyeColor::PumpkinOrange => Rgb::new(209, 145, 18), + EyeColor::GhastlyYellow => Rgb::new(205, 212, 29), + EyeColor::MagicPurple => Rgb::new(110, 3, 143), + EyeColor::ToxicGreen => Rgb::new(1, 185, 1), } } pub fn white_rgb(self) -> Rgb { @@ -319,13 +514,123 @@ impl EyeColor { #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] pub enum Accessory { Nothing, - Something, -} -pub const ALL_ACCESSORIES: [Accessory; 2] = [Accessory::Nothing, Accessory::Something]; - -#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] -pub enum Beard { - None, Some, } -pub const ALL_BEARDS: [Beard; 2] = [Beard::None, Beard::Some]; +pub const ALL_ACCESSORIES: [Accessory; 2] = [Accessory::Nothing, Accessory::Some]; + +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] +pub enum Skin { + Pale, + White, + Tanned, + Brown, + TannedBrown, + TannedDarkBrown, + Black, + Blacker, + TannedBlack, + Iron, + Steel, + DanariOne, + DanariTwo, + DanariThree, + DanariFour, + ElfOne, + ElfTwo, + ElfThree, + OrcOne, + OrcTwo, + OrcThree, + UndeadOne, + UndeadTwo, + UndeadThree, +} +impl Skin { + pub fn rgb(self) -> Rgb { + let color = match self { + Self::Pale => (252, 211, 179), + Self::White => (253, 195, 164), + Self::Tanned => (253, 206, 150), + Self::Brown => (225, 177, 128), + Self::TannedBrown => (219, 165, 131), + Self::TannedDarkBrown => (189, 131, 93), + Self::Black => (168, 109, 79), + Self::Blacker => (123, 68, 55), + Self::TannedBlack => (118, 60, 36), + Self::Iron => (135, 113, 95), + Self::Steel => (108, 94, 86), + Self::DanariOne => (104, 168, 196), + Self::DanariTwo => (30, 149, 201), + Self::DanariThree => (57, 120, 148), + Self::DanariFour => (40, 85, 105), + Self::ElfOne => (176, 161, 181), + Self::ElfTwo => (132, 139, 161), + Self::ElfThree => (138, 119, 201), + Self::OrcOne => (67, 141, 46), + Self::OrcTwo => (82, 117, 36), + Self::OrcThree => (71, 94, 42), + Self::UndeadOne => (255, 255, 255), + Self::UndeadTwo => (178, 178, 178), + Self::UndeadThree => (145, 135, 121), + }; + Rgb::from(color) + } + pub fn light_rgb(self) -> Rgb { + let color = match self { + Self::Pale => (255, 165, 165), + Self::White => (255, 165, 165), + Self::Tanned => (253, 206, 150), + Self::Brown => (225, 177, 128), + Self::TannedBrown => (219, 165, 131), + Self::TannedDarkBrown => (189, 131, 93), + Self::Black => (168, 109, 79), + Self::Blacker => (123, 68, 55), + Self::TannedBlack => (118, 60, 36), + Self::Iron => (135, 113, 95), + Self::Steel => (108, 94, 86), + Self::DanariOne => (104, 168, 196), + Self::DanariTwo => (30, 149, 201), + Self::DanariThree => (57, 120, 148), + Self::DanariFour => (40, 85, 105), + Self::ElfOne => (176, 161, 181), + Self::ElfTwo => (132, 139, 161), + Self::ElfThree => (138, 119, 201), + Self::OrcOne => (77, 150, 51), + Self::OrcTwo => (85, 124, 37), + Self::OrcThree => (73, 100, 43), + Self::UndeadOne => (255, 255, 255), + Self::UndeadTwo => (178, 178, 178), + Self::UndeadThree => (145, 135, 121), + }; + Rgb::from(color) + } + pub fn dark_rgb(self) -> Rgb { + let color = match self { + Self::Pale => (207, 173, 147), + Self::White => (212, 162, 138), + Self::Tanned => (207, 167, 123), + Self::Brown => (187, 147, 107), + Self::TannedBrown => (219, 165, 131), + Self::TannedDarkBrown => (157, 108, 77), + Self::Black => (168, 109, 79), + Self::Blacker => (123, 68, 55), + Self::TannedBlack => (118, 60, 36), + Self::Iron => (135, 113, 95), + Self::Steel => (108, 94, 86), + Self::DanariOne => (104, 168, 196), + Self::DanariTwo => (30, 149, 201), + Self::DanariThree => (57, 120, 148), + Self::DanariFour => (40, 85, 105), + Self::ElfOne => (176, 161, 181), + Self::ElfTwo => (132, 139, 161), + Self::ElfThree => (138, 119, 201), + Self::OrcOne => (68, 129, 44), + Self::OrcTwo => (77, 111, 34), + Self::OrcThree => (68, 91, 40), + Self::UndeadOne => (255, 255, 255), + Self::UndeadTwo => (178, 178, 178), + Self::UndeadThree => (145, 135, 121), + }; + Rgb::from(color) + } +} diff --git a/common/src/figure/mat_cell.rs b/common/src/figure/mat_cell.rs index 905457f3b0..0154054f8c 100644 --- a/common/src/figure/mat_cell.rs +++ b/common/src/figure/mat_cell.rs @@ -4,6 +4,8 @@ use vek::*; #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub enum Material { Skin, + SkinDark, + SkinLight, Hair, EyeDark, EyeLight, diff --git a/common/src/figure/mod.rs b/common/src/figure/mod.rs index eda0bc23cf..cf06ac7651 100644 --- a/common/src/figure/mod.rs +++ b/common/src/figure/mod.rs @@ -129,6 +129,23 @@ impl MatSegment { } vol } + /// Transform cells + pub fn map(mut self, transform: impl Fn(MatCell) -> Option) -> Self { + for pos in self.full_pos_iter() { + if let Some(new) = transform(*self.get(pos).unwrap()) { + self.set(pos, new).unwrap(); + } + } + + self + } + /// Transform cell colors + pub fn map_rgb(self, transform: impl Fn(Rgb) -> Rgb) -> Self { + self.map(|cell| match cell { + MatCell::Normal(rgb) => Some(MatCell::Normal(transform(rgb))), + _ => None, + }) + } } impl From<&DotVoxData> for MatSegment { @@ -152,9 +169,9 @@ impl From<&DotVoxData> for MatSegment { 1 => MatCell::Mat(Material::Hair), 2 => MatCell::Mat(Material::EyeDark), 3 => MatCell::Mat(Material::EyeLight), + 4 => MatCell::Mat(Material::SkinLight), + 5 => MatCell::Mat(Material::SkinDark), 7 => MatCell::Mat(Material::EyeWhite), - //1 => MatCell::Mat(Material::HairLight), - //1 => MatCell::Mat(Material::HairDark), //6 => MatCell::Mat(Material::Clothing), index => { let color = palette diff --git a/voxygen/src/anim/character/idle.rs b/voxygen/src/anim/character/idle.rs index 85806d6372..5fc5e0ab74 100644 --- a/voxygen/src/anim/character/idle.rs +++ b/voxygen/src/anim/character/idle.rs @@ -2,12 +2,9 @@ use super::{ super::{Animation, SkeletonAttr}, CharacterSkeleton, }; -use std::{f32::consts::PI, ops::Mul}; +use std::f32::consts::PI; use vek::*; -pub struct Input { - pub attack: bool, -} pub struct IdleAnimation; impl Animation for IdleAnimation { @@ -16,7 +13,7 @@ impl Animation for IdleAnimation { fn update_skeleton( skeleton: &Self::Skeleton, - global_time: f64, + _global_time: f64, anim_time: f64, _rate: &mut f32, skeleton_attr: &SkeletonAttr, @@ -25,8 +22,9 @@ impl Animation for IdleAnimation { let wave_ultra_slow = (anim_time as f32 * 1.0 + PI).sin(); let wave_ultra_slow_cos = (anim_time as f32 * 1.0 + PI).cos(); + let wave_ultra_slow_abs = ((anim_time as f32 * 0.5 + PI).sin()) + 1.0; - let head_look = Vec2::new( + /*let head_look = Vec2::new( ((global_time + anim_time) as f32 / 12.0) .floor() .mul(7331.0) @@ -37,25 +35,26 @@ impl Animation for IdleAnimation { .mul(1337.0) .sin() * 0.25, - ); + );*/ next.head.offset = Vec3::new( 0.0 + skeleton_attr.neck_right, 0.0 + skeleton_attr.neck_forward, - skeleton_attr.neck_height + 15.0 + wave_ultra_slow * 0.3, + skeleton_attr.neck_height + 15.0 + wave_ultra_slow * 0.1, ); - next.head.ori = - Quaternion::rotation_z(head_look.x) * Quaternion::rotation_x(head_look.y.abs()); + /*next.head.ori = + Quaternion::rotation_z(head_look.x) * Quaternion::rotation_x(head_look.y.abs());*/ + next.head.scale = Vec3::one() * skeleton_attr.head_scale; - next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + wave_ultra_slow * 0.3); + next.chest.offset = Vec3::new(0.0, 0.0, 7.0 + wave_ultra_slow * 0.1); next.chest.ori = Quaternion::rotation_x(0.0); - next.chest.scale = Vec3::one(); + next.chest.scale = Vec3::one() + wave_ultra_slow_abs * 0.05; - next.belt.offset = Vec3::new(0.0, 0.0, 5.0 + wave_ultra_slow * 0.3); + next.belt.offset = Vec3::new(0.0, 0.0, 5.0 + wave_ultra_slow * 0.1); next.belt.ori = Quaternion::rotation_x(0.0); - next.belt.scale = Vec3::one(); + next.belt.scale = Vec3::one() + wave_ultra_slow_abs * 0.05; - next.shorts.offset = Vec3::new(0.0, 0.0, 2.0 + wave_ultra_slow * 0.3); + next.shorts.offset = Vec3::new(0.0, 0.0, 2.0 + wave_ultra_slow * 0.1); next.shorts.ori = Quaternion::rotation_x(0.0); next.shorts.scale = Vec3::one(); @@ -71,10 +70,10 @@ impl Animation for IdleAnimation { next.r_hand.offset = Vec3::new( 7.5, 0.0 + wave_ultra_slow_cos * 0.15, - 0.0 + wave_ultra_slow * 0.5, + 0.0 + wave_ultra_slow * 0.5 + wave_ultra_slow_abs * -0.05, ); next.r_hand.ori = Quaternion::rotation_x(0.0 + wave_ultra_slow * -0.06); - next.r_hand.scale = Vec3::one(); + next.r_hand.scale = Vec3::one() + wave_ultra_slow_abs * -0.05; next.l_foot.offset = Vec3::new(-3.4, -0.1, 8.0); next.l_foot.ori = Quaternion::identity(); @@ -90,15 +89,15 @@ impl Animation for IdleAnimation { 15.0, ); next.weapon.ori = Quaternion::rotation_y(2.5) * Quaternion::rotation_z(1.57); - next.weapon.scale = Vec3::one(); + next.weapon.scale = Vec3::one() + wave_ultra_slow_abs * -0.05; next.l_shoulder.offset = Vec3::new(-5.0, 0.0, 4.7); next.l_shoulder.ori = Quaternion::rotation_x(0.0); - next.l_shoulder.scale = Vec3::one() * 1.1; + next.l_shoulder.scale = (Vec3::one() + wave_ultra_slow_abs * -0.05) * 1.15; next.r_shoulder.offset = Vec3::new(5.0, 0.0, 4.7); next.r_shoulder.ori = Quaternion::rotation_x(0.0); - next.r_shoulder.scale = Vec3::one() * 1.1; + next.r_shoulder.scale = (Vec3::one() + wave_ultra_slow_abs * -0.05) * 1.15; next.draw.offset = Vec3::new(0.0, 5.0, 0.0); next.draw.ori = Quaternion::rotation_y(0.0); diff --git a/voxygen/src/hud/spell.rs b/voxygen/src/hud/spell.rs index 2802e86d86..0f6229da1c 100644 --- a/voxygen/src/hud/spell.rs +++ b/voxygen/src/hud/spell.rs @@ -15,9 +15,6 @@ widget_ids! { spell_title, frame, content_align, - - - } } diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index ac5010747f..98aa14b23b 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -2,7 +2,8 @@ mod scene; mod ui; use crate::{ - session::SessionState, window::Event, Direction, GlobalState, PlayState, PlayStateResult, + session::SessionState, window::Event as WinEvent, Direction, GlobalState, PlayState, + PlayStateResult, }; use client::{self, Client}; use common::{clock::Clock, comp, msg::ClientState}; @@ -35,16 +36,15 @@ impl PlayState for CharSelectionState { let mut current_client_state = self.client.borrow().get_client_state(); while let ClientState::Pending | ClientState::Registered = current_client_state { - // Handle window events. + // Handle window events for event in global_state.window.fetch_events() { + if self.char_selection_ui.handle_event(event.clone()) { + continue; + } match event { - Event::Close => { + WinEvent::Close => { return PlayStateResult::Shutdown; } - // Pass events to ui. - Event::Ui(event) => { - self.char_selection_ui.handle_event(event); - } // Pass all other events to the scene event => { self.scene.handle_input_event(event); diff --git a/voxygen/src/menu/char_selection/scene.rs b/voxygen/src/menu/char_selection/scene.rs index 9d57cda816..c54a74661f 100644 --- a/voxygen/src/menu/char_selection/scene.rs +++ b/voxygen/src/menu/char_selection/scene.rs @@ -12,7 +12,7 @@ use crate::{ camera::{Camera, CameraMode}, figure::{load_mesh, FigureModelCache, FigureState}, }, - window::Event, + window::{Event, PressState}, }; use client::Client; use common::{ @@ -45,6 +45,9 @@ pub struct Scene { figure_model_cache: FigureModelCache, figure_state: FigureState, + + turning: bool, + char_ori: f32, } impl Scene { @@ -76,6 +79,9 @@ impl Scene { )) .unwrap(), backdrop_state: FigureState::new(renderer, FixtureSkeleton::new()), + + turning: false, + char_ori: 0.0, } } @@ -93,15 +99,23 @@ impl Scene { self.camera.set_aspect_ratio(dims.x as f32 / dims.y as f32); true } + Event::MouseButton(_, state) => { + self.turning = state == PressState::Pressed; + true + } + Event::CursorMove(delta) if self.turning => { + self.char_ori += delta.x * 0.01; + true + } // All other events are unhandled _ => false, } } pub fn maintain(&mut self, renderer: &mut Renderer, client: &Client, body: humanoid::Body) { - self.camera.set_focus_pos(Vec3::unit_z() * 2.0); + self.camera.set_focus_pos(Vec3::unit_z() * 1.5); self.camera.update(client.state().get_time()); - self.camera.set_distance(4.2); + self.camera.set_distance(3.0); // 4.2 self.camera .set_orientation(Vec3::new(client.state().get_time() as f32 * 0.0, 0.0, 0.0)); @@ -142,7 +156,7 @@ impl Scene { self.figure_state.update( renderer, Vec3::zero(), - -Vec3::unit_y(), + Vec3::new(self.char_ori.sin(), -self.char_ori.cos(), 0.0), 1.0, Rgba::broadcast(1.0), 1.0 / 60.0, // TODO: Use actual deltatime here? diff --git a/voxygen/src/menu/char_selection/ui.rs b/voxygen/src/menu/char_selection/ui.rs index b98027c35a..4214c9b37d 100644 --- a/voxygen/src/menu/char_selection/ui.rs +++ b/voxygen/src/menu/char_selection/ui.rs @@ -1,9 +1,9 @@ +use crate::window::{Event as WinEvent, PressState}; use crate::{ render::{Consts, Globals, Renderer}, ui::{ - self, - img_ids::{BlankGraphic, ImageGraphic, VoxelGraphic}, - ImageSlider, Ui, + img_ids::{BlankGraphic, ImageGraphic, VoxelGraphic, VoxelMs9Graphic}, + ImageFrame, ImageSlider, Tooltip, Tooltipable, Ui, }, GlobalState, }; @@ -35,6 +35,7 @@ widget_ids! { divider, bodyrace_text, facialfeatures_text, + char_delete, // REMOVE THIS AFTER IMPLEMENTATION daggers_grey, @@ -73,6 +74,7 @@ widget_ids! { elf_skin_bg, danari_skin_bg, name_input_bg, + info, // Sliders hairstyle_slider, @@ -151,6 +153,11 @@ image_ids! { slider_range: "voxygen.element.slider.track", slider_indicator: "voxygen.element.slider.indicator", + + delete_button: "voxygen.element.buttons.x_red", + delete_button_hover: "voxygen.element.buttons.x_red_hover", + delete_button_press: "voxygen.element.buttons.x_red_press", + // Tool Icons @@ -186,6 +193,15 @@ image_ids! { nothing: (), } } +rotation_image_ids! { + pub struct ImgsRot { + + + // Tooltip Test + tt_side: "voxygen/element/frames/tt_test_edge", + tt_corner: "voxygen/element/frames/tt_test_corner_tr", + } +} font_ids! { pub struct Fonts { @@ -202,12 +218,21 @@ pub enum Event { const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0); const TEXT_COLOR_2: Color = Color::Rgba(1.0, 1.0, 1.0, 0.2); +/*enum InfoContent { + //Deletion, + Name, +}*/ + pub struct CharSelectionUi { ui: Ui, ids: Ids, imgs: Imgs, + rot_imgs: ImgsRot, fonts: Fonts, character_creation: bool, + /*info_content: InfoContent, + info_window: bool, + deletion_confirmation: bool,*/ pub character_name: String, pub character_body: humanoid::Body, pub character_tool: Option, @@ -224,6 +249,7 @@ impl CharSelectionUi { let ids = Ids::new(ui.id_generator()); // Load images let imgs = Imgs::load(&mut ui).expect("Failed to load images!"); + let rot_imgs = ImgsRot::load(&mut ui).expect("Failed to load images!"); // Load fonts let fonts = Fonts::load(&mut ui).expect("Failed to load fonts!"); @@ -232,7 +258,11 @@ impl CharSelectionUi { ui, ids, imgs, + rot_imgs, fonts, + //info_window: false, + //info_content: InfoContent::Name, + //deletion_confirmation: false, character_creation: false, character_name: "Character Name".to_string(), character_body: humanoid::Body::random(), @@ -243,8 +273,25 @@ impl CharSelectionUi { // TODO: Split this into multiple modules or functions. fn update_layout(&mut self, client: &Client) -> Vec { let mut events = Vec::new(); - let ref mut ui_widgets = self.ui.set_widgets().0; + let (ref mut ui_widgets, ref mut tooltip_manager) = self.ui.set_widgets(); let version = env!("CARGO_PKG_VERSION"); + // Tooltip + let tooltip_human = Tooltip::new({ + // Edge images [t, b, r, l] + // Corner images [tr, tl, br, bl] + let edge = &self.rot_imgs.tt_side; + let corner = &self.rot_imgs.tt_corner; + ImageFrame::new( + [edge.cw180, edge.none, edge.cw270, edge.cw90], + [corner.none, corner.cw270, corner.cw90, corner.cw180], + Color::Rgba(0.08, 0.07, 0.04, 1.0), + 5.0, + ) + }) + .title_font_size(15) + .desc_font_size(10) + .title_text_color(TEXT_COLOR) + .desc_text_color(TEXT_COLOR_2); // Character Selection ///////////////// if !self.character_creation { @@ -367,6 +414,15 @@ impl CharSelectionUi { .set(self.ids.character_box_1, ui_widgets) .was_clicked() {} + if Button::image(self.imgs.delete_button) + .w_h(30.0 * 0.5, 30.0 * 0.5) + .top_right_with_margins_on(self.ids.character_box_1, 15.0, 15.0) + .hover_image(self.imgs.delete_button_hover) + .press_image(self.imgs.delete_button_press) + .with_tooltip(tooltip_manager, "Delete Character", "", &tooltip_human) + .set(self.ids.char_delete, 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) @@ -532,6 +588,7 @@ impl CharSelectionUi { .was_clicked() { self.character_body.body_type = humanoid::BodyType::Male; + self.character_body.validate(); } // Female Image::new(self.imgs.female) @@ -552,6 +609,7 @@ impl CharSelectionUi { .was_clicked() { self.character_body.body_type = humanoid::BodyType::Female; + self.character_body.validate(); } // Alignment for Races and Tools @@ -559,17 +617,30 @@ impl CharSelectionUi { .mid_bottom_with_margin_on(self.ids.creation_buttons_alignment_1, -324.0) .set(self.ids.creation_buttons_alignment_2, ui_widgets); + let (human_icon, orc_icon, dwarf_icon, elf_icon, undead_icon, danari_icon) = + match self.character_body.body_type { + humanoid::BodyType::Male => ( + self.imgs.human_m, + self.imgs.orc_m, + self.imgs.dwarf_m, + self.imgs.elf_m, + self.imgs.undead_m, + self.imgs.danari_m, + ), + humanoid::BodyType::Female => ( + self.imgs.human_f, + self.imgs.orc_f, + self.imgs.dwarf_f, + self.imgs.elf_f, + self.imgs.undead_f, + self.imgs.danari_f, + ), + }; // Human - Image::new( - if let humanoid::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); + Image::new(human_icon) + .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 humanoid::Race::Human = self.character_body.race { self.imgs.icon_border_pressed } else { @@ -578,23 +649,26 @@ impl CharSelectionUi { .middle_of(self.ids.human) .hover_image(self.imgs.icon_border_mo) .press_image(self.imgs.icon_border_press) + .with_tooltip(tooltip_manager, "Human", "", &tooltip_human) + /*.tooltip_image( + if let humanoid::BodyType::Male = self.character_body.body_type { + self.imgs.human_m + } else { + self.imgs.human_f + }, + )*/ .set(self.ids.race_1, ui_widgets) .was_clicked() { self.character_body.race = humanoid::Race::Human; + self.character_body.validate(); } // Orc - Image::new( - if let humanoid::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); + Image::new(orc_icon) + .w_h(70.0, 70.0) + .right_from(self.ids.human, 2.0) + .set(self.ids.orc, ui_widgets); if Button::image(if let humanoid::Race::Orc = self.character_body.race { self.imgs.icon_border_pressed } else { @@ -603,22 +677,18 @@ impl CharSelectionUi { .middle_of(self.ids.orc) .hover_image(self.imgs.icon_border_mo) .press_image(self.imgs.icon_border_press) + .with_tooltip(tooltip_manager, "Orc", "", &tooltip_human) .set(self.ids.race_2, ui_widgets) .was_clicked() { self.character_body.race = humanoid::Race::Orc; + self.character_body.validate(); } // Dwarf - Image::new( - if let humanoid::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); + Image::new(dwarf_icon) + .w_h(70.0, 70.0) + .right_from(self.ids.orc, 2.0) + .set(self.ids.dwarf, ui_widgets); if Button::image(if let humanoid::Race::Dwarf = self.character_body.race { self.imgs.icon_border_pressed } else { @@ -627,22 +697,18 @@ impl CharSelectionUi { .middle_of(self.ids.dwarf) .hover_image(self.imgs.icon_border_mo) .press_image(self.imgs.icon_border_press) + .with_tooltip(tooltip_manager, "Dwarf", "", &tooltip_human) .set(self.ids.race_3, ui_widgets) .was_clicked() { self.character_body.race = humanoid::Race::Dwarf; + self.character_body.validate(); } // Elf - Image::new( - if let humanoid::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); + Image::new(elf_icon) + .w_h(70.0, 70.0) + .down_from(self.ids.human, 2.0) + .set(self.ids.elf, ui_widgets); if Button::image(if let humanoid::Race::Elf = self.character_body.race { self.imgs.icon_border_pressed } else { @@ -651,22 +717,18 @@ impl CharSelectionUi { .middle_of(self.ids.elf) .hover_image(self.imgs.icon_border_mo) .press_image(self.imgs.icon_border_press) + .with_tooltip(tooltip_manager, "Elf", "", &tooltip_human) .set(self.ids.race_4, ui_widgets) .was_clicked() { self.character_body.race = humanoid::Race::Elf; + self.character_body.validate(); } // Undead - Image::new( - if let humanoid::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); + Image::new(undead_icon) + .w_h(70.0, 70.0) + .right_from(self.ids.elf, 2.0) + .set(self.ids.undead, ui_widgets); if Button::image(if let humanoid::Race::Undead = self.character_body.race { self.imgs.icon_border_pressed } else { @@ -675,34 +737,32 @@ impl CharSelectionUi { .middle_of(self.ids.undead) .hover_image(self.imgs.icon_border_mo) .press_image(self.imgs.icon_border_press) + .with_tooltip(tooltip_manager, "Undead", "", &tooltip_human) .set(self.ids.race_5, ui_widgets) .was_clicked() { self.character_body.race = humanoid::Race::Undead; + self.character_body.validate(); } // Danari - Image::new( - if let humanoid::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); + Image::new(danari_icon) + .w_h(70.0, 70.0) + .right_from(self.ids.undead, 2.0) + .set(self.ids.danari, ui_widgets); if Button::image(if let humanoid::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) + .with_tooltip(tooltip_manager, "Danari", "", &tooltip_human) .set(self.ids.race_6, ui_widgets) .was_clicked() { self.character_body.race = humanoid::Race::Danari; + self.character_body.validate(); } // Hammer @@ -719,6 +779,7 @@ impl CharSelectionUi { .middle_of(self.ids.hammer) .hover_image(self.imgs.icon_border_mo) .press_image(self.imgs.icon_border_press) + .with_tooltip(tooltip_manager, "Hammer", "", &tooltip_human) .set(self.ids.hammer_button, ui_widgets) .was_clicked() { @@ -743,6 +804,7 @@ impl CharSelectionUi { .middle_of(self.ids.bow) //.hover_image(self.imgs.icon_border_mo) //.press_image(self.imgs.icon_border_press) + //.with_tooltip(tooltip_manager, "Bow", "", &tooltip_human) .set(self.ids.bow_button, ui_widgets) .was_clicked() { @@ -765,6 +827,7 @@ impl CharSelectionUi { .middle_of(self.ids.staff) //.hover_image(self.imgs.icon_border_mo) //.press_image(self.imgs.icon_border_press) + //.with_tooltip(tooltip_manager, "Staff", "", &tooltip_human) .set(self.ids.staff_button, ui_widgets) .was_clicked() { @@ -787,6 +850,7 @@ impl CharSelectionUi { .middle_of(self.ids.sword) .hover_image(self.imgs.icon_border_mo) .press_image(self.imgs.icon_border_press) + .with_tooltip(tooltip_manager, "Sword", "", &tooltip_human) .set(self.ids.sword_button, ui_widgets) .was_clicked() { @@ -806,6 +870,7 @@ impl CharSelectionUi { .middle_of(self.ids.daggers) //.hover_image(self.imgs.icon_border_mo) //.press_image(self.imgs.icon_border_press) + //.with_tooltip(tooltip_manager, "Daggers", "", &tooltip_human) .set(self.ids.daggers_button, ui_widgets) .was_clicked() { @@ -828,6 +893,7 @@ impl CharSelectionUi { .middle_of(self.ids.axe) .hover_image(self.imgs.icon_border_mo) .press_image(self.imgs.icon_border_press) + .with_tooltip(tooltip_manager, "Axe", "", &tooltip_human) .set(self.ids.axe_button, ui_widgets) .was_clicked() { @@ -868,27 +934,26 @@ impl CharSelectionUi { .set(slider_id, ui_widgets) }; // Hair Style - let current_hair_style = self.character_body.hair_style; if let Some(new_val) = char_slider( self.ids.creation_buttons_alignment_2, "Hair Style", self.ids.hairstyle_text, - humanoid::ALL_HAIR_STYLES.len() - 1, - humanoid::ALL_HAIR_STYLES - .iter() - .position(|&c| c == current_hair_style) - .unwrap_or(0), + self.character_body + .race + .num_hair_styles(self.character_body.body_type) as usize + - 1, + self.character_body.hair_style as usize, self.ids.hairstyle_slider, ui_widgets, ) { - self.character_body.hair_style = humanoid::ALL_HAIR_STYLES[new_val]; + self.character_body.hair_style = new_val as u8; } // Hair Color if let Some(new_val) = char_slider( self.ids.hairstyle_slider, "Hair Color", self.ids.haircolor_text, - self.character_body.race.num_hair_colors() - 1, + self.character_body.race.num_hair_colors() as usize - 1, self.character_body.hair_color as usize, self.ids.haircolor_slider, ui_widgets, @@ -900,7 +965,7 @@ impl CharSelectionUi { self.ids.haircolor_slider, "Skin", self.ids.skin_text, - self.character_body.race.num_skin_colors() - 1, + self.character_body.race.num_skin_colors() as usize - 1, self.character_body.skin as usize, self.ids.skin_slider, ui_widgets, @@ -928,7 +993,7 @@ impl CharSelectionUi { self.ids.eyebrows_slider, "Eye Color", self.ids.eyecolor_text, - self.character_body.race.num_eye_colors() - 1, + self.character_body.race.num_eye_colors() as usize - 1, self.character_body.eye_color as usize, self.ids.eyecolor_slider, ui_widgets, @@ -936,37 +1001,41 @@ impl CharSelectionUi { self.character_body.eye_color = new_val as u8; } // Accessories - let current_accessory = self.character_body.accessory; + let _current_accessory = self.character_body.accessory; if let Some(new_val) = char_slider( self.ids.eyecolor_slider, "Accessories", self.ids.accessories_text, - humanoid::ALL_ACCESSORIES.len() - 1, - humanoid::ALL_ACCESSORIES - .iter() - .position(|&c| c == current_accessory) - .unwrap_or(0), + self.character_body + .race + .num_accessories(self.character_body.body_type) as usize + - 1, + self.character_body.accessory as usize, self.ids.accessories_slider, ui_widgets, ) { - self.character_body.accessory = humanoid::ALL_ACCESSORIES[new_val]; + self.character_body.accessory = new_val as u8; } // Beard - if let humanoid::BodyType::Male = self.character_body.body_type { - let current_beard = self.character_body.beard; + if self + .character_body + .race + .num_beards(self.character_body.body_type) + > 1 + { if let Some(new_val) = char_slider( self.ids.accessories_slider, "Beard", self.ids.beard_text, - humanoid::ALL_BEARDS.len() - 1, - humanoid::ALL_BEARDS - .iter() - .position(|&c| c == current_beard) - .unwrap_or(0), + self.character_body + .race + .num_beards(self.character_body.body_type) as usize + - 1, + self.character_body.beard as usize, self.ids.beard_slider, ui_widgets, ) { - self.character_body.beard = humanoid::ALL_BEARDS[new_val]; + self.character_body.beard = new_val as u8; } } else { Text::new("Beard") @@ -1022,8 +1091,15 @@ impl CharSelectionUi { events } - pub fn handle_event(&mut self, event: ui::Event) { - self.ui.handle_event(event); + pub fn handle_event(&mut self, event: WinEvent) -> bool { + match event { + WinEvent::Ui(event) => { + self.ui.handle_event(event); + true + } + WinEvent::MouseButton(_, PressState::Pressed) => !self.ui.no_widget_capturing_mouse(), + _ => false, + } } pub fn maintain(&mut self, renderer: &mut Renderer, client: &Client) -> Vec { diff --git a/voxygen/src/menu/main/ui.rs b/voxygen/src/menu/main/ui.rs index d8f0011f2e..e0d001556b 100644 --- a/voxygen/src/menu/main/ui.rs +++ b/voxygen/src/menu/main/ui.rs @@ -3,7 +3,7 @@ use crate::{ ui::{ self, img_ids::{BlankGraphic, ImageGraphic, VoxelGraphic}, - ImageFrame, Tooltip, Tooltipable, Ui, + ImageFrame, Tooltip, Ui, /*Tooltipable,*/ }, GlobalState, }; @@ -159,13 +159,13 @@ impl MainMenuUi { fn update_layout(&mut self, global_state: &mut GlobalState) -> Vec { let mut events = Vec::new(); - let (ref mut ui_widgets, ref mut tooltip_manager) = self.ui.set_widgets(); + let (ref mut ui_widgets, ref mut _tooltip_manager) = self.ui.set_widgets(); let version = env!("CARGO_PKG_VERSION"); const TEXT_COLOR: Color = Color::Rgba(1.0, 1.0, 1.0, 1.0); const TEXT_COLOR_2: Color = Color::Rgba(1.0, 1.0, 1.0, 0.2); // Tooltip - let tooltip = Tooltip::new({ + let _tooltip = Tooltip::new({ // Edge images [t, b, r, l] // Corner images [tr, tl, br, bl] let edge = &self.rot_imgs.tt_side; @@ -499,13 +499,13 @@ impl MainMenuUi { .label_color(TEXT_COLOR) .label_font_size(24) .label_y(Relative::Scalar(5.0)) - .with_tooltip( + /*.with_tooltip( tooltip_manager, "Login", "Click to login with the entered details", &tooltip, ) - .tooltip_image(self.imgs.v_logo) + .tooltip_image(self.imgs.v_logo)*/ .set(self.ids.login_button, ui_widgets) .was_clicked() { diff --git a/voxygen/src/scene/figure/cache.rs b/voxygen/src/scene/figure/cache.rs index b91498d9cf..ddeb9f3fba 100644 --- a/voxygen/src/scene/figure/cache.rs +++ b/voxygen/src/scene/figure/cache.rs @@ -100,7 +100,13 @@ impl FigureModelCache { CameraMode::FirstPerson => None, }, match camera_mode { - CameraMode::ThirdPerson => Some(mesh_chest(body.chest)), + CameraMode::ThirdPerson => Some(mesh_chest( + body.chest, + body.race, + body.skin, + body.hair_color, + body.eye_color, + )), CameraMode::FirstPerson => None, }, match camera_mode { @@ -108,7 +114,13 @@ impl FigureModelCache { CameraMode::FirstPerson => None, }, match camera_mode { - CameraMode::ThirdPerson => Some(mesh_pants(body.pants)), + CameraMode::ThirdPerson => Some(mesh_pants( + body.pants, + body.race, + body.skin, + body.hair_color, + body.eye_color, + )), CameraMode::FirstPerson => None, }, if camera_mode == CameraMode::FirstPerson @@ -118,7 +130,13 @@ impl FigureModelCache { { None } else { - Some(mesh_left_hand(body.hand)) + Some(mesh_left_hand( + body.hand, + body.race, + body.skin, + body.hair_color, + body.eye_color, + )) }, if character_state .map(|cs| cs.movement.is_roll()) @@ -126,14 +144,32 @@ impl FigureModelCache { { None } else { - Some(mesh_right_hand(body.hand)) + Some(mesh_right_hand( + body.hand, + body.race, + body.skin, + body.hair_color, + body.eye_color, + )) }, match camera_mode { - CameraMode::ThirdPerson => Some(mesh_left_foot(body.foot)), + CameraMode::ThirdPerson => Some(mesh_left_foot( + body.foot, + body.race, + body.skin, + body.hair_color, + body.eye_color, + )), CameraMode::FirstPerson => None, }, match camera_mode { - CameraMode::ThirdPerson => Some(mesh_right_foot(body.foot)), + CameraMode::ThirdPerson => Some(mesh_right_foot( + body.foot, + body.race, + body.skin, + body.hair_color, + body.eye_color, + )), CameraMode::FirstPerson => None, }, if camera_mode != CameraMode::FirstPerson @@ -150,15 +186,23 @@ impl FigureModelCache { None }, match camera_mode { - CameraMode::ThirdPerson => { - Some(mesh_left_shoulder(body.shoulder)) - } + CameraMode::ThirdPerson => Some(mesh_left_shoulder( + body.shoulder, + body.race, + body.skin, + body.hair_color, + body.eye_color, + )), CameraMode::FirstPerson => None, }, match camera_mode { - CameraMode::ThirdPerson => { - Some(mesh_right_shoulder(body.shoulder)) - } + CameraMode::ThirdPerson => Some(mesh_right_shoulder( + body.shoulder, + body.race, + body.skin, + body.hair_color, + body.eye_color, + )), CameraMode::FirstPerson => None, }, Some(mesh_draw()), diff --git a/voxygen/src/scene/figure/load.rs b/voxygen/src/scene/figure/load.rs index 695c2bc8d1..7643305880 100644 --- a/voxygen/src/scene/figure/load.rs +++ b/voxygen/src/scene/figure/load.rs @@ -6,8 +6,7 @@ use common::{ assets::{self, watch::ReloadIndicator, Asset}, comp::{ humanoid::{ - Accessory, Beard, Belt, BodyType, Chest, EyeColor, Eyebrows, Foot, HairStyle, Hand, - Pants, Race, Shoulder, + Belt, BodyType, Chest, EyeColor, Eyebrows, Foot, Hand, Pants, Race, Shoulder, Skin, }, item::Tool, object, quadruped, quadruped_medium, Item, @@ -42,19 +41,25 @@ fn graceful_load_mat_segment(mesh_name: &str) -> MatSegment { MatSegment::from(graceful_load_vox(mesh_name).as_ref()) } +fn generate_mesh(segment: &Segment, offset: Vec3) -> Mesh { + Meshable::::generate_mesh(segment, offset).0 +} + pub fn load_mesh(mesh_name: &str, position: Vec3) -> Mesh { - Meshable::::generate_mesh(&load_segment(mesh_name), position).0 + generate_mesh(&load_segment(mesh_name), position) } fn color_segment( mat_segment: MatSegment, - skin: Rgb, + skin: Skin, hair_color: Rgb, eye_color: EyeColor, ) -> Segment { // TODO move some of the colors to common mat_segment.to_segment(|mat| match mat { - Material::Skin => skin, + Material::Skin => skin.rgb(), + Material::SkinDark => skin.light_rgb(), + Material::SkinLight => skin.dark_rgb(), Material::Hair => hair_color, // TODO add back multiple colors Material::EyeLight => eye_color.light_rgb(), @@ -63,33 +68,32 @@ fn color_segment( }) } -fn recolor_greys(segment: Segment, color: Rgb) -> Segment { +fn recolor_grey(rgb: Rgb, color: Rgb) -> Rgb { use common::util::{linear_to_srgb, srgb_to_linear}; - segment.map_rgb(|rgb| { - const BASE_GREY: f32 = 178.0; - if rgb.r == rgb.g && rgb.g == rgb.b { - let c1 = srgb_to_linear(rgb.map(|e| e as f32 / BASE_GREY)); - let c2 = srgb_to_linear(color.map(|e| e as f32 / 255.0)); + const BASE_GREY: f32 = 178.0; + if rgb.r == rgb.g && rgb.g == rgb.b { + let c1 = srgb_to_linear(rgb.map(|e| e as f32 / BASE_GREY)); + let c2 = srgb_to_linear(color.map(|e| e as f32 / 255.0)); - linear_to_srgb(c1 * c2).map(|e| (e.min(1.0).max(0.0) * 255.0) as u8) - } else { - rgb - } - }) + linear_to_srgb(c1 * c2).map(|e| (e.min(1.0).max(0.0) * 255.0) as u8) + } else { + rgb + } } +// All offsets should be relative to an initial origin that doesn't change when combining segments #[derive(Serialize, Deserialize)] -struct VoxSpec(String, [i32; 3]); // All offsets should be relative to an initial origin that doesn't change when combining segments - // All reliant on humanoid::Race and humanoid::BodyType +struct VoxSpec(String, [i32; 3]); +// All reliant on humanoid::Race and humanoid::BodyType #[derive(Serialize, Deserialize)] struct HumHeadSubSpec { offset: [f32; 3], // Should be relative to initial origin head: VoxSpec, eyes: VoxSpec, - hair: HashMap>, - beard: HashMap>, - accessory: HashMap>, + hair: Vec>, + beard: Vec>, + accessory: Vec>, } #[derive(Serialize, Deserialize)] pub struct HumHeadSpec(HashMap<(Race, BodyType), HumHeadSubSpec>); @@ -110,12 +114,12 @@ impl HumHeadSpec { race: Race, body_type: BodyType, hair_color: u8, - hair_style: HairStyle, - beard: Beard, + hair_style: u8, + beard: u8, eye_color: u8, skin: u8, _eyebrows: Eyebrows, - accessory: Accessory, + accessory: u8, ) -> Mesh { let spec = match self.0.get(&(race, body_type)) { Some(spec) => spec, @@ -129,26 +133,31 @@ impl HumHeadSpec { }; let hair_rgb = race.hair_color(hair_color); - let skin_rgb = race.skin_color(skin); - let eye_color = race.eye_color(eye_color); + let skin = race.skin_color(skin); + let eye_rgb = race.eye_color(eye_color); // Load segment pieces let bare_head = graceful_load_mat_segment(&spec.head.0); - let eyes = graceful_load_mat_segment(&spec.eyes.0); - let hair = match spec.hair.get(&hair_style) { + let eyes = color_segment( + graceful_load_mat_segment(&spec.eyes.0).map_rgb(|rgb| recolor_grey(rgb, hair_rgb)), + skin, + hair_rgb, + eye_rgb, + ); + let hair = match spec.hair.get(hair_style as usize) { Some(Some(spec)) => Some(( - recolor_greys(graceful_load_segment(&spec.0), hair_rgb), + graceful_load_segment(&spec.0).map_rgb(|rgb| recolor_grey(rgb, hair_rgb)), Vec3::from(spec.1), )), Some(None) => None, None => { - warn!("No specification for this hair style: {:?}", hair_style); + warn!("No specification for hair style {}", hair_style); None } }; - let beard = match spec.beard.get(&beard) { + let beard = match spec.beard.get(beard as usize) { Some(Some(spec)) => Some(( - recolor_greys(graceful_load_segment(&spec.0), hair_rgb), + graceful_load_segment(&spec.0).map_rgb(|rgb| recolor_grey(rgb, hair_rgb)), Vec3::from(spec.1), )), Some(None) => None, @@ -157,7 +166,7 @@ impl HumHeadSpec { None } }; - let accessory = match spec.accessory.get(&accessory) { + let accessory = match spec.accessory.get(accessory as usize) { Some(Some(spec)) => Some((graceful_load_segment(&spec.0), Vec3::from(spec.1))), Some(None) => None, None => { @@ -168,28 +177,30 @@ impl HumHeadSpec { let (head, origin_offset) = DynaUnionizer::new() .add( - color_segment(bare_head, skin_rgb, hair_rgb, eye_color), + color_segment(bare_head, skin, hair_rgb, eye_rgb), spec.head.1.into(), ) - .add( - color_segment(eyes, skin_rgb, hair_rgb, eye_color), - spec.eyes.1.into(), - ) + .add(eyes, spec.eyes.1.into()) .maybe_add(hair) .maybe_add(beard) .maybe_add(accessory) .unify(); - Meshable::::generate_mesh( + generate_mesh( &head, Vec3::from(spec.offset) + origin_offset.map(|e| e as f32 * -1.0), ) - .0 } } -pub fn mesh_chest(chest: Chest) -> Mesh { - let color = match chest { +pub fn mesh_chest( + chest: Chest, + race: Race, + skin: u8, + hair_color: u8, + eye_color: u8, +) -> Mesh { + let chest_color = match chest { Chest::Blue => (28, 66, 109), Chest::Brown => (54, 30, 26), Chest::Dark => (24, 19, 17), @@ -197,18 +208,27 @@ pub fn mesh_chest(chest: Chest) -> Mesh { Chest::Orange => (148, 52, 33), }; - let bare_chest = graceful_load_segment("figure.body.chest"); - let chest_armor = graceful_load_segment("armor.chest.grayscale"); + let color = |mat_segment| { + color_segment( + mat_segment, + race.skin_color(skin), + race.hair_color(hair_color), + race.eye_color(eye_color), + ) + }; + + let bare_chest = graceful_load_mat_segment("figure.body.chest"); + let chest_armor = graceful_load_mat_segment("armor.chest.grayscale"); let chest = DynaUnionizer::new() - .add(bare_chest, Vec3::new(0, 0, 0)) + .add(color(bare_chest), Vec3::new(0, 0, 0)) .add( - recolor_greys(chest_armor, Rgb::from(color)), + color(chest_armor.map_rgb(|rgb| recolor_grey(rgb, Rgb::from(chest_color)))), Vec3::new(0, 0, 0), ) .unify() .0; - Meshable::::generate_mesh(&chest, Vec3::new(-6.0, -3.5, 0.0)).0 + generate_mesh(&chest, Vec3::new(-6.0, -3.5, 0.0)) } pub fn mesh_belt(belt: Belt) -> Mesh { @@ -221,7 +241,13 @@ pub fn mesh_belt(belt: Belt) -> Mesh { ) } -pub fn mesh_pants(pants: Pants) -> Mesh { +pub fn mesh_pants( + pants: Pants, + race: Race, + skin: u8, + hair_color: u8, + eye_color: u8, +) -> Mesh { let color = match pants { Pants::Blue => (28, 66, 109), Pants::Brown => (54, 30, 26), @@ -230,52 +256,95 @@ pub fn mesh_pants(pants: Pants) -> Mesh { Pants::Orange => (148, 52, 33), }; - let pants_segment = recolor_greys( - graceful_load_segment("armor.pants.grayscale"), - Rgb::from(color), + let pants_segment = color_segment( + graceful_load_mat_segment("armor.pants.grayscale") + .map_rgb(|rgb| recolor_grey(rgb, Rgb::from(color))), + race.skin_color(skin), + race.hair_color(hair_color), + race.eye_color(eye_color), ); - Meshable::::generate_mesh( - &pants_segment, - Vec3::new(-5.0, -3.5, 0.0), - ) - .0 + generate_mesh(&pants_segment, Vec3::new(-5.0, -3.5, 0.0)) } -pub fn mesh_left_hand(hand: Hand) -> Mesh { - load_mesh( - match hand { - Hand::Default => "figure.body.hand", - }, - Vec3::new(-2.0, -2.5, -2.0), - ) +pub fn mesh_left_hand( + hand: Hand, + race: Race, + skin: u8, + hair_color: u8, + eye_color: u8, +) -> Mesh { + let hand_segment = color_segment( + graceful_load_mat_segment(match hand { + Hand::Bare => "figure.body.hand", + Hand::Dark => "armor.hand.dark-0", + }), + race.skin_color(skin), + race.hair_color(hair_color), + race.eye_color(eye_color), + ); + + generate_mesh(&hand_segment, Vec3::new(-2.0, -2.5, -2.0)) } -pub fn mesh_right_hand(hand: Hand) -> Mesh { - load_mesh( - match hand { - Hand::Default => "figure.body.hand", - }, - Vec3::new(-2.0, -2.5, -2.0), - ) +pub fn mesh_right_hand( + hand: Hand, + race: Race, + skin: u8, + hair_color: u8, + eye_color: u8, +) -> Mesh { + let hand_segment = color_segment( + graceful_load_mat_segment(match hand { + Hand::Bare => "figure.body.hand", + Hand::Dark => "armor.hand.dark-0", + }), + race.skin_color(skin), + race.hair_color(hair_color), + race.eye_color(eye_color), + ); + + generate_mesh(&hand_segment, Vec3::new(-2.0, -2.5, -2.0)) } -pub fn mesh_left_foot(foot: Foot) -> Mesh { - load_mesh( - match foot { - Foot::Dark => "armor.foot.foot_dark", - }, - Vec3::new(-2.5, -3.5, -9.0), - ) +pub fn mesh_left_foot( + foot: Foot, + race: Race, + skin: u8, + hair_color: u8, + eye_color: u8, +) -> Mesh { + let foot_segment = color_segment( + graceful_load_mat_segment(match foot { + Foot::Bare => "figure.body.foot", + Foot::Dark => "armor.foot.dark-0", + }), + race.skin_color(skin), + race.hair_color(hair_color), + race.eye_color(eye_color), + ); + + generate_mesh(&foot_segment, Vec3::new(-2.5, -3.5, -9.0)) } -pub fn mesh_right_foot(foot: Foot) -> Mesh { - load_mesh( - match foot { - Foot::Dark => "armor.foot.foot_dark", - }, - Vec3::new(-2.5, -3.5, -9.0), - ) +pub fn mesh_right_foot( + foot: Foot, + race: Race, + skin: u8, + hair_color: u8, + eye_color: u8, +) -> Mesh { + let foot_segment = color_segment( + graceful_load_mat_segment(match foot { + Foot::Bare => "figure.body.foot", + Foot::Dark => "armor.foot.dark-0", + }), + race.skin_color(skin), + race.hair_color(hair_color), + race.eye_color(eye_color), + ); + + generate_mesh(&foot_segment, Vec3::new(-2.5, -3.5, -9.0)) } pub fn mesh_main(item: Option<&Item>) -> Mesh { @@ -299,24 +368,44 @@ pub fn mesh_main(item: Option<&Item>) -> Mesh { } } -pub fn mesh_left_shoulder(shoulder: Shoulder) -> Mesh { - load_mesh( - match shoulder { +pub fn mesh_left_shoulder( + shoulder: Shoulder, + race: Race, + skin: u8, + hair_color: u8, + eye_color: u8, +) -> Mesh { + let shoulder_segment = color_segment( + graceful_load_mat_segment(match shoulder { Shoulder::None => return Mesh::new(), Shoulder::Brown1 => "armor.shoulder.shoulder_l_brown", - }, - Vec3::new(-2.5, -3.5, -1.5), - ) + }), + race.skin_color(skin), + race.hair_color(hair_color), + race.eye_color(eye_color), + ); + + generate_mesh(&shoulder_segment, Vec3::new(-2.5, -3.5, -1.5)) } -pub fn mesh_right_shoulder(shoulder: Shoulder) -> Mesh { - load_mesh( - match shoulder { +pub fn mesh_right_shoulder( + shoulder: Shoulder, + race: Race, + skin: u8, + hair_color: u8, + eye_color: u8, +) -> Mesh { + let shoulder_segment = color_segment( + graceful_load_mat_segment(match shoulder { Shoulder::None => return Mesh::new(), Shoulder::Brown1 => "armor.shoulder.shoulder_r_brown", - }, - Vec3::new(-2.5, -3.5, -1.5), - ) + }), + race.skin_color(skin), + race.hair_color(hair_color), + race.eye_color(eye_color), + ); + + generate_mesh(&shoulder_segment, Vec3::new(-2.5, -3.5, -1.5)) } // TODO: Inventory diff --git a/voxygen/src/ui/cache.rs b/voxygen/src/ui/cache.rs index ae88334fd3..405233cc48 100644 --- a/voxygen/src/ui/cache.rs +++ b/voxygen/src/ui/cache.rs @@ -27,10 +27,13 @@ impl Cache { let max_texture_size = renderer.max_texture_size(); - let graphic_cache_dims = - Vec2::new(w, h).map(|e| (e * GRAPHIC_CACHE_SIZE).min(max_texture_size as u16)); + let graphic_cache_dims = Vec2::new(w, h).map(|e| { + (e * GRAPHIC_CACHE_SIZE) + .min(max_texture_size as u16) + .max(512) + }); let glyph_cache_dims = - Vec2::new(w, h).map(|e| (e * GLYPH_CACHE_SIZE).min(max_texture_size as u16)); + Vec2::new(w, h).map(|e| (e * GLYPH_CACHE_SIZE).min(max_texture_size as u16).max(512)); Ok(Self { glyph_cache: GlyphCache::builder() @@ -61,9 +64,11 @@ impl Cache { // Resizes and clears the GraphicCache pub fn resize_graphic_cache(&mut self, renderer: &mut Renderer) -> Result<(), Error> { let max_texture_size = renderer.max_texture_size(); - let cache_dims = renderer - .get_resolution() - .map(|e| (e * GRAPHIC_CACHE_SIZE).min(max_texture_size as u16)); + let cache_dims = renderer.get_resolution().map(|e| { + (e * GRAPHIC_CACHE_SIZE) + .min(max_texture_size as u16) + .max(512) + }); self.graphic_cache.clear_cache(cache_dims); self.graphic_cache_tex = renderer.create_dynamic_texture(cache_dims)?; Ok(()) @@ -73,7 +78,7 @@ impl Cache { let max_texture_size = renderer.max_texture_size(); let cache_dims = renderer .get_resolution() - .map(|e| (e * GLYPH_CACHE_SIZE).min(max_texture_size as u16)); + .map(|e| (e * GLYPH_CACHE_SIZE).min(max_texture_size as u16).max(512)); self.glyph_cache = GlyphCache::builder() .dimensions(cache_dims.x as u32, cache_dims.y as u32) .scale_tolerance(SCALE_TOLERANCE) diff --git a/voxygen/src/ui/mod.rs b/voxygen/src/ui/mod.rs index 4b7981f020..5dada295d5 100644 --- a/voxygen/src/ui/mod.rs +++ b/voxygen/src/ui/mod.rs @@ -124,8 +124,8 @@ impl Ui { let mut ui = UiBuilder::new(win_dims).build(); let tooltip_manager = TooltipManager::new( ui.widget_id_generator(), - Duration::from_millis(1000), - Duration::from_millis(1000), + Duration::from_millis(1), + Duration::from_millis(100), scale.scale_factor_logical(), ); diff --git a/voxygen/src/ui/widgets/tooltip.rs b/voxygen/src/ui/widgets/tooltip.rs index dc2219c3c1..6627a8c5bd 100644 --- a/voxygen/src/ui/widgets/tooltip.rs +++ b/voxygen/src/ui/widgets/tooltip.rs @@ -127,11 +127,11 @@ impl TooltipManager { }; match self.state { - HoverState::Hovering(hover) => tooltip(1.0, hover.1, ui), - HoverState::Fading(start, hover, _) => tooltip( - (1.0f32 - start.elapsed().as_millis() as f32 / self.hover_dur.as_millis() as f32) + HoverState::Hovering(Hover(id, xy)) if id == src_id => tooltip(1.0, xy, ui), + HoverState::Fading(start, Hover(id, xy), _) if id == src_id => tooltip( + (0.1f32 - start.elapsed().as_millis() as f32 / self.hover_dur.as_millis() as f32) .max(0.0), - hover.1, + xy, ui, ), HoverState::Start(start, id) if id == src_id && start.elapsed() > self.hover_dur => { @@ -139,7 +139,7 @@ impl TooltipManager { self.state = HoverState::Hovering(Hover(id, xy)); tooltip(1.0, xy, ui); } - HoverState::Start(_, _) | HoverState::None => (), + _ => (), } } } diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index 2bf555ca8f..a0ccf0154e 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -57,6 +57,10 @@ pub enum Event { Char(char), /// The cursor has been panned across the screen while grabbed. CursorPan(Vec2), + /// The cursor has been moved across the screen while ungrabbed. + CursorMove(Vec2), + /// A mouse button has been pressed or released + MouseButton(MouseButton, PressState), /// The camera has been requested to zoom. Zoom(f32), /// A key that the game recognises has been pressed or released. @@ -71,6 +75,9 @@ pub enum Event { Focused(bool), } +pub type MouseButton = winit::MouseButton; +pub type PressState = winit::ElementState; + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Deserialize, Serialize)] pub enum KeyMouse { Key(glutin::VirtualKeyCode), @@ -277,8 +284,10 @@ impl Window { events.push(Event::Resize(Vec2::new(width as u32, height as u32))); } glutin::WindowEvent::ReceivedCharacter(c) => events.push(Event::Char(c)), - glutin::WindowEvent::MouseInput { button, state, .. } if cursor_grabbed => { - if let Some(game_inputs) = key_map.get(&KeyMouse::Mouse(button)) { + glutin::WindowEvent::MouseInput { button, state, .. } => { + if let (true, Some(game_inputs)) = + (cursor_grabbed, key_map.get(&KeyMouse::Mouse(button))) + { for game_input in game_inputs { events.push(Event::InputUpdate( *game_input, @@ -286,6 +295,7 @@ impl Window { )); } } + events.push(Event::MouseButton(button, state)); } glutin::WindowEvent::KeyboardInput { input, .. } => match input.virtual_keycode { @@ -341,10 +351,18 @@ impl Window { glutin::Event::DeviceEvent { event, .. } => match event { glutin::DeviceEvent::MouseMotion { delta: (dx, dy), .. - } if cursor_grabbed && *focused => events.push(Event::CursorPan(Vec2::new( - dx as f32 * (pan_sensitivity as f32 / 100.0), - dy as f32 * (pan_sensitivity as f32 / 100.0), - ))), + } if *focused => { + let delta = Vec2::new( + dx as f32 * (pan_sensitivity as f32 / 100.0), + dy as f32 * (pan_sensitivity as f32 / 100.0), + ); + + if cursor_grabbed { + events.push(Event::CursorPan(delta)); + } else { + events.push(Event::CursorMove(delta)); + } + } glutin::DeviceEvent::MouseWheel { delta: glutin::MouseScrollDelta::LineDelta(_x, y), ..