Esempio n. 1
0
        public static void Retrieve(IMausoleum mausoleum, Dictionary <SimDescription, Pair <IMausoleum, Urnstone> > urnstones)
        {
            List <Urnstone> allStones = Inventories.QuickFind <Urnstone>(mausoleum.Inventory);

            foreach (Urnstone stone in allStones)
            {
                SimDescription sim = stone.DeadSimsDescription;
                if ((stone.InWorld) && (!stone.InInventory))
                {
                    continue;
                }

                if (urnstones.ContainsKey(sim))
                {
                    continue;
                }

                if (HasLiveFamily(sim))
                {
                    continue;
                }

                urnstones.Add(sim, new Pair <IMausoleum, Urnstone>(mausoleum, stone));
            }
        }
Esempio n. 2
0
        protected override OptionResult Run(IActor actor, IMausoleum mausoleum)
        {
            Dictionary <SimDescription, Pair <IMausoleum, Urnstone> > urnstones = new Dictionary <SimDescription, Pair <IMausoleum, Urnstone> >();

            CommonSpace.Helpers.CleanseTheDead.Retrieve(mausoleum, urnstones);

            if ((urnstones == null) || (urnstones.Count == 0))
            {
                SimpleMessageDialog.Show(Name, Common.Localize(GetTitlePrefix() + ":Empty"));
                return(OptionResult.Failure);
            }

            Sim sim = actor as Sim;

            Selection.Results choices = new Selection(Name, sim.SimDescription, urnstones.Keys).SelectMultiple();
            if (choices.Count == 0)
            {
                return(OptionResult.Failure);
            }

            if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt", false, new object[] { choices.Count })))
            {
                return(OptionResult.Failure);
            }

            CommonSpace.Helpers.CleanseTheDead.Cleanse(choices, urnstones, false, null);

            return(OptionResult.SuccessClose);
        }
Esempio n. 3
0
        protected override OptionResult Run(IActor actor, IMausoleum mausoleum)
        {
            if (CameraController.IsMapViewModeEnabled())
            {
                Sims3.Gameplay.Core.Camera.ToggleMapView();
            }

            HudModel.OpenObjectInventoryForOwner(mausoleum);
            return OptionResult.SuccessClose;
        }
Esempio n. 4
0
        protected override OptionResult Run(IActor actor, IMausoleum mausoleum)
        {
            if (CameraController.IsMapViewModeEnabled())
            {
                Sims3.Gameplay.Core.Camera.ToggleMapView();
            }

            HudModel.OpenObjectInventoryForOwner(mausoleum);
            return(OptionResult.SuccessClose);
        }
Esempio n. 5
0
        public static void Retrieve(IMausoleum mausoleum, Dictionary<SimDescription, Pair<IMausoleum, Urnstone>> urnstones)
        {
            List<Urnstone> allStones = Inventories.QuickFind<Urnstone>(mausoleum.Inventory);

            foreach (Urnstone stone in allStones)
            {
                SimDescription sim = stone.DeadSimsDescription;
                if ((stone.InWorld) && (!stone.InInventory)) continue;

                if (urnstones.ContainsKey(sim)) continue;

                if (HasLiveFamily(sim)) continue;

                urnstones.Add(sim, new Pair<IMausoleum, Urnstone>(mausoleum, stone));
            }
        }
Esempio n. 6
0
        public static bool MoveToMausoleum(IMausoleum mausoleum, Urnstone urnstone)
        {
            bool bOriginalValue = mausoleum.Inventory.IgnoreInventoryValidation;

            try
            {
                mausoleum.Inventory.IgnoreInventoryValidation = true;

                if (Inventories.TryToMove(urnstone, mausoleum.Inventory))
                {
                    return(true);
                }
            }
            finally
            {
                mausoleum.Inventory.IgnoreInventoryValidation = bOriginalValue;
            }

            return(false);
        }
Esempio n. 7
0
        public static bool MoveToMausoleum(Urnstone urnstone)
        {
            List <IMausoleum> mausoleums = new List <IMausoleum>(Sims3.Gameplay.Queries.GetObjects <IMausoleum>());

            if (mausoleums.Count > 0)
            {
                IMausoleum mausoleum = RandomUtil.GetRandomObjectFromList(mausoleums);
                if (mausoleum != null)
                {
                    foreach (IActor actor in urnstone.ReferenceList)
                    {
                        actor.InteractionQueue.PurgeInteractions(urnstone);
                    }

                    if (MoveToMausoleum(mausoleum, urnstone))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
Esempio n. 8
0
        protected override OptionResult Run(GameHitParameters <GameObject> parameters)
        {
            List <IMausoleum> mausoleums = new List <IMausoleum>(Sims3.Gameplay.Queries.GetObjects <IMausoleum>());

            if (mausoleums.Count == 0)
            {
                SimpleMessageDialog.Show(Name, Common.Localize("ManageTheDead:Error"));
                return(OptionResult.Failure);
            }

            IMausoleum mausoleum = null;

            if (mausoleums.Count > 1)
            {
                List <Item> options = new List <Item>();

                foreach (IMausoleum element in mausoleums)
                {
                    options.Add(new Item(element.LotCurrent.Name, element));
                }

                Item selection = new CommonSelection <Item>(Common.Localize("ManageTheDead:ListTitle"), options).SelectSingle();
                if (selection == null)
                {
                    return(OptionResult.Failure);
                }

                mausoleum = selection.Value;
            }
            else
            {
                mausoleum = mausoleums[0];
            }

            return(Run(parameters.mActor, mausoleum));
        }
Esempio n. 9
0
        public static bool MoveToMausoleum(IMausoleum mausoleum, Urnstone urnstone)
        {
            bool bOriginalValue = mausoleum.Inventory.IgnoreInventoryValidation;

            try
            {
                mausoleum.Inventory.IgnoreInventoryValidation = true;

                if (Inventories.TryToMove(urnstone, mausoleum.Inventory))
                {
                    return true;
                }
            }
            finally
            {
                mausoleum.Inventory.IgnoreInventoryValidation = bOriginalValue;
            }

            return false;
        }
Esempio n. 10
0
 protected abstract OptionResult Run(IActor actor, IMausoleum mausoleum);