private static ListenerAction OnObjectChanged(Event e) { try { Urnstone urnstone = e.TargetObject as Urnstone; if (urnstone != null) { Instantiator.AddInteractionsForUrnstones(urnstone); } } catch (Exception exception) { Instantiator.Exception(exception); StyledNotification.Show(new StyledNotification.Format("Failed to load Vampire Tweaker Interactions. Error generated by fer456.VampireTweaker.Interactions.dll. See info below and in Documents_Electronic Arts_The Sims 3" + exception, StyledNotification.NotificationStyle.kDebugAlert)); } return(ListenerAction.Keep); }
public static void AddAllInteractionsForUrnstones() { try { List <Urnstone> list = new List <Urnstone>(Sims3.Gameplay.Queries.GetObjects <Urnstone>()); foreach (Urnstone urnstone in list) { if (urnstone != null) { Instantiator.AddInteractionsForUrnstones(urnstone); } } sBoughtObject = EventTracker.AddListener(EventTypeId.kBoughtObject, new ProcessEventDelegate(Instantiator.OnObjectChanged)); sOnObjectAddedToInventory = EventTracker.AddListener(EventTypeId.kInventoryObjectAdded, new ProcessEventDelegate(Instantiator.OnObjectChanged)); sOnObjectChanged = EventTracker.AddListener(EventTypeId.kObjectStateChanged, new ProcessEventDelegate(Instantiator.OnObjectChanged)); } catch (Exception exception) { Instantiator.Exception(exception); StyledNotification.Show(new StyledNotification.Format("Failed to load Vampire Tweaker Interactions. Error generated by fer456.VampireTweaker.Interactions.dll. See info below and in Documents_Electronic Arts_The Sims 3" + exception, StyledNotification.NotificationStyle.kDebugAlert)); } }