Exemple #1
0
        private SimDescription ShowObjectSelectionDialog(GameObject sim)
        {
            List <ObjectPicker.HeaderInfo> headers = new List <ObjectPicker.HeaderInfo>();

            headers.Add(new ObjectPicker.HeaderInfo("Object", null, 400));


            List <ObjectPicker.RowInfo> tableData = new List <ObjectPicker.RowInfo>();

            int roomId = sim.RoomId;
            List <SimDescription> residents = Household.AllSimsLivingInWorld();
            List <SimDescription> townies   = Household.AllTownieSimDescriptions();

            List <SimDescription> simdescriptions = new List <SimDescription>();

            foreach (SimDescription townie in residents)
            {
                if (townie.IsHuman && !townie.ChildOrBelow && !simdescriptions.Contains(townie))
                {
                    simdescriptions.Add(townie);
                }
            }

            foreach (SimDescription gameObject in simdescriptions)
            {
                ObjectPicker.RowInfo rowInfo = new ObjectPicker.RowInfo(gameObject, new List <ObjectPicker.ColumnInfo>());
                ThumbnailKey         thumbnail;
                if (gameObject.CreatedSim != null)
                {
                    thumbnail = gameObject.CreatedSim.GetThumbnailKey();
                }
                else
                {
                    thumbnail = gameObject.GetEverydayThumbnail(ThumbnailSize.Medium);
                }
                rowInfo.ColumnInfo.Add(new ObjectPicker.ThumbAndTextColumn(thumbnail, gameObject.FullName));
                tableData.Add(rowInfo);
            }

            List <ObjectPicker.TabInfo> list3 = new List <ObjectPicker.TabInfo>();

            list3.Add(new ObjectPicker.TabInfo("shop_all_r2", "Hire A Sim", tableData));
            string buttonOk     = Localization.LocalizeString("Ui/Caption/Global:Ok", new object[0]);
            string buttonCancel = Localization.LocalizeString("Ui/Caption/Global:Cancel", new object[0]);
            List <ObjectPicker.RowInfo> userSelection = BigObjectPickerDialog.Show(true, ModalDialog.PauseMode.PauseSimulator,
                                                                                   "Select A Sim to Hire", buttonOk, buttonCancel, list3, headers, 1);

            if (userSelection == null || userSelection.Count < 1)
            {
                return(null);
            }
            return(userSelection[0].Item as SimDescription);
        }
Exemple #2
0
        public static List <ObjectPicker.RowInfo> Show(bool modal, ModalDialog.PauseMode pauseType, string title, string buttonTrue, string buttonFalse, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, int numSelectableRows, Vector2 position, bool viewTypeToggle, List <ObjectPicker.RowInfo> preSelectedRows, bool showHeadersAndToggle)
        {
            List <ObjectPicker.RowInfo> result;

            using (BigObjectPickerDialog bigObjectPickerDialog = new BigObjectPickerDialog(modal, pauseType, title, buttonTrue, buttonFalse, listObjs, headers, numSelectableRows, position, viewTypeToggle, preSelectedRows, showHeadersAndToggle))
            {
                bigObjectPickerDialog.StartModal();
                if (bigObjectPickerDialog.Result == null || bigObjectPickerDialog.Result.Count == 0)
                {
                    result = null;
                }
                else
                {
                    result = bigObjectPickerDialog.Result;
                }
            }
            return(result);
        }
 public static List<ObjectPicker.RowInfo> Show(bool modal, ModalDialog.PauseMode pauseType, string title, string buttonTrue, string buttonFalse, List<ObjectPicker.TabInfo> listObjs, List<ObjectPicker.HeaderInfo> headers, int numSelectableRows, Vector2 position, bool viewTypeToggle, List<ObjectPicker.RowInfo> preSelectedRows, bool showHeadersAndToggle)
 {
     List<ObjectPicker.RowInfo> result;
     using (BigObjectPickerDialog bigObjectPickerDialog = new BigObjectPickerDialog(modal, pauseType, title, buttonTrue, buttonFalse, listObjs, headers, numSelectableRows, position, viewTypeToggle, preSelectedRows, showHeadersAndToggle))
     {
         bigObjectPickerDialog.StartModal();
         if (bigObjectPickerDialog.Result == null || bigObjectPickerDialog.Result.Count == 0)
         {
             result = null;
         }
         else
         {
             result = bigObjectPickerDialog.Result;
         }
     }
     return result;
 }
Exemple #4
0
 public static List <ObjectPicker.RowInfo> Show(bool modal, ModalDialog.PauseMode pauseType, string title, string buttonTrue, string buttonFalse, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, int numSelectableRows, Vector2 position, bool viewTypeToggle, List <ObjectPicker.RowInfo> preSelectedRows)
 {
     return(BigObjectPickerDialog.Show(modal, pauseType, title, buttonTrue, buttonFalse, listObjs, headers, numSelectableRows, position, viewTypeToggle, preSelectedRows, true));
 }
Exemple #5
0
 public static List <ObjectPicker.RowInfo> Show(string title, string buttonTrue, string buttonFalse, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, int numSelectableRows, List <ObjectPicker.RowInfo> preSelectedRows, bool showHeadersAndToggle)
 {
     return(BigObjectPickerDialog.Show(true, ModalDialog.PauseMode.PauseSimulator, title, buttonTrue, buttonFalse, listObjs, headers, numSelectableRows, new Vector2(-1f, -1f), true, preSelectedRows, showHeadersAndToggle));
 }
Exemple #6
0
 public static List <ObjectPicker.RowInfo> Show(bool modal, ModalDialog.PauseMode pauseType, string title, string buttonTrue, string buttonFalse, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, int numSelectableRows)
 {
     return(BigObjectPickerDialog.Show(modal, pauseType, title, buttonTrue, buttonFalse, listObjs, headers, numSelectableRows, new Vector2(-1f, -1f), false));
 }
Exemple #7
0
 public static List <ObjectPicker.RowInfo> Show(string title, string buttonTrue, string buttonFalse, List <ObjectPicker.TabInfo> listObjs, List <ObjectPicker.HeaderInfo> headers, int numSelectableRows, bool viewTypeToggle)
 {
     return(BigObjectPickerDialog.Show(true, ModalDialog.PauseMode.PauseTask, title, buttonTrue, buttonFalse, listObjs, headers, numSelectableRows, new Vector2(-1f, -1f), viewTypeToggle));
 }