Exemple #1
0
        public void AddInteractionsToChildren()
        {
            this.RemoveInteractionsFromChildren();
            List <ObjectGuid> objectsICanBuyInDisplay = this.GetObjectIDsICanBuyInDisplay(null, false);

            for (int i = 0; i < objectsICanBuyInDisplay.Count; i++)
            {
                GameObject gameObject = GlobalFunctions.ConvertGuidToObject <GameObject>(objectsICanBuyInDisplay[i]);
                if (gameObject != null)
                {
                    if (StoreHelperClass.AddPurchaseInteraction(null, gameObject, null, true))
                    {
                        gameObject.RemoveAllInteractions();
                        this.mObjectsWithMyInteraction.Add(objectsICanBuyInDisplay[i]);
                        gameObject.RemoveInteractionByType(StoreSetBase.ChildObjectPurchaseStub.Singleton);
                        gameObject.RemoveInteractionByType(StoreSetBase.ChildObjectBrowseStub.Singleton);
                        gameObject.AddInteraction(new StoreSetBase.ChildObjectPurchaseStub.Definition(base.ObjectId));
                        gameObject.AddInteraction(new StoreSetBase.ChildObjectBrowseStub.Definition(base.ObjectId));
                    }
                }
            }
        }
Exemple #2
0
        public override List <ObjectGuid> GetObjectIDsICanBuyInDisplay(Sim actor, bool isAutonomous)
        {
            List <ObjectGuid> list = new List <ObjectGuid>();

            if (base.Charred)
            {
                return(list);
            }
            GameObject[] objectsIntersectingObject = Sims3.Gameplay.Queries.GetObjectsIntersectingObject(base.ObjectId);
            if (objectsIntersectingObject != null && objectsIntersectingObject.Length > 0)
            {
                //bool isRug = true;
                //StoreSetBase sBase = RestockItemHelperClass.ReturnStoreSetBase(objectsIntersectingObject[0], out isRug);
                for (int i = 0; i < objectsIntersectingObject.Length; i++)
                {
                    if (StoreHelperClass.AddPurchaseInteraction(actor, objectsIntersectingObject[i], this, isAutonomous))
                    {
                        objectsIntersectingObject[i].RemoveInteractionByType(StoreSetBase.ChildObjectPurchaseStub.Singleton);
                        objectsIntersectingObject[i].RemoveInteractionByType(StoreSetBase.ChildObjectBrowseStub.Singleton);
                        objectsIntersectingObject[i].AddInteraction(new StoreSetBase.ChildObjectPurchaseStub.Definition(base.ObjectId));
                        objectsIntersectingObject[i].AddInteraction(new StoreSetBase.ChildObjectBrowseStub.Definition(base.ObjectId));
                        list.Add(objectsIntersectingObject[i].ObjectId);
                    }

                    BroomStand broomStand = objectsIntersectingObject[i] as BroomStand;
                    if (broomStand != null)
                    {
                        MagicBroom magicBroom = broomStand.GetContainedObject((Slot)2820733094u) as MagicBroom;
                        if (magicBroom != null)// && base.TestIfObjectCanBeBoughtByActor(magicBroom, actor))
                        {
                            list.Add(magicBroom.ObjectId);
                        }
                    }
                }
            }
            return(list);
        }