Skip to content

Commit

Permalink
Provide better compatibility to Anamnesis .chara files
Browse files Browse the repository at this point in the history
  • Loading branch information
Minmoose committed Sep 22, 2024
1 parent 9e6c20b commit e5e7f11
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
35 changes: 22 additions & 13 deletions Brio/Files/AnamnesisCharaFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,28 @@ internal class AnamnesisCharaFile : JsonDocumentBase
public ItemSave Wrists { get; set; }
public ItemSave LeftRing { get; set; }
public ItemSave RightRing { get; set; }
public Vector3 SkinColor { get; set; }
public Vector3 SkinGloss { get; set; }
public Vector3 LeftEyeColor { get; set; }
public Vector3 RightEyeColor { get; set; }
public Vector3 LimbalRingColor { get; set; }
public Vector3 HairColor { get; set; }
public Vector3 HairGloss { get; set; }
public Vector3 HairHighlight { get; set; }
public Vector4 MouthColor { get; set; }
public Vector3 BustScale { get; set; }

public GlassesSave? Glasses { get; set; }

public float Transparency { get; set; }
public float MuscleTone { get; set; }

// Extended Appearance

public float HeightMultiplier { get; set; }
public float MuscleTone { get; set; } = 1f;

public Vector3? SkinColor { get; set; } = null;
public Vector3? SkinGloss { get; set; } = null;
public Vector3? LeftEyeColor { get; set; } = null;
public Vector3? RightEyeColor { get; set; } = null;
public Vector3? LimbalRingColor { get; set; } = null;
public Vector3? HairColor { get; set; } = null;
public Vector3? HairGloss { get; set; } = null;
public Vector3? HairHighlight { get; set; } = null;
public Vector4? MouthColor { get; set; } = null;

public Vector3? BustScale { get; set; } = null;

public GlassesSave? Glasses { get; set; }

public override void GetAutoTags(ref TagCollection tags)
{
Expand Down Expand Up @@ -151,6 +158,7 @@ public static implicit operator ActorAppearance(AnamnesisCharaFile chara)

// Extended Appearance
appearance.ExtendedAppearance.Transparency = chara.Transparency;
appearance.ExtendedAppearance.HeightMultiplier = chara.HeightMultiplier;

return appearance;
}
Expand Down Expand Up @@ -210,7 +218,8 @@ public static implicit operator AnamnesisCharaFile(ActorAppearance appearance)
Glasses = appearance.Facewear,

// Extended Appearance
Transparency = appearance.ExtendedAppearance.Transparency
Transparency = appearance.ExtendedAppearance.Transparency,
HeightMultiplier = appearance.ExtendedAppearance.HeightMultiplier
};

return charaFile;
Expand Down
2 changes: 2 additions & 0 deletions Brio/Game/Actor/Appearance/ActorAppearance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public unsafe static ActorAppearance FromCharacter(DalamudCharacter character)
actorAppearance.ExtendedAppearance.CharacterTint = charaBase->Tint;
actorAppearance.ExtendedAppearance.Wetness = charaBase->Wetness;
actorAppearance.ExtendedAppearance.WetnessDepth = charaBase->WetnessDepth;

actorAppearance.ExtendedAppearance.HeightMultiplier = charaBase->ScaleFactor2;
}

charaBase = character.GetWeaponCharacterBase(ActorEquipSlot.MainHand);
Expand Down
5 changes: 5 additions & 0 deletions Brio/Game/Actor/Appearance/ActorExtendedAppearance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ internal struct ActorExtendedAppearance()
public Vector4 MainHandTint = Vector4.One;
public Vector4 OffHandTint = Vector4.One;


//
// TODO, Brio ignores the following filds

public float HeightMultiplier = 1.0f;
}

0 comments on commit e5e7f11

Please sign in to comment.