public static void AddInteractions(Sims3.Gameplay.Objects.Electronics.Computer obj) { foreach (InteractionObjectPair pair in obj.Interactions) { if (pair.InteractionDefinition.GetType() == Version.Singleton.GetType()) { return; } } obj.AddInteraction(Version.Singleton); }
protected static ListenerAction OnObjectBought(Sims3.Gameplay.EventSystem.Event e) { if (e.Id == EventTypeId.kBoughtObject) { Sims3.Gameplay.Objects.Electronics.Computer obj = e.TargetObject as Sims3.Gameplay.Objects.Electronics.Computer; if (obj != null) { AddInteractions(obj); } } return(ListenerAction.Keep); }