コード例 #1
0
        private static void DrawThoughtListing(Rect listingRect, Pawn pawn, ref Vector2 thoughtScrollPosition)
        {
            if (Event.current.type == EventType.Layout)
            {
                return;
            }
            Text.Font = GameFont.Small;
            PawnNeedsUIUtility.GetThoughtGroupsInDisplayOrder(pawn.needs.mood, NeedsCardUtility.thoughtGroupsPresent);
            float height = (float)NeedsCardUtility.thoughtGroupsPresent.Count * 24f;

            Widgets.BeginScrollView(listingRect, ref thoughtScrollPosition, new Rect(0f, 0f, listingRect.width - 16f, height), true);
            Text.Anchor = TextAnchor.MiddleLeft;
            float num = 0f;

            for (int i = 0; i < NeedsCardUtility.thoughtGroupsPresent.Count; i++)
            {
                Rect rect = new Rect(0f, num, listingRect.width - 16f, 20f);
                if (NeedsCardUtility.DrawThoughtGroup(rect, NeedsCardUtility.thoughtGroupsPresent[i], pawn))
                {
                    num += 24f;
                }
            }
            Widgets.EndScrollView();
            Text.Anchor = TextAnchor.UpperLeft;
        }
コード例 #2
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)));
 }
コード例 #3
0
        public static void DoNeedsMoodAndThoughts(Rect rect, Pawn pawn, ref Vector2 thoughtScrollPosition)
        {
            Rect rect2 = new Rect(rect.x, rect.y, 225f, rect.height);

            NeedsCardUtility.DoNeeds(rect2, pawn);
            if (pawn.needs.mood != null)
            {
                Rect rect3 = new Rect(rect2.xMax, rect.y, rect.width - rect2.width, rect.height);
                NeedsCardUtility.DoMoodAndThoughts(rect3, pawn, ref thoughtScrollPosition);
            }
        }
コード例 #4
0
        private static void DoMoodAndThoughts(Rect rect, Pawn pawn, ref Vector2 thoughtScrollPosition)
        {
            GUI.BeginGroup(rect);
            Rect rect2 = new Rect(0f, 0f, rect.width * 0.8f, 70f);

            pawn.needs.mood.DrawOnGUI(rect2, 2147483647, -1f, true, true);
            Rect rect3 = new Rect(0f, 80f, rect.width, rect.height - 70f - 10f);

            rect3 = rect3.ContractedBy(10f);
            NeedsCardUtility.DrawThoughtListing(rect3, pawn, ref thoughtScrollPosition);
            GUI.EndGroup();
        }
コード例 #5
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;
            }
        }
コード例 #6
0
 protected override void UpdateSize()
 {
     this.size = NeedsCardUtility.GetSize(base.SelPawn);
 }
コード例 #7
0
 protected override void FillTab()
 {
     NeedsCardUtility.DoNeedsMoodAndThoughts(new Rect(0f, 0f, this.size.x, this.size.y), base.SelPawn, ref this.thoughtScrollPosition);
 }