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)); } }
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); }
protected override OptionResult Run(IActor actor, IMausoleum mausoleum) { if (CameraController.IsMapViewModeEnabled()) { Sims3.Gameplay.Core.Camera.ToggleMapView(); } HudModel.OpenObjectInventoryForOwner(mausoleum); return OptionResult.SuccessClose; }
protected override OptionResult Run(IActor actor, IMausoleum mausoleum) { if (CameraController.IsMapViewModeEnabled()) { Sims3.Gameplay.Core.Camera.ToggleMapView(); } HudModel.OpenObjectInventoryForOwner(mausoleum); return(OptionResult.SuccessClose); }
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)); } }
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); }
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); }
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)); }
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; }
protected abstract OptionResult Run(IActor actor, IMausoleum mausoleum);