public virtual void LoadCrossRef(VMAvatarMarshal input, VMContext context) { base.LoadCrossRef(input, context); HandObject = context.VM.GetObjectById(input.HandObject); if (HandObject != null && HandObject is VMGameObject) { ((ObjectComponent)HandObject.WorldUI).ForceDynamic = true; } //we need to fix the gender, since InitBodyData resets it. var gender = GetPersonData(VMPersonDataVariable.Gender); InitBodyData(context); SetPersonData(VMPersonDataVariable.Gender, gender); SetPersonData(VMPersonDataVariable.RenderDisplayFlags, GetPersonData(VMPersonDataVariable.RenderDisplayFlags)); BodyOutfit = input.BodyOutfit; HeadOutfit = input.HeadOutfit; var headPurchasable = Content.Content.Get().AvatarPurchasables.Get(input.BodyOutfit); var bodyPurchasable = Content.Content.Get().AvatarPurchasables.Get(input.HeadOutfit); Outfit Head = Content.Content.Get().AvatarOutfits.Get(headPurchasable != null ? headPurchasable.OutfitID : BodyOutfit); Outfit Body = Content.Content.Get().AvatarOutfits.Get(bodyPurchasable != null ? bodyPurchasable.OutfitID : HeadOutfit); Avatar.Head = Head; Avatar.Body = Body; Avatar.Handgroup = Avatar.Body; }
public VMAvatarMarshal Save() { var anims = new VMAnimationStateMarshal[Animations.Count]; int i = 0; foreach (var anim in Animations) { anims[i++] = anim.Save(); } var gameObj = new VMAvatarMarshal { Animations = anims, CarryAnimationState = (CarryAnimationState == null) ? null : CarryAnimationState.Save(), //NULLable Name = Name, Message = Message, MessageTimeout = MessageTimeout, MotiveChanges = MotiveChanges, PersonData = PersonData, MotiveData = MotiveData, HandObject = (HandObject == null) ? (short)0 : HandObject.ObjectID, RadianDirection = RadianDirection, DefaultSuits = DefaultSuits, BoundAppearances = BoundAppearances.ToArray(), BodyOutfit = BodyOutfit, HeadOutfit = HeadOutfit, SkinTone = SkinTone }; SaveEnt(gameObj); return(gameObj); }
public virtual void LoadCrossRef(VMAvatarMarshal input, VMContext context) { base.LoadCrossRef(input, context); HandObject = context.VM.GetObjectById(input.HandObject); if (HandObject != null && HandObject is VMGameObject) { ((ObjectComponent)HandObject.WorldUI).ForceDynamic = true; } //we need to fix the gender, since InitBodyData resets it. var gender = GetPersonData(VMPersonDataVariable.Gender); InitBodyData(context); SetPersonData(VMPersonDataVariable.Gender, gender); BodyOutfit = input.BodyOutfit; HeadOutfit = input.HeadOutfit; }
public virtual void Load(VMAvatarMarshal input) { base.Load(input); Animations = new List <VMAnimationState>(); foreach (var anim in input.Animations) { Animations.Add(new VMAnimationState(anim)); } CarryAnimationState = (input.CarryAnimationState == null) ? null : new VMAnimationState(input.CarryAnimationState); Message = input.Message; MessageTimeout = input.MessageTimeout; MotiveChanges = input.MotiveChanges; MotiveDecay = input.MotiveDecay; PersonData = input.PersonData; MotiveData = input.MotiveData; RadianDirection = input.RadianDirection; KillTimeout = input.KillTimeout; DefaultSuits = input.DefaultSuits; BoundAppearances = new HashSet <string>(input.BoundAppearances); foreach (var aprN in BoundAppearances) { var apr = FSO.Content.Content.Get().AvatarAppearances.Get(aprN); if (apr != null) { Avatar.AddAccessory(apr); } } SkinTone = input.SkinTone; if (UseWorld) { WorldUI.ObjectID = ObjectID; } }
public virtual void Load(VMAvatarMarshal input) { base.Load(input); Animations = new List <VMAnimationState>(); foreach (var anim in input.Animations) { Animations.Add(new VMAnimationState(anim)); } CarryAnimationState = (input.CarryAnimationState == null) ? null : new VMAnimationState(input.CarryAnimationState); Message = input.Message; MessageTimeout = input.MessageTimeout; MotiveChanges = input.MotiveChanges; MotiveDecay = input.MotiveDecay; PersonData = input.PersonData; MotiveData = input.MotiveData; RadianDirection = input.RadianDirection; KillTimeout = input.KillTimeout; DefaultSuits = input.DefaultSuits; DynamicSuits = input.DynamicSuits; Decoration = input.Decoration; BoundAppearances = new HashSet <string>(input.BoundAppearances); if (VM.UseWorld) { foreach (var aprN in BoundAppearances) { var apr = FSO.Content.Content.Get().AvatarAppearances.Get(aprN); if (apr != null) { Avatar.AddAccessory(apr); } } var oftProvider = Content.Content.Get().AvatarOutfits; if (Decoration.Back != 0) { Avatar.DecorationBack = oftProvider.Get(Decoration.Back); } if (Decoration.Head != 0) { Avatar.DecorationHead = oftProvider.Get(Decoration.Head); } if (Decoration.Tail != 0) { Avatar.DecorationTail = oftProvider.Get(Decoration.Tail); } if (Decoration.Shoes != 0) { Avatar.DecorationShoes = oftProvider.Get(Decoration.Shoes); } } SkinTone = input.SkinTone; if (UseWorld) { WorldUI.ObjectID = ObjectID; } }