Ejemplo n.º 1
0
 public static Vector2 GetSize(Pawn pawn)
 {
     NeedsCardUtility.UpdateDisplayNeeds(pawn);
     if (pawn.needs.mood != null)
     {
         return(NeedsCardUtility.FullSize);
     }
     return(new Vector2(225f, (float)NeedsCardUtility.displayNeeds.Count * Mathf.Min(70f, NeedsCardUtility.FullSize.y / (float)NeedsCardUtility.displayNeeds.Count)));
 }
Ejemplo n.º 2
0
        public static void DoNeeds(Rect rect, Pawn pawn)
        {
            NeedsCardUtility.UpdateDisplayNeeds(pawn);
            float num = 0f;

            for (int i = 0; i < NeedsCardUtility.displayNeeds.Count; i++)
            {
                Need need  = NeedsCardUtility.displayNeeds[i];
                Rect rect2 = new Rect(rect.x, rect.y + num, rect.width, Mathf.Min(70f, rect.height / (float)NeedsCardUtility.displayNeeds.Count));
                if (!need.def.major)
                {
                    if (i > 0 && NeedsCardUtility.displayNeeds[i - 1].def.major)
                    {
                        rect2.y += 10f;
                    }
                    rect2.width *= 0.73f;
                    rect2.height = Mathf.Max(rect2.height * 0.666f, 30f);
                }
                need.DrawOnGUI(rect2, 2147483647, -1f, true, true);
                num = rect2.yMax;
            }
        }