コード例 #1
0
        private static ScientificSample SelectDNASample(Sim robot, CASAgeGenderFlags gender)
        {
            List <ObjectPicker.HeaderInfo> list       = new List <ObjectPicker.HeaderInfo>();
            List <ObjectPicker.TabInfo>    list2      = new List <ObjectPicker.TabInfo>();
            List <ScientificSample>        dnaSamples = GetDNASamples(robot, gender);

            int numSelectableRows = 1;

            ObjectPicker.TabInfo tabInfo = new ObjectPicker.TabInfo(string.Empty, "TabText", new List <ObjectPicker.RowInfo>());

            foreach (ScientificSample current in dnaSamples)
            {
                ObjectPicker.RowInfo rowInfo = new ObjectPicker.RowInfo(current, new List <ObjectPicker.ColumnInfo>());
                rowInfo.ColumnInfo.Add(new ObjectPicker.ThumbAndTextColumn(current.GetThumbnailKey(), current.GetLocalizedName()));
                rowInfo.ColumnInfo.Add(new ObjectPicker.TextColumn(current.Subject.GetSubjectString()));
                tabInfo.RowInfo.Add(rowInfo);
            }

            list2.Add(tabInfo);
            list.Add(new ObjectPicker.HeaderInfo("HeaderString1", "HeaderTooltip1", 250));
            list.Add(new ObjectPicker.HeaderInfo("HeaderString2", "HeaderTooltip2", 250));
            List <ObjectPicker.RowInfo> list4 = ObjectPickerDialog.Show(true, ModalDialog.PauseMode.PauseSimulator, "DialogTitle",
                                                                        "Okay", "Cancel", list2, list, numSelectableRows);
            ScientificSample result = null;

            if (list4 != null && list4.Count > 0)
            {
                result = (ScientificSample)list4[0].Item;
            }

            return(result);
        }
コード例 #2
0
ファイル: Unemployed.cs プロジェクト: yakoder/NRaas
        public void ChangeName()
        {
            List <ObjectPicker.HeaderInfo> headers = new List <ObjectPicker.HeaderInfo>();

            headers.Add(new ObjectPicker.HeaderInfo("NRaasUnemployed:OptionColumn", "NRaasUnemployed:OptionColumnTooltip", 230));

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

            foreach (Pair <string, string> name in GetLocalizedTitles(OwnerDescription.IsFemale))
            {
                ObjectPicker.RowInfo item = new ObjectPicker.RowInfo(name.Second, new List <ObjectPicker.ColumnInfo>());

                item.ColumnInfo.Add(new ObjectPicker.TextColumn(name.First));

                rowInfo.Add(item);
            }

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

            tabInfo.Add(new ObjectPicker.TabInfo("shop_all_r2", Common.LocalizeEAString("Ui/Caption/ObjectPicker:All"), rowInfo));

            string buttonTrue  = Common.LocalizeEAString("NRaasUnemployed:Ok");
            string buttonFalse = Common.LocalizeEAString("Ui/Caption/ObjectPicker:Cancel");

            List <ObjectPicker.RowInfo> list = ObjectPickerDialog.Show(true, ModalDialog.PauseMode.PauseSimulator, Common.LocalizeEAString("NRaasUnemployed:Title"), buttonTrue, buttonFalse, tabInfo, headers, 1, new Vector2(-1f, -1f), true);

            List <string> selection = new List <string>();

            if ((list == null) || (list.Count == 0))
            {
                return;
            }

            UpdateName(list[0].Item as string);
        }
コード例 #3
0
        protected static void ChooseSchool(Sim sim)
        {
            List<ObjectPicker.HeaderInfo> headers = new List<ObjectPicker.HeaderInfo>();
            headers.Add(new ObjectPicker.HeaderInfo("NRaasSchooling:OptionColumn", "NRaasSchooling:OptionColumnTooltip", 230));

            List<ObjectPicker.RowInfo> rowInfo = new List<ObjectPicker.RowInfo>();
            foreach (Career career in CareerManager.CareerList)
            {
                if (career is SchoolElementary)
                {
                    if (!sim.SimDescription.Child) continue;
                }
                else if (career is SchoolHigh)
                {
                    if (!sim.SimDescription.Teen) continue;
                }
                else if (career is School)
                {
                    if ((!sim.SimDescription.Child) && (!sim.SimDescription.Teen)) continue;
                }
                else
                {
                    continue;
                }

                GreyedOutTooltipCallback greyedOutTooltipCallback = null;
                if (!career.CanAcceptCareer(sim.ObjectId, ref greyedOutTooltipCallback)) continue;

                CareerLocation location = Career.FindClosestCareerLocation(sim, career.Guid);
                if (location == null) continue;

                ObjectPicker.RowInfo item = new ObjectPicker.RowInfo(location, new List<ObjectPicker.ColumnInfo>());

                item.ColumnInfo.Add(new ObjectPicker.TextColumn(career.Name));

                rowInfo.Add(item);
            }

            List<ObjectPicker.TabInfo> tabInfo = new List<ObjectPicker.TabInfo>();
            tabInfo.Add(new ObjectPicker.TabInfo("shop_all_r2", Common.LocalizeEAString("Ui/Caption/ObjectPicker:All"), rowInfo));

            string buttonTrue = Common.LocalizeEAString("Ui/Caption/Global:Accept");
            string buttonFalse = Common.LocalizeEAString("Ui/Caption/ObjectPicker:Cancel");

            List<ObjectPicker.RowInfo> list = ObjectPickerDialog.Show(true, ModalDialog.PauseMode.PauseSimulator, Common.LocalizeEAString("NRaasSchooling:Title"), buttonTrue, buttonFalse, tabInfo, headers, 1, new Vector2(-1f, -1f), true);

            if ((list == null) || (list.Count == 0)) return;

            CareerLocation sel = list[0].Item as CareerLocation;
            if (sel == null) return;

            SchoolBooter.Enroll(sim, null, sel);
        }
コード例 #4
0
        public static IndustrialOven.MenuRecipeInfo ReturnSelectedFoodItem(OFBOven.Menu menu, Sim sim)
        {
            List <ObjectPicker.HeaderInfo> headers  = new List <ObjectPicker.HeaderInfo>();
            List <ObjectPicker.TabInfo>    listObjs = new List <ObjectPicker.TabInfo>();

            //IndustrialOven.Menu menu = parameters.Target as IndustrialOven.Menu;
            if (menu == null)
            {
                return(null);
            }
            int cost = sim.FamilyFunds;

            if (sim.TraitManager.HasElement(TraitNames.DiscountDiner))
            {
                cost = 2147483647;
            }
            List <IndustrialOven.MenuRecipeInfo> foodsAtOrBelowCost = menu.GetFoodsAtOrBelowCost(cost);

            if (foodsAtOrBelowCost == null)
            {
                return(null);
            }
            headers.Add(new ObjectPicker.HeaderInfo("Store/Objects/IndustrialOven:SelectRecipeHeader", "Store/Objects/IndustrialOven:SelectRecipeHeaderTooltip", 500));
            List <ObjectPicker.RowInfo> list = new List <ObjectPicker.RowInfo>();

            for (int i = 0; i < foodsAtOrBelowCost.Count; i++)
            {
                Recipe recipe = foodsAtOrBelowCost[i].FindRecipe();
                if (recipe != null)
                {
                    List <ObjectPicker.ColumnInfo> list2 = new List <ObjectPicker.ColumnInfo>();
                    list2.Add(new ObjectPicker.ThumbAndTextColumn(recipe.GetThumbnailKey(ThumbnailSize.Large), recipe.GenericName));
                    ObjectPicker.RowInfo item = new ObjectPicker.RowInfo(foodsAtOrBelowCost[i], list2);
                    list.Add(item);
                }
            }
            ObjectPicker.TabInfo item2 = new ObjectPicker.TabInfo("recipeRowImageName", StringTable.GetLocalizedString("Store/Objects/IndustrialOven/SetMenu:TabText"), list);
            listObjs.Add(item2);

            List <ObjectPicker.RowInfo> selection = ObjectPickerDialog.Show(true, ModalDialog.PauseMode.PauseSimulator,
                                                                            CommonMethodsOFBBistroSet.LocalizeString("SelectMeal", new object[] { sim.FullName }),
                                                                            CommonMethodsOFBBistroSet.LocalizeString("Select", new object[0]),
                                                                            CommonMethodsOFBBistroSet.LocalizeString("Cancel", new object[0]),
                                                                            listObjs, headers, 1);

            if (selection != null && selection.Count > 0)
            {
                return((IndustrialOven.MenuRecipeInfo)selection[0].Item);
            }

            return(null);
        }
コード例 #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="interactionName"></param>
        /// <returns></returns>
        public static Shift ReturnShift(Sim sim, OFBOven oven, int NumSelectableRows)
        {
            string buttonFalse = Localization.LocalizeString("Ui/Caption/ObjectPicker:Cancel", new object[0]);

            List <ObjectPicker.HeaderInfo> headers  = new List <ObjectPicker.HeaderInfo>();
            List <ObjectPicker.TabInfo>    listObjs = new List <ObjectPicker.TabInfo>();

            headers.Add(new ObjectPicker.HeaderInfo("", "", 500));
            List <ObjectPicker.RowInfo> list = new List <ObjectPicker.RowInfo>();

            foreach (Shift shift in oven.info.Shifts)
            {
                List <ObjectPicker.ColumnInfo> list2 = new List <ObjectPicker.ColumnInfo>();

                ThumbnailKey key = new ThumbnailKey();

                SimDescription simDescription = SimDescription.Find(shift.Cheff.DescriptionId);
                if (simDescription != null)
                {
                    key = simDescription.GetThumbnailKey(ThumbnailSize.Large, 0);
                }
                list2.Add(new ObjectPicker.ThumbAndTextColumn(key, shift.StarWork + ":00 - " + shift.EndWork + ":00"));
                ObjectPicker.RowInfo item = new ObjectPicker.RowInfo(shift, list2);
                list.Add(item);
            }

            ObjectPicker.TabInfo item2 = new ObjectPicker.TabInfo("recipeRowImageName", StringTable.GetLocalizedString("Store/Objects/IndustrialOven/SetMenu:TabText"), list);
            listObjs.Add(item2);


            List <ObjectPicker.RowInfo> objects = ObjectPickerDialog.Show("Shifts", "Select", "Cancel", listObjs, headers, NumSelectableRows);

            if (objects != null && objects.Count > 0)
            {
                return((Shift)objects[0].Item);
            }

            return(null);
        }
コード例 #6
0
ファイル: Romancer.cs プロジェクト: yakoder/NRaas
            protected override bool Run(SimDescription a, SimDescription b)
            {
                Relationship relation = Relationship.Get(a, b, true);

                if (relation == null)
                {
                    return(false);
                }

                string currentState = relation.LTR.CurrentLTR;

                List <NewLevel> allOptions = new List <NewLevel>();

                string newState = ChangeRelationship.NextNegativeRomanceState(currentState);

                while (newState != null)
                {
                    if (!relation.LTR.RelationshipIsInappropriate(LTRData.Get(newState)))
                    {
                        allOptions.Insert(0, new NewLevel(newState, false));
                    }

                    newState = ChangeRelationship.NextNegativeRomanceState(newState);
                }

                allOptions.Add(new NewLevel(currentState, true));

                if (currentState == "Stranger")
                {
                    newState = "Acquaintance";
                    allOptions.Add(new NewLevel(newState, true));
                }
                else
                {
                    newState = currentState;
                }

                newState = ChangeRelationship.NextPositiveRomanceState(newState);
                while (newState != null)
                {
                    if (!relation.LTR.RelationshipIsInappropriate(LTRData.Get(newState)))
                    {
                        allOptions.Add(new NewLevel(newState, true));
                    }

                    newState = ChangeRelationship.NextPositiveRomanceState(newState);
                }

                List <ObjectPicker.HeaderInfo> headers = new List <ObjectPicker.HeaderInfo>();

                headers.Add(new ObjectPicker.HeaderInfo("Level", "Relationship Level", 230));

                int count = 0;

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

                foreach (NewLevel level in allOptions)
                {
                    ObjectPicker.RowInfo item = new ObjectPicker.RowInfo(level, new List <ObjectPicker.ColumnInfo>());

                    count++;

                    item.ColumnInfo.Add(new ObjectPicker.TextColumn(count.ToString() + ". " + level.mState));

                    rowInfo.Add(item);
                }

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

                tabInfo.Add(new ObjectPicker.TabInfo("shop_all_r2", Localization.LocalizeString("Ui/Caption/ObjectPicker:All", new object[0]), rowInfo));

                string buttonTrue  = "Ok";
                string buttonFalse = Localization.LocalizeString("Ui/Caption/ObjectPicker:Cancel", new object[0]);

                List <ObjectPicker.RowInfo> list = ObjectPickerDialog.Show(true, ModalDialog.PauseMode.PauseSimulator, "Relationship", buttonTrue, buttonFalse, tabInfo, headers, 1, new Vector2(-1f, -1f), true);

                List <string> selection = new List <string>();

                if ((list == null) || (list.Count == 0))
                {
                    return(false);
                }

                NewLevel choice = list[0].Item as NewLevel;

                if (choice == null)
                {
                    return(false);
                }

                if (choice.mState == currentState)
                {
                    return(false);
                }

                bool bFirst = true;

                if (choice.mUp)
                {
                    while (BumpUp(a, b, bFirst))
                    {
                        if (choice.mState == relation.LTR.CurrentLTR)
                        {
                            return(true);
                        }

                        if (currentState == relation.LTR.CurrentLTR)
                        {
                            return(false);
                        }
                        currentState = relation.LTR.CurrentLTR;

                        bFirst = false;
                    }
                }
                else
                {
                    while (BumpDown(a, b, bFirst))
                    {
                        if (choice.mState == relation.LTR.CurrentLTR)
                        {
                            return(true);
                        }

                        if (currentState == relation.LTR.CurrentLTR)
                        {
                            return(false);
                        }
                        currentState = relation.LTR.CurrentLTR;

                        bFirst = false;
                    }
                }

                return(true);
            }