public override void DoCell(Rect rect, Pawn pawn, PawnTable table) { if (!pawn.IsGuest()) { return; } UpdateCache(pawn); base.DoCell(rect, pawn, table); // Use cache - only get comp when we have enough friends if (friendsShortCache >= friendsRequiredShortCache && pawn.MayRecruitAtAll() && pawn.MayRecruitRightNow()) { var rect2 = rect; rect2.x -= 4; if (Widgets.ButtonText(rect2, txtRecruit)) { ITab_Pawn_Guest.RecruitDialog(pawn, false); } } else { base.DoCell(rect, pawn, table); } }
public override void DoCell(Rect rect, Pawn pawn, PawnTable table) { if (!pawn.IsGuest()) { return; } // Store cache friendsShortCache = pawn.GetFriendsInColony(); friendsRequiredShortCache = GuestUtility.FriendsRequired(pawn.MapHeld) + pawn.GetEnemiesInColony(); base.DoCell(rect, pawn, table); // Use cache - only get comp when we have enough friends if (friendsShortCache >= friendsRequiredShortCache && MayRecruitAtAll(pawn)) { var rect2 = rect; rect2.x -= 4; if (Widgets.ButtonText(rect2, txtRecruit)) { ITab_Pawn_Guest.RecruitDialog(pawn, false); } } else { base.DoCell(rect, pawn, table); } }