Beispiel #1
0
        protected override ManagerStory.Story PrintFormattedStory(StoryProgressionObject manager, string text, string summaryKey, object[] parameters, string[] extended, ManagerStory.StoryLogging logging)
        {
            Writing skill = Sim.SkillManager.GetSkill <Writing>(SkillNames.Writing);

            WrittenBookData writing = skill.LastCompletedWriting;

            List <BookGeneralData> randomList           = new List <BookGeneralData>(BookData.BookGeneralDataList.Values);
            BookGeneralData        randomObjectFromList = RandomUtil.GetRandomObjectFromList(randomList);

            int genre   = RandomUtil.GetInt(1, Writing.kDialogsPerGenre);
            int quality = RandomUtil.GetInt(1, Writing.kDialogsPerQuality);

            text = Writing.LocalizeString(Sim.IsFemale, "Finished" + writing.Genre.ToString() + genre, new object[] { Sim, writing.NumPages, writing.Title, randomObjectFromList.Title });
            if (writing.Quality != Writing.WrittenBookQuality.Normal)
            {
                string str2 = Writing.LocalizeString(Sim.IsFemale, "Finished" + writing.Quality.ToString() + quality, new object[] { Sim, writing.NumPages, writing.Title });
                text = text + " " + str2;
            }

            string str3 = Writing.LocalizeString(Sim.IsFemale, "RoyaltyDetails", new object[] { Sim, Writing.kRoyaltyLength, writing.Royalty, SimClockUtils.GetText(Writing.kRoyaltyPayHour) });

            text = text + Common.NewLine + Common.NewLine + str3;

            if (extended == null)
            {
                extended = new string[] { writing.Title, EAText.GetNumberString(writing.Royalty) };
            }

            return(base.PrintFormattedStory(manager, text, summaryKey, parameters, extended, logging));
        }
Beispiel #2
0
        public override string GetUIValue(bool pure)
        {
            if (NumSelectable == 1)
            {
                return(base.GetUIValue(pure));
            }
            else if (string.IsNullOrEmpty(GetLocalizationUIKey()))
            {
                return(EAText.GetNumberString(Lookup.Count));
            }
            else
            {
                string text = ConvertToUIValue(GetLocalizationUIKey(), Value);

                if ((!pure) && (!string.IsNullOrEmpty(text)))
                {
                    if (text == ConvertToUIValue(GetLocalizationUIKey(), Default))
                    {
                        text = "(" + text + ")";
                    }
                }

                return(text);
            }
        }
Beispiel #3
0
        public void AddSummaryToLog(string localizedText, string[] extended)
        {
            Common.StringBuilder extendedText = new Common.StringBuilder();

            extendedText += EAText.GetNumberString(SimClock.ElapsedCalendarDays()) + " ";
            extendedText += SimClock.CurrentTime().ToString() + ": ";
            extendedText += localizedText;

            if (extended != null)
            {
                extendedText += " (";

                bool first = true;
                foreach (string text in extended)
                {
                    if (!first)
                    {
                        extendedText += " ";
                    }

                    extendedText += text;
                    first         = false;
                }

                extendedText += ")";
            }

            AddValue <DumpStoryLogOption, string>(extendedText.ToString());
        }
Beispiel #4
0
 public Item(CASParts.Key key)
     : base(key, GetCategoryName(key.mCategory) + " " + EAText.GetNumberString(key.GetIndex() + 1), -1)
 {
     if (mValue.mCategory == OutfitCategories.None)
     {
         SetThumbnail("shop_all_r2", ProductVersion.BaseGame);
     }
 }
Beispiel #5
0
        public static ObjectPicker.RowInfo CreateRow(string title, int count, string description)
        {
            List <ObjectPicker.ColumnInfo> columns = new List <ObjectPicker.ColumnInfo>();

            columns.Add(new ObjectPicker.TextColumn(title));
            columns.Add(new ObjectPicker.TextColumn(EAText.GetNumberString(count)));
            columns.Add(new ObjectPicker.TextColumn(description));

            return(new ObjectPicker.RowInfo(null, columns));
        }
Beispiel #6
0
            public override string GetDisplayValue(ListedSettingOption <TType, TTarget> option)
            {
                int count = 0;

                if (mList != null)
                {
                    count = mList.Count;
                }

                return(EAText.GetNumberString(count));
            }
Beispiel #7
0
 protected override string GetDisplayValue(int value, bool forPrompt)
 {
     if (forPrompt)
     {
         return(EAText.GetNumberString(value));
     }
     else
     {
         return(value.ToString());
     }
 }
Beispiel #8
0
        public override string GetUIValue(bool pure)
        {
            int count = 0;

            if (Value != null)
            {
                count = Value.Count;
            }

            return(EAText.GetNumberString(count));
        }
Beispiel #9
0
        protected override ManagerStory.Story PrintStory(StoryProgressionObject manager, string name, object[] parameters, string[] extended, ManagerStory.StoryLogging logging)
        {
            if (parameters == null)
            {
                parameters = new object[] { Sim, mFunds };
            }

            if (extended == null)
            {
                extended = new string[] { EAText.GetNumberString(mFunds) };
            }

            return(base.PrintStory(manager, name, parameters, extended, logging));
        }
Beispiel #10
0
        public static string GetTitle(string caption, float value)
        {
            string title = caption;

            if (!string.IsNullOrEmpty(title))
            {
                title = title.Trim();
            }

            if (MasterController.Settings.mShowCASSliderValues)
            {
                title += " (" + EAText.GetNumberString(value) + ")";
            }

            return(title);
        }
Beispiel #11
0
            protected override ManagerStory.Story PrintFormattedStory(StoryProgressionObject manager, string text, string summaryKey, object[] parameters, string[] extended, ManagerStory.StoryLogging logging)
            {
                if (manager == null)
                {
                    manager = Skills;
                }

                Skill skill = Sim.SkillManager.GetElement(mSkill);

                if (skill == null)
                {
                    return(null);
                }

                if (extended == null)
                {
                    extended = new string[] { skill.Name, EAText.GetNumberString(mLevel) };
                }

                if (mLevel == 0)
                {
                    text = skill.Description;
                }
                else
                {
                    string entryKey = skill.LevelUpStrings[mLevel];
                    if (!string.IsNullOrEmpty(entryKey))
                    {
                        text = Common.LocalizeEAString(skill.SkillOwner.IsFemale, "Gameplay/Skills/Skill:SkillLevelIncreasedDialogText", new object[] { skill.SkillOwner, skill.Name, mLevel }) + Common.NewLine + Common.NewLine + Common.LocalizeEAString(skill.SkillOwner.IsFemale, entryKey, new object[] { skill.SkillOwner });
                    }
                    else
                    {
                        text = Common.LocalizeEAString(skill.SkillOwner.IsFemale, "Gameplay/Skills/Skill:SkillLevelIncreasedDialogText", new object[] { skill.SkillOwner, skill.Name, mLevel });
                    }
                }

                ManagerStory.Story story = base.PrintFormattedStory(manager, text, summaryKey, parameters, extended, logging);

                if (story != null)
                {
                    story.mOverrideImage   = skill.NonPersistableData.DreamsAndPromisesIcon;
                    story.mOverrideVersion = skill.NonPersistableData.SkillProductVersion;
                }

                return(story);
            }
Beispiel #12
0
        protected override string GetLocalizedValue(string value, ref ThumbnailKey icon)
        {
            // called from option dialog
            string[] split = value.Split('-');

            if (split.Length < 2)
            {
                split[0] = ""; // will cause TryParseEnum to fail
            }

            SkillNames result;
            Skill      skill;

            if (!ParserFunctions.TryParseEnum <SkillNames>(split[0], out result, SkillNames.None))
            {
                ulong guid;
                if (ulong.TryParse(split[0], out guid))
                {
                    result = (SkillNames)guid;
                }
                else
                {
                    return(SkillNames.None + " " + EAText.GetNumberString(0));
                }
            }

            skill = SkillManager.GetStaticSkill(result);

            if (skill == null)
            {
                return(SkillNames.None + " " + EAText.GetNumberString(0));
            }

            icon = new ThumbnailKey(skill.DreamsAndPromisesIconKey, ThumbnailSize.Medium);

            int num = 0;

            int.TryParse(split[1], out num);

            return(skill.Name + " " + EAText.GetNumberString(num));
        }
Beispiel #13
0
        protected override string GetLocalizedValue(string value, ref ThumbnailKey icon)
        {
            string[] split = value.Split('-');

            if (split.Length < 2)
            {
                split[0] = ""; // will cause TryParseEnum to fail
            }

            OccupationNames result;
            Occupation      career;

            if (!ParserFunctions.TryParseEnum <OccupationNames>(split[0], out result, OccupationNames.Undefined))
            {
                ulong guid;
                if (ulong.TryParse(split[0], out guid))
                {
                    result = (OccupationNames)guid;
                }
                else
                {
                    return(OccupationNames.Undefined + " " + EAText.GetNumberString(0));
                }
            }

            career = CareerManager.GetStaticOccupation(result);

            if (career == null)
            {
                return(OccupationNames.Undefined + " " + EAText.GetNumberString(0));
            }

            icon = new ThumbnailKey(ResourceKey.CreatePNGKey(career.CareerIconColored, ResourceUtils.ProductVersionToGroupId(ProductVersion.BaseGame)), ThumbnailSize.Medium);

            int num = 0;

            int.TryParse(split[1], out num);

            return(career.CareerName + " " + EAText.GetNumberString(num));
        }
Beispiel #14
0
            public LotHouseItem(Lot lot, Household house, int count)
                : base(null, count)
            {
                if ((lot == null) && (house == null))
                {
                    mName = "(" + Common.LocalizeEAString("Ui/Caption/ObjectPicker:All") + ")";
                }
                else if (house != null)
                {
                    mName = SelectionCriteria.TownFamily.GetQualifiedName(house);
                }
                else if (lot is WorldLot)
                {
                    mName = "(" + Common.Localize("HouseholdInteraction:WorldLot") + ")";
                }
                else
                {
                    mName = lot.Name;
                    if (!string.IsNullOrEmpty(mName))
                    {
                        mName += " - ";
                    }
                    mName += lot.Address;

                    if (string.IsNullOrEmpty(mName))
                    {
                        mName = EAText.GetNumberString(lot.LotId);
                    }
                }

                if (lot != null)
                {
                    mThumbnail = lot.GetThumbnailKey();
                }

                mLot   = lot;
                mHouse = house;
            }
Beispiel #15
0
            protected override ManagerStory.Story PrintFormattedStory(StoryProgressionObject manager, string text, string summaryKey, object[] parameters, string[] extended, ManagerStory.StoryLogging logging)
            {
                if (SimTypes.IsSelectable(Sim))
                {
                    return(null);
                }

                if (mOldLevel >= Sim.CelebrityLevel)
                {
                    return(null);
                }

                if ((Sim.CelebrityLevel <= 1) && (!GetValue <ShowFirstLevelOption, bool>()))
                {
                    IncStat("First Level Denied");
                    return(null);
                }

                CelebrityManager celebrityManager = Sim.CelebrityManager;

                CelebrityLevelStaticData currentLevelStaticData = celebrityManager.GetCurrentLevelStaticData();

                if (currentLevelStaticData != null)
                {
                    string levelUpTnsLocalizationKey = currentLevelStaticData.LevelUpTnsLocalizationKey;
                    if (levelUpTnsLocalizationKey != null)
                    {
                        text = CelebrityManager.LocalizeSpreadsheetString(Sim.IsFemale, levelUpTnsLocalizationKey, new object[] { celebrityManager.LevelName, Sim });
                    }
                }

                if (extended == null)
                {
                    extended = new string[] { EAText.GetNumberString(Sim.CelebrityLevel) };
                }

                return(base.PrintFormattedStory(manager, text, "0x635e705292bc4b00", parameters, extended, logging));
            }
Beispiel #16
0
        protected override bool OnPerform()
        {
            RelationshipsPanel panel = RelationshipsPanel.Instance;

            if (panel == null)
            {
                return(true);
            }

            if (!panel.Visible)
            {
                return(true);
            }

            if (panel.mHudModel != null)
            {
                if (!(panel.mHudModel is HudModelProxy))
                {
                    panel.mHudModel.SimChanged             -= panel.OnSimChanged;
                    panel.mHudModel.SimAgeChanged          -= panel.OnSimAgeChanged;
                    panel.mHudModel.CareerUpdated          -= panel.OnCareerUpdated;
                    panel.mHudModel.OccultUpdated          -= panel.OnOccultChanged;
                    panel.mHudModel.RelationshipsChanged   -= panel.OnRelationshipsChanged;
                    panel.mHudModel.SimAppearanceChanged   -= panel.OnSimAppearanceChanged;
                    panel.mHudModel.VisitorsChanged        -= panel.OnVisitorsChanged;
                    panel.mHudModel.SimCurrentWorldChanged -= panel.OnSimCurrentWorldChanged;

                    panel.mHudModel = new HudModelProxy(panel.mHudModel);

                    panel.mHudModel.SimChanged             += panel.OnSimChanged;
                    panel.mHudModel.SimAgeChanged          += panel.OnSimAgeChanged;
                    panel.mHudModel.CareerUpdated          += panel.OnCareerUpdated;
                    panel.mHudModel.OccultUpdated          += panel.OnOccultChanged;
                    panel.mHudModel.RelationshipsChanged   += panel.OnRelationshipsChanged;
                    panel.mHudModel.SimAppearanceChanged   += panel.OnSimAppearanceChanged;
                    panel.mHudModel.VisitorsChanged        += panel.OnVisitorsChanged;
                    panel.mHudModel.SimCurrentWorldChanged += panel.OnSimCurrentWorldChanged;

                    panel.Repopulate(panel.mHudModel.CurrentRelationships);
                }
            }

            if ((panel.mRelItemGrid != null) && (panel.mRelItemGrid.mGrid != null))
            {
                for (int i = 0; i < panel.mRelItemGrid.mGrid.ColumnCount; i++)
                {
                    WindowBase window = panel.mRelItemGrid.mGrid.GetCellWindow(i, 0);

                    Window childByID = window.GetChildByID(0x2, true) as Window;
                    childByID.MouseUp -= panel.OnSimOnLotMouseUp;
                    childByID.MouseUp -= panel.OnSimNotOnLotMouseUp;

                    childByID.MouseUp -= OnSimMouseUp;
                    childByID.MouseUp += OnSimMouseUp;

                    float value = 0;

                    FillBarController controller = window.GetChildByID(0x5, true) as FillBarController;
                    if (controller != null)
                    {
                        value = controller.Value;
                    }

                    childByID = window.GetChildByID(0x24, true) as Window;
                    if (childByID != null)
                    {
                        if ((childByID.TooltipText != null) && (!childByID.TooltipText.EndsWith(")")))
                        {
                            childByID.TooltipText += " (" + EAText.GetNumberString(value) + ")";
                        }
                    }
                }
            }

            return(true);
        }
Beispiel #17
0
            public override void SetValue(int value, int storeType)
            {
                mValue = value;

                mName = EAText.GetNumberString(value);
            }
Beispiel #18
0
 public override ObjectPicker.ColumnInfo GetValue(VectorBooter.Item item)
 {
     return(new ObjectPicker.TextColumn(EAText.GetNumberString(item.Count)));
 }
Beispiel #19
0
 public string GetLocalizedName(SimDescription sim, bool alternate)
 {
     return(Common.LocalizeEAString(sim.IsFemale, "Ui/Caption/ObjectPicker:" + mCategory) + " " + EAText.GetNumberString(GetIndex(sim, alternate) + 1));
 }
Beispiel #20
0
 private static void AppendEvent(StringBuilder builder, string key, int data)
 {
     AppendEvent(builder, key, EAText.GetNumberString(data));
 }
Beispiel #21
0
        protected override ManagerStory.Story PrintFormattedStory(StoryProgressionObject manager, string text, string summaryKey, object[] parameters, string[] extended, ManagerStory.StoryLogging logging)
        {
            if (manager == null)
            {
                manager = Careers;
            }

            if ((extended == null) && (Sim.Occupation != null))
            {
                extended = new string[] { Sim.Occupation.GetLocalizedCareerName(Sim.IsFemale), EAText.GetNumberString(Sim.Occupation.Level) };
            }

            text = Common.LocalizeEAString(Sim.IsFemale, "Gameplay/Careers/Career:Demotion", new object[] { Sim, Event.Career.CurLevelJobTitle });

            ManagerStory.Story story = base.PrintFormattedStory(manager, text, summaryKey, parameters, extended, logging);

            if (story != null)
            {
                story.mOverrideImage = Event.Career.CareerIconColored;
            }

            return(story);
        }
        protected override ManagerStory.Story PrintFormattedStory(StoryProgressionObject manager, string text, string summaryKey, object[] parameters, string[] extended, ManagerStory.StoryLogging logging)
        {
            if (manager == null)
            {
                manager = Careers;
            }

            if (extended == null)
            {
                if (Event.Career is School)
                {
                    extended = new string[] { Event.Career.GetLocalizedCareerName(Sim.IsFemale) };
                }
                else
                {
                    extended = new string[] { Event.Career.GetLocalizedCareerName(Sim.IsFemale), EAText.GetNumberString(Event.Career.Level) };
                }
            }

            ManagerStory.Story story = base.PrintFormattedStory(manager, mText, summaryKey, parameters, extended, logging);

            if (story != null)
            {
                story.mOverrideImage = Event.Career.CareerIconColored;
            }

            return(story);
        }
 protected override string GetDisplayValue(float value, bool forPrompt)
 {
     return(EAText.GetNumberString(value));
 }
Beispiel #24
0
 public override string GetInteractionName(IActor actor, GameObject target, InteractionObjectPair iop)
 {
     if (mOption != null)
     {
         return(Common.Localize("Root:MenuName").Replace("...", "") + " = " + EAText.GetNumberString(VersionStamp.sVersion));
     }
     else
     {
         return(base.GetInteractionName(actor, target, iop));
     }
 }
Beispiel #25
0
 public override ObjectPicker.ColumnInfo GetValue(SimDescription item)
 {
     return(new ObjectPicker.TextColumn(EAText.GetNumberString(PortraitPanel.Settings.GetSimSort(item))));
 }
Beispiel #26
0
 public override string GetUIValue(bool pure)
 {
     return(EAText.GetNumberString(Value.Count));
 }
Beispiel #27
0
 public string DisplayValue(Season season)
 {
     return(EAText.GetNumberString(GetActualDay(season) /*+ 2*/) + ": " + Common.LocalizeEAString("Ui/Tooltips/CareerPanel:" + mSeason + "Holiday"));
 }
Beispiel #28
0
        protected override OptionResult Run(GameHitParameters <GameObject> parameters)
        {
            string name = StringInputDialog.Show(Name, Common.Localize(GetTitlePrefix() + ":Prompt"), EAText.GetNumberString(MasterController.Settings.SkillStamps.Count + 1));

            if (string.IsNullOrEmpty(name))
            {
                return(OptionResult.Failure);
            }

            MasterController.Settings.SkillStamps.Add(new SkillStamp(name));

            MasterController.Settings.UpdateStamp();

            return(OptionResult.SuccessRetain);
        }
Beispiel #29
0
 public override ObjectPicker.ColumnInfo GetValue(IExportBinContents item)
 {
     return(new ObjectPicker.TextColumn(EAText.GetNumberString(item.HouseholdSims.Count)));
 }
Beispiel #30
0
        public List <CareerLevelItem> GetLevelOptions(OccupationNames career)
        {
            List <CareerLevelItem> results = new List <CareerLevelItem>();

            Career career2 = CareerManager.GetStaticCareer(career);

            if (career2 == null)
            {
                return(results);
            }

            results.Add(new CareerLevelItem(new LevelData(career, string.Empty, -1), Common.Localize("Selection:All"), ThumbnailKey.kInvalidThumbnailKey));

            foreach (KeyValuePair <string, Dictionary <int, Sims3.Gameplay.Careers.CareerLevel> > staticData in career2.CareerLevels)
            {
                foreach (KeyValuePair <int, Sims3.Gameplay.Careers.CareerLevel> levelStaticData in staticData.Value)
                {
                    results.Add(new CareerLevelItem(new LevelData(career, staticData.Key, levelStaticData.Key), career2.Name + " - " + levelStaticData.Value.BranchName + " - " + Common.LocalizeEAString(false, levelStaticData.Value.mName) + " (" + EAText.GetNumberString(levelStaticData.Key) + ")", new ThumbnailKey(ResourceKey.CreatePNGKey(career2.CareerIconColored, ResourceUtils.ProductVersionToGroupId(ProductVersion.BaseGame)), ThumbnailSize.Medium)));
                }
            }

            return(results);
        }