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); } } } }
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); } }
public DereferenceMapTag() { MapTagManager mapTagManager = MapTagManager.ActiveMapTagManager; if (mapTagManager != null) { foreach (IMapTag tag in mapTagManager.GetCurrentMapTags()) { mMapTags.Add(tag, true); } } }
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); } } } } }
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); } }
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)); } } } } } }