mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Shoulder offsets, meta.ron versioning
This commit is contained in:
parent
250e4b3043
commit
f5c2341167
BIN
assets/voxygen/element/buttons/inv_slot.png
(Stored with Git LFS)
BIN
assets/voxygen/element/buttons/inv_slot.png
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/armor/chest/chest_none.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/armor/chest/chest_none.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/armor/chest/cultist.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/armor/chest/cultist.vox
(Stored with Git LFS)
Binary file not shown.
@ -113,21 +113,21 @@
|
||||
),
|
||||
CultistPurple: (
|
||||
left: (
|
||||
vox_spec: ("armor.shoulder.cultist_right", (-2.0, -3.5, 1.0)),
|
||||
vox_spec: ("armor.shoulder.cultist_right", (-2.0, -3.5, 0.0)),
|
||||
color: Some((30, 0, 64))
|
||||
),
|
||||
right: (
|
||||
vox_spec: ("armor.shoulder.cultist_right", (-2.9, -3.5, 1.0)),
|
||||
vox_spec: ("armor.shoulder.cultist_right", (-2.9, -3.5, 0.0)),
|
||||
color: Some((30, 0, 64))
|
||||
)
|
||||
),
|
||||
CultistBlue: (
|
||||
left: (
|
||||
vox_spec: ("armor.shoulder.cultist_right", (-2.0, -3.5, 1.0)),
|
||||
vox_spec: ("armor.shoulder.cultist_right", (-2.0, -3.5, 0.0)),
|
||||
color: Some((57, 81, 132))
|
||||
),
|
||||
right: (
|
||||
vox_spec: ("armor.shoulder.cultist_right", (-2.9, -3.5, 1.0)),
|
||||
vox_spec: ("armor.shoulder.cultist_right", (-2.9, -3.5, 0.0)),
|
||||
color: Some((57, 81, 132))
|
||||
)
|
||||
),
|
||||
|
@ -1,3 +1,6 @@
|
||||
// Note: If you changes here "break" old character saves you can change the
|
||||
// version in voxygen\src\meta.rs in order to reset save files to being empty
|
||||
|
||||
use crate::comp::{
|
||||
body::object, projectile, Body, CharacterAbility, Gravity, HealthChange, HealthSource,
|
||||
LightEmitter, Projectile,
|
||||
|
@ -31,6 +31,7 @@ pub use self::{
|
||||
use super::{Bone, Skeleton};
|
||||
use crate::render::FigureBoneData;
|
||||
use common::comp;
|
||||
|
||||
#[derive(Clone, Default)]
|
||||
pub struct CharacterSkeleton {
|
||||
head: Bone,
|
||||
@ -167,18 +168,18 @@ impl SkeletonAttr {
|
||||
pub fn calculate_scale(body: &comp::humanoid::Body) -> f32 {
|
||||
use comp::humanoid::{BodyType::*, Race::*};
|
||||
match (body.race, body.body_type) {
|
||||
(Orc, Male) => 0.95 * 1.2,
|
||||
(Orc, Female) => 0.85 * 1.2,
|
||||
(Human, Male) => 0.85 * 1.2,
|
||||
(Human, Female) => 0.8 * 1.2,
|
||||
(Elf, Male) => 0.85 * 1.2,
|
||||
(Elf, Female) => 0.8 * 1.2,
|
||||
(Dwarf, Male) => 0.7 * 1.2,
|
||||
(Dwarf, Female) => 0.65 * 1.2,
|
||||
(Undead, Male) => 0.8 * 1.2,
|
||||
(Undead, Female) => 0.75 * 1.2,
|
||||
(Danari, Male) => 0.58 * 1.2,
|
||||
(Danari, Female) => 0.58 * 1.2,
|
||||
(Orc, Male) => 1.14,
|
||||
(Orc, Female) => 1.02,
|
||||
(Human, Male) => 1.02,
|
||||
(Human, Female) => 0.96,
|
||||
(Elf, Male) => 1.02,
|
||||
(Elf, Female) => 0.96,
|
||||
(Dwarf, Male) => 0.84,
|
||||
(Dwarf, Female) => 0.78,
|
||||
(Undead, Male) => 0.96,
|
||||
(Undead, Female) => 0.9,
|
||||
(Danari, Male) => 0.696,
|
||||
(Danari, Female) => 0.696,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -206,7 +207,7 @@ impl<'a> From<&'a comp::humanoid::Body> for SkeletonAttr {
|
||||
(Orc, Male) => (0.0, 14.0),
|
||||
(Orc, Female) => (0.0, 14.0),
|
||||
(Human, Male) => (0.3, 13.5),
|
||||
(Human, Female) => (-0.6, 13.5),
|
||||
(Human, Female) => (0.0, 13.8),
|
||||
(Elf, Male) => (0.0, 13.5),
|
||||
(Elf, Female) => (0.0, 13.5),
|
||||
(Dwarf, Male) => (0.0, 14.5),
|
||||
|
@ -4,6 +4,7 @@ use log::warn;
|
||||
use serde_derive::{Deserialize, Serialize};
|
||||
use std::{fs, io::Write, path::PathBuf};
|
||||
|
||||
const VALID_VERSION: u32 = 0; // Change this if you broke charsaves
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[repr(C)]
|
||||
pub struct CharacterData {
|
||||
@ -13,11 +14,12 @@ pub struct CharacterData {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
//#[serde(default)]
|
||||
#[repr(C)]
|
||||
pub struct Meta {
|
||||
pub characters: Vec<CharacterData>,
|
||||
pub selected_character: usize,
|
||||
pub version: u32,
|
||||
}
|
||||
|
||||
impl Meta {
|
||||
@ -38,8 +40,12 @@ impl Meta {
|
||||
let path = Self::get_meta_path();
|
||||
|
||||
if let Ok(file) = fs::File::open(&path) {
|
||||
match ron::de::from_reader(file) {
|
||||
Ok(s) => return s,
|
||||
match ron::de::from_reader::<_, Meta>(file) {
|
||||
Ok(s) => {
|
||||
if s.version == VALID_VERSION {
|
||||
return s;
|
||||
}
|
||||
},
|
||||
Err(e) => {
|
||||
log::warn!("Failed to parse meta file! Fallback to default. {}", e);
|
||||
// Rename the corrupted settings file
|
||||
|
Loading…
Reference in New Issue
Block a user