public static void DrawTrainingCard(Rect rect, Pawn pawn) { GUI.BeginGroup(rect); string label = "TrainableIntelligence".Translate() + ": " + pawn.RaceProps.TrainableIntelligence.label; Widgets.Label(new Rect(0f, 0f, rect.width, 25f), label); if (pawn.training.IsCompleted(TrainableDefOf.Obedience)) { Rect rect2 = new Rect(0f, 20f, rect.width, 25f); Widgets.Label(rect2, "Master".Translate() + ": "); Vector2 center = rect2.center; rect2.xMin = center.x; string label2 = TrainableUtility.MasterString(pawn); if (Widgets.ButtonText(rect2, label2, true, false, true)) { TrainableUtility.OpenMasterSelectMenu(pawn); } } float num = 50f; List <TrainableDef> trainableDefsInListOrder = TrainableUtility.TrainableDefsInListOrder; for (int i = 0; i < trainableDefsInListOrder.Count; i++) { if (TrainingCardUtility.TryDrawTrainableRow(new Rect(0f, num, rect.width, 28f), pawn, trainableDefsInListOrder[i])) { num = (float)(num + 28.0); } } GUI.EndGroup(); }
public static void DrawTrainingCard(Rect rect, Pawn pawn) { Text.Font = GameFont.Small; Rect rect2 = new Rect(TrainingCardUtility.TrainabilityLeft, TrainingCardUtility.TrainabilityTop, 30f, 30f); TooltipHandler.TipRegion(rect2, "RenameAnimal".Translate()); if (Widgets.ButtonImage(rect2, TexButton.Rename)) { Find.WindowStack.Add(new Dialog_NamePawn(pawn)); } Listing_Standard listing_Standard = new Listing_Standard(); listing_Standard.Begin(rect); listing_Standard.Label("CreatureTrainability".Translate(new object[] { pawn.def.label }).CapitalizeFirst() + ": " + pawn.RaceProps.trainability.LabelCap, -1f, null); Listing_Standard arg_FE_0 = listing_Standard; string label = "CreatureWildness".Translate(new object[] { pawn.def.label }).CapitalizeFirst() + ": " + pawn.RaceProps.wildness.ToStringPercent(); string wildnessExplanation = TrainableUtility.GetWildnessExplanation(pawn.def); arg_FE_0.Label(label, -1f, wildnessExplanation); if (pawn.training.HasLearned(TrainableDefOf.Obedience)) { Rect rect3 = listing_Standard.GetRect(25f); Widgets.Label(rect3, "Master".Translate() + ": "); rect3.xMin = rect3.center.x; TrainableUtility.MasterSelectButton(rect3, pawn, false); } listing_Standard.Gap(12f); float num = 50f; List <TrainableDef> trainableDefsInListOrder = TrainableUtility.TrainableDefsInListOrder; for (int i = 0; i < trainableDefsInListOrder.Count; i++) { if (TrainingCardUtility.TryDrawTrainableRow(listing_Standard.GetRect(28f), pawn, trainableDefsInListOrder[i])) { num += 28f; } } listing_Standard.End(); }