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); }
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)); }
private static void DrawPawnRow(float y, float width, SocialCardUtility.CachedSocialTabEntry entry, Pawn selPawnForSocialInfo) { float rowHeight = SocialCardUtility.GetRowHeight(entry, width, selPawnForSocialInfo); Rect rect = new Rect(0f, y, width, rowHeight); Pawn otherPawn = entry.otherPawn; if (Mouse.IsOver(rect)) { GUI.color = SocialCardUtility.HighlightColor; GUI.DrawTexture(rect, TexUI.HighlightTex); } TooltipHandler.TipRegion(rect, () => SocialCardUtility.GetPawnRowTooltip(entry, selPawnForSocialInfo), entry.otherPawn.thingIDNumber * 13 + selPawnForSocialInfo.thingIDNumber); if (Widgets.ButtonInvisible(rect, false)) { if (Current.ProgramState == ProgramState.Playing) { if (otherPawn.Dead) { Messages.Message("MessageCantSelectDeadPawn".Translate(new object[] { otherPawn.LabelShort }).CapitalizeFirst(), MessageTypeDefOf.RejectInput, false); } else if (otherPawn.SpawnedOrAnyParentSpawned || otherPawn.IsCaravanMember()) { CameraJumper.TryJumpAndSelect(otherPawn); } else { Messages.Message("MessageCantSelectOffMapPawn".Translate(new object[] { otherPawn.LabelShort }).CapitalizeFirst(), MessageTypeDefOf.RejectInput, false); } } else if (Find.GameInitData.startingAndOptionalPawns.Contains(otherPawn)) { Page_ConfigureStartingPawns page_ConfigureStartingPawns = Find.WindowStack.WindowOfType <Page_ConfigureStartingPawns>(); if (page_ConfigureStartingPawns != null) { page_ConfigureStartingPawns.SelectPawn(otherPawn); SoundDefOf.RowTabSelect.PlayOneShotOnCamera(null); } } } float width2; float width3; float width4; float width5; float width6; SocialCardUtility.CalculateColumnsWidths(width, out width2, out width3, out width4, out width5, out width6); Rect rect2 = new Rect(5f, y + 3f, width2, rowHeight - 3f); SocialCardUtility.DrawRelationLabel(entry, rect2, selPawnForSocialInfo); Rect rect3 = new Rect(rect2.xMax, y + 3f, width3, rowHeight - 3f); SocialCardUtility.DrawPawnLabel(otherPawn, rect3); Rect rect4 = new Rect(rect3.xMax, y + 3f, width4, rowHeight - 3f); SocialCardUtility.DrawMyOpinion(entry, rect4, selPawnForSocialInfo); Rect rect5 = new Rect(rect4.xMax, y + 3f, width5, rowHeight - 3f); SocialCardUtility.DrawHisOpinion(entry, rect5, selPawnForSocialInfo); Rect rect6 = new Rect(rect5.xMax, y + 3f, width6, rowHeight - 3f); SocialCardUtility.DrawPawnSituationLabel(entry.otherPawn, rect6, selPawnForSocialInfo); }