/// <summary> /// /// </summary> /// <param name="interactionName"></param> /// <returns></returns> public static List <IMiniSimDescription> ShowSimSelector(Sim actor, Household currentHousehold, string interactionName) { List <IMiniSimDescription> residents = new List <IMiniSimDescription>(); string buttonFalse = Localization.LocalizeString("Ui/Caption/ObjectPicker:Cancel", new object[0]); List <PhoneSimPicker.SimPickerInfo> list = new List <PhoneSimPicker.SimPickerInfo>(); List <object> list2; //Create list of sims foreach (Sim s in currentHousehold.Sims) { list.Add(Phone.Call.CreateBasicPickerInfo(actor.SimDescription, s.SimDescription)); } list2 = PhoneSimPicker.Show(true, ModalDialog.PauseMode.PauseSimulator, list, interactionName, interactionName, buttonFalse, currentHousehold.Sims.Count, false); if (list2 == null || list2.Count == 0) { return(null); } foreach (var item in list2) { residents.Add(item as SimDescription); } return(residents); }
/// <summary> /// /// </summary> /// <param name="interactionName"></param> /// <returns></returns> public static List <IMiniSimDescription> ShowSimSelector(Sim actor, ulong cheffId, string interactionName) { List <IMiniSimDescription> residents = new List <IMiniSimDescription>(); string buttonFalse = Localization.LocalizeString("Ui/Caption/ObjectPicker:Cancel", new object[0]); List <PhoneSimPicker.SimPickerInfo> list = new List <PhoneSimPicker.SimPickerInfo>(); List <object> list2; //Create list of sims foreach (SimDescription sd in SimDescription.GetAll(SimDescription.Repository.Household)) { if (!sd.IsPet && sd.TeenOrAbove && sd.IsContactable && sd.SimDescriptionId != cheffId) { list.Add(Phone.Call.CreateBasicPickerInfo(actor.SimDescription, sd)); } } list2 = PhoneSimPicker.Show(true, ModalDialog.PauseMode.PauseSimulator, list, interactionName, interactionName, buttonFalse, 3, false); if (list2 == null || list2.Count == 0) { return(null); } foreach (var item in list2) { residents.Add(item as SimDescription); } return(residents); }
protected override bool Run() { List <PhoneSimPicker.SimPickerInfo> sims = ListOfAllSims(base.Actor); if ((sims == null) || (sims.Count == 0)) { SimpleMessageDialog.Show("Pollination", "There is no one available on the lot to pollinate."); return(false); } List <object> list = PhoneSimPicker.Show(true, ModalDialog.PauseMode.PauseSimulator, sims, "Select Partner", "Select", "Cancel"); if ((list == null) || (list.Count == 0)) { return(false); } SimDescription other = list[0] as SimDescription; Sim otherSim = other.CreatedSim; if (otherSim == null) { SimpleMessageDialog.Show("Pollination", other.FirstName + " " + other.LastName + " was unavailable for pollination."); return(false); } if (otherSim == base.Actor) { otherSim = null; } return(Pollinator.Pollinate(otherSim, base.Actor)); }
public static SimDescription ReturnSimsInHousehold(SimDescription actor, bool teenOrAbove, bool residentsOnly) { string buttonFalse = Localization.LocalizeString("Ui/Caption/ObjectPicker:Cancel", new object[0]); List <PhoneSimPicker.SimPickerInfo> list = new List <PhoneSimPicker.SimPickerInfo>(); List <object> list2; //Create list of sims if (residentsOnly) { foreach (Household h in Household.GetHouseholdsLivingInWorld()) { foreach (SimDescription sd in h.SimDescriptions) { if (!sd.IsPet && sd.TeenOrAbove) { list.Add(Phone.Call.CreateBasicPickerInfo(actor, sd)); } } } } else { foreach (SimDescription sd in SimDescription.GetAll(SimDescription.Repository.Household)) { if (!sd.IsPet && sd.TeenOrAbove && sd.IsContactable) { list.Add(Phone.Call.CreateBasicPickerInfo(actor, sd)); } } } list2 = PhoneSimPicker.Show(true, ModalDialog.PauseMode.PauseSimulator, list, "", "", buttonFalse, 1, false); if (list2 == null || list2.Count == 0) { return(null); } return(list2[0] as SimDescription); }
protected override bool Run() { List <PhoneSimPicker.SimPickerInfo> sims = ListOfAllSims(base.Actor); if ((sims == null) || (sims.Count == 0)) { SimpleMessageDialog.Show("Orienter", "There is no one available on the lot to orient."); return(false); } List <object> list = PhoneSimPicker.Show(true, ModalDialog.PauseMode.PauseSimulator, sims, "Select Sim", "Select", "Cancel"); if ((list == null) || (list.Count == 0)) { return(false); } SimDescription other = list[0] as SimDescription; return(OrientMe.Perform(other)); }