protected virtual bool Allow(MiniSimDescription me, IMiniSimDescription actor) { IEnumerable <TOption> options = GetOptions(); if (options == null) { return(true); } if (MatchAll) { foreach (TOption option in options) { if (!option.Test(me, false, actor)) { return(false); } } return(true); } else { foreach (TOption option in options) { if (option.Test(me, false, actor)) { return(true); } } return(false); } }
public static void GenerateCrossWorldThumbnail(MiniSimDescription miniSim, SimDescription sim, bool forceGeneration) { if (forceGeneration || (sim.HomeWorld == GameUtils.GetCurrentWorld())) { ThumbnailTechnique technique = sim.IsDead ? ThumbnailTechnique.Sepia : ThumbnailTechnique.Default; ResourceKey travelThumbnailOutfitForSim = MiniSimDescription.GetTravelThumbnailOutfitForSim(sim); if (travelThumbnailOutfitForSim.InstanceId != 0x0L) { ThumbnailManager.GenerateHouseholdSimThumbnail(travelThumbnailOutfitForSim, travelThumbnailOutfitForSim.InstanceId, 0x0, ThumbnailSizeMask.Large, technique, false, true, sim.AgeGenderSpecies); ThumbnailManager.GenerateTravelSimThumbnail(travelThumbnailOutfitForSim, miniSim.mThumbKey.mDescKey.InstanceId, ThumbnailSizeMask.Large, technique); } else { SimOutfit outfit = sim.GetOutfit(OutfitCategories.Everyday, 0); if ((outfit != null) && (outfit.IsValid)) { sim.mDefaultOutfitKey = outfit.Key; ThumbnailManager.GenerateHouseholdSimThumbnail(sim.DefaultOutfitKey, sim.DefaultOutfitKey.InstanceId, 0, ThumbnailSizeMask.Large, technique, false, true, sim.AgeGenderSpecies); ThumbnailManager.GenerateTravelSimThumbnail(sim.DefaultOutfitKey, miniSim.mThumbKey.mDescKey.InstanceId, ThumbnailSizeMask.Large, technique); } } } }
protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor) { if (mFilter == null) { return(false); } foreach (SimSelection.ICriteria item in mFilter.mElements) { if (item.CanBeRandomCriteria && RandomUtil.CoinFlip()) { continue; } ITestableOption testable = item as ITestableOption; if (testable == null) { continue; } if (!testable.Test(me, false, actor)) { return(false); } } return(true); }
public override bool Get(MiniSimDescription me, IMiniSimDescription actor, Dictionary <int, int> results) { try { if (me.CASGenealogy == null) { return(false); } if (me.CASGenealogy.IChildren == null) { return(false); } int count = me.CASGenealogy.IChildren.Count; results[count] = count; return(true); } catch { // Sim may not have a valid celebrity manager return(false); } }
protected bool Run(IMiniSimDescription a, IMiniSimDescription b) { try { if (b is SimDescription) { SimDescription sim = b as SimDescription; if (!Test(a, sim)) { return(true); } return(PrivateRun(a, sim)); } else { MiniSimDescription sim = b as MiniSimDescription; if (!Test(a, sim)) { return(true); } return(PrivateRun(a, sim)); } } catch (Exception e) { Common.Exception(a, b as SimDescription, e); return(false); } }
public override bool Get(MiniSimDescription me, IMiniSimDescription actor, Dictionary <int, int> results) { int level = Genealogies.GetFamilyLevel(me.CASGenealogy); results[level] = level; return(true); }
public static SimDescription ImportWithCheck(MiniSimDescription miniSim) { // Custom // Importing a sim that already exists in town causes issues with the long-term relationship system, don't do it SimDescription simDescription = SimDescription.Find(miniSim.SimDescriptionId); if (simDescription == null) { simDescription = UnpackSimAndUpdateRel(miniSim); if (simDescription != null) { Household.CreateTouristHousehold(); Household.TouristHousehold.AddTemporary(simDescription); miniSim.Instantiated = true; (Sims3.UI.Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).OnSimCurrentWorldChanged(true, miniSim); if (simDescription.AgingState == null) { simDescription.AgingState = new AgingState(simDescription); } simDescription.AgingState.MergeTravelInformation(miniSim); simDescription.PushAgingEnabledToAgingManager(); } } return(simDescription); }
protected override bool Run(MiniSimDescription me, bool singleSelection) { if (!Prompt(me)) return false; Annihilation.Cleanse(me); return true; }
public bool GetAgelessForeign(MiniSimDescription desc) { if (desc.HomeWorld != WorldName.Undefined && desc.HomeWorld != WorldName.UserCreated) { return(mAgelessForeign.ContainsKey(desc.HomeWorld)); } if (mWorldForSims.ContainsKey(desc.SimDescriptionId)) { string world = mWorldForSims[desc.SimDescriptionId]; string name = world.Replace(".world", ""); WorldName worldName = WorldName.Undefined; try { worldName = unchecked ((WorldName)ResourceUtils.HashString32(name.Replace(" ", ""))); } catch { return(true); } return(mAgelessForeign.ContainsKey(worldName)); } return(true); }
protected static void RepairMiniSim(SimDescription sim) { if (sim == null) { return; } MiniSimDescription miniSim = MiniSimDescription.Find(sim.SimDescriptionId); if (miniSim != null) { if (sim.Partner != null) { if (miniSim.PartnerSimDescriptionId != sim.Partner.SimDescriptionId) { Overwatch.Log(Relationships.GetFullName(sim) + " MiniSim Partner Reset"); miniSim.PartnerSimDescriptionId = sim.Partner.SimDescriptionId; } } else { if (miniSim.PartnerSimDescriptionId != 0) { Overwatch.Log(Relationships.GetFullName(sim) + " MiniSim Partner Cleared"); miniSim.PartnerSimDescriptionId = 0; } } } }
protected override OptionResult Run(GameHitParameters <GameObject> parameters) { if (!AcceptCancelDialog.Show(Common.Localize(GetTitlePrefix() + ":Prompt"))) { return(OptionResult.Failure); } // Store for later use List <SimDescription> sims = new List <SimDescription>(GameStates.TravelHousehold.AllSimDescriptions); GameStates.sTravelData = null; WorldData.SetVacationWorld(false, true); WorldName currentWorld = GameUtils.GetCurrentWorld(); foreach (SimDescription sim in sims) { MiniSimDescription miniSim = MiniSimDescription.Find(sim.SimDescriptionId); if (miniSim != null) { miniSim.mHomeWorld = currentWorld; } sim.mHomeWorld = currentWorld; } if (Sim.ActiveActor != null) { (Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).OnSimAgeChanged(Sim.ActiveActor.ObjectId); } return(OptionResult.SuccessClose); }
public static SimDescription UnpackSim(MiniSimDescription ths, bool updateGenealogy) { try { if (ths == null) { return(null); } // Calling ImportSimDescription prior to the Aging Manager being available is invalid, don't allow it if (AgingManager.Singleton == null) { return(null); } SimDescription desc = new SimDescription(); ResourceKeyContentCategory installed = ResourceKeyContentCategory.kInstalled; DownloadContent.ImportSimDescription(ths.mTravelKey, desc, ref installed); desc.SimDescriptionId = ths.mSimDescriptionId; if (desc.CareerManager != null) { // Fixup for careers require a household, which is not set until later in this process desc.CareerManager.mJob = null; desc.CareerManager.mSchool = null; } desc.Fixup(); if (updateGenealogy && !GameStates.IsTravelling) { if (desc.DefaultOutfitKey == ResourceKey.kInvalidResourceKey) { SimOutfit outfit = desc.GetOutfit(OutfitCategories.Everyday, 0x0); if ((outfit == null) || (!outfit.IsValid)) { desc.Dispose(false, false); return(null); } desc.UpdateFromOutfit(OutfitCategories.Everyday); } desc.CASGenealogy = ths.CASGenealogy; } Corrections.CleanupBrokenSkills(desc, null); OccultTypeHelper.ValidateOccult(desc, null); return(desc); } catch (Exception e) { Common.Exception(ths.FullName, e); return(null); } }
private static void UpdateInWorldRelationships(MiniSimDescription ths, SimDescription myDesc) { foreach (MiniRelationship relationship in ths.mMiniRelationships) { MiniSimDescription description = Find(relationship.SimDescriptionId); if ((description != null) && description.Instantiated) { SimDescription y = SimDescription.Find(relationship.SimDescriptionId); if (y == null) { description.Instantiated = false; } else { Relationship unsafely; MiniRelationship mrB = description.FindMiniRelationship(ths, false); // Custom if (mrB != null) { if (GameStates.IsTravelling) { unsafely = Relationship.GetUnsafely(myDesc, y); } else { unsafely = Relationship.Get(myDesc, y, true); } unsafely.UpdateFromMiniRelationship(relationship, mrB); } } } } }
public new List <SimDescription> CreateNewbornsBeforePacking(float bonusMoodPoints, bool addToFamily, int numSims, int numPets) { SimDescription geneticMom = null, geneticDad = null, robotDad = null; MiniSimDescription miniMom = null, miniDad = null, miniRoboDad = null; List <SimDescription> results; GetParentDescriptions(ref geneticMom, ref miniMom, ref geneticDad, ref miniDad, ref robotDad, ref miniRoboDad); if (RobotDadDescriptionID != 0uL) { results = CreateNewbornsBeforePacking(geneticMom, robotDad, geneticDad, bonusMoodPoints, addToFamily, numSims, numPets); } else { results = CreateNewbornsBeforePacking(geneticMom, geneticDad, bonusMoodPoints, addToFamily, numSims, numPets); } if (miniMom != null) { geneticMom.Dispose(true, true); } if (miniDad != null) { geneticDad.Dispose(true, true); } if (miniRoboDad != null) { robotDad.Dispose(true, true); } return(results); }
public static void PackUpToMiniSimDescription(SimDescription ths) { if (ths.CreatedSim != null) { ths.CreatedSim.Destroy(); Common.Sleep(); } if (Find(ths.SimDescriptionId) != null) { SimDescription father = null; if (ths.Pregnancy != null) { if ((ths.Pregnancy.mDad == null) || ths.Pregnancy.mDad.HasBeenDestroyed) { if (SimDescription.Find(ths.Pregnancy.DadDescriptionId) == null) { MiniSimDescription description = Find(ths.Pregnancy.DadDescriptionId); if (description != null) { father = UnpackSim(description); father.Genealogy.SetSimDescription(father); Household.TouristHousehold.AddTemporary(father); } } } } PackSim(ths); if (father != null) { father.Dispose(true, true); } } else { MiniSimDescription.AddMiniSim(ths); ths.Household.RemoveTemporary(ths); MiniSimDescription miniSim; if (MiniSimDescription.sMiniSims.TryGetValue(ths.SimDescriptionId, out miniSim)) { GenerateCrossWorldThumbnail(miniSim, ths, true); } ths.Dispose(true, true); } ths.mPackingDescriptionTask = null; if (!GameStates.IsTravelling) { (Sims3.Gameplay.UI.Responder.Instance.HudModel as Sims3.Gameplay.UI.HudModel).OnSimCurrentWorldChanged(false, ths); } ths.ClearOutfits(true); }
protected override bool PrivateAllow(IMiniSimDescription a, MiniSimDescription b) { if (!Fixup(a as SimDescription)) { return(false); } return(Allow(a.CASGenealogy as Genealogy, b.Genealogy)); }
protected override bool Run(SimDescription a, MiniSimDescription b) { if (!Fixup(a)) { return(false); } return(Run(a.Genealogy, b.Genealogy)); }
protected bool Test(MiniSimDescription me) { if (!AllowSpecies(me)) { return(false); } return(PrivateAllow(me)); }
protected override bool PrivateAllow(MiniSimDescription me) { if (!base.PrivateAllow(me)) { return(false); } return(Allow(me.Genealogy)); }
protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor) { Genealogy genealogy = actor.CASGenealogy as Genealogy; if (genealogy == null) return false; if (me.Genealogy.IsSufficientlyRelatedToRuleOutRomance(genealogy)) return false; return true; }
protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor) { if (me.LastName == null) { return(false); } return(me.LastName.Trim().ToLower().StartsWith(mPrefix)); }
protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor) { if (me.HouseholdMembers == null) { return(false); } return(!me.HouseholdMembers.Contains(actor.SimDescriptionId)); }
protected bool Test(IMiniSimDescription a, MiniSimDescription b) { if (!AllowSpecies(a, b)) { return(false); } return(PrivateAllow(a, b)); }
protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor) { Genealogy genealogy = actor.CASGenealogy as Genealogy; if (genealogy == null) return false; if (!me.Genealogy.IsBloodRelated(genealogy)) return false; return true; }
public static List <KnownInfo> GetKnownInfo(HudModel ths, IMiniSimDescription simDesc) { if ((ths.mSavedCurrentSim != null) && (ths.mSavedCurrentSim.SimDescription != null) && (simDesc != null)) { if (ths.mSavedCurrentSim.SimDescription == simDesc) { return(GetKnownInfoAboutSelf(ths, simDesc)); } if (simDesc is SimDescription) { if (ths.mSavedCurrentSim.SocialComponent != null) { foreach (Relationship relationship in ths.mSavedCurrentSim.SocialComponent.Relationships) { if (relationship == null) { continue; } SimDescription otherSimDescription = relationship.GetOtherSimDescription(ths.mSavedCurrentSim.SimDescription); if (otherSimDescription != simDesc) { continue; } InformationLearnedAboutSim learnedInfo = relationship.InformationAbout(otherSimDescription); return(GetKnownInfoList(ths, otherSimDescription, learnedInfo)); } } } else { MiniSimDescription tsd = MiniSimDescription.Find(ths.mSavedCurrentSim.SimDescription.SimDescriptionId); if (tsd != null) { foreach (MiniRelationship relationship in tsd.MiniRelationships) { if (relationship == null) { continue; } if (relationship.SimDescriptionId != simDesc.SimDescriptionId) { continue; } MiniSimDescription otherTsd = MiniSimDescription.Find(relationship.SimDescriptionId); return(relationship.GetKnownInfo(tsd, otherTsd)); } } } } return(new List <KnownInfo>()); }
public new List <SimDescription> CreateNewbornsBeforePacking(float bonusMoodPoints, bool bAddToFamily, int householdSimMembers, int householdPetMembers) { MiniSimDescription miniDescription = null; SimDescription description; if (mDad == null || mDad.HasBeenDestroyed) { description = SimDescription.Find(DadDescriptionId); if (description == null) { miniDescription = MiniSimDescription.Find(DadDescriptionId); if (miniDescription != null) { description = miniDescription.UnpackSim(); description.Genealogy.SetSimDescription(description); } } } else { description = mDad.SimDescription; } float averageMoodForBirth = GetAverageMoodForBirth(description, bonusMoodPoints); Random pregoRandom = new Random(mRandomGenSeed); int numForBirth = GetNumForBirth(description, pregoRandom, householdSimMembers, householdPetMembers); Random gen = new Random(mRandomGenSeed); List <SimDescription> list = new List <SimDescription>(); for (int i = 0; i < numForBirth; i++) { DetermineGenderOfBaby(gen); CASAgeGenderFlags gender = mGender; mGender = CASAgeGenderFlags.None; SimDescription description2 = AlienUtilsEx.MakeAlienBaby(description, mMom.SimDescription, gender, averageMoodForBirth, pregoRandom, false); description2.WasCasCreated = false; if (bAddToFamily) { mMom.Household.Add(description2); Sim sim = description2.Instantiate(mMom.Position); CheckForGhostBaby(sim); } list.Add(description2); } if (miniDescription != null) { description.Dispose(true, true); } return(list); }
protected override bool PrivateUpdate(ScenarioFrame frame) { MiniSimDescription miniSim = Sim.GetMiniSimForProtection(); if (miniSim != null) { miniSim.AddProtection(MiniSimDescription.ProtectionFlag.PartialFromPlayer); } return(true); }
public static void Add(SimDescription sim, MiniSimDescription miniSim) { sChecks.Add(new Check(sim, miniSim)); if (sTask == null) { sTask = new AgingCheckTask(); sTask.AddToSimulator(); } }
protected override bool Run(MiniSimDescription me, bool singleSelection) { if (!Prompt(me)) { return(false); } Annihilation.Cleanse(me); return(true); }
protected virtual bool PrivateAllow(IMiniSimDescription a, MiniSimDescription b) { SimDescription simA = a as SimDescription; if (simA == null) { return(false); } return(PrivateAllow(simA, b)); }
public void Validate() { foreach (ulong sim in sims) { IMiniSimDescription desc = MiniSimDescription.Find(sim); if (desc == null) { sims.Remove(sim); } } }
public bool GetAgelessForeign(MiniSimDescription desc) { WorldName name = GetHomeWorld(desc as IMiniSimDescription); if (name != WorldName.Undefined) { return(mAgelessForeign.ContainsKey(name)); } return(true); }
protected static List <TraitNames> GetTraits(MiniSimDescription sim) { List <TraitNames> traits = new List <TraitNames>(); if (sim.Traits != null) { traits.AddRange(sim.Traits); } return(traits); }
public static void MergeTravelInformation(SimDescription ths, MiniSimDescription msd, Dictionary<ulong,SimDescription> allSims) { Common.StringBuilder msg = new Common.StringBuilder("MergeTravelInformation " + ths.FullName + Common.NewLine); msg += "A"; Traveler.InsanityWriteLog(msg); foreach (MiniRelationship relationship in msd.MiniRelationships) { SimDescription y = null; if (!allSims.TryGetValue(relationship.SimDescriptionId, out y)) { y = SimDescription.Find(relationship.SimDescriptionId); } if (y != null) { Relationship unsafely = null; try { unsafely = Relationship.GetUnsafely(ths, y); } catch (Exception e) { Common.Exception(ths, e); } if (unsafely != null) { float change = relationship.Value - unsafely.LTR.Liking; if (change != 0f) { unsafely.LTR.UpdateLiking(change); } RomanceVisibilityState.MergeTravelInformationOnTravelBackHome(relationship, unsafely); } } } msg += "B"; Traveler.InsanityWriteLog(msg); ths.CASGenealogy = msd.CASGenealogy; AgingCheckTask.Add(ths, msd); msg += "C"; Traveler.InsanityWriteLog(msg); }
protected static void Update(MiniSimDescription miniSim) { if (miniSim == null) return; while ((AgingManager.Singleton == null) || (AlarmManager.Global == null)) { SpeedTrap.Sleep(); } if (MiniSims.UpdateThumbnailKey(miniSim) == MiniSims.Results.Success) { //Common.DebugNotify("Updated: " + miniSim.FullName); SpeedTrap.Sleep(); } }
protected override bool PrivateAllow(MiniSimDescription me) { return true; }
public bool GetAgelessForeign(MiniSimDescription desc) { if (desc.HomeWorld != WorldName.Undefined && desc.HomeWorld != WorldName.UserCreated) { return mAgelessForeign.ContainsKey(desc.HomeWorld); } if (mWorldForSims.ContainsKey(desc.SimDescriptionId)) { string world = mWorldForSims[desc.SimDescriptionId]; string name = world.Replace(".world", ""); WorldName worldName = WorldName.Undefined; try { worldName = unchecked((WorldName)ResourceUtils.HashString32(name.Replace(" ", ""))); } catch { return true; } return mAgelessForeign.ContainsKey(worldName); } return true; }
public Check(SimDescription sim, MiniSimDescription miniSim) { mSim = sim; mMiniSim = miniSim; }
public static bool IsOccult(MiniSimDescription sim, OccultTypes type) { switch (type) { case OccultTypes.Vampire: return sim.IsVampire; case OccultTypes.Frankenstein: return sim.IsFrankenstein; case OccultTypes.Mummy: return sim.IsMummy; case OccultTypes.Unicorn: return sim.IsUnicorn; case OccultTypes.Genie: return sim.IsGenie; case OccultTypes.Fairy: return sim.IsFairy; case OccultTypes.Ghost: return sim.IsDead || sim.IsPlayableGhost; case OccultTypes.Werewolf: return sim.IsWerewolf; case OccultTypes.Witch: return sim.IsWitch; case OccultTypes.Mermaid: return sim.IsMermaid; case OccultTypes.Robot: return sim.IsEP11Bot; } return false; }
public static bool IsDead(MiniSimDescription sim) { if (sim == null) return true; if (sim.IsPlayableGhost) return false; return sim.IsDead; }
protected override bool PrivateAllow(MiniSimDescription me) { if (IsFirst) return true; foreach (IMiniSimDescription a in mA) { if (Test(a, me)) return true; } return false; }
public static bool Matches(MiniSimDescription sim, SimType type) { switch(type) { case SimType.MiniSim: return true; case SimType.Dead: return IsDead(sim); case SimType.Alive: return !IsDead(sim); case SimType.Service: return sim.IsServicePerson; case SimType.Mummy: return sim.IsMummy; case SimType.Alien: return sim.IsAlien; case SimType.Animal: return !sim.IsHuman; case SimType.Fairy: return sim.IsFairy; case SimType.Frankenstein: case SimType.SimBot: return sim.IsFrankenstein; case SimType.PlayableGhost: return sim.IsPlayableGhost; case SimType.Unicorn: return sim.IsUnicorn; case SimType.Vampire: return sim.IsVampire; case SimType.Werewolf: return sim.IsWerewolf; case SimType.Witch: return sim.IsWitch; case SimType.Genie: return sim.IsGenie; case SimType.Mermaid: return sim.IsMermaid; case SimType.Human: return sim.IsHuman; case SimType.Married: return sim.IsMarried; case SimType.Partnered: return sim.HasPartner; case SimType.Foreign: return (sim.HomeWorld != GameUtils.GetCurrentWorld()); case SimType.Local: return (sim.HomeWorld == GameUtils.GetCurrentWorld()); case SimType.Plumbot: return sim.IsEP11Bot; case SimType.Dog: return sim.IsADogSpecies; case SimType.Cat: return sim.IsCat; case SimType.Horse: return sim.IsHorse; case SimType.Deer: return sim.IsDeer; case SimType.Raccoon: return sim.IsRaccoon; case SimType.Role: return sim.HasAssignedRole; case SimType.Employed: return sim.JobIcon != string.Empty; case SimType.Unemployed: return sim.JobIcon == string.Empty; case SimType.HasDegree: return sim.mDegrees.Count > 0; case SimType.Degreeless: return sim.mDegrees.Count == 0; } return false; }
protected override bool PrivateAllow(MiniSimDescription me) { // Base class checks IsValidDescription //if (!base.Allow(me)) return false; if (me.ToddlerOrBelow) return false; if (mTest != null) { if (!mTest.Test(me)) return false; } return true; }
protected virtual bool PrivateAllow(SimDescription a, MiniSimDescription b) { return false; }
protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor) { return ValidChoices.ContainsKey(me.SimDescriptionId); }
protected override bool PrivateAllow(MiniSimDescription me) { //if (!base.Allow(me)) return false; return true; }
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); } }
protected override bool Run(MiniSimDescription me, bool singleSelection) { Perform(me); return true; }
static FamilyTreeDialog() { sConstructorStub = new MiniSimDescription(); sConstructorStub.mGenealogy = new Genealogy(); }
protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor) { //if (!base.Allow(me, actor)) return false; return true; }
protected override bool Run(MiniSimDescription me, bool singleSelection) { return Annihilation.Cleanse(me); }
protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor) { if (me.FirstName == null) return false; return me.FirstName.Trim().ToLower().StartsWith(mPrefix); }
protected virtual bool Run(SimDescription a, MiniSimDescription b) { return false; }
protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor) { if (me.HouseholdMembers == null) return false; return !me.HouseholdMembers.Contains (actor.SimDescriptionId); }
protected bool Test(IMiniSimDescription a, MiniSimDescription b) { if (!AllowSpecies(a, b)) return false; return PrivateAllow(a, b); }
protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor) { return me.IsMale; }
protected virtual bool PrivateAllow(IMiniSimDescription a, MiniSimDescription b) { SimDescription simA = a as SimDescription; if (simA == null) return false; return PrivateAllow(simA, b); }
protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor) { return !IsMyAncestor(me.CASGenealogy as Genealogy, actor.CASGenealogy as Genealogy); }
protected override bool Allow(MiniSimDescription me, IMiniSimDescription actor) { if (mFilter == null) return false; foreach (SimSelection.ICriteria item in mFilter.mElements) { ITestableOption testable = item as ITestableOption; if (testable == null) continue; if (!testable.Test(me, false, actor)) { return false; } } return true; }