Exemplo n.º 1
0
        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);
            }
        }
Exemplo n.º 2
0
        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);
                    }
                }
            }
        }
Exemplo n.º 3
0
 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);
         }
     }
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 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);
     }
 }
Exemplo n.º 6
0
        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?
                }
            }
        }
Exemplo n.º 7
0
        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;
                }
            }
        }