Esempio n. 1
0
        public override bool InRabbitHole()
        {
            try
            {
                Definition definition = InteractionDefinition as Definition;

                CareerLocation careerLocation = definition.mLocation;
                if (careerLocation == null)
                {
                    return(false);
                }

                TryDisablingCameraFollow(Actor);

                return(SchoolBooter.Enroll(Actor, definition.mName.Second, careerLocation));
            }
            catch (ResetException)
            {
                throw;
            }
            catch (Exception e)
            {
                Common.Exception(Actor, Target, e);
                return(false);
            }
        }
Esempio n. 2
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);
        }