private void appMoveButton_Click(object sender, RoutedEventArgs e)
        {
            MoveDialog dialog = new MoveDialog(GetSelectedApps());

            dialog.Owner = this;
            dialog.ShowDialog();
        }
Example #2
0
        static void MoveFile(string fileName)
        {
            MoveDialog dialog = new MoveDialog(fileName);

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            Dictionary <string, string> oldPathToNewPath = new Dictionary <string, string>();

            foreach (string file in dialog.MovingFiles)
            {
                oldPathToNewPath[file] = dialog.SelectedDirectory;
            }
            MovingHelper.AddToQueue(oldPathToNewPath, true, false, dialog.FixPackages);
        }
Example #3
0
        /// <summary>
        /// Invoked when the user selects the "Move" command
        /// </summary>
        static void MoveClicked(object sender, EventArgs e)
        {
            MoveDialog dialog = new MoveDialog(PluginBase.MainForm.CurrentDocument.FileName);

            if (dialog.ShowDialog() != DialogResult.OK)
            {
                return;
            }
            Dictionary <string, string> oldPathToNewPath = new Dictionary <string, string>();

            foreach (string file in dialog.MovingFiles)
            {
                oldPathToNewPath[file] = dialog.SelectedDirectory;
            }
            MovingHelper.AddToQueue(oldPathToNewPath, true, false, dialog.FixPackages);
        }
Example #4
0
        public override bool Run()
        {
            try
            {
                if (Target.Route(this))
                {
                    StandardEntry();
                    Mirror.EnterStateMachine(this);
                    AnimateSim("ChangeAppearance");
                    StartStages();

                    if (Responder.Instance.OptionsModel.SaveGameInProgress)
                    {
                        StandardExit();
                        return(false);
                    }

                    mTookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(Actor, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    if (!mTookSemaphore)
                    {
                        StandardExit();
                        return(false);
                    }
                    if (!Actor.IsSelectable)
                    {
                        StandardExit();
                        return(false);
                    }

                    if (!IntroTutorial.IsRunning || IntroTutorial.AreYouExitingTutorial())
                    {
                        while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                        {
                            SpeedTrap.Sleep();
                        }

                        int careerOutfitIndex = Actor.SimDescription.CareerOutfitIndex;
                        if (Actor.CurrentOutfitCategory == OutfitCategories.Career)
                        {
                            ArrayList outfits = Actor.SimDescription.GetOutfits(Actor.CurrentOutfitCategory);
                            for (int i = 0; i < outfits.Count; i++)
                            {
                                if (Actor.CurrentOutfit.Key == (outfits[i] as SimOutfit).Key)
                                {
                                    Actor.SimDescription.CareerOutfitIndex = i;
                                    break;
                                }
                            }
                        }

                        new Sims.Mirror().Perform(new GameHitParameters <GameObject>(Actor, Actor, GameObjectHit.NoHit));

                        while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                        {
                            SpeedTrap.Sleep();
                        }

                        AnimateSim("NodAsApproval");
                        AnimateSim("LeaveMirror");

                        if (Actor.CurrentOutfitCategory == OutfitCategories.Career)
                        {
                            Actor.SimDescription.CareerOutfitIndex = careerOutfitIndex;
                        }

                        StandardExit();

                        /*
                         * Actor.RecreateOccupationOutfits();
                         * (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).NotifySimChanged(Actor.ObjectId);
                         */
                        return(true);
                    }

                    StandardExit();
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }

            return(false);
        }
Example #5
0
        public override bool Run()
        {
            try
            {
                if (!IntroTutorial.IsRunning || IntroTutorial.AreYouExitingTutorial())
                {
                    SocialJig = GlobalFunctions.CreateObjectOutOfWorld("horseMountDismountJig", ProductVersion.EP5) as SocialJig;
                    SocialJig.RegisterParticipants(Actor, Target);
                    bool succeeded = false;
                    if (!BeginSocialInteraction(new SocialInteractionB.Definition(null, Saddle.LocalizeString(Target.IsFemale, "HaveOutfitEdited", new object[0x0]), false), true, false))
                    {
                        return(succeeded);
                    }
                    StandardEntry();
                    if (Responder.Instance.OptionsModel.SaveGameInProgress)
                    {
                        BeginCommodityUpdates();
                        EndCommodityUpdates(true);
                        StandardExit();
                        return(true);
                    }
                    mTookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(Target, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    if (!mTookSemaphore)
                    {
                        StandardExit();
                        return(false);
                    }
                    if (Target.IsSelectable)
                    {
                        while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                        {
                            SpeedTrap.Sleep();
                        }

                        BeginCommodityUpdates();
                        SimDescription simDescription = Target.SimDescription;
                        if (simDescription == null)
                        {
                            throw new Exception("ChangeOutfit:  sim doesn't have a description!");
                        }
                        CASChangeReporter.Instance.ClearChanges();

                        new Sims.Dresser().Perform(new GameHitParameters <GameObject>(Target, Target, GameObjectHit.NoHit));

                        while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                        {
                            SpeedTrap.Sleep();
                        }

                        EndCommodityUpdates(true);

                        /*
                         * if (Target.CurrentOutfitIndex > simDescription.GetOutfitCount(Target.CurrentOutfitCategory))
                         * {
                         *  Target.UpdateOutfitInfo();
                         * }
                         *
                         * (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).NotifySimChanged(Target.ObjectId);
                         */

                        StandardExit();
                        return(true);
                    }
                    StandardExit();
                }
                return(false);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }

            return(false);
        }
Example #6
0
        public static bool Show(IMovingModel model)
        {
            if (IntroTutorial.IsRunning && !IntroTutorial.AreYouExitingTutorial())
            {
                return(false);
            }

            if (ScreenGrabController.InProgress || VideoGrabHelper.InUse)
            {
                return(false);
            }

            UserToolUtils.OnClose();
            Sims3.Gameplay.UI.Responder.Instance.HudModel.CloseSecondaryInventory();
            PopupMenu.CloseOptions();
            Tutorialette.TriggerLesson(Lessons.Moving, null);
            List <IMapTagPickerInfo> mapTagPickerInfos = null;
            string titleText   = Localization.LocalizeString("Ui/Caption/MovingDialog:ChooseLocation", new object[0]);
            string confirmText = Localization.LocalizeString("Ui/Caption/MovingDialog:ChooseConfirm", new object[0]);

            MoveDialogBase.Result running = MoveDialogBase.Result.Running;
            ulong         maxValue        = ulong.MaxValue;
            HouseboatSize houseboatSize   = HouseboatSize.None;

            if (!MoveDialog.Show(model))
            {
                return(false);
            }

            SceneMgrWindow sceneWindow = UIManager.GetSceneWindow();

            if (sceneWindow != null)
            {
                sceneWindow.StopForwardingAllEvents();
            }

            do
            {
                switch (running)
                {
                case MoveDialogBase.Result.LotSelect:
                case MoveDialogBase.Result.HouseSelect:
                case MoveDialogBase.Result.LotAndHouseSelect:
                case MoveDialogBase.Result.PortSelect:
                    running = MoveDialog.RunWithPickedLot(maxValue, houseboatSize);
                    break;

                default:
                    running = MoveDialog.Run();
                    break;
                }

                switch (running)
                {
                case MoveDialogBase.Result.LotSelect:
                case MoveDialogBase.Result.HouseSelect:
                case MoveDialogBase.Result.LotAndHouseSelect:
                case MoveDialogBase.Result.PortSelect:
                    if (mapTagPickerInfos == null)
                    {
                        mapTagPickerInfos = new List <IMapTagPickerInfo>();
                    }
                    else
                    {
                        mapTagPickerInfos.Clear();
                    }

                    bool isSource = model.SourceIsSelectedHousehold();
                    int  householdBuyingPowerFunds = model.GetHouseholdBuyingPowerFunds(isSource);
                    bool flag3 = true;
                    if (running == MoveDialogBase.Result.PortSelect)
                    {
                        flag3 = ChangeHouseboatDialog.Show(false, ref houseboatSize, true);
                    }

                    if (flag3)
                    {
                        foreach (Lot lot in LotManager.AllLots)
                        {
                            if ((!lot.IsWorldLot && lot.IsResidentialLot) && (lot.IsApartmentLot || (lot.Household == null)))
                            {
                                if (running == MoveDialogBase.Result.PortSelect)
                                {
                                    if ((lot.CommercialLotSubType == CommercialLotSubType.kEP10_Port) && lot.IsUnoccupiedPortLot())
                                    {
                                        HouseboatInfo info = HouseboatUtils.GetInfo(houseboatSize);
                                        MovingToPortMapTagPickerLotInfo item = new MovingToPortMapTagPickerLotInfo(lot, MapTagType.PortLot, info.Price);
                                        mapTagPickerInfos.Add(item);
                                    }
                                }
                                else if (((!lot.IsWorldLot && lot.IsResidentialLot) && (lot.ResidentialLotSubType != ResidentialLotSubType.kEP10_PrivateLot)) && ((lot.IsApartmentLot || (lot.Household == null)) && !UnchartedIslandMarker.DoesLotHaveUnchartedIslandMarker(lot)))
                                {
                                    if (lot.IsApartmentLot)
                                    {
                                        if ((running == MoveDialogBase.Result.HouseSelect) && ((lot.Household == null) || !model.HouseholdIsSource(lot.Household.HouseholdId)))
                                        {
                                            MapTagPickerLotInfo item = new MapTagPickerLotInfo(lot, MapTagType.Apartment);
                                            mapTagPickerInfos.Add(item);
                                        }
                                    }
                                    else if (World.LotIsEmpty(lot.LotId) && lot.IsLotEmptyFromObjects())
                                    {
                                        if (running != MoveDialogBase.Result.HouseSelect)
                                        {
                                            MapTagPickerLotInfo info;

                                            // Custom
                                            if (Mover.GetLotCost(lot) <= householdBuyingPowerFunds)
                                            {
                                                info = new MapTagPickerLotInfo(lot, MapTagType.AvailableEmptyLot);
                                            }
                                            else
                                            {
                                                info = new MapTagPickerLotInfo(lot, MapTagType.UnavailableEmptyLot);
                                            }

                                            mapTagPickerInfos.Add(info);
                                        }
                                    }
                                    else if (running != MoveDialogBase.Result.LotSelect)
                                    {
                                        MapTagPickerLotInfo info2;

                                        // Custom
                                        if (Mover.GetLotCost(lot) <= householdBuyingPowerFunds)
                                        {
                                            info2 = new MapTagPickerLotInfo(lot, MapTagType.AvailableEmptyHouse);
                                        }
                                        else
                                        {
                                            info2 = new MapTagPickerLotInfo(lot, MapTagType.UnavailableEmptyHouse);
                                        }
                                        mapTagPickerInfos.Add(info2);
                                    }
                                }
                            }
                        }
                    }
                    IMapTagPickerInfo info3 = null;

                    if (flag3)
                    {
                        bool flag4;
                        info3 = MapTagPickerDialog.Show(mapTagPickerInfos, titleText, confirmText, null, false, 0f, false, out flag4);
                    }
                    if (info3 != null)
                    {
                        maxValue = info3.LotId;
                    }
                    break;
                }
            }while ((running != MoveDialogBase.Result.Accepted) && (running != MoveDialogBase.Result.Cancelled));

            if (sceneWindow != null)
            {
                sceneWindow.StartForwardingEventsToGame();
            }

            MoveDialog.Shutdown();
            return(running == MoveDialogBase.Result.Accepted);
        }
Example #7
0
        public static void DisplayCAS(Sim simInCAS, ref bool tookSemaphore)
        {
            if (!Responder.Instance.OptionsModel.SaveGameInProgress)
            {
                bool flag = GameStates.WaitForInteractionStateChangeSemaphore(simInCAS, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                tookSemaphore = flag;
                if (tookSemaphore)
                {
                    while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                    {
                        SpeedTrap.Sleep();
                    }

                    new Sims.Basic.Tattoo().Perform(new GameHitParameters <GameObject>(simInCAS, simInCAS, GameObjectHit.NoHit));

                    while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                    {
                        SpeedTrap.Sleep();
                    }
                }
            }
        }
Example #8
0
        public override bool Run()
        {
            try
            {
                if (Actor.IsHuman)
                {
                    InteractionInstance entry = Singleton.CreateInstance(Target, Target, GetPriority(), false, true);
                    return(Target.InteractionQueue.Add(entry));
                }
                if (!IntroTutorial.IsRunning || IntroTutorial.AreYouExitingTutorial())
                {
                    if (Responder.Instance.OptionsModel.SaveGameInProgress)
                    {
                        return(false);
                    }
                    mTookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(Actor, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    if (!mTookSemaphore)
                    {
                        return(false);
                    }
                    if (Actor.IsSelectable)
                    {
                        while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                        {
                            SpeedTrap.Sleep();
                        }

                        BeginCommodityUpdates();
                        SimDescription simDescription = Actor.SimDescription;
                        if (simDescription == null)
                        {
                            throw new Exception("CustomizeCollarAndCoats: Sim doesn't have a description!");
                        }
                        CASChangeReporter.Instance.ClearChanges();

                        new Sims.Dresser().Perform(new GameHitParameters <GameObject>(Target, Target, GameObjectHit.NoHit));

                        while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                        {
                            SpeedTrap.Sleep();
                        }

                        EndCommodityUpdates(true);

                        /*
                         * (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).NotifySimChanged(Actor.ObjectId);
                         */
                        return(true);
                    }
                }
                return(false);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }

            return(false);
        }
Example #9
0
        public static bool DisplayCAS(Sim simInCAS, Sim stylerSim, ref bool tookSemaphore, bool forceFailureOutfit)
        {
            if (!Responder.Instance.OptionsModel.SaveGameInProgress)
            {
                tookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(simInCAS, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                if (!tookSemaphore)
                {
                    return(false);
                }
                Sim sim = stylerSim ?? simInCAS;
                if (sim.Household == Household.ActiveHousehold)
                {
                    while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                    {
                        SpeedTrap.Sleep();
                    }

                    StyledNotification notification = null;
                    if (stylerSim != null)
                    {
                        Stylist occupation = stylerSim.Occupation as Stylist;
                        if (occupation != null)
                        {
                            Stylist.Makeover currentJob = occupation.CurrentJob as Stylist.Makeover;
                            if ((currentJob != null) && (currentJob.MakeoverTarget == simInCAS))
                            {
                                string titleText = currentJob.JobTitle + ":" + Common.NewLine + Common.NewLine;
                                foreach (TaskInfo info in occupation.GetTaskNames().Values)
                                {
                                    titleText = titleText + "- " + info.TaskDescription + Common.NewLine;
                                }
                                StyledNotification.Format format = new StyledNotification.Format(titleText, StyledNotification.NotificationStyle.kGameMessagePositive);
                                notification = StyledNotification.Show(format);
                            }
                        }
                    }

                    new Sims.Stylist().Perform(new GameHitParameters <GameObject>(simInCAS, simInCAS, GameObjectHit.NoHit));

                    if (forceFailureOutfit)
                    {
                        CASLogic.GetSingleton().SetOverrideExitOutfit(OutfitCategories.Makeover, 0x0);
                    }

                    while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                    {
                        SpeedTrap.Sleep();
                    }

                    if (notification != null)
                    {
                        notification.CloseNow();
                    }

                    Styling.UpdateJobTrackerIfNecessary(simInCAS, stylerSim, forceFailureOutfit);
                    return(true);
                }
            }
            return(false);
        }
Example #10
0
        public override bool Run()
        {
            try
            {
                if (!IntroTutorial.IsRunning || IntroTutorial.AreYouExitingTutorial())
                {
                    if (!Target.RouteAndOpenDrawer(this, Actor))
                    {
                        return(false);
                    }
                    if (Responder.Instance.OptionsModel.SaveGameInProgress)
                    {
                        BeginCommodityUpdates();
                        bool succeeded = Target.CloseDrawerAndExit(this, Actor);
                        EndCommodityUpdates(succeeded);
                        return(succeeded);
                    }

                    mTookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(Actor, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    if (!mTookSemaphore)
                    {
                        StandardExit();
                        return(false);
                    }

                    if (Actor.IsSelectable)
                    {
                        while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                        {
                            SpeedTrap.Sleep();
                        }

                        BeginCommodityUpdates();

                        new Sims.Dresser().Perform(new GameHitParameters <GameObject>(Actor, Actor, GameObjectHit.NoHit));

                        while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                        {
                            SpeedTrap.Sleep();
                        }

                        bool flag2 = Target.CloseDrawerAndExit(this, Actor);
                        Actor.InteractionQueue.CancelAllInteractionsByType(Dresser.ChangeClothes.Singleton);

                        EndCommodityUpdates(flag2);

                        /*
                         * (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).NotifySimChanged(Actor.ObjectId);
                         */
                        return(flag2);
                    }

                    StandardExit();
                }
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }

            return(false);
        }
Example #11
0
        private new void OnDisplayCAS()
        {
            while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
            {
                SpeedTrap.Sleep();
            }

            if (Actor.IsSelectable)
            {
                Definition interactionDefinition = InteractionDefinition as Definition;
                switch (interactionDefinition.GetSurgeryType())
                {
                case Hospital.SurgeryTypes.PlasticSurgeryFaceCheap:
                    ApplySurgery(Hospital.SurgeryTypes.PlasticSurgeryFaceCheap, Hospital.kCheapSurgeryFaceCost, Hospital.kCheapSurgeryFailureChance, "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryFaceFailure", "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryFaceSuccess");
                    break;

                case Hospital.SurgeryTypes.PlasticSurgeryFaceExpensive:
                    ApplySurgery(Hospital.SurgeryTypes.PlasticSurgeryFaceExpensive, Hospital.kExpensiveSurgeryFaceCost, Hospital.kExpensiveSurgeryFailureChance, "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryFaceFailure", "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryFaceSuccess");
                    break;

                case Hospital.SurgeryTypes.PlasticSurgeryBodyCheap:
                    ApplySurgery(Hospital.SurgeryTypes.PlasticSurgeryBodyCheap, Hospital.kCheapSurgeryBodyCost, Hospital.kCheapSurgeryFailureChance, "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryBodyFailure", "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryBodySuccess");
                    break;

                case Hospital.SurgeryTypes.PlasticSurgeryBodyExpensive:
                    ApplySurgery(Hospital.SurgeryTypes.PlasticSurgeryBodyExpensive, Hospital.kExpensiveSurgeryBodyCost, Hospital.kExpensiveSurgeryFailureChance, "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryBodyFailure", "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:PlasticSurgeryBodySuccess");
                    break;

                case Hospital.SurgeryTypes.PlasticSurgeryCorrectiveFace:
                    if ((Actor.SimDescription.PreSurgeryFacialBlends != null) && (Actor.FamilyFunds >= Hospital.kCorrectiveFaceSurgeryCost))
                    {
                        Actor.ModifyFunds(-Hospital.kCorrectiveFaceSurgeryCost);
                        OutfitUtils.RestoreFace(Actor);
                        Actor.ShowTNSAndPlayStingIfSelectable(Common.LocalizeEAString(Actor.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:CorrectiveSurgerySuccess", new object[] { Actor }), StyledNotification.NotificationStyle.kGameMessagePositive, Target.ObjectId, ObjectGuid.InvalidObjectGuid, "sting_plastic_surgery_undo");
                        mReaction = Reaction.Happy;
                    }
                    break;

                case Hospital.SurgeryTypes.PlasticSurgeryCorrectiveBody:
                    if ((Actor.SimDescription.PreSurgeryBodyFitness != -1f) && (Actor.FamilyFunds >= Hospital.kCorrectiveBodySurgeryCost))
                    {
                        Actor.ModifyFunds(-Hospital.kCorrectiveBodySurgeryCost);
                        OutfitUtils.RestoreBody(Actor);
                        Actor.ShowTNSAndPlayStingIfSelectable(Common.LocalizeEAString(Actor.IsFemale, "Gameplay/Objects/RabbitHoles/Hospital/PlasticSurgery:CorrectiveSurgerySuccess", new object[] { Actor }), StyledNotification.NotificationStyle.kGameMessagePositive, Target.ObjectId, ObjectGuid.InvalidObjectGuid, "sting_plastic_surgery_undo");
                        mReaction = Reaction.Happy;
                    }
                    break;
                }

                /*
                 * if (mReaction != Reaction.None)
                 * {
                 *  Actor.RecreateOccupationOutfits();
                 *  (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).NotifySimChanged(Actor.ObjectId);
                 * }
                 */
            }
        }
Example #12
0
            // Methods
            public override bool Run()
            {
                if (!IntroTutorial.IsRunning || IntroTutorial.AreYouExitingTutorial())
                {
                    if (!RouteAndAnimate(this, base.Actor))
                    {
                        return(false);
                    }

                    if (Sims3.Gameplay.UI.Responder.Instance.OptionsModel.SaveGameInProgress)
                    {
                        base.BeginCommodityUpdates();
                        base.EndCommodityUpdates(true);
                        return(true);
                    }
                    this.mTookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(base.Actor, ~(ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    if (!this.mTookSemaphore)
                    {
                        base.StandardExit();
                        return(false);
                    }
                    //  if (base.Actor.IsSelectable)
                    {
                        while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                        {
                            Simulator.Sleep(0);
                        }
                        base.BeginCommodityUpdates();
                        SimDescription simDescription = base.Actor.SimDescription;
                        if (simDescription == null)
                        {
                            throw new Exception("ChangeOutfit:  sim doesn't have a description!");
                        }
                        CASChangeReporter.Instance.ClearChanges();
                        GameStates.TransitionToCASDresserMode();
                        CASLogic singleton = CASLogic.GetSingleton();
                        bool     flag2     = false;

                        try
                        {
                            singleton.LoadSim(simDescription, base.Actor.CurrentOutfitCategory, 0);
                            while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                            {
                                Simulator.Sleep(0);
                            }
                            CASChangeReporter.Instance.SendChangedEvents(base.Actor);
                            CASChangeReporter.Instance.ClearChanges();
                            EventTracker.SendEvent(EventTypeId.kPlannedOutfit, base.Actor, base.Target);
                            flag2 = true;
                            base.Actor.InteractionQueue.CancelAllInteractionsByType(Dresser.ChangeClothes.Singleton);
                        }
                        finally
                        {
                        }
                        base.EndCommodityUpdates(flag2);
                        if (base.Actor.CurrentOutfitIndex > simDescription.GetOutfitCount(base.Actor.CurrentOutfitCategory))
                        {
                            base.Actor.UpdateOutfitInfo();
                        }
                        base.Actor.RecreateOccupationOutfits();
                        (Sims3.Gameplay.UI.Responder.Instance.HudModel as HudModel).NotifySimChanged(base.Actor.ObjectId);

                        //Animate View object, and handle the purchases
                        this.AcquireStateMachine("viewobjectinteraction");
                        this.SetActor("x", Actor);
                        this.EnterSim("Enter");
                        this.AnimateSim("1");

                        logic_ClosingDown(this.Actor);

                        return(flag2);
                    }
                }

                return(false);
            }
        public override bool Run()
        {
            try
            {
                if (!IntroTutorial.IsRunning || IntroTutorial.AreYouExitingTutorial())
                {
                    bool flag = true;
                    if (!Target.RouteToPedestal(Actor, true))
                    {
                        return(false);
                    }

                    if (Responder.Instance.OptionsModel.SaveGameInProgress)
                    {
                        return(false);
                    }

                    mTookSemaphore = GameStates.WaitForInteractionStateChangeSemaphore(Actor, ~(ExitReason.Replan | ExitReason.MidRoutePushRequested | ExitReason.ObjectStateChanged | ExitReason.PlayIdle | ExitReason.MaxSkillPointsReached));
                    if (!mTookSemaphore)
                    {
                        return(false);
                    }

                    if (Actor.IsSelectable)
                    {
                        while ((Sims3.Gameplay.Gameflow.CurrentGameSpeed == Sims3.Gameplay.Gameflow.GameSpeed.Pause) || MoveDialog.InProgress())
                        {
                            SpeedTrap.Sleep(0x0);
                        }

                        StandardEntry();
                        BeginCommodityUpdates();
                        EnterStateMachine("ShoppingPedestal", "Enter", "x");
                        SetParameter("x:Age", Actor.SimDescription.Age);
                        AnimateSim("Change Item");

                        SimDescription simDesc = Actor.SimDescription;
                        if (Actor.FamilyFunds >= ClothingPedestal.kCostToPlanPurchaseOutfit)
                        {
                            simDesc = Actor.SimDescription;
                            if (simDesc == null)
                            {
                                throw new Exception("ChangeOutfit:  sim doesn't have a description!");
                            }

                            if (GameUtils.IsInstalled(ProductVersion.EP2))
                            {
                                new Sims.Stylist(Sims.CASBase.EditType.None, Target.DisplayCategory).Perform(new GameHitParameters <GameObject>(Actor, Actor, GameObjectHit.NoHit));
                            }
                            else
                            {
                                new Sims.Dresser(Sims.CASBase.EditType.None, Target.DisplayCategory).Perform(new GameHitParameters <GameObject>(Actor, Actor, GameObjectHit.NoHit));
                            }

                            while (GameStates.NextInWorldStateId != InWorldState.SubState.LiveMode)
                            {
                                SpeedTrap.Sleep(0x0);
                            }

                            if (!CASChangeReporter.Instance.CasCancelled && !Actor.IsOnHomeLot(Target))
                            {
                                simDesc.Household.ModifyFamilyFunds(-ClothingPedestal.kCostToPlanPurchaseOutfit);
                            }
                        }

                        AnimateSim("Exit");
                        EndCommodityUpdates(true);
                        StandardExit();
                        if (Actor.CurrentOutfitIndex > simDesc.GetOutfitCount(Actor.CurrentOutfitCategory))
                        {
                            Actor.UpdateOutfitInfo();
                        }
                        Actor.RecreateOccupationOutfits();
                        (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).NotifySimChanged(Actor.ObjectId);
                        EventTracker.SendEvent(EventTypeId.kBoughtOutfitFromPedestal, Actor, Target);
                        return(flag);
                    }
                }
                return(false);
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
            }

            return(false);
        }