public override void PlaceInSlot(VMEntity obj, int slot, bool cleanOld, VMContext context) { if (cleanOld) { obj.PrePositionChange(context); } if (!obj.GhostImage) { HandObject = obj; CarryAnimationState = new VMAnimationState(FSO.Content.Content.Get().AvatarAnimations.Get("a2o-rarm-carry-loop.anim"), false); //set default carry animation obj.Container = this; obj.ContainerSlot = (short)slot; } if (UseWorld) { obj.WorldUI.Container = this.WorldUI; obj.WorldUI.ContainerSlot = slot; if (obj.WorldUI is ObjectComponent) { var objC = (ObjectComponent)obj.WorldUI; objC.ForceDynamic = true; } } obj.Position = Position; //TODO: is physical position the same as the slot offset position? if (cleanOld) { obj.PositionChange(context, false); } }
public override void PlaceInSlot(VMEntity obj, int slot, bool cleanOld, VMContext context) { if (cleanOld) { obj.PrePositionChange(context); } if (Contained != null) { if (slot > -1 && slot < Contained.Length) { if (!obj.GhostImage) { Contained[slot] = obj; obj.Container = this; obj.ContainerSlot = (short)slot; } if (UseWorld) { obj.WorldUI.Container = this.WorldUI; obj.WorldUI.ContainerSlot = slot; } obj.Position = Position; //TODO: is physical position the same as the slot offset position? if (cleanOld) { obj.PositionChange(context, false); } } } }
public void RemoveObjectInstance(VMEntity target) { target.PrePositionChange(this); if (!target.GhostImage) { VM.RemoveEntity(target); } if (UseWorld) { if (target is VMGameObject) { Blueprint.RemoveObject((ObjectComponent)target.WorldUI); } else { Blueprint.RemoveAvatar((AvatarComponent)target.WorldUI); } } }
public override bool PlaceInSlot(VMEntity obj, int slot, bool cleanOld, VMContext context) { if (GetSlot(slot) == obj) { return(true); //already in slot } if (GetSlot(slot) != null || WillLoopSlot(obj)) { return(false); //would recursively loop slot.. } if (cleanOld) { obj.PrePositionChange(context); } if (Contained != null) { if (slot > -1 && slot < Contained.Length) { if (!obj.GhostImage) { Contained[slot] = obj; obj.Container = this; obj.ContainerSlot = (short)slot; } if (UseWorld) { obj.WorldUI.Container = this.WorldUI; obj.WorldUI.ContainerSlot = slot; } obj.Position = Position; //TODO: is physical position the same as the slot offset position? if (cleanOld) { obj.PositionChange(context, false); } return(true); } } return(false); }
public void RemoveObjectInstance(VMEntity target) { target.PrePositionChange(this); if (!target.GhostImage) VM.RemoveEntity(target); if (UseWorld) { if (target is VMGameObject) Blueprint.RemoveObject((ObjectComponent)target.WorldUI); else Blueprint.RemoveAvatar((AvatarComponent)target.WorldUI); } }
public override void PlaceInSlot(VMEntity obj, int slot, bool cleanOld, VMContext context) { if (cleanOld) obj.PrePositionChange(context); if (Contained != null) { if (slot > -1 && slot < Contained.Length) { if (!obj.GhostImage) { Contained[slot] = obj; obj.Container = this; obj.ContainerSlot = (short)slot; } if (UseWorld) { obj.WorldUI.Container = this.WorldUI; obj.WorldUI.ContainerSlot = slot; } obj.Position = Position; //TODO: is physical position the same as the slot offset position? } } }
public override void PlaceInSlot(VMEntity obj, int slot, bool cleanOld, VMContext context) { if (cleanOld) obj.PrePositionChange(context); if (!obj.GhostImage) { HandObject = obj; CarryAnimationState = new VMAnimationState(FSO.Content.Content.Get().AvatarAnimations.Get("a2o-rarm-carry-loop.anim"), false); //set default carry animation obj.Container = this; obj.ContainerSlot = (short)slot; } if (UseWorld) { obj.WorldUI.Container = this.WorldUI; obj.WorldUI.ContainerSlot = slot; obj.Position = Position; //TODO: is physical position the same as the slot offset position? if (obj.WorldUI is ObjectComponent) { var objC = (ObjectComponent)obj.WorldUI; objC.ForceDynamic = true; } } }