Example #1
0
        public static void OnPickFromPanel(MiniSimDescription ths, UIMouseEventArgs eventArgs, GameObjectHit gameObjectHit)
        {
            try
            {
                Sims3.Gameplay.UI.PieMenu.ClearInteractions();
                Sims3.Gameplay.UI.PieMenu.HidePieMenuSimHead    = true;
                Sims3.UI.Hud.PieMenu.sIncrementalButtonIndexing = true;

                Sim activeActor = Sim.ActiveActor;
                if (activeActor != null)
                {
                    if (activeActor.InteractionQueue.CanPlayerQueue())
                    {
                        List <InteractionObjectPair> interactions = new List <InteractionObjectPair>();

                        if (GameUtils.IsInstalled(ProductVersion.EP8))
                        {
                            InteractionDefinition interaction = new Mailbox.WriteLoveLetter.Definition(ths.SimDescriptionId);
                            interactions.Add(new InteractionObjectPair(interaction, activeActor));
                        }

                        IPhone targetObject = activeActor.Inventory.Find <IPhone>();
                        if (targetObject != null)
                        {
                            interactions.Add(new InteractionObjectPair(GetCallInviteOverForeignVisitorsFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetCallChatFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetCallInviteToAttendGraduationFromRelationPanelDefinition(ths), targetObject));
                        }
                        if (GameUtils.IsInstalled(ProductVersion.EP9))
                        {
                            interactions.Add(new InteractionObjectPair(targetObject.GetSendChatTextFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetSendInsultTextFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetSendPictureTextFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetSendSecretAdmirerTextFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetSendBreakUpTextFromRelationPanelDefinition(ths), targetObject));
                            interactions.Add(new InteractionObjectPair(targetObject.GetSendWooHootyTextFromRelationPanelDefinition(ths), targetObject));
                        }

                        if (CelebrityManager.CanSocialize(activeActor.SimDescription, ths))
                        {
                            Sims3.Gameplay.UI.PieMenu.TestAndBringUpPieMenu(null, eventArgs, gameObjectHit, interactions, InteractionMenuTypes.Normal);
                        }
                        else
                        {
                            GreyedOutTooltipCallback greyedOutTooltipCallbackForced = delegate
                            {
                                return(Common.LocalizeEAString("Gameplay/CelebritySystem/CelebrityManager:NotAbleToSocialize"));
                            };
                            Sims3.Gameplay.UI.PieMenu.TestAndBringUpPieMenu(null, eventArgs, gameObjectHit, interactions, InteractionMenuTypes.Normal, "Gameplay/Abstracts/GameObject:NoInteractions", false, greyedOutTooltipCallbackForced);
                        }
                    }
                    else
                    {
                        Vector2 mousePosition;
                        if (eventArgs.DestinationWindow != null)
                        {
                            mousePosition = eventArgs.DestinationWindow.WindowToScreen(eventArgs.MousePosition);
                        }
                        else
                        {
                            mousePosition = eventArgs.MousePosition;
                        }
                        Sims3.Gameplay.UI.PieMenu.ShowGreyedOutTooltip(Common.LocalizeEAString("Gameplay/Abstracts/GameObject:TooManyInteractions"), mousePosition);
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception(ths.FullName, e);
            }
        }
Example #2
0
        public static void OnPickFromPanel(SimDescription ths, UIMouseEventArgs eventArgs, GameObjectHit gameObjectHit)
        {
            try
            {
                Sims3.Gameplay.UI.PieMenu.ClearInteractions();
                Sims3.Gameplay.UI.PieMenu.HidePieMenuSimHead    = true;
                Sims3.UI.Hud.PieMenu.sIncrementalButtonIndexing = true;

                Sim activeActor = Sim.ActiveActor;
                if (activeActor != null)
                {
                    if (activeActor.InteractionQueue.CanPlayerQueue())
                    {
                        bool success = false;
                        try
                        {
                            IPhone activePhone = null;
                            if (activeActor.Inventory != null)
                            {
                                activePhone = activeActor.Inventory.Find <IPhone>();
                            }

                            List <InteractionObjectPair> interactions = new List <InteractionObjectPair>();

                            bool isServiceAlien = (ths.Household != null) && ths.Household.IsAlienHousehold;
                            if (GameUtils.IsInstalled(ProductVersion.EP8) && !isServiceAlien)
                            {
                                interactions.Add(new InteractionObjectPair(new Mailbox.WriteLoveLetter.Definition(ths.SimDescriptionId), activeActor));
                            }

                            if (GameUtils.IsInstalled(ProductVersion.EP10))
                            {
                                interactions.Add(new InteractionObjectPair(new OccultMermaid.SignalMermaid.Definition(ths), activeActor));
                            }

                            if (ths.CreatedSim != null)
                            {
                                List <InteractionObjectPair> others = ths.CreatedSim.GetAllInteractionsForActor(activeActor);
                                if (others != null)
                                {
                                    interactions.AddRange(others);
                                }
                            }

                            if (ths.IsHuman)
                            {
                                if (ths.CreatedSim != null)
                                {
                                    interactions.Add(new InteractionObjectPair(CallOver.Singleton, ths.CreatedSim));
                                }

                                if (activePhone != null)
                                {
                                    interactions.Add(new InteractionObjectPair(activePhone.GetCallChatFromRelationPanelDefinition(ths), activePhone));

                                    if (GameUtils.IsInstalled(ProductVersion.EP4))
                                    {
                                        interactions.Add(new InteractionObjectPair(activePhone.GetCallPrank(ths), activePhone));
                                    }

                                    if (GameUtils.IsInstalled(ProductVersion.EP9))
                                    {
                                        interactions.Add(new InteractionObjectPair(activePhone.GetSendChatTextFromRelationPanelDefinition(ths), activePhone));
                                        interactions.Add(new InteractionObjectPair(activePhone.GetSendInsultTextFromRelationPanelDefinition(ths), activePhone));
                                        interactions.Add(new InteractionObjectPair(activePhone.GetSendPictureTextFromRelationPanelDefinition(ths), activePhone));
                                        interactions.Add(new InteractionObjectPair(activePhone.GetSendSecretAdmirerTextFromRelationPanelDefinition(ths), activePhone));
                                        interactions.Add(new InteractionObjectPair(activePhone.GetSendBreakUpTextFromRelationPanelDefinition(ths), activePhone));
                                        if (!sGetSendWooHootyTextDefinition.Valid)
                                        {
                                            interactions.Add(new InteractionObjectPair(activePhone.GetSendWooHootyTextFromRelationPanelDefinition(ths), activePhone));
                                        }
                                        else
                                        {
                                            InteractionDefinition instance = null;
                                            instance = sGetSendWooHootyTextDefinition.Invoke <InteractionDefinition>(new object[] { ths });
                                            interactions.Add(new InteractionObjectPair(instance, activePhone));
                                        }
                                    }

                                    if ((!ths.IsEnrolledInBoardingSchool() && !ths.IsDroppingOut) && !GameStates.IsEarlyDepartureSim(ths.SimDescriptionId))
                                    {
                                        interactions.Add(new InteractionObjectPair(activePhone.GetCallInviteOverFromRelationPanelDefinition(ths, true), activePhone));
                                        interactions.Add(new InteractionObjectPair(activePhone.GetCallInviteToLotFromRelationPanelDefintion(ths), activePhone));
                                        interactions.Add(new InteractionObjectPair(activePhone.GetCallAskOutOnDateFromRelationPanelDefintion(ths), activePhone));
                                        if (!isServiceAlien)
                                        {
                                            interactions.Add(new InteractionObjectPair(activePhone.GetCallInviteHouseholdOverFromRelationshipPanelDefiniton(ths), activePhone));
                                        }
                                        interactions.Add(new InteractionObjectPair(activePhone.GetCallInviteToAttendGraduationFromRelationPanelDefinition(ths), activePhone));
                                    }
                                    else
                                    {
                                        interactions.Add(new InteractionObjectPair(activePhone.GetRemoveFromBoardingSchool(ths), activePhone));
                                    }
                                }
                            }
                            else if (ths.IsPet)
                            {
                                if (ths.CreatedSim != null)
                                {
                                    interactions.Add(new InteractionObjectPair(Sim.CallPet.Singleton, ths.CreatedSim));
                                }

                                if (activePhone != null)
                                {
                                    interactions.Add(new InteractionObjectPair(activePhone.GetCallBringPetOverFromRelationshipPanelDefinition(ths), activePhone));
                                }
                            }

                            if (CelebrityManager.CanSocialize(activeActor.SimDescription, ths))
                            {
                                Sims3.Gameplay.UI.PieMenu.TestAndBringUpPieMenu(ths.CreatedSim, eventArgs, gameObjectHit, interactions, InteractionMenuTypes.Normal);
                                success = true;
                            }
                        }
                        catch (Exception e)
                        {
                            Common.Exception(activeActor.SimDescription, ths, e);
                        }

                        if ((!success) && (ths.CreatedSim != null))
                        {
                            Sims3.Gameplay.UI.PieMenu.TestAndBringUpPieMenu(ths.CreatedSim, eventArgs, gameObjectHit, InteractionsEx.GetImmediateInteractions(ths.CreatedSim), InteractionMenuTypes.Normal);
                        }
                    }
                    else
                    {
                        Vector2 mousePosition;
                        if (eventArgs.DestinationWindow != null)
                        {
                            mousePosition = eventArgs.DestinationWindow.WindowToScreen(eventArgs.MousePosition);
                        }
                        else
                        {
                            mousePosition = eventArgs.MousePosition;
                        }
                        Sims3.Gameplay.UI.PieMenu.ShowGreyedOutTooltip(Common.LocalizeEAString("Gameplay/Abstracts/GameObject:TooManyInteractions"), mousePosition);
                    }
                }
            }
            catch (Exception e)
            {
                Common.Exception(ths, e);
            }
        }