Exemple #1
0
        public override void Startup()
        {
            // From StateMachine:Startup
            mBaseCallFlag |= BaseCallFlag.kStartup;

            // From InWorldSubState
            while (sDelayNextStateStartupCount > 0x0)
            {
                SpeedTrap.Sleep(0x0);
            }
            EventTracker.SendEvent(new InWorldSubStateEvent(this, true));

            // From EditTownState
            if (SeasonsManager.Enabled)
            {
                SeasonsManager.OnEnterEditTown();
            }

            AudioManager.MusicMode = MusicMode.EditTown;
            UserToolUtils.UserToolGeneric(0xc8, new ResourceKey(0x0L, 0x0, 0x0));
            BorderTreatmentsController.Hide();
            GameUtils.Pause();
            base.PlaceLotWizardCheck();
            EditTownController.Load();
            Tutorialette.TriggerLesson(Lessons.EditTown, null);
            Tutorialette.TriggerLesson(Lessons.PlacingNewVenues, null);
            //Household.DestroyHouseholdsWithoutGuardians();
            CASExitLoadScreen.Close();
            InWorldSubState.EdgeScrollCheck();
            InWorldSubState.OpportunityDialogCheck();
        }
Exemple #2
0
        public List <Item> GetCarOptions()
        {
            List <Item> results = new List <Item>();

            CarNpcManager manager = CarNpcManager.Singleton;

            if (manager == null)
            {
                return(results);
            }

            foreach (CarNpcManager.NpcCars car in Enum.GetValues(typeof(CarNpcManager.NpcCars)))
            {
                ProductVersion version = manager.GetProductVersionForNpcCar(car);

                ResourceKey key = GlobalFunctions.CreateProductKey((ulong)car, version);

                BuildBuyProduct product = UserToolUtils.GetProduct(UserToolUtils.BuildBuyProductType.Object, key);

                if (product == null)
                {
                    continue;
                }

                results.Add(new Item(car, product.CatalogName, new ThumbnailKey(product.ProductResourceKey, ThumbnailSize.Medium)));
            }

            return(results);
        }
Exemple #3
0
        public BuildBuyPreset PresetAtIndex(uint index)
        {
            uint presetID = UserToolUtils.ProductPresetIdAtIndex(this, index);

            if (presetID != uint.MaxValue)
            {
                return(new BuildBuyPreset(this, presetID));
            }
            return((BuildBuyPreset)null);
        }
Exemple #4
0
 private void Dispose(bool fromDtor)
 {
     if (this.mHandle != 0U)
     {
         UserToolUtils.DestroyProduct(this);
         this.mHandle = 0U;
     }
     if (fromDtor)
     {
         return;
     }
     GC.SuppressFinalize((object)this);
 }
Exemple #5
0
        public BuyProductList(Common.IStatGenerator stats, BuildBuyProduct.eBuyCategory buyCategory, BuildBuyProduct.eBuySubCategory buySubCategory, int minimumPrice, int maximumPrice)
        {
            List <object> products = UserToolUtils.GetObjectProductListFiltered((uint)buyCategory, uint.MaxValue, (ulong)buySubCategory, ulong.MaxValue, ulong.MaxValue, 0x0, uint.MaxValue, 0x0, 0x0);

            stats.IncStat("BuyProduct " + buyCategory);
            stats.IncStat("BuyProduct " + buySubCategory);

            stats.AddStat("BuyProduct Possibles", products.Count);

            foreach (object obj in products)
            {
                BuildBuyProduct product = obj as BuildBuyProduct;
                if (product == null)
                {
                    continue;
                }

                if (!product.ShowInCatalog)
                {
                    continue;
                }

                if (product.Price < minimumPrice)
                {
                    continue;
                }

                if (product.Price > maximumPrice)
                {
                    continue;
                }

                // 319e4f1d:00000000:00000000000f5f40
                if (product.ObjectInstanceName == "RCcart")
                {
                    continue;
                }

                // 319e4f1d:00000000:00000000000f5e5a
                if (product.ProductResourceKey != ResourceKey.kInvalidResourceKey && product.ProductResourceKey.ToString() == "319e4f1d:00000000:00000000000f5e5a")
                {
                    continue;
                }

                // Common.WriteLog("Product: " + product.CatalogName + " ResKey: " + product.ProductResourceKey + " Instance: " + product.ObjectInstanceName);

                mProducts.Add(product);
            }

            stats.AddStat("BuyProduct Results", mProducts.Count);
        }
Exemple #6
0
 public bool CheckObjectPlacement(UserToolUtils.BuildBuyProductType checkForType)
 {
     return(UserToolUtils.CheckObjectPlacement(this, checkForType));
 }
Exemple #7
0
 public BuildBuyPreset PresetMatchingString(
     string presetStr,
     bool bAllowApproxMatch)
 {
     return(this.PresetWithId(UserToolUtils.GetPresetIdFromProductAndString(this.mHandle, presetStr, bAllowApproxMatch)));
 }
Exemple #8
0
 public uint GetProductCategory(UserToolUtils.BuildBuyProductType type)
 {
     return(UserToolUtils.GetProductCategory(this, type));
 }
Exemple #9
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);
        }
Exemple #10
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();
            }
        }
Exemple #11
0
        public ScriptExecuteType _InitInit(bool postLoad)
        {
            if (mbInited)
            {
                return(GetScriptExecuteType());
            }

            mbInited = true;

            mProduct = UserToolUtils.GetProduct(UserToolUtils.BuildBuyProductType.Object, GetResourceKey());
            if (mProduct != null)
            {
                mbProductInited = true;
            }

            if (mActorsUsingMe != null)
            {
                while (mActorsUsingMe.Remove(null))
                {
                }
            }

            if (postLoad)
            {
                if (mRoutingReferenceList != null)
                {
                    int i = 0;
                    while (i < mRoutingReferenceList.Count)
                    {
                        if (mRoutingReferenceList[i] == null || !Sims3.SimIFace.Objects.IsValid(mRoutingReferenceList[i].ObjectId))
                        {
                            mRoutingReferenceList.RemoveAt(i);
                        }
                        else
                        {
                            i++;
                        }
                    }
                }

                try
                {
                    OnLoad();
                }
                catch (Exception)
                {
                    if (!isAwcore)
                    {
                        if (AssemblyCheckByNiec.IsInstalled("NRaasErrorTrap") || SCOSR.IsScriptCore2020())
                        {
                            throw;
                        }
                    }
                }
            }
            else
            {
                try
                {
                    OnCreation();
                }
                catch (Exception)
                {
                    if (!isAwcore)
                    {
                        if (AssemblyCheckByNiec.IsInstalled("NRaasErrorTrap") || SCOSR.IsScriptCore2020())
                        {
                            throw;
                        }
                    }
                }
            }

            try
            {
                if (AddToLot())
                {
                    LotManager.PlaceObjectOnLot(this, base.Proxy.ObjectId);
                }
            }
            catch (Exception)
            {
                if (!isAwcore)
                {
                    if (AssemblyCheckByNiec.IsInstalled("NRaasErrorTrap") || SCOSR.IsScriptCore2020())
                    {
                        throw;
                    }
                }
            }

            try
            {
                OnStartup();
            }
            catch (Exception)
            {
                if (!NiecHelperSituation.__acorewIsnstalled__)
                {
                    if (AssemblyCheckByNiec.IsInstalled("NRaasErrorTrap") || SCOSR.IsScriptCore2020())
                    {
                        throw;
                    }
                }
            }

            if (mObjComponents != null)
            {
                try
                {
                    int j = 0;
                    while (j < mObjComponents.Count)
                    {
                        ObjectComponent objectComponent = mObjComponents[j];
                        if (objectComponent != null)
                        {
                            if (postLoad)
                            {
                                objectComponent.OnLoad();
                            }
                            objectComponent.OnStartup();
                            j++;
                        }
                        else
                        {
                            mObjComponents.RemoveAt(j);
                        }
                    }
                    if (mObjComponents.Count == 0)
                    {
                        mObjComponents = null;
                    }
                }
                catch (Exception)
                {
                    if (!NiecHelperSituation.__acorewIsnstalled__)
                    {
                        if (AssemblyCheckByNiec.IsInstalled("NRaasErrorTrap") || SCOSR.IsScriptCore2020())
                        {
                            throw;
                        }
                    }
                }
            }

            try
            {
                if (!postLoad && LotManager.sIsBuildBuyModeOn)
                {
                    SetOwnerLot(LotManager.ActiveLot);
                }
                UpdateOwnerLot(LotCurrent);
            }
            catch (Exception)
            {
                mLotCurrent = LotManager.sWorldLot;
                if (!isAwcore)
                {
                    if (AssemblyCheckByNiec.IsInstalled("NRaasErrorTrap") || SCOSR.IsScriptCore2020())
                    {
                        throw;
                    }
                }
            }
            if (isAwcore)
            {
                Sim obj_Sim = ((object)this) as Sim;
                if (obj_Sim != null)
                {
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mAutonomy);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mBuffManager);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mMoodManager);
                    if (obj_Sim.mInteractionQueue != null)
                    {
                        NFinalizeDeath.AddItemToList(gcList, obj_Sim.mInteractionQueue);
                        NFinalizeDeath.AddItemToList(gcList, obj_Sim.mInteractionQueue.mInteractionList);
                    }
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mLookAtManager);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mIdleManager);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mThoughtBalloonManager);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mSocialComponent);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mSnubManager);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mMapTagManager);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mDreamsAndPromisesManager);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mDreamsAndPromisesManager);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mDeepSnowEffectManager);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mFlags);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.SleepDreamManager);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mCelebrity);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mActorsUsingMe);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mClothingReactionBroadcaster);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mOpportunityManager);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mPosture);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mActiveSwitchOutfitHelper);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mMapTagManager);
                    NFinalizeDeath.AddItemToList(gcList, obj_Sim.mSimCommodityInteractionMap);
                }
            }
            return(GetScriptExecuteType());
        }
Exemple #12
0
 /// <summary>
 /// Initializes all ScriptCore classes that data to the App Domain
 /// and initialize any other static members in Sims3.SimIFace classes.
 /// </summary>
 public static void Initialize()
 {
     if (!sInitialized)
     {
         if (gAnimation == null)
         {
             gAnimation = new Animation();
         }
         if (gAudio == null)
         {
             gAudio = new Audio();
         }
         if (gAutomationUtils == null)
         {
             gAutomationUtils = new AutomationUtils();
         }
         if (gCacheManager == null)
         {
             gCacheManager = new CacheManager();
         }
         if (gCameraController == null)
         {
             gCameraController = new CameraController();
         }
         if (gCASUtils == null)
         {
             gCASUtils = new CASUtils();
         }
         if (gCommandSystem == null)
         {
             gCommandSystem = new CommandSystem();
         }
         if (gCTProductModularObject == null)
         {
             gCTProductModularObject = new CTProductModularObject();
         }
         if (gDataFactory == null)
         {
             gDataFactory = new DataFactory();
         }
         if (gDebugDraw == null)
         {
             gDebugDraw = new DebugDraw();
         }
         if (gDeviceConfig == null)
         {
             gDeviceConfig = new DeviceConfig();
         }
         if (gDownloadContent == null)
         {
             gDownloadContent = new DownloadContent();
         }
         if (gEAText == null)
         {
             gEAText = new EAText();
         }
         if (gEATrace == null)
         {
             gEATrace = new EATrace();
         }
         if (gEventQueueInitializer == null)
         {
             gEventQueueInitializer = new EventQueueInitializer();
         }
         if (gGameUtils == null)
         {
             gGameUtils = new GameUtils();
         }
         if (gLoadSaveManager == null)
         {
             gLoadSaveManager = new LoadSaveManager();
         }
         if (gLocalizedStringService == null)
         {
             gLocalizedStringService = new LocalizedStringService();
         }
         if (gLookAtMgr == null)
         {
             gLookAtMgr = new LookAtMgr();
         }
         if (gNameGuidMapService == null)
         {
             gNameGuidMapService = new NameGuidMapService();
         }
         if (gObjects == null)
         {
             gObjects = new Objects();
         }
         if (gOnlineFeatures == null)
         {
             gOnlineFeatures = new OnlineFeatures();
         }
         //if (gProfilerUtils == null) gProfilerUtils = new ProfilerUtils();
         if (gQueries == null)
         {
             gQueries = new Queries();
         }
         if (gRandom == null)
         {
             gRandom = new ScriptCore.Random();
         }
         if (gReflection == null)
         {
             gReflection = new ScriptCore.Reflection();
         }
         if (gRouteManager == null)
         {
             gRouteManager = new RouteManager();
         }
         if (gSACS == null)
         {
             gSACS = new SACS();
         }
         if (gSimulator == null)
         {
             gSimulator = new Simulator();
         }
         if (gSlots == null)
         {
             gSlots = new Slots();
         }
         if (gSocialFeatures == null)
         {
             gSocialFeatures = new SocialFeatures();
         }
         if (gStopWatch == null)
         {
             gStopWatch = new StopWatch();
         }
         if (gStreamHost == null)
         {
             gStreamHost = new StreamHost();
         }
         if (gSwarm == null)
         {
             gSwarm = new Swarm();
         }
         if (gThumbnailManager == null)
         {
             gThumbnailManager = new ThumbnailManager();
         }
         if (gUIManager == null)
         {
             gUIManager = new UIManager();
         }
         if (gUserToolUtils == null)
         {
             gUserToolUtils = new UserToolUtils();
         }
         if (gVideoRecorder == null)
         {
             gVideoRecorder = new VideoRecorder();
         }
         if (gWorld == null)
         {
             gWorld = new World();
         }
         // Will this still be reached if any of the constructors throw an Exception? Hopefully not
         sInitialized = true;
     }
 }