Пример #1
0
        public TaggedString FullDescriptionFor(Pawn p)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append(baseDesc.Formatted(p.Named("PAWN")).AdjustedFor(p).Resolve());
            stringBuilder.AppendLine();
            stringBuilder.AppendLine();
            List <SkillDef> allDefsListForReading = DefDatabase <SkillDef> .AllDefsListForReading;

            for (int i = 0; i < allDefsListForReading.Count; i++)
            {
                SkillDef skillDef = allDefsListForReading[i];
                if (skillGainsResolved.ContainsKey(skillDef))
                {
                    stringBuilder.AppendLine(skillDef.skillLabel.CapitalizeFirst() + ":   " + skillGainsResolved[skillDef].ToString("+##;-##"));
                }
            }
            if (DisabledWorkTypes.Any() || DisabledWorkGivers.Any())
            {
                stringBuilder.AppendLine();
            }
            foreach (WorkTypeDef disabledWorkType in DisabledWorkTypes)
            {
                stringBuilder.AppendLine(disabledWorkType.gerundLabel.CapitalizeFirst() + " " + "DisabledLower".Translate());
            }
            foreach (WorkGiverDef disabledWorkGiver in DisabledWorkGivers)
            {
                stringBuilder.AppendLine(disabledWorkGiver.workType.gerundLabel.CapitalizeFirst() + ": " + disabledWorkGiver.LabelCap + " " + "DisabledLower".Translate());
            }
            if (ModsConfig.RoyaltyActive)
            {
                unlockedMeditationTypesTemp.Clear();
                foreach (MeditationFocusDef allDef in DefDatabase <MeditationFocusDef> .AllDefs)
                {
                    for (int j = 0; j < allDef.requiredBackstoriesAny.Count; j++)
                    {
                        BackstoryCategoryAndSlot backstoryCategoryAndSlot = allDef.requiredBackstoriesAny[j];
                        if (spawnCategories.Contains(backstoryCategoryAndSlot.categoryName) && backstoryCategoryAndSlot.slot == slot)
                        {
                            unlockedMeditationTypesTemp.Add(allDef.LabelCap);
                            break;
                        }
                    }
                }
                if (unlockedMeditationTypesTemp.Count > 0)
                {
                    stringBuilder.AppendLine();
                    stringBuilder.AppendLine("MeditationFocusesUnlocked".Translate() + ": ");
                    stringBuilder.AppendLine(unlockedMeditationTypesTemp.ToLineList("  - "));
                }
            }
            string str = stringBuilder.ToString().TrimEndNewlines();

            return(Find.ActiveLanguageWorker.PostProcessed(str));
        }