Ejemplo n.º 1
0
        public static void OnMapTagAdded(IMapTag tag)
        {
            if (Sim.ActiveActor == null || Sim.ActiveActor.MapTagManager == null || !CameraController.IsMapViewModeEnabled())
            {
                return;
            }

            if (tag.TagType == MapTagType.Venue)
            {
                MapTagsModel  model   = MapTagsModel.Singleton;
                MapTagManager manager = Sim.ActiveActor.MapTagManager;
                MapTag        mTag    = tag as MapTag;
                if (model != null && manager != null && mTag != null)
                {
                    Lot lot = LotManager.GetLot(mTag.LotId);
                    if (lot != null && ShouldReplace(lot))
                    {
                        CustomTagNRaas customTag = new CustomTagNRaas(lot, mTag.Owner);
                        manager.RemoveTag(tag.ObjectGuid);
                        Tagger.sReplaced.Add(lot.LotId);
                        manager.AddTag(customTag);
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public static void InitTags(bool lotOnly)
        {
            MapTagsModel model = MapTagsModel.Singleton;

            if (model != null)
            {
                if (CameraController.IsMapViewModeEnabled())
                {
                    Tagger.Settings.ValidateActiveFilters(false);
                    if (!lotOnly)
                    {
                        if (Tagger.staticData.Count > 0)
                        {
                            foreach (IMapTag tag in model.GetCurrentMapTags())
                            {
                                MapTagHelper.OnMapTagAdded(tag);
                            }
                        }

                        if (Tagger.Settings.mEnableSimTags || Tagger.Settings.mTaggedSims.Count > 0)
                        {
                            if (Tagger.Settings.mColorByCash)
                            {
                                TagDataHelper.GenerateMoneyGraphData();
                            }

                            foreach (Sim sim in LotManager.Actors)
                            {
                                if (sim.SimDescription.CreatedSim != null && !sim.HasBeenDestroyed)
                                {
                                    MapTagHelper.SetupSimTag(sim);
                                }
                            }
                        }
                    }

                    if (Tagger.Settings.mEnableLotTags)
                    {
                        if (Tagger.Settings.mColorLotTagsByCash)
                        {
                            TagDataHelper.GenerateMoneyGraphData();
                        }

                        foreach (Lot lot in LotManager.AllLots)
                        {
                            if (lot.Household != null && lot.ObjectId != ObjectGuid.InvalidObjectGuid)
                            {
                                MapTagHelper.SetupLotTag(lot);
                            }
                        }
                    }
                }
                else
                {
                    RemoveTags();
                }
            }
        }
Ejemplo n.º 3
0
        public static void InitTags(bool lotOnly)
        {
            MapTagsModel model = MapTagsModel.Singleton;

            if (model != null)
            {
                if (CameraController.IsMapViewModeEnabled())
                {
                    if (!lotOnly)
                    {
                        Tagger.sReplaced.Clear();

                        if (Tagger.staticData.Count > 0)
                        {
                            foreach (IMapTag tag in model.GetCurrentMapTags())
                            {
                                MapTagHelper.OnMapTagAdded(tag);
                            }
                        }

                        if (Tagger.Settings.mEnableSimTags || Tagger.Settings.mTaggedSims.Count > 0)
                        {
                            foreach (Sim sim in LotManager.Actors)
                            {
                                if (sim.SimDescription.CreatedSim != null)
                                {
                                    MapTagHelper.SetupSimTag(sim);
                                }
                            }
                        }
                    }

                    if (Tagger.Settings.mEnableLotTags)
                    {
                        foreach (Lot lot in LotManager.AllLots)
                        {
                            if (lot.Household != null && lot.ObjectId != ObjectGuid.InvalidObjectGuid)
                            {
                                MapTagHelper.SetupLotTag(lot);
                            }
                        }
                    }

                    model.FireMapTagRefreshAll();
                }
                else
                {
                    RemoveTags();
                }
            }
        }
Ejemplo n.º 4
0
        public void SetupMapTags(bool initial, bool lotOnly)
        {
            MapTagsModel model = MapTagsModel.Singleton;

            if (model != null)
            {
                if (initial)
                {
                    Responder.Instance.MapTagsModel.MapTagAdded     += new MapTagChangedDelegate(MapTagHelper.OnMapTagAdded);
                    CameraController.OnCameraMapViewEnabledCallback += OnMapView;
                    EventTracker.AddListener(EventTypeId.kEventSimSelected, new ProcessEventDelegate(this.OnSimSelected));
                    EventTracker.AddListener(EventTypeId.kLotChosenForActiveHousehold, new ProcessEventDelegate(this.OnActiveHouseholdMoved));
                }

                InitTags(lotOnly);
            }
        }
Ejemplo n.º 5
0
        public static void SetupMapTags(bool initial, bool lotOnly)
        {
            MapTagsModel model = MapTagsModel.Singleton;

            if (model != null)
            {
                if (initial)
                {
                    Sims3.UI.Responder.Instance.MapTagsModel.MapTagAdded      += new MapTagChangedDelegate(MapTagHelper.OnMapTagAdded);
                    Sims3.UI.Responder.Instance.MapTagsModel.MapTagRefreshAll += OnRefreshed;
                    CameraController.OnCameraMapViewEnabledCallback           += OnMapView;
                    new Common.ImmediateEventListener(EventTypeId.kEventSimSelected, OnSimSelected);
                    new Common.ImmediateEventListener(EventTypeId.kLotChosenForActiveHousehold, OnActiveHouseholdMoved);
                }

                InitTags(lotOnly);
            }
        }