public override void PositionChange(VMContext context, bool noEntryPoint)
        {
            if (GhostImage)
            {
                return;
            }

            var room = context.GetObjectRoom(this);

            SetRoom(room);

            if (HandObject != null)
            {
                context.UnregisterObjectPos(HandObject);
                HandObject.Position = Position;
                HandObject.PositionChange(context, noEntryPoint);
            }

            context.RegisterObjectPos(this);
            if (Container != null)
            {
                return;
            }
            if (Position == LotTilePos.OUT_OF_WORLD)
            {
                return;
            }

            base.PositionChange(context, noEntryPoint);
        }
Exemple #2
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);
            }
        }
Exemple #3
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);
                    }
                }
            }
        }
Exemple #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);
        }