public static void OnWorldLoadFinished(object sender, EventArgs e) { if (alreadyParsed) { Ferry <PersistedData> .UnloadCargo(); } alreadyParsed = false; ObjectLoader.FindAndSortAllExistingSewables(); for (int i = 0; i < Sims3.Gameplay.Queries.GetObjects <PhoneSmart>().Length; i++) { if (Sims3.Gameplay.Queries.GetObjects <PhoneSmart>()[i] != null) { AddInteractionsPhone(Sims3.Gameplay.Queries.GetObjects <PhoneSmart>()[i]); } } foreach (Computer computer in Sims3.Gameplay.Queries.GetObjects <Computer>()) { if (computer != null) { AddInteractionsComputer(computer); } } // Save/cache our loaded key to make discovery quicker. Rather than always looping through it. for (int i = 0; i < ObjectLoader.sewableSettings.Count; i++) { Pattern.mStoredPatternsKeySettingsList.Add(ObjectLoader.sewableSettings[i].key); } foreach (KeyValuePair <ulong, bool> keyvalues in GlobalOptionsSewingTable.retrieveData.whoIsInPatternClub) { print("Re-assigned the mailbox alarm!"); SimDescription description = SimDescription.Find(keyvalues.Key); Mailbox mailbox = Mailbox.GetMailboxOnLot(description.LotHome); mailbox.AddAlarmDay(1f, DaysOfTheWeek.Thursday, GlobalOptionsSewingTable.SendPatterns, "Mailbox: Pattern club " + description.mSimDescriptionId.ToString(), AlarmType.AlwaysPersisted); } //mPatternClubAlarm = AlarmManager.Global.AddAlarmDay(1f, DaysOfTheWeek.Thursday, GlobalOptionsSewingTable.SendPatterns, "Mailbox: Pattern club", AlarmType.NeverPersisted, null); //mWearClothing = AlarmManager.Global.AddAlarmRepeating(24f, TimeUnit.Hours, WearGiftedClothing, 1f, TimeUnit.Days, "Wear gifted clothing", AlarmType.AlwaysPersisted, null); EventTracker.AddListener(EventTypeId.kBoughtObject, new ProcessEventDelegate(OnObjectChanged)); EventTracker.AddListener(EventTypeId.kInventoryObjectAdded, new ProcessEventDelegate(OnObjectChanged)); EventTracker.AddListener(EventTypeId.kObjectStateChanged, new ProcessEventDelegate(OnObjectChanged)); }
public override bool Run() { base.StandardEntry(); if (!base.Target.StartComputing(this, SurfaceHeight.Table, true)) { base.StandardExit(); return(false); } //mActor = Actor; base.Target.StartVideo(Computer.VideoType.Browse); base.BeginCommodityUpdates(); base.AnimateSim("WorkTyping"); bool flag = TwoButtonDialog.Show(Localization.LocalizeString("Lyralei/Localized/JoinPatternClubDesc:InteractionName", new object[0]) + kCost.ToString(), Localization.LocalizeString("Lyralei/Localized/JoinPatternClubYES:InteractionName", new object[0]), Localization.LocalizeString("Lyralei/Localized/JoinPatternClubNO:InteractionName", new object[0])); if (flag) { if (base.Actor.FamilyFunds >= kCost) { base.Actor.ModifyFunds(-kCost); } else if (!GameUtils.IsFutureWorld()) { //base.Actor.UnpaidBills += kCost; StyledNotification.Format format = new StyledNotification.Format(Localization.LocalizeString("Lyralei/Localized/NotEnoughMoney:Test", new object[0]), base.Actor.ObjectId, base.Target.ObjectId, StyledNotification.NotificationStyle.kGameMessageNegative); StyledNotification.Show(format); } Mailbox mailbox = Mailbox.GetMailboxOnLot(base.Actor.LotHome); mailbox.AddAlarmDay(1f, DaysOfTheWeek.Thursday, GlobalOptionsSewingTable.SendPatterns, "Mailbox: Pattern club " + base.Actor.mSimDescription.mSimDescriptionId.ToString(), AlarmType.AlwaysPersisted); GlobalOptionsSewingTable.retrieveData.whoIsInPatternClub.Add(Actor.SimDescription.mSimDescriptionId, true); base.Actor.ShowTNSIfSelectable(Localization.LocalizeString("Lyralei/Localized/JoinedPatternClub:InteractionName", new object[0]), StyledNotification.NotificationStyle.kGameMessagePositive); } base.Target.StopComputing(this, Computer.StopComputingAction.TurnOff, false); base.EndCommodityUpdates(flag); base.StandardExit(); return(true); }