Esempio n. 1
0
 private new void OnSelection(UIBinInfo info)
 {
     if (((mFrom != null) && (mFrom != info)) && (info.HouseholdId != ulong.MaxValue))
     {
         mModel.CenterCamera(info.LotId);
         GameEntryMovingModelEx.MergeHouseholds(EditTownController.Instance, mFrom, info);
     }
     else
     {
         Simulator.AddObject(new OneShotFunctionWithParams(new FunctionWithParam(WarnCantMergeHouseholds), info));
     }
 }
Esempio n. 2
0
        private new void OnSelection(UIBinInfo lotInfo)
        {
            if (lotInfo.HouseholdId == ulong.MaxValue)
            {
                if ((mInfo != null) && (mFrom != InfoSource.Unknown))
                {
                    LotValidity lotValidity = mModel.GetLotValidity(lotInfo.LotId);

                    // EA Standard does not distinguish between vacation and private lots, messing up [StoryProgression] rental systems
                    foreach (PropertyData data in RealEstateManager.AllPropertiesFromAllHouseholds())
                    {
                        if (data.PropertyType == RealEstatePropertyType.VacationHome)
                        {
                            continue;
                        }

                        if (data.LotId == lotInfo.LotId)
                        {
                            Simulator.AddObject(new OneShotFunctionWithParams(WarnLotGeneric, lotInfo));
                            return;
                        }
                    }

                    mModel.CenterCamera(lotInfo.LotId);
                    if (mInfo.LotId != ulong.MaxValue)
                    {
                        bool allow = false;
                        if (lotValidity == LotValidity.Valid)
                        {
                            allow = true;
                        }
                        else if ((Mover.Settings.mAllowGreaterThanEight) && (!mModel.LotContentsWillFit(mInfo, lotInfo.LotId)))
                        {
                            allow = true;
                        }

                        if (allow)
                        {
                            mPlacing = true;
                            EditTownController.Instance.ShowUI(false);
                            UIManager.DarkenBackground(true);
                            Sims3.UI.Responder.Instance.DisableQuit();
                            Simulator.AddObject(new OneShotFunctionWithParams(PlaceLotTask, lotInfo));
                        }
                        else if (!mModel.LotContentsWillFit(mInfo, lotInfo.LotId))
                        {
                            Simulator.AddObject(new OneShotFunctionWithParams(WarnTooBig, lotInfo));
                        }
                        else
                        {
                            Simulator.AddObject(new OneShotFunctionWithParams(WarnLotGeneric, lotInfo));
                        }
                    }
                    else if (mInfo.HouseholdId != ulong.MaxValue)
                    {
                        if (lotValidity == LotValidity.Unavailable)
                        {
                            if ((!Mover.Settings.mFreeRealEstate) && (mInfo.HouseholdFunds < lotInfo.LotWorth))
                            {
                                Simulator.AddObject(new OneShotFunctionWithParams(WarnInsufficientFunds, lotInfo));
                                return;
                            }
                        }

                        if (lotValidity != LotValidity.Invalid)
                        {
                            mPlacing = true;
                            Simulator.AddObject(new OneShotFunctionWithParams(ConfirmPurchaseTaskEx, lotInfo));
                            return;
                        }
                    }
                }
            }
            else if (mInfo.LotId == ulong.MaxValue)
            {
                if (mFrom == InfoSource.Clipboard)
                {
                    mModel.CenterCamera(lotInfo.LotId);
                    GameEntryMovingModelEx.MergeHouseholds(EditTownController.Instance, mInfo, lotInfo);
                }
                else
                {
                    mModel.CenterCamera(lotInfo.LotId);
                    Simulator.AddObject(new OneShotFunctionWithParams(PlaceHouseholdTaskEx, lotInfo));
                }
            }
        }