コード例 #1
0
        private static string GetPawnRowTooltip(SocialCardUtility.CachedSocialTabEntry entry, Pawn selPawnForSocialInfo)
        {
            StringBuilder stringBuilder = new StringBuilder();

            if (entry.otherPawn.RaceProps.Humanlike && selPawnForSocialInfo.RaceProps.Humanlike)
            {
                stringBuilder.AppendLine(selPawnForSocialInfo.relations.OpinionExplanation(entry.otherPawn));
                stringBuilder.AppendLine();
                stringBuilder.Append("SomeonesOpinionOfMe".Translate(new object[]
                {
                    entry.otherPawn.LabelShort
                }));
                stringBuilder.Append(": ");
                stringBuilder.Append(entry.opinionOfMe.ToStringWithSign());
            }
            else
            {
                stringBuilder.AppendLine(entry.otherPawn.LabelCapNoCount);
                string pawnSituationLabel = SocialCardUtility.GetPawnSituationLabel(entry.otherPawn, selPawnForSocialInfo);
                if (!pawnSituationLabel.NullOrEmpty())
                {
                    stringBuilder.AppendLine(pawnSituationLabel);
                }
                stringBuilder.AppendLine("--------------");
                stringBuilder.Append(SocialCardUtility.GetRelationsString(entry, selPawnForSocialInfo));
            }
            if (Prefs.DevMode)
            {
                stringBuilder.AppendLine();
                stringBuilder.AppendLine("(debug) Compatibility: " + selPawnForSocialInfo.relations.CompatibilityWith(entry.otherPawn).ToString("F2"));
                stringBuilder.Append("(debug) RomanceChanceFactor: " + selPawnForSocialInfo.relations.SecondaryRomanceChanceFactor(entry.otherPawn).ToString("F2"));
            }
            return(stringBuilder.ToString());
        }
コード例 #2
0
        private static void DrawRelationLabel(SocialCardUtility.CachedSocialTabEntry entry, Rect rect, Pawn selPawnForSocialInfo)
        {
            string relationsString = SocialCardUtility.GetRelationsString(entry, selPawnForSocialInfo);

            if (!relationsString.NullOrEmpty())
            {
                GUI.color = SocialCardUtility.RelationLabelColor;
                Widgets.Label(rect, relationsString);
            }
        }
コード例 #3
0
        private static float GetRowHeight(SocialCardUtility.CachedSocialTabEntry entry, float rowWidth, Pawn selPawnForSocialInfo)
        {
            float width;
            float width2;
            float num;
            float num2;
            float num3;

            SocialCardUtility.CalculateColumnsWidths(rowWidth, out width, out width2, out num, out num2, out num3);
            float num4 = 0f;

            num4 = Mathf.Max(num4, Text.CalcHeight(SocialCardUtility.GetRelationsString(entry, selPawnForSocialInfo), width));
            num4 = Mathf.Max(num4, Text.CalcHeight(SocialCardUtility.GetPawnLabel(entry.otherPawn), width2));
            return(num4 + 3f);
        }
コード例 #4
0
        private static float GetRowHeight(CachedSocialTabEntry entry, float rowWidth, Pawn selPawnForSocialInfo)
        {
            float width  = default(float);
            float width2 = default(float);
            float num    = default(float);
            float num2   = default(float);
            float num3   = default(float);

            SocialCardUtility.CalculateColumnsWidths(rowWidth, out width, out width2, out num, out num2, out num3);
            float a = 0f;

            a = Mathf.Max(a, Text.CalcHeight(SocialCardUtility.GetRelationsString(entry, selPawnForSocialInfo), width));
            a = Mathf.Max(a, Text.CalcHeight(SocialCardUtility.GetPawnLabel(entry.otherPawn), width2));
            return((float)(a + 3.0));
        }