public static bool HasSnapshot(LifeEventManager.LifeEvent e) { if (!e.HasSnapshot) return false; UIImage image = UIManager.LoadUIImage(e.Snapshot); return (image != null); }
public override bool Perform(LifeEventManager manager) { foreach (LifeEventManager.LifeEvent e in manager.GetVisibleLifeEvents()) { e.Forget(manager.mOwnerDescription); } return(true); }
protected override bool Allow(LifeEventManager manager) { foreach (LifeEventManager.LifeEvent e in manager.GetVisibleLifeEvents()) { if (e.HasSnapshot) { return(true); } } return(false); }
public override bool Perform(LifeEventManager manager) { Dictionary <string, List <LifeEventManager.LifeEvent> > lookup = new Dictionary <string, List <LifeEventManager.LifeEvent> >(); foreach (LifeEventManager.LifeEvent e in manager.GetVisibleLifeEvents()) { string name = null; try { name = e.GetLocalizedName(manager.mOwnerDescription); } catch (Exception exception) { Common.Exception(manager.mOwnerDescription, exception); } if (string.IsNullOrEmpty(name)) { continue; } List <LifeEventManager.LifeEvent> list; if (!lookup.TryGetValue(name, out list)) { list = new List <LifeEventManager.LifeEvent>(); lookup.Add(name, list); } list.Add(e); } foreach (List <LifeEventManager.LifeEvent> list in lookup.Values) { list.Sort(OnSort); LifeEventManager.LifeEvent source = null; foreach (LifeEventManager.LifeEvent e in list) { if ((source == null) || (HasSnapshot(e))) { source = e; } else if (source.Subject == e.Subject) { e.Forget(manager.mOwnerDescription); } } } return(true); }
public override bool Perform(LifeEventManager manager) { foreach (LifeEventManager.LifeEvent e in manager.GetVisibleLifeEvents()) { if (HasSnapshot(e)) { continue; } e.Forget(manager.mOwnerDescription); } return(true); }
public abstract bool Perform(LifeEventManager manager);
protected abstract bool Allow(LifeEventManager manager);
public override bool Perform(LifeEventManager manager) { Dictionary<string, List<LifeEventManager.LifeEvent>> lookup = new Dictionary<string, List<LifeEventManager.LifeEvent>>(); foreach (LifeEventManager.LifeEvent e in manager.GetVisibleLifeEvents()) { string name = null; try { name = e.GetLocalizedName(manager.mOwnerDescription); } catch (Exception exception) { Common.Exception(manager.mOwnerDescription, exception); } if (string.IsNullOrEmpty(name)) continue; List<LifeEventManager.LifeEvent> list; if (!lookup.TryGetValue(name, out list)) { list = new List<LifeEventManager.LifeEvent>(); lookup.Add(name, list); } list.Add(e); } foreach (List<LifeEventManager.LifeEvent> list in lookup.Values) { list.Sort(OnSort); LifeEventManager.LifeEvent source = null; foreach (LifeEventManager.LifeEvent e in list) { if ((source == null) || (HasSnapshot(e))) { source = e; } else if (source.Subject == e.Subject) { e.Forget(manager.mOwnerDescription); } } } return true; }
public static int OnSort(LifeEventManager.LifeEvent left, LifeEventManager.LifeEvent right) { try { return left.Timestamp.CompareTo(right.Timestamp); } catch (Exception e) { Common.Exception("OnSort", e); return 0; } }
protected override bool Allow(LifeEventManager manager) { return (manager.mCurrentNumberOfVisibleLifeEvents > 0); }
protected override bool Allow(LifeEventManager manager) { foreach (LifeEventManager.LifeEvent e in manager.GetVisibleLifeEvents()) { if (e.HasSnapshot) return true; } return false; }
public override bool Perform(LifeEventManager manager) { foreach (LifeEventManager.LifeEvent e in manager.GetVisibleLifeEvents()) { e.Forget(manager.mOwnerDescription); } return true; }
protected override bool Allow(LifeEventManager manager) { return(manager.mCurrentNumberOfVisibleLifeEvents > 0); }
public override void Startup() { Common.StringBuilder msg = new Common.StringBuilder("LiveModeStateEx:Startup" + Common.NewLine); Traveler.InsanityWriteLog(msg); try { UIManager.BlackBackground(false); msg += "A1"; Traveler.InsanityWriteLog(msg); // StateMachineState:Startup() mBaseCallFlag |= BaseCallFlag.kStartup; // InWorldSubState:Startup() while (sDelayNextStateStartupCount > 0x0) { SpeedTrap.Sleep(); } msg += "A2"; Traveler.InsanityWriteLog(msg); EventTracker.SendEvent(new InWorldSubStateEvent(this, true)); //base.Startup(); msg += "A3"; Traveler.InsanityWriteLog(msg); ShowUI(true); if (CameraController.IsMapViewModeEnabled() && !TutorialModel.Singleton.IsTutorialRunning()) { CameraController.EnableCameraMapView(true); } msg += "B"; Traveler.InsanityWriteLog(msg); CASExitLoadScreen.Close(); bool traveling = false; if (GameStates.IsTravelling) { if (GameStates.sTravelData == null) { GameStates.ClearTravelStatics(); } else { traveling = true; GameStatesEx.OnArrivalAtVacationWorld(); } } msg += "C"; Traveler.InsanityWriteLog(msg); if (GameStates.sNextSimToSelect != null) { DreamCatcher.SelectNoLotCheckImmediate(GameStates.sNextSimToSelect, true, true); GameStates.sNextSimToSelect = null; } msg += "D"; Traveler.InsanityWriteLog(msg); bool flag2 = false; if (LoadingScreenController.Instance != null) { if ((GameStates.IsPerfTestRunning || (CommandLine.FindSwitch("campos") != null)) || (CommandLine.FindSwitch("camtarget") != null)) { msg += "D1"; Traveler.InsanityWriteLog(msg); GameUtils.EnableSceneDraw(true); LoadingScreenController.Unload(); } else if (traveling) { msg += "D2"; Traveler.InsanityWriteLog(msg); uint customFlyThroughIndex = CameraController.GetCustomFlyThroughIndex(); if (GameStates.IsNewGame && (customFlyThroughIndex != 0x0)) { msg += "D3"; Traveler.InsanityWriteLog(msg); WaitForLotLoad(true, false); ShowUI(false); ShowMaptags(false); msg += "D4"; Traveler.InsanityWriteLog(msg); AudioManager.MusicMode = MusicMode.Flyby; CameraController.OnCameraFlyThroughFinishedCallback += OnCameraFlyThroughFinishedEvent; CameraController.StartFlyThrough(customFlyThroughIndex, false); flag2 = true; msg += "D5"; Traveler.InsanityWriteLog(msg); GameUtils.EnableSceneDraw(true); LoadingScreenController.Unload(); while (LoadingScreenController.Instance != null) { Sleep(0.0); } } else { msg += "D6"; Traveler.InsanityWriteLog(msg); WaitForLotLoad(true, true); Camera.SetView(CameraView.SimView, true, true); } } else { msg += "D7"; Traveler.InsanityWriteLog(msg); Camera.RestorePersistedState(); msg += "D8"; Traveler.InsanityWriteLog(msg); WaitForLotLoad(false, true); } } else if (traveling) { msg += "D9"; Traveler.InsanityWriteLog(msg); WaitForLotLoad(!GameUtils.IsUniversityWorld(), true); Camera.SetView(CameraView.SimView, true, true); } msg += "E"; Traveler.InsanityWriteLog(msg); UserToolUtils.UserToolGeneric(0xc8, new ResourceKey(0x0L, 0x0, 0x0)); if (!flag2) { GameUtils.Unpause(); } if (AudioManager.MusicMode != MusicMode.Flyby) { AudioManager.MusicMode = MusicMode.None; } msg += "F"; Traveler.InsanityWriteLog(msg); InWorldSubState.EdgeScrollCheck(); InWorldSubState.OpportunityDialogCheck(); try { DreamsAndPromisesManager.ValidateLifetimeWishes(); } catch (Exception e) { Common.Exception(msg, e); } LifeEventManager.ValidatePendingLifeEvents(); if (GameUtils.IsInstalled(ProductVersion.EP9)) { Tutorialette.TriggerLesson(Lessons.Degrees, Sim.ActiveActor); } if (GameUtils.GetCurrentWorldType() == WorldType.Base) { Tutorialette.TriggerLesson(Lessons.Traveling, Sim.ActiveActor); } if (Sims3.Gameplay.ActiveCareer.ActiveCareer.ActiveCareerShowGeneralLesson) { Tutorialette.TriggerLesson(Lessons.Professions, Sim.ActiveActor); } msg += "G"; Traveler.InsanityWriteLog(msg); Tutorialette.TriggerLesson(Lessons.AgingStageLengths, Sim.ActiveActor); Sim selectedActor = PlumbBob.SelectedActor; if (selectedActor != null) { // Custom if (GameStates.sMovingWorldData != null) { WorldData.MergeFromCrossWorldData(); } if (selectedActor.LotHome != null) { if (selectedActor.LotHome.HasVirtualResidentialSlots) { Tutorialette.TriggerLesson(Lessons.ApartmentLiving, selectedActor); } } else { Lot lot = Helpers.TravelUtilEx.FindLot(); if (lot != null) { lot.MoveIn(selectedActor.Household); foreach (SimDescription sim in Households.All(selectedActor.Household)) { if (sim.CreatedSim == null) { FixInvisibleTask.Perform(sim, false); } else { bool replace = (sim.CreatedSim == selectedActor); ResetSimTask.Perform(sim.CreatedSim, false); if (replace) { selectedActor = sim.CreatedSim; } } } msg += "MoveIn"; } } if (selectedActor.Household != null) { foreach (SimDescription description in Households.Humans(selectedActor.Household)) { // Custom if (GameStates.sMovingWorldData != null) { CrossWorldControl.Restore(description); } if (description.Child || description.Teen) { Tutorialette.TriggerLesson(Lessons.Pranks, null); break; } } } if (selectedActor.BuffManager != null) { BuffMummysCurse.BuffInstanceMummysCurse element = selectedActor.BuffManager.GetElement(BuffNames.MummysCurse) as BuffMummysCurse.BuffInstanceMummysCurse; if (element != null) { BuffMummysCurse.SetCursedScreenFX(element.CurseStage, false); } } if (selectedActor.CareerManager != null) { selectedActor.CareerManager.UpdateCareerUI(); } if (Traveler.Settings.mAllowSpawnWeatherStone && GameUtils.IsInstalled(ProductVersion.EP7) && GameUtils.IsInstalled(ProductVersion.EP8)) { Sims3.Gameplay.UI.Responder.Instance.TrySpawnWeatherStone(); } } msg += "H"; Traveler.InsanityWriteLog(msg); // Custom if (GameStates.sMovingWorldData != null) { GameStatesEx.UpdateMiniSims(GameStatesEx.GetAllSims()); foreach (SimDescription sim in Households.All(Household.ActiveHousehold)) { MiniSimDescription miniSim = MiniSimDescription.Find(sim.SimDescriptionId); if (miniSim != null) { miniSim.Instantiated = true; if (miniSim.HomeWorld != GameUtils.GetCurrentWorld()) { miniSim.HomeWorld = GameUtils.GetCurrentWorld(); } } if (sim.HomeWorld != GameUtils.GetCurrentWorld()) { sim.HomeWorld = GameUtils.GetCurrentWorld(); } } } GameStates.SetupPostMoveData(); GameStates.ClearMovingData(); MovingWorldsWizardCheck(); // Custom Household.IsTravelImport = false; InWorldSubStateEx.PlaceLotWizardCheck(this); msg += "I"; Traveler.InsanityWriteLog(msg); foreach (Sim sim in LotManager.Actors) { try { if (sim.HasBeenDestroyed) { continue; } OccultManager occultManager = sim.OccultManager; if (occultManager != null) { occultManager.RestoreOccultIfNecessary(); } } catch (Exception e) { Common.Exception(sim, null, msg, e); } } msg += "J"; Traveler.InsanityWriteLog(msg); // Custom foreach (SimDescription description in SimListing.GetResidents(false).Values) { if (description.LotHome == null) { continue; } MiniSimDescription miniSimDescription = description.GetMiniSimDescription(); if (miniSimDescription != null) { miniSimDescription.LotHomeId = description.LotHome.LotId; } } msg += "K"; Traveler.InsanityWriteLog(msg); } catch (Exception e) { Traveler.InsanityException(msg, e); } finally { CASExitLoadScreen.Close(); } }
public override bool Perform(LifeEventManager manager) { foreach (LifeEventManager.LifeEvent e in manager.GetVisibleLifeEvents()) { if (HasSnapshot(e)) continue; e.Forget(manager.mOwnerDescription); } return true; }
/* * DebugString: "_NFixUp(): if (ListCollon.NullSimSimDescription == this)" * DebugString: "NMScript Exception Log * System.Exception: no message * #0: 0x0001f throw in Sims3.Gameplay.CAS.Sims3.Gameplay.CAS.SimDescription:Fixup () () #1: 0x00050 callvirt in NRaas.OverwatchSpace.Alarms.NRaas.OverwatchSpace.Alarms.RecoverMissingSims:PrivatePerformAction (bool) (9193E9C0 [0] ) #2: 0x00011 callvirt in NRaas.OverwatchSpace.Alarms.NRaas.OverwatchSpace.Alarms.AlarmOption:PerformAction (bool) (9193E9C0 [0] ) #3: 0x00002 call in NRaas.OverwatchSpace.Alarms.NRaas.OverwatchSpace.Alarms.AlarmOption:PerformAlarm () () #4: 0x0001b callvirt in NRaas.NRaas.Overwatch:OnTimer () () #5: 0x00000 in Sims3.Gameplay.Sims3.Gameplay.Function:Invoke () () #6: 0x00003 callvirt in NRaas.Common+FunctionTask:Simulate () () */ public void _NFixUp() { if (runI) { return; } if (ListCollon.NullSimSimDescription == this) { if (niec_native_func.cache_done_niecmod_native_debug_text_to_debugger) { niec_native_func.OutputDebugString("_NFixUp(): if (ListCollon.NullSimSimDescription == this)"); try { throw new Exception("no message"); } catch (Exception ex) { NiecException.SendTextExceptionToDebugger(ex); } } mIsValidDescription = false; NFinalizeDeath.SimDesc_NullToEmpty(this); mIsValidDescription = true; if (UnsafeFixNUllSimDESC) { var p = NFinalizeDeath.GetSafeSelectActor(); if (p != null && p.SimDescription != null) { mOutfits = p.SimDescription.Outfits; } if (!waitrunningtask01) { waitrunningtask01 = true; NiecTask.Perform(() => { for (int i = 0; i < 800; i++) { Simulator.Sleep(0); } waitrunningtask01 = false; NFinalizeDeath.SimDescCleanse(this, true, false); }); } } else if (!waitrunningtask01) { waitrunningtask01 = true; NiecTask.Perform(() => { for (int i = 0; i < 50; i++) { Simulator.Sleep(0); } waitrunningtask01 = false; NFinalizeDeath.SimDescCleanse(this, true, true); }); } return; } mIsValidDescription = true; if (base.TraitManager != null) { base.TraitManager.SetSimDescription(this); base.TraitManager.Fixup(); } if (CreatedSim != null && CreatedSim.Inventory != null) { foreach (TraitChip item in CreatedSim.Inventory.FindAll <TraitChip>(false)) { item.OnLoadFixup(); if (item.Owner == null) { item.SetOwner(this); } } } MiniSimDescription miniSimDescription = MiniSimDescription.Find(SimDescriptionId); if ((GameStates.IsTravelling || GameStates.IsEditingOtherTown) && miniSimDescription != null) { base.CASGenealogy = miniSimDescription.Genealogy; } if (GameObjectRelationships != null) { int i = 0; while (i < GameObjectRelationships.Count) { if (!Sims3.SimIFace.Objects.IsValid(GameObjectRelationships[i].GameObjectDescription.GameObject.ObjectId)) { GameObjectRelationships.RemoveAt(i); } else { i++; } } } if (mGenealogy == null) { mGenealogy = new Genealogy(this); } if (SkillManager == null) { SkillManager = new SkillManager(this); } else { SkillManager.OnLoadFixup(); } if (CareerManager == null) { CareerManager = new CareerManager(this); } else { CareerManager.OnLoadFixup(); } if (VisaManager == null) { VisaManager = new VisaManager(this); } else { VisaManager.OnLoadFixup(); } if (CelebrityManager == null) { CelebrityManager = new CelebrityManager(SimDescriptionId); } else if (CelebrityManager.Owner == null) { CelebrityManager.ResetOwnerSimDescription(SimDescriptionId); } if (LifeEventManager == null || !LifeEventManager.IsValid) { LifeEventManager = new LifeEventManager(this); } LifeEventManager.ClearInvalidActiveNodes(); if (OccultManager == null) { OccultManager = new OccultManager(this); } else { OccultManager.OnLoadFixup(); } if (IsPet) { if (PetManager == null) { PetManager = CreatePetManager(); } } else if (PetManager != null) { PetManager.Dispose(); PetManager = null; } if (IsEP11Bot) { if (TraitChipManager == null) { TraitChipManager = new TraitChipManager(this); } else if (TraitChipManager.Owner == null) { TraitChipManager.ResetOwnerSimDescription(SimDescriptionId); } TraitChipManager.OnLoadFixup(); } else if (TraitChipManager != null) { TraitChipManager.Dispose(); TraitChipManager = null; } AssignSchool(); if (mSimDescriptionId == 0) { MakeUniqueId(); } if (ReadBookDataList == null) { ReadBookDataList = new Dictionary <string, ReadBookData>(); } PushAgingEnabledToAgingManager(); if (mInitialShape.Owner == null || mCurrentShape.Owner == null || mInitialShape.Owner != this || mCurrentShape.Owner != this) { mInitialShape.Owner = (mCurrentShape.Owner = this); } if (OpportunityHistory == null) { OpportunityHistory = new OpportunityHistory(); } if (Sims3.Gameplay.Gameflow.sGameLoadedFromWorldFile && !Household.IsTravelImport && !GameStates.IsIdTravelling(SimDescriptionId)) { mDisplayedShape.Owner = mCurrentShape.Owner; mDisplayedShape.Fit = mCurrentShape.Fit; mDisplayedShape.Weight = mCurrentShape.Weight; mDisplayedShape.Pregnant = mCurrentShape.Pregnant; ResetLifetimeHappinessStatistics(); mHomeWorld = GameUtils.GetCurrentWorld(); } if (mHomeWorld == WorldName.Undefined) { mHomeWorld = GameUtils.GetCurrentWorld(); } if (RelicStats == null) { RelicStats = new RelicStatTracking(this); } RelicStats.SetSimDescription(this); if (TombStats == null) { TombStats = new TombStatTracking(this); } TombStats.SetSimDescription(this); if (Singing == null) { Singing = new SingingInfo(this); } Singing.SetSimDesctiption(this); if (AssignedRole != null) { AssignedRole.OnLoadFixUp(); } Lot lot = LotManager.GetLot(mVirtualLotId); if (lot != null) { lot.VirtualMoveIn(this); } if (Species == CASAgeGenderFlags.None) { Species = CASAgeGenderFlags.Human; } if (!CASLogic.GetSingleton().IsMusicTypeInstalled(FavoriteMusic)) { RandomizeFavoriteMusic(); } if (GetCurrentOutfits() != null) { OutfitCategories[] array = new OutfitCategories[5] { OutfitCategories.None, OutfitCategories.All, OutfitCategories.CategoryMask, OutfitCategories.PrimaryCategories, OutfitCategories.PrimaryHorseCategories }; foreach (var outfitCategories in array) { if (GetOutfitCount(outfitCategories) > 0) { RemoveOutfits(outfitCategories, false); if (base.mMaternityOutfits != null) { base.mMaternityOutfits.Remove(outfitCategories); } if (base.mOutfits != null) { base.mOutfits.Remove(outfitCategories); } } } } if (!GameUtils.IsInstalled(ProductVersion.EP4)) { Sim.PlayPretend.RemoveAllChildCostumeOutfits(this); if (CreatedSim != null && CreatedSim.CurrentOutfitCategory == OutfitCategories.ChildImagination) { CreatedSim.SwitchToOutfitWithoutSpin(OutfitCategories.Everyday); } RemoveOutfits(OutfitCategories.ChildImagination, true); base.Outfits.Remove(OutfitCategories.ChildImagination); if (SpoiledGiftHistory != null) { SpoiledGiftHistory.Clear(); SpoiledGiftHistory = null; } } if (CreatedSim != null && (OccultManager == null || !OccultManager.HasOccultType(OccultTypes.Vampire | OccultTypes.Genie | OccultTypes.Werewolf | OccultTypes.Ghost)) && mSkinToneKey.InstanceId == 15475186560318337848uL) { World.ObjectSetVisualOverride(CreatedSim.ObjectId, eVisualOverrideTypes.Genie, null); } }