예제 #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);
                    }
                }
            }
        }
예제 #2
0
        public static void SetupSimTag(Sim sim)
        {
            Sim active = Sims3.Gameplay.Actors.Sim.ActiveActor;

            if (active == null)
            {
                return;
            }

            MapTagManager mtm = active.MapTagManager;

            if (mtm == null)
            {
                return;
            }

            try
            {
                if (sim == null)
                {
                    return;
                }

                MapTag tag = mtm.GetTag(sim);

                if ((sim.Household == Household.ActiveHousehold) ||
                    (sim.SimDescription.AssignedRole is RoleSpecialMerchant) ||
                    (sim.SimDescription.AssignedRole is Proprietor) ||
                    (Tagger.Settings.mTaggedSims.Contains(sim.SimDescription.SimDescriptionId)) ||
                    (Tagger.Settings.mEnableSimTags && (!Tagger.Settings.HasSimFilterActive() || Tagger.Settings.DoesSimMatchSimFilters(sim.SimDescription.SimDescriptionId))))
                {
                    if (((tag is NPCSimMapTag) || (tag is SelectedSimMapTag)) || (tag is FamilySimMapTag))
                    {
                        mtm.RemoveTag(tag);
                    }

                    if (!mtm.HasTag(sim))
                    {
                        mtm.AddTag(new TrackedSim(sim, mtm.Actor));
                    }
                    else
                    {
                        mtm.RefreshTag(tag);
                    }
                }
                else if (tag is TrackedSim)
                {
                    mtm.RemoveTag(tag);
                }
            }
            catch (Exception exception)
            {
                Common.DebugException(sim, exception);
            }
        }
예제 #3
0
        public DereferenceMapTag()
        {
            MapTagManager mapTagManager = MapTagManager.ActiveMapTagManager;

            if (mapTagManager != null)
            {
                foreach (IMapTag tag in mapTagManager.GetCurrentMapTags())
                {
                    mMapTags.Add(tag, true);
                }
            }
        }
예제 #4
0
파일: Tagger.cs 프로젝트: pepoluan/NRaas
        public static void RemoveTags()
        {
            Sim active = Sims3.Gameplay.Actors.Sim.ActiveActor;

            if (active == null)
            {
                return;
            }

            MapTagManager mtm = active.MapTagManager;

            if (mtm == null)
            {
                return;
            }

            if (!Tagger.Settings.mEnableLotTags)
            {
                foreach (Lot lot in LotManager.AllLots)
                {
                    if (lot.Household != null && lot.ObjectId != ObjectGuid.InvalidObjectGuid)
                    {
                        MapTag tag = mtm.GetTag(lot);

                        if (tag != null && tag is TrackedLot)
                        {
                            mtm.RemoveTag(tag);
                        }
                    }
                }
            }

            if (!Tagger.Settings.mEnableSimTags)
            {
                foreach (Sim sim in LotManager.Actors)
                {
                    if (sim.SimDescription.CreatedSim != null)
                    {
                        MapTag tag = mtm.GetTag(sim);

                        if (tag != null && tag is TrackedSim && !Tagger.Settings.mTaggedSims.Contains(sim.SimDescription.SimDescriptionId))
                        {
                            mtm.RemoveTag(tag);
                        }
                    }
                }
            }
        }
예제 #5
0
        public static void SetupLotTag(Lot lot)
        {
            Sim active = Sims3.Gameplay.Actors.Sim.ActiveActor;

            if (active == null)
            {
                return;
            }

            MapTagManager mtm = active.MapTagManager;

            if (mtm == null)
            {
                return;
            }

            try
            {
                MapTag tag = mtm.GetTag(lot);

                if ((!Tagger.Settings.HasLotFilterActive() || Tagger.Settings.DoesHouseholdMatchLotFilters(lot.Household.AllSimDescriptions)) && Tagger.Settings.mEnableLotTags)
                {
                    if ((tag != null) && (!(tag is TrackedLot)) && (!(tag is HomeLotMapTag)))
                    {
                        mtm.RemoveTag(tag);
                    }
                    if (!mtm.HasTag(lot))
                    {
                        mtm.AddTag(new TrackedLot(lot, mtm.Actor));
                    }
                    else
                    {
                        mtm.RefreshTag(tag);
                    }
                }
                else if (tag is TrackedLot)
                {
                    mtm.RemoveTag(tag);
                }
            }
            catch (Exception exception)
            {
                Common.DebugException(lot, exception);
            }
        }
예제 #6
0
 public static void AddMapTags(FoodTruck truck)
 {
     if (Household.ActiveHousehold != null)
     {
         foreach (Sim sim in Household.ActiveHousehold.Sims)
         {
             if (sim.IsHuman && sim.SimDescription.ChildOrAbove)
             {
                 MapTagManager mapTagManager = sim.MapTagManager;
                 if (mapTagManager != null)
                 {
                     if (mapTagManager.HasTag(truck))
                     {
                         mapTagManager.RefreshTag(truck);
                     }
                     else
                     {
                         mapTagManager.AddTag(new FoodTruckMapTag(truck, sim));
                     }
                 }
             }
         }
     }
 }