protected override OptionResult Perform(IActor actor, GameObject target, GameObjectHit hit) { Lot lot = GetLot(target, hit); if (lot == null) { return(OptionResult.Failure); } string backupAddress = ""; string key = World.GetLotAddressKey(lot.LotId); if (!string.IsNullOrEmpty(key) && Localization.HasLocalizationString(key)) { backupAddress = Common.LocalizeEAString(key); } string text = StringInputDialog.Show(GetInteractionName(), GetPrompt(lot, lot.Household, backupAddress), lot.Address, StringInputDialog.Validation.NoneAllowEmptyOK); if (text == null || text == lot.Address) { return(OptionResult.Failure); } if (text == "" || text == backupAddress) { Tagger.Settings.mAddresses.Remove(lot.LotId); } else { Tagger.Settings.AddAddress(lot.LotId, text); } lot.mAddressLocalizationKey = text; return(OptionResult.SuccessClose); }
public override InteractionTestResult Test(ref InteractionInstanceParameters parameters, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { try { mHit = parameters.Hit; if (!BaseInteractionTuning.kDisplayAlways) { if (!Cheats.sTestingCheatsEnabled) { return(InteractionTestResult.Def_TestFailed); } } if (Test(parameters.Actor, parameters.Target as OBJ, parameters.Autonomous, ref greyedOutTooltipCallback)) { return(InteractionTestResult.Pass); } } catch (ResetException) { throw; } catch (Exception e) { Common.Exception(parameters.Actor, parameters.Target, e); } return(InteractionTestResult.Def_TestFailed); }
public static Lot GetLot(GameObject target, GameObjectHit hit) { Lot lot = target as Lot; if (lot != null) { if (lot.IsBaseCampLotType) { return(null); } return(lot); } if (target is Sims3.Gameplay.Objects.Electronics.Computer) { return(null); } if (target is RabbitHole) { return(null); } if (target != null) { if (target.LotCurrent != null) { return(target.LotCurrent); } } return(LotManager.GetLotAtPoint(hit.mPoint)); }
protected override bool Test(IActor actor, Lot target, GameObjectHit hit, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (Common.IsRootMenuObject(target)) { return(false); } return(base.Test(actor, target, hit, ref greyedOutTooltipCallback)); }
protected override bool Test(IActor actor, GameObject target, GameObjectHit hit, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (target is Lot) { return(Common.IsRootMenuObject(target)); } return(true); }
public static InteractionDefinitionOptionList CreateNesting(IActor actor, GameObjectHit hit, List <InteractionObjectPair> pairs) { InteractionDefinitionOptionList primary = new InteractionDefinitionOptionList(""); foreach (InteractionObjectPair pair in pairs) { GreyedOutTooltipCallback greyedOutTooltipCallback = null; InteractionInstanceParameters parameters = new InteractionInstanceParameters(pair, actor, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true); parameters.mGameObjectHit = hit; InteractionTestResult result = pair.InteractionDefinition.Test(ref parameters, ref greyedOutTooltipCallback); if (!IUtil.IsPass(result)) { continue; } string[] paths = pair.InteractionDefinition.GetPath(actor.IsFemale); List <string> fullPath = new List <string>(); if (paths != null) { fullPath.AddRange(paths); } if (pair is IopWithPrependedPath) { fullPath.Insert(0, (pair as IopWithPrependedPath).PrependPath); } InteractionDefinitionOptionList list = primary; foreach (string path in fullPath) { string lookup = path; if (lookup == null) { lookup = ""; } InteractionDefinitionOptionList nextList = list.GetOption(lookup); if (nextList == null) { nextList = new InteractionDefinitionOptionList(lookup); list.Add(nextList); } list = nextList; } list.Add(new InteractionDefinitionOption(pair, actor)); } return(primary); }
protected override bool Test(IActor actor, GameObject target, GameObjectHit hit, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (!Common.kDebugging) { return(false); } return(base.Test(actor, target, hit, ref greyedOutTooltipCallback)); }
/* * public override InteractionInstance CreateInstance(ref InteractionInstanceParameters parameters) * { * InteractionInstance na = new FishAutonomouslyEx(); * na.Init(ref parameters); * return na; * } */ public override InteractionTestResult Test(ref InteractionInstanceParameters parameters, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { //if (parameters.Autonomous) { GameObjectHit gameObjectHit = InteractionInstance.CreateFakeGameObjectHit(parameters.Target.Position); InteractionObjectPair iop = new IopWithCustomTuning(FishHere.Singleton, Terrain.Singleton, parameters.InteractionObjectPair.Tuning, parameters.Target.GetType()); InteractionInstanceParameters parameters2 = new InteractionInstanceParameters(iop, parameters.Actor, parameters.Priority, parameters.Autonomous, parameters.CancellableByPlayer, gameObjectHit); return(FishHere.Singleton.Test(ref parameters2, ref greyedOutTooltipCallback)); } //return InteractionTestResult.Gen_NotAutonomous; }
protected override bool Test(IActor a, GameObject target, GameObjectHit hit, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { Lot lot = Porter.GetLot(target); if (lot == null) { return(false); } return(lot.IsResidentialLot); }
protected override bool Test(IActor actor, Sim target, GameObjectHit hit, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (PortraitPanel.Settings.mShowCycleButton) { if (!PortraitPanel.Settings.mShowSimMenu) { return(false); } } return(base.Test(actor, target, hit, ref greyedOutTooltipCallback)); }
private bool OnPickLot(Lot ths, UIMouseEventArgs eventArgs, GameObjectHit gameObjectHit) { BuildableShell[] buildableShells = ths.BuildableShells; int index = 0x0; while (index < buildableShells.Length) { return(GameObjectEx.OnPick(buildableShells[index], eventArgs, gameObjectHit)); } return(GameObjectEx.OnPick(ths, eventArgs, gameObjectHit)); }
protected override bool Test(IActor actor, GameObject target, GameObjectHit hit, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { Sim targetSim = target as Sim; if (targetSim != null) { return(target == actor); } else { return(true); } }
public static OptionResult Perform(IActor actor, GameObjectHit hit, List <InteractionObjectPair> pairs, bool popupStyle) { if (popupStyle) { Sims3.Gameplay.UI.PieMenu.TestAndBringUpPieMenu(actor, new InteractionDefinitionOptionList.UIMouseEventArgsEx(), hit, pairs, InteractionMenuTypes.Normal); return(OptionResult.SuccessClose); } else { InteractionDefinitionOptionList primary = InteractionDefinitionOptionList.CreateNesting(actor, hit, pairs); return(primary.Perform(new GameHitParameters <GameObject>(actor, actor as GameObject, hit))); } }
protected override bool Test(IActor a, GameObject target, GameObjectHit hit, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { Sim sim = target as Sim; if (sim != null) { if (!Overwatch.Settings.mShowSimMenu) { return(false); } return(sim == Sim.ActiveActor); } return(true); }
public Lot GetLot(GameObject target, GameObjectHit hit) { Lot lot = target as Lot; if (lot != null) { return(lot); } if (target != null && target.LotCurrent != null) { return(target.LotCurrent); } return(hit != null?LotManager.GetLotAtPoint(hit.mPoint) : null); }
private static bool TestInteractions(Sim activeActor, GameObjectHit gameObjectHit, List<InteractionObjectPair> interactions) { bool found = false; for (int i = interactions.Count - 1; i >= 0; i--) { InteractionObjectPair interaction = interactions[i]; string name = interaction.InteractionDefinition.GetType().ToString(); bool testSuccess = false, nameSuccess = false; try { InteractionInstanceParameters userDirected = new InteractionInstanceParameters(interaction, activeActor, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true); userDirected.mGameObjectHit = gameObjectHit; try { name = interaction.InteractionDefinition.GetInteractionName(ref userDirected); nameSuccess = true; } catch { name = interaction.InteractionDefinition.GetType().ToString(); } GreyedOutTooltipCallback callback = null; if (IUtil.IsPass(interaction.InteractionDefinition.Test(ref userDirected, ref callback)) || (callback != null)) { found = true; } testSuccess = true; } catch (Exception e) { Common.Exception(activeActor, interaction.Target, name, e); } if ((!testSuccess) || (!nameSuccess)) { interactions.RemoveAt(i); } } return found; }
private static bool TestInteractions(Sim activeActor, GameObjectHit gameObjectHit, List <InteractionObjectPair> interactions) { bool found = false; for (int i = interactions.Count - 1; i >= 0; i--) { InteractionObjectPair interaction = interactions[i]; string name = interaction.InteractionDefinition.GetType().ToString(); bool testSuccess = false, nameSuccess = false; try { InteractionInstanceParameters userDirected = new InteractionInstanceParameters(interaction, activeActor, new InteractionPriority(InteractionPriorityLevel.UserDirected), false, true); userDirected.mGameObjectHit = gameObjectHit; try { name = interaction.InteractionDefinition.GetInteractionName(ref userDirected); nameSuccess = true; } catch { name = interaction.InteractionDefinition.GetType().ToString(); } GreyedOutTooltipCallback callback = null; if (IUtil.IsPass(interaction.InteractionDefinition.Test(ref userDirected, ref callback)) || (callback != null)) { found = true; } testSuccess = true; } catch (Exception e) { Common.Exception(activeActor, interaction.Target, name, e); } if ((!testSuccess) || (!nameSuccess)) { interactions.RemoveAt(i); } } return(found); }
protected override bool Test(IActor actor, GameObject target, GameObjectHit hit, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (!base.Test(actor, target, hit, ref greyedOutTooltipCallback)) { return(false); } if (target is Sim) { if (!Decensor.Settings.mShowSimMenu) { return(false); } } return(true); }
protected SimDescription PrivateRun(IActor actor, Role.RoleType type, GameObjectHit hit) { Sim actorSim = actor as Sim; sFailureConditions = null; SimSelection sims = SimSelection.Create(Register.GetRoleName(type), Name, actorSim.SimDescription, type); if (sims.IsEmpty) { if (!string.IsNullOrEmpty(sFailureConditions)) { Common.DebugNotify(sFailureConditions); Common.DebugWriteLog(sFailureConditions); } SimpleMessageDialog.Show(Name, Register.Localize("Select:Error")); return(null); } SimDescription sim = sims.SelectSingle(); if (sim != null) { if (sim.CreatedByService != null) { sim.CreatedByService.EndService(sim); } if (sim.AssignedRole != null) { sim.AssignedRole.RemoveSimFromRole(); } if (CriteriaItem.HasRealJob(sim)) { if (AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":EmployedPrompt", sim.IsFemale, new object[] { sim }))) { sim.Occupation.RetireNoConfirmation(); } } } return(sim); }
protected override bool Test(IActor actor, GameObject target, GameObjectHit hit, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { Sim targetSim = target as Sim; if (targetSim != null) { if (!Woohooer.Settings.mSimMenuVisibility) { return(false); } return(target == actor); } else { return(true); } }
public bool TestNoLpp(ref InteractionInstanceParameters parameters) { var terraintest = parameters.Target as Terrain; if (terraintest == null) { return(false); } //Sim sim = parameters.Actor as Sim; GameObjectHit hit = parameters.Hit; //SwimmingInPool swimmingInPool = sim.Posture as SwimmingInPool; switch (hit.mType) { case GameObjectHitType.WaterSea: /* * if (swimmingInPool != null) * { * return !swimmingInPool.ContainerIsOcean; * } * */ return(false); case GameObjectHitType.WaterPond: /* * if (PondManager.ArePondsLiquid()) * { * if (swimmingInPool != null) * { * return !swimmingInPool.ContainerIsOcean; * } * return false; * } * break; * */ return(false); case GameObjectHitType.WaterPool: return(false); } return(true); }
protected override OptionResult Perform(IActor actor, GameObject target, GameObjectHit hit) { Lot lot = GetLot(target, hit); if (lot == null) { return(OptionResult.Failure); } uint type = (uint)lot.CommercialLotSubType; Common.Notify("Current Type: " + lot.mMetaAutonomyType.ToString()); List <Item> allOptions = new List <Item>(); foreach (Lot.MetaAutonomyType metaAutoType in Enum.GetValues(typeof(Lot.MetaAutonomyType))) { allOptions.Add(new Item(metaAutoType)); } Item selection = new CommonSelection <Item>(lot.GetLocalizedName(), allOptions).SelectSingle(); if (selection == null) { return(OptionResult.Failure); } if (!Tagger.Settings.TypeHasCustomSettings(type)) { TagSettingKey key = new TagSettingKey(); key.MetaAutonomyType = (uint)selection.Value; Tagger.Settings.mCustomTagSettings.Add(type, key); } else { Tagger.Settings.mCustomTagSettings[type].MetaAutonomyType = (uint)selection.Value; } Tagger.SetMetaAutonomyType(lot, selection.Value); Common.Notify(GetInteractionName() + ": " + selection.Value); return(OptionResult.SuccessClose); }
public static bool FishTestTerrain(ref InteractionInstanceParameters parameters) { Sim sim = parameters.Actor as Sim; GameObjectHit hit = parameters.Hit; SwimmingInPool swimmingInPool = sim.Posture as SwimmingInPool; GameObjectHitType mType = hit.mType; if ((int)mType != 1) { switch ((int)mType - 8) { case 1: return(true); case 0: if (PondManager.ArePondsLiquid()) { return(true); } return(false); case 2: return(false); // Cats cannot fish in swimming pools. So much human code about swimming pools. } } else { FishingSpot fishingSpot = GameObject.GetObject(new ObjectGuid(hit.mId)) as FishingSpot; if (fishingSpot != null) { if (PondManager.ArePondsLiquid()) { return(true); } return(false); } } return(false); }
public static void PopulateFishingPoints() { if (sFishingPoints == null) { sFishingPoints = new List <Pair <Lot, GameObjectHit> >(); foreach (Lot lot in LotManager.AllLots) { Vector3[] vectorArray; if (((lot != null) && !lot.IsWorldLot) && (World.FindPondRepresentativePositions(lot.LotId, out vectorArray) && (vectorArray.Length != 0x0))) { foreach (Vector3 vector in vectorArray) { GameObjectHit b = InteractionInstance.CreateFakeGameObjectHit(vector); if ((b.mType == GameObjectHitType.WaterSea) || (b.mType == GameObjectHitType.WaterPond)) { sFishingPoints.Add(new Pair <Lot, GameObjectHit>(lot, b)); } } } } } }
public static bool PublicTest(IActor a, GameObject target, GameObjectHit hit, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (!IsVisible(target)) { return(false); } if (!(target is Sim)) { Lot lot = OptionItem.GetLot(target, hit); if (lot != null) { if (!lot.IsResidentialLot) { if (lot.LastDisplayedLevel < 0) { return(false); } } } } return(true); }
public static FishType GetCaughtFishType(Sim actor, GameObjectHit hit) { GetSpawnerChances(actor, FishingSpot.GetFishingData(hit.mPoint, hit.mType), out List <FishType> fish, out float[] chances); float num = 0f; for (int i = 0; i < chances.Length; i++) { num += chances[i]; } if (num == 0f) { return(FishType.None); } float num2 = RandomUtil.GetFloat(num); int j; for (j = 0; num2 > chances[j]; j++) { num2 -= chances[j]; } FishType fishType = fish[j]; return(fishType); }
protected override bool Test(IActor actor, GameObject target, GameObjectHit hit, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { if (StoryProgression.Main == null) { return(false); } if (target is Sim) { if (!StoryProgressionSpace.Managers.ManagerSim.AddInteractionsOption.sQuickCheck) { return(false); } } else if ((target is Lot) || (target is BuildableShell)) { if (!StoryProgressionSpace.Managers.ManagerLot.AddInteractionsOption.sQuickCheck) { return(false); } } return(true); }
protected override bool Test(IActor actor, GameObject target, GameObjectHit hit, ref GreyedOutTooltipCallback greyedOutTooltipCallback) { Lot lot = GetLot(target, hit); return(Tagger.Settings.mEnableLotInteractions && lot != null && !lot.IsWorldLot && lot.IsCommunityLot); }
public static bool OnPick(GameObject ths, UIMouseEventArgs eventArgs, GameObjectHit gameObjectHit) { Sim activeActor = Sim.ActiveActor; try { if (!GameStates.IsPlayFlowState) { if (GameStates.IsBuildBuyLikeState) return false; bool isFemale = false; if (activeActor != null) { isFemale = activeActor.IsFemale; } InteractionMenuTypes menuType = InteractionMenuTypes.Normal; List<InteractionObjectPair> interactions = new List<InteractionObjectPair>(); if (((eventArgs.Modifiers & Modifiers.kModifierMaskShift) != Modifiers.kModifierMaskNone) && Cheats.sTestingCheatsEnabled) { interactions.AddRange(ths.GetAllCheatInteractionsForActor(activeActor)); if (Selector.Settings.mMoveInteractionsToShift) { foreach (InteractionObjectPair pair in ths.GetAllInteractionsForActor(activeActor)) { if (IsImmediateInteraction(pair, isFemale)) { interactions.Add(pair); } } } menuType = InteractionMenuTypes.Debug; GameObject.ValidateInteractionList(activeActor, interactions); } else if ((activeActor != null) && activeActor.InteractionQueue.CanPlayerQueue()) { List<InteractionObjectPair> allInteractions = null; if (ths.Charred) { allInteractions = ths.GetCharredInteractions(activeActor); } else { allInteractions = ths.GetAllInteractionsForActor(activeActor); } if (Selector.Settings.mMoveInteractionsToShift) { foreach (InteractionObjectPair pair in allInteractions) { if (!IsImmediateInteraction(pair, isFemale)) { interactions.Add(pair); } } } else { interactions = allInteractions; } GameObject.ValidateInteractionList(activeActor, interactions); Lot targetObject = LotManager.GetLot(gameObjectHit.mId); if (ths.IsOnDivingFloor && ((activeActor.Level != ths.Level) || (activeActor.LotCurrent != ths.LotCurrent))) { interactions.Add(new InteractionObjectPair(ProxyGoToTargetsLotAndScubaDive.Singleton, ths.LotCurrent)); } else if ((((targetObject != null) && targetObject.IsDivingLot) && (gameObjectHit.mType == GameObjectHitType.LotTerrain)) && ((activeActor.Level != 0) || (activeActor.LotCurrent != targetObject))) { interactions.Add(new InteractionObjectPair(ProxyGoToTargetsLotAndScubaDive.Singleton, targetObject)); } } else if ((activeActor != null) && !activeActor.InteractionQueue.CanPlayerQueue()) { Sims3.Gameplay.UI.PieMenu.ShowGreyedOutTooltip(Localization.LocalizeString("Gameplay/Abstracts/GameObject:TooManyInteractions", new object[0x0]), eventArgs.MousePosition); return true; } else { if (Selector.Settings.mShowNoInteractions) { Sims3.Gameplay.UI.PieMenu.ShowGreyedOutTooltip(Localization.LocalizeString("Gameplay/Abstracts/GameObject:NoInteractions", new object[0x0]), eventArgs.MousePosition); } return true; } if (!TestInteractions(activeActor, gameObjectHit, interactions)) { if (!Selector.Settings.mShowNoInteractions) return true; } bool success = false; try { Sims3.Gameplay.UI.PieMenu.TestAndBringUpPieMenu(ths, eventArgs, gameObjectHit, interactions, menuType); success = true; } catch (Exception e) { Common.Exception(activeActor, ths, e); } if (!success) { List<InteractionObjectPair> immediateInteractions = new List<InteractionObjectPair>(); foreach (InteractionObjectPair interaction in interactions) { if (interaction.InteractionDefinition is IImmediateInteractionDefinition) { immediateInteractions.Add(interaction); } } immediateInteractions = ths.BuildInteractions(activeActor, immediateInteractions); Sims3.Gameplay.UI.PieMenu.TestAndBringUpPieMenu(ths, eventArgs, gameObjectHit, immediateInteractions, menuType); } return true; } } catch (Exception e) { Common.Exception(activeActor, ths, e); } return false; }
protected override OptionResult Perform(IActor actor, GameObject target, GameObjectHit hit) { mTarget = target; return(new InteractionOptionList <IObjectOption, GameObject> .AllList(GetInteractionName(actor, target, hit), SingleSelection, GetOptions).Perform(new GameHitParameters <GameObject>(actor, target, hit))); }
protected abstract OptionResult Perform(IActor actor, TTarget target, GameObjectHit hit);
public void OnPickFromPanel(UIMouseEventArgs eventArgs, GameObjectHit gameObjectHit) { mSim.OnPickFromPanel(eventArgs, gameObjectHit); }
private bool OnPickLot(Lot ths, UIMouseEventArgs eventArgs, GameObjectHit gameObjectHit) { BuildableShell[] buildableShells = ths.BuildableShells; int index = 0x0; while (index < buildableShells.Length) { return GameObjectEx.OnPick(buildableShells[index], eventArgs, gameObjectHit); } return GameObjectEx.OnPick(ths, eventArgs, gameObjectHit); }
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); } }
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); } }
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); } }