示例#1
0
        private TextModel GetGenderAndAge()
        {
            var gender     = GetGender();
            var genderKind = Lang.AdjectiveNoun(gender, Base.kindDef?.race?.label);

            if (Base.ageTracker == null)
            {
                return(TextModel.Create(genderKind.CapitalizeFirst(), GetBioTooltip(), FactionRelationColor, InspectPanePlus.ToggleBioTab));
            }

            Base.ageTracker.AgeBiologicalTicks.TicksToPeriod(out var years, out var quadrums, out var days, out _);
            var ageDays = (quadrums * GenDate.DaysPerQuadrum) + days;

            var age = years.ToString().Bold();

            if ((ageDays == 0) || (ageDays == GenDate.DaysPerYear))
            {
                age = Lang.CombineWords(age, Lang.Get("Model.Age.Birthday"));
            }
            else if (ageDays == 1)
            {
                age = Lang.CombineWords(age, Lang.Get("Model.Age.Day"));
            }
            else
            {
                age = Lang.CombineWords(age, Lang.Get("Model.Age.Days", ageDays));
            }

            return(TextModel.Create(Lang.Get("Model.GenderAndAge", genderKind, age).CapitalizeFirst(), GetBioTooltip(), FactionRelationColor, InspectPanePlus.ToggleBioTab));
        }
示例#2
0
        private TextModel GetRelationKindAndFaction()
        {
            var faction      = (Base.Faction == null) || !Base.Faction.HasName ? null : Lang.Get("Model.OfFaction", Base.Faction.Name);
            var relationKind = Lang.AdjectiveNoun(GetFactionRelation(), GetKind());

            return(TextModel.Create(Lang.Get("Model.RelationKindAndFaction", relationKind, faction).Trim().CapitalizeFirst(), GetBioTooltip(), FactionRelationColor, InspectPanePlus.ToggleBioTab));
        }
示例#3
0
        private string GetGenderRaceAndAgeText(bool hideRaceIfHuman)
        {
            var gender     = GetGender();
            var genderKind = Lang.AdjectiveNoun(gender, hideRaceIfHuman ? GetRaceIfNotHuman() : GetRace());

            if (Base.ageTracker == null)
            {
                return(genderKind.Trim());
            }

            Base.ageTracker.AgeBiologicalTicks.TicksToPeriod(out var years, out var quadrums, out var days, out _);
            var ageDays = (quadrums * GenDate.DaysPerQuadrum) + days;

            var age = years.ToString().Bold();

            if (ageDays == 0 || ageDays == GenDate.DaysPerYear)
            {
                age = Lang.CombineWords(age, Lang.Get("Model.Age.Birthday"));
            }
            else if (ageDays == 1)
            {
                age = Lang.CombineWords(age, Lang.Get("Model.Age.Day"));
            }
            else
            {
                age = Lang.CombineWords(age, Lang.Get("Model.Age.Days", ageDays));
            }

            return(Lang.Get("Model.GenderRaceAndAge", genderKind, age).Trim());
        }