示例#1
0
        private GameObject ShowObjectSelectionDialog(Sim 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;

            listAllObjectsInRoom(sim, tableData, roomId);

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

            list3.Add(new ObjectPicker.TabInfo("shop_all_r2", "Select An Object", 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 An Object To Move", buttonOk, buttonCancel, list3, headers, 1);

            if (userSelection == null || userSelection.Count < 1)
            {
                return(null);
            }
            return(userSelection[0].Item as GameObject);
        }
        public static GameObject ShowObjectSelectionDialog(Sim sim)
        {
            List <ObjectPicker.HeaderInfo> headers = new List <ObjectPicker.HeaderInfo>();

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


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

            int roomId = sim.RoomId;

            GameObject[] gameObjectsInLot = sim.LotCurrent.GetObjects <GameObject>();
            foreach (GameObject gameObject in gameObjectsInLot)
            {
                if (gameObject.RoomId == roomId && gameObject != sim)
                {
                    ObjectPicker.RowInfo rowInfo   = new ObjectPicker.RowInfo(gameObject, new List <ObjectPicker.ColumnInfo>());
                    ThumbnailKey         thumbnail = gameObject.GetThumbnailKey();
                    rowInfo.ColumnInfo.Add(new ObjectPicker.ThumbAndTextColumn(thumbnail, gameObject.GetLocalizedName()));
                    tableData.Add(rowInfo);
                }
            }

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

            list3.Add(new ObjectPicker.TabInfo("shop_all_r2", "Select Something To Look At", 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 Something To Look At", buttonOk, buttonCancel, list3, headers, 1);

            if (userSelection == null || userSelection.Count < 1)
            {
                return(null);
            }
            return(userSelection[0].Item as GameObject);
        }