Beispiel #1
0
        public override bool Run()
        {
            try
            {
                if (!Target.StartComputing(this, SurfaceHeight.Table, true))
                {
                    return(false);
                }

                if (!UIUtils.IsOkayToStartModalDialog())
                {
                    return(false);
                }

                Target.StartVideo(Computer.VideoType.Browse);
                AnimateSim("GenericTyping");

                string failReason = null;
                if (((Actor.Household == Household.ActiveHousehold) && !MovingSituation.MovingInProgress) && InWorldSubState.IsEditTownValid(Actor.LotHome, ref failReason))
                {
                    Definition interactionDefinition = InteractionDefinition as Definition;
                    if (interactionDefinition.LocalMove)
                    {
                        if (!Household.ActiveHousehold.LotHome.IsApartmentLot && (Household.ActiveHousehold.GetNumberOfRoommates() > 0))
                        {
                            if (!TwoButtonDialog.Show(Localization.LocalizeString("Ui/Caption/Roommates:MovingDismissConfirmation", new object[0]), LocalizationHelper.Yes, LocalizationHelper.No))
                            {
                                Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false);
                                return(true);
                            }

                            Household.RoommateManager.StopAcceptingRoommates(true);
                        }

                        MovingDialogEx.Show(new GameplayMovingModelEx(Actor));
                    }
                    else
                    {
                        MovingWorldsModel model = new MovingWorldsModel(Actor);
                        MovingWorldDialog.Show(model);
                        if ((model.WorldName != null) && MovingWorldUtil.VerifyWorldMove())
                        {
                            Common.FunctionTask.Perform(model.TriggerSaveAndTravel);
                        }
                    }
                }

                Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false);
                return(true);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Beispiel #2
0
        public override Phone.Call.ConversationBehavior OnCallConnected()
        {
            try
            {
                if (UIUtils.IsOkayToStartModalDialog())
                {
                    string failReason = null;
                    if (((Actor.Household == Household.ActiveHousehold) && !MovingSituation.MovingInProgress) && InWorldSubState.IsEditTownValid(Actor.LotHome, ref failReason))
                    {
                        Definition interactionDefinition = InteractionDefinition as Definition;
                        if (interactionDefinition.LocalMove)
                        {
                            if (!Household.ActiveHousehold.LotHome.IsApartmentLot && (Household.ActiveHousehold.GetNumberOfRoommates() > 0))
                            {
                                if (!TwoButtonDialog.Show(Localization.LocalizeString("Ui/Caption/Roommates:MovingDismissConfirmation", new object[0]), LocalizationHelper.Yes, LocalizationHelper.No))
                                {
                                    return(Phone.Call.ConversationBehavior.JustHangUp);
                                }

                                Household.RoommateManager.StopAcceptingRoommates(true);
                            }

                            MovingDialogEx.Show(new GameplayMovingModelEx(Actor));
                        }
                        else
                        {
                            MovingWorldsModel model = new MovingWorldsModel(Actor);
                            MovingWorldDialog.Show(model);
                            if ((model.WorldName != null) && MovingWorldUtil.VerifyWorldMove())
                            {
                                Common.FunctionTask.Perform(model.TriggerSaveAndTravel);
                            }
                        }
                    }
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }
            return(Phone.Call.ConversationBehavior.JustHangUp);
        }