예제 #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));
            }
        }
예제 #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);
        }
예제 #3
0
        protected override OptionResult Run(IActor actor, IMausoleum mausoleum)
        {
            if (CameraController.IsMapViewModeEnabled())
            {
                Sims3.Gameplay.Core.Camera.ToggleMapView();
            }

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

            HudModel.OpenObjectInventoryForOwner(mausoleum);
            return(OptionResult.SuccessClose);
        }
예제 #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));
            }
        }
예제 #6
0
파일: Urnstones.cs 프로젝트: yakoder/NRaas
        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);
        }
예제 #7
0
파일: Urnstones.cs 프로젝트: yakoder/NRaas
        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);
        }
예제 #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));
        }
예제 #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;
        }
예제 #10
0
 protected abstract OptionResult Run(IActor actor, IMausoleum mausoleum);