public static bool ActivateSimScreenMaskedFuncFromHousehold(PlayFlowModel ths, Household selectedHousehold, Lot selectedLot) { if ((selectedHousehold == null) || (selectedLot == null)) { return(false); } using (DreamCatcher.HouseholdStore store = new DreamCatcher.HouseholdStore(selectedHousehold, Mover.Settings.mDreamCatcher)) { Camera.SetMapViewActiveLotMode(true); LotManager.LockActiveLot(selectedLot); // Custom DreamCatcher.Task.PrepareToBecomeActiveHousehold(selectedHousehold); Sim sim = BinCommon.ActivateSim(selectedHousehold, selectedLot); if (sim == null) { sim = Households.AllSims(selectedHousehold)[0]; if (sim != null) { PlumbBob.ForceSelectActor(sim); } } LotManager.SetWallsViewMode(0x12e); selectedLot.SetDisplayLevel(selectedLot.DoesFoundationExistOnLot() ? 0x1 : 0x0); if (sim.LotCurrent == sim.LotHome) { Camera.FocusOnSelectedSim(); Camera.SetView(CameraView.SimView, false, false); } else { Camera.FocusOnLot(sim.LotHome.LotId, 0f); Camera.SetView(CameraView.HouseView, false, false); } } selectedLot.CheckIfLotNeedsBabysitter(); ths.Sleep(1.5); return(true); }
public static PlaceResult PlaceFromExportBin(Household household, ExportBinContents exportBinItem, Lot lot, PlaceAction action, bool buyFurnished, GetLotCost onLotCost, ref Sim newActiveSim) { if (household == null) { return(PlaceResult.InvalidBinHousehold); } else if (lot == null) { return(PlaceResult.InvalidLot); } else if (exportBinItem == null) { return(PlaceResult.ContentFailure); } bool flag = exportBinItem.IsLoaded(); if (!flag) { ExportBinContentsEx.Import(exportBinItem, false); } PlaceResult contentFailure = PlaceResult.ContentFailure; if (household != null) { if (((action & PlaceAction.PlaceAndPay) != PlaceAction.PlaceOnly) && !PayForLot(household, lot, buyFurnished, onLotCost)) { if (!flag) { ExportBinContentsEx.Flush(exportBinItem); } Household.CleanupOldIdToNewSimDescriptionMap(); return(PlaceResult.InsufficientFunds); } if ((!buyFurnished) && (!lot.IsApartmentLot)) { lot.MakeLotUnfurnished(); Common.Sleep(); lot.UpdateCachedValues(); } CreateActors(household, lot, false); CreateInventories(household, exportBinItem.HouseholdContents, exportBinItem.IndexMap); Common.Sleep(); BinCommon.UpdateImportedUrnstones(household, lot); household.PostImport(); if ((action & PlaceAction.MoveIn) != PlaceAction.PlaceOnly) { BinCommon.MoveIn(household, lot); } if ((action & PlaceAction.Activate) != PlaceAction.PlaceOnly) { newActiveSim = BinCommon.ActivateSim(exportBinItem.Household, lot); } ThumbnailManager.GenerateHouseholdThumbnail(household.HouseholdId, household.HouseholdId, ThumbnailSizeMask.Large | ThumbnailSizeMask.Medium); contentFailure = PlaceResult.Success; } if (!flag) { ExportBinContentsEx.Flush(exportBinItem); } return(contentFailure); }